client/entities and client/client_utilities build

This commit is contained in:
2015-08-02 04:12:22 +10:00
parent 0150dbb929
commit 8838fcd14e
9 changed files with 94 additions and 16 deletions
+7 -7
View File
@@ -30,16 +30,16 @@
void BaseCharacter::CorrectSprite() {
//NOTE: These must correspond to the sprite sheet in use
if (motion.y > 0) {
sprite.SetYIndex(0);
sprite.SetIndexY(0);
}
else if (motion.y < 0) {
sprite.SetYIndex(1);
sprite.SetIndexY(1);
}
else if (motion.x > 0) {
sprite.SetYIndex(3);
sprite.SetIndexY(3);
}
else if (motion.x < 0) {
sprite.SetYIndex(2);
sprite.SetIndexY(2);
}
//animation
@@ -48,7 +48,7 @@ void BaseCharacter::CorrectSprite() {
}
else {
sprite.SetDelay(0);
sprite.SetXIndex(0);
sprite.SetIndexX(0);
}
}
@@ -72,9 +72,9 @@ std::string BaseCharacter::GetHandle() const {
return handle;
}
std::string BaseCharacter::SetAvatar(std::string s) {
std::string BaseCharacter::SetAvatar(SDL_Renderer* const renderer, std::string s) {
avatar = s;
sprite.LoadSurface(ConfigUtility::GetSingleton()["dir.sprites"] + avatar, CHARACTER_CELLS_X, CHARACTER_CELLS_Y);
sprite.Load(renderer, ConfigUtility::GetSingleton()["dir.sprites"] + avatar, CHARACTER_CELLS_X, CHARACTER_CELLS_Y);
return avatar;
}
+1 -1
View File
@@ -41,7 +41,7 @@ public:
int GetOwner();
std::string SetHandle(std::string s);
std::string GetHandle() const;
std::string SetAvatar(std::string s);
std::string SetAvatar(SDL_Renderer* const, std::string s);
std::string GetAvatar() const;
protected:
+2 -2
View File
@@ -35,9 +35,9 @@ std::string BaseMonster::GetHandle() const {
return handle;
}
std::string BaseMonster::SetAvatar(std::string s) {
std::string BaseMonster::SetAvatar(SDL_Renderer* const renderer, std::string s) {
avatar = s;
sprite.LoadSurface(ConfigUtility::GetSingleton()["dir.sprites"] + avatar, 4, 1);
sprite.Load(renderer, ConfigUtility::GetSingleton()["dir.sprites"] + avatar, 4, 1);
return avatar;
}
+1 -1
View File
@@ -32,7 +32,7 @@ public:
std::string SetHandle(std::string s);
std::string GetHandle() const;
std::string SetAvatar(std::string s);
std::string SetAvatar(SDL_Renderer* const, std::string s);
std::string GetAvatar() const;
protected:
+2 -2
View File
@@ -26,8 +26,8 @@ void Entity::Update() {
sprite.Update(0.016);
}
void Entity::DrawTo(SDL_Surface* const dest, int camX, int camY) {
sprite.DrawTo(dest, origin.x - camX, origin.y - camY);
void Entity::DrawTo(SDL_Renderer* const renderer, int camX, int camY) {
sprite.DrawTo(renderer, origin.x - camX, origin.y - camY);
}
SpriteSheet* Entity::GetSprite() {
+1 -1
View File
@@ -29,7 +29,7 @@
class Entity {
public:
virtual void Update();
virtual void DrawTo(SDL_Surface* const, int camX, int camY);
virtual void DrawTo(SDL_Renderer* const, int camX, int camY);
SpriteSheet* GetSprite();