From a1fa39b43639137e141febf67224f698ec17aec9 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 30 Apr 2005 19:11:19 +0000 Subject: Emoticons framerate independent and NPCs image smaller to work in OpenGL --- src/engine.cpp | 15 +++++++++------ src/game.cpp | 1 + src/game.h | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/engine.cpp b/src/engine.cpp index e013041f..11a0cd81 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -288,6 +288,13 @@ void Engine::logic() default: break; } + + if (being->emotion != 0) { + being->emotion_time--; + if (being->emotion_time == 0) { + being->emotion = 0; + } + } } if (get_elapsed_time(being->speech_time) > 5000) @@ -367,8 +374,8 @@ void Engine::draw() guiGraphics->drawRectangle(gcn::Rectangle(sx * 32, sy * 32, 32, 32)); #endif - if ((being->job >= 100) && (being->job <= 110)) { // Draw a NPC - npcset->spriteset[4 * (being->job - 100) + dir]->draw(screen, + if ((being->job >= 100) && (being->job < 110)) { // Draw a NPC + npcset->spriteset[being->job - 100]->draw(screen, sx * 32 - 8 - offset_x, sy * 32 - 52 - offset_y); } @@ -407,10 +414,6 @@ void Engine::draw() emotionset->spriteset[being->emotion - 1]->draw(screen, sx * 32 + 5 + get_x_offset(being) - offset_x, sy * 32 - 65 + get_y_offset(being) - offset_y); - being->emotion_time--; - if (being->emotion_time == 0) { - being->emotion = 0; - } } graphics->drawText(being->name, diff --git a/src/game.cpp b/src/game.cpp index b079135c..8e0168b2 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -55,6 +55,7 @@ int gameTime = 0; OkDialog *deathNotice = NULL; +#define EMOTION_TIME 150 #define MAX_TIME 10000 class DeatchNoticeListener : public gcn::ActionListener { diff --git a/src/game.h b/src/game.h index 5759e617..4d4fe7bf 100644 --- a/src/game.h +++ b/src/game.h @@ -30,7 +30,6 @@ #include #define SPEECH_TIME 80 -#define EMOTION_TIME 40 #define SPEECH_MAX_TIME 100 // Action defines -- cgit v1.2.3-70-g09d2