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;
}