diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-10 02:24:56 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-10 02:24:56 +0000 |
commit | decb141cc131cfd5f7e44e1ac4ca9e1e6525e686 (patch) | |
tree | ab1973915b960ecf54853c6058b212f3fc50aaf9 | |
parent | 31047c05a9b56c101566301d81931c66bc4b9ecd (diff) | |
download | mana-decb141cc131cfd5f7e44e1ac4ca9e1e6525e686.tar.gz mana-decb141cc131cfd5f7e44e1ac4ca9e1e6525e686.tar.bz2 mana-decb141cc131cfd5f7e44e1ac4ca9e1e6525e686.tar.xz mana-decb141cc131cfd5f7e44e1ac4ca9e1e6525e686.zip |
Always compile with debug window and hide it on startup. Also added fading out
effect on damage font (only works in OpenGL).
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | src/being.cpp | 31 | ||||
-rw-r--r-- | src/being.h | 14 | ||||
-rw-r--r-- | src/game.cpp | 23 |
4 files changed, 38 insertions, 40 deletions
@@ -1,6 +1,12 @@ +2005-10-10 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/being.cpp, src/being.h, src/game.cpp: Always compile with debug + window and hide it on startup. Also added fading out effect on damage + font (only works in OpenGL). + 2005-10-09 Yohann Ferreira <bertram@cegetel.net> - * ChangeLog, src/gui/browserbox.cpp, src/gui/ministatus.cpp, + * src/gui/browserbox.cpp, src/gui/ministatus.cpp, src/gui/debugwindow.h, src/gui/debugwindow.cpp, src/game.cpp, src/engine.cpp, src/Makefile.am: Corrected the white browser font bug and the black hp/mp bug which were linked. Added a debug window @@ -441,7 +447,7 @@ 2005-09-12 Björn Steinbrink <B.Steinbrink@gmx.de> - * M src/Makefile.am, src/gui/browserbox.cpp, src/gui/gui.cpp, + * src/Makefile.am, src/gui/browserbox.cpp, src/gui/gui.cpp, src/resources/resourcemanager.cpp, src/resources/resourcemanager.h, src/resources/sdlimageloader.cpp, src/resources/sdlimageloader.h: Added SDLImageLoader to make guichan support physfs. Removed diff --git a/src/being.cpp b/src/being.cpp index 72ccd2ad..785eae40 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -243,24 +243,16 @@ void Being::setHairStyle(Uint16 style) } } -Uint16 Being::getHairColor() -{ - return hairColor; -} - -Uint16 Being::getHairStyle() -{ - return hairStyle; -} - -void Being::setSpeech(const std::string &text, Uint32 time) +void +Being::setSpeech(const std::string &text, Uint32 time) { speech = text; speech_time = tick_time; showSpeech = true; } -void Being::setDamage(Sint16 amount, Uint32 time) +void +Being::setDamage(Sint16 amount, Uint32 time) { if (!amount) { damage = "miss"; @@ -273,7 +265,8 @@ void Being::setDamage(Sint16 amount, Uint32 time) showDamage = true; } -void Being::setMap(Map *map) +void +Being::setMap(Map *map) { // Remove sprite from potential previous map if (mMap != NULL) @@ -290,7 +283,8 @@ void Being::setMap(Map *map) } } -void Being::nextStep() +void +Being::nextStep() { mFrame = 0; @@ -324,7 +318,8 @@ void Being::nextStep() walk_time += mWalkSpeed / 10; } -void Being::logic() +void +Being::logic() { // Determine whether speech should still be displayed if (get_elapsed_time(speech_time) > 5000) @@ -392,7 +387,8 @@ void Being::logic() } } -void Being::drawSpeech(Graphics *graphics, Sint32 offsetX, Sint32 offsetY) +void +Being::drawSpeech(Graphics *graphics, Sint32 offsetX, Sint32 offsetY) { int px = mPx + offsetX; int py = mPy + offsetY; @@ -422,7 +418,10 @@ void Being::drawSpeech(Graphics *graphics, Sint32 offsetX, Sint32 offsetY) } int textY = (getType() == PLAYER) ? 70 : 32; + int dt = get_elapsed_time(damage_time); + float a = (dt > 1500) ? 1.0 - (dt - 1500) / 1500.0 : 1.0; + graphics->setColor(gcn::Color(255, 255, 255, (int)(255 * a))); graphics->drawText(damage, px + 16, py - textY - get_elapsed_time(damage_time) / 100, diff --git a/src/being.h b/src/being.h index 67c8c6b6..59ee7ca2 100644 --- a/src/being.h +++ b/src/being.h @@ -135,7 +135,7 @@ class Being : public Sprite * Returns the name of the being. */ const std::string& - getName() { return mName; } + getName() const { return mName; } /** * Sets the name for the being. @@ -148,22 +148,26 @@ class Being : public Sprite /** * Sets the hair color for this being. */ - void setHairColor(Uint16 color); + void + setHairColor(Uint16 color); /** * Gets the hair color for this being. */ - Uint16 getHairColor(); + Uint16 + getHairColor() const { return hairColor; } /** * Sets the hair style for this being. */ - void setHairStyle(Uint16 style); + void + setHairStyle(Uint16 style); /** * Gets the hair style for this being. */ - Uint16 getHairStyle(); + Uint16 + getHairStyle() const { return hairStyle; } /** * Makes this being take the next step of his path. diff --git a/src/game.cpp b/src/game.cpp index 8b952ebd..8d5d0cf8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -67,10 +67,7 @@ #include "gui/status.h" #include "gui/ministatus.h" #include "gui/trade.h" - -#ifdef DEBUG #include "gui/debugwindow.h" -#endif #include "net/messagein.h" #include "net/messageout.h" @@ -120,9 +117,7 @@ TradeWindow *tradeWindow; //BuddyWindow *buddyWindow; HelpWindow *helpWindow; PopupMenu *popupMenu; -#ifdef DEBUG DebugWindow *debugWindow; -#endif Inventory *inventory = NULL; @@ -223,9 +218,8 @@ void createGuiWindows() //buddyWindow = new BuddyWindow(); helpWindow = new HelpWindow(); popupMenu = new PopupMenu(); -#ifdef DEBUG debugWindow = new DebugWindow(); -#endif + // Initialize window positions int screenW = graphics->getWidth(); int screenH = graphics->getHeight(); @@ -259,9 +253,8 @@ void createGuiWindows() //buddyWindow->setVisible(false); helpWindow->setVisible(false); popupMenu->setVisible(false); -#ifdef DEBUG - debugWindow->setVisible(true); -#endif + debugWindow->setVisible(false); + // Do not focus any text field gui->focusNone(); } @@ -291,9 +284,7 @@ void destroyGuiWindows() //delete buddyWindow; delete helpWindow; delete popupMenu; -#ifdef DEBUG delete debugWindow; -#endif } void do_init() @@ -649,14 +640,12 @@ void do_input() setupWindow->requestMoveToTop(); used = true; break; -#ifdef DEBUG + // Debug window case SDLK_d: - debugWindow->setVisible(!debugWindow->isVisible()); - if (debugWindow->isVisible()) debugWindow->requestMoveToTop(); - used = true; + requestedWindow = debugWindow; break; -#endif + // screenshot (picture, hence the p) case SDLK_p: { |