From a353543dd4da3c489a84f6f17125fdd0e1be2349 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 4 Jun 2007 21:48:47 +0000 Subject: Merged 0.0 changes from revision 3234 to 3317 to trunk. --- src/particle.h | 288 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 src/particle.h (limited to 'src/particle.h') diff --git a/src/particle.h b/src/particle.h new file mode 100644 index 00000000..7a747a5f --- /dev/null +++ b/src/particle.h @@ -0,0 +1,288 @@ +/* + * The Mana World + * Copyright 2006 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _PARTICLE_H +#define _PARTICLE_H + +#include +#include + +#include + +#include "guichanfwd.h" +#include "sprite.h" + + +class Map; +class Particle; +class ParticleEmitter; + +typedef std::list Particles; +typedef Particles::iterator ParticleIterator; +typedef std::list Emitters; +typedef Emitters::iterator EmitterIterator; + +/** + * A particle spawned by a ParticleEmitter. + */ +class Particle : public Sprite +{ + public: + static const float PARTICLE_SKY; /**< Maximum Z position of particles */ + static int fastPhysics; /**< Mode of squareroot calculation */ + static int particleCount; /**< Current number of particles */ + static int maxCount; /**< Maximum number of particles */ + static int emitterSkip; /**< Duration of pause between two emitter updates in ticks */ + + /** + * Constructor. + * + * @param map the map this particle will add itself to, may be NULL + */ + Particle(Map *map); + + /** + * Destructor. + */ + ~Particle(); + + /** + * Deletes all child particles and emitters + */ + void + clear(); + + /** + * Gives a particle the properties of an engine root particle and loads + * the particle-related config settings + */ + void + setupEngine(); + + /** + * Updates particle position, returns false when the particle should + * be deleted + */ + virtual bool + update(); + + /** + * Draws the particle image + */ + virtual void + draw(Graphics *graphics, int offsetX, int offsetY) const; + + /** + * Necessary for sorting with the other sprites + */ + virtual int + getPixelY() const + { + return (int)(mPosY + mPosZ) - 64; + }; + + /* + Basic Particle properties: + */ + + /** + * Sets the map the particle is on. + */ + void setMap(Map *map); + + /** + * Creates a child particle that hosts some emitters described in the + * particleEffectFile. + */ + Particle* + addEffect(std::string particleEffectFile, int pixelX, int pixelY); + + /** + * Creates a standalone text particle. + */ + Particle* + addTextSplashEffect(std::string text, int colorR, int colorG, int colorB, + gcn::Font *font, int x, int y); + + /** + * Adds an emitter to the particle. + */ + void + addEmitter (ParticleEmitter* emitter) + { mChildEmitters.push_back(emitter); } + + /** + * Sets the position in 3 dimensional space in pixels relative to map + */ + void + setPosition(float x, float y, float z) + { mPosX = x; mPosY = y; mPosZ = z; } + + /** + * Sets the position in 2 dimensional space in pixels relative to map + */ + void + setPosition(float x, float y) + { mPosX = x; mPosY = y; } + + float getPosX() const + { return mPosX; } + + float getPosY() const + { return mPosY; } + + float getPosZ() const + { return mPosZ; } + + /** + * Changes the particle position relative + */ + void + moveBy(float x, float y, float z) + { mPosX += x; mPosY += y; mPosZ += z; } + + /** + * Sets the time in game ticks until the particle is destroyed. + */ + void + setLifetime(int lifetime) + { mLifetimeLeft = lifetime; mLifetimePast = 0; } + + /** + * Sets the age of the pixel in game ticks where the particle has + * faded in completely + */ + void + setFadeOut (int fadeOut) + { mFadeOut = fadeOut; } + + /** + * Sets the remaining particle lifetime where the particle starts to + * fade out + */ + void + setFadeIn (int fadeIn) + { mFadeIn = fadeIn; } + + /** + * Sets the sprite iterator of the particle on the current map to make + * it easier to remove the particle from the map when it is destroyed + */ + void + setSpriteIterator(std::list::iterator spriteIterator) + { mSpriteIterator = spriteIterator; } + + /** + * Gets the sprite iterator of the particle on the current map + */ + std::list::iterator + getSpriteIterator() const + { return mSpriteIterator; } + + /** + * Sets the current velocity in 3 dimensional space + */ + void + setVector(float x, float y, float z) + { mVectorX = x; mVectorY = y; mVectorZ = z; } + + /** + * Sets the downward acceleration + */ + void + setGravity(float g) + { mGravity = g; } + + /** + * Sets the ammount of random vector changes + */ + void + setRandomnes(int r) + { mRandomnes = r; } + + /** + * Sets the ammount of velocity particles retain after + * hitting the ground. + */ + void + setBounce(float bouncieness) + { mBounce = bouncieness; } + + /** + * Makes the particle move toward another particle with a + * given acceleration and momentum + */ + void setDestination(Particle *target, float accel, float moment) + { mTarget = target; mAcceleration = accel; mMomentum = moment; } + + /** + * Sets the distance in pixel the particle can come near the target + * particle before it is destroyed. Does only make sense after a + * target particle has been set using setDestination. + */ + void setDieDistance(float dist) + { mInvDieDistance = 1.0f / dist; } + + /** + * Manually marks the particle for deletion + */ + void kill() + { mAlive = false; mAutoDelete = true; } + + /** + * After calling this function the particle will only request + * deletion when kill() is called + */ + void disableAutoDelete() + { mAutoDelete = false; } + + protected: + bool mAlive; /**< Is the particle supposed to be drawn and updated?*/ + float mPosX, mPosY, mPosZ; /**< Position in 3 dimensonal space - pixel based relative to map */ + int mLifetimeLeft; /**< Lifetime left in game ticks*/ + int mLifetimePast; /**< Age of the particle in game ticks*/ + int mFadeOut; /**< Lifetime in game ticks left where fading out begins*/ + int mFadeIn; /**< Age in game ticks where fading in is finished*/ + + private: + // generic properties + bool mAutoDelete; /**< May the particle request its deletion by the parent particle?*/ + Map *mMap; /**< Map the particle is on*/ + std::list::iterator mSpriteIterator; /**< iterator of the particle on the current map */ + Emitters mChildEmitters; /**< List of child emitters*/ + Particles mChildParticles; /**< List of particles controlled by this particle*/ + //dynamic particle + float mVectorX, mVectorY, mVectorZ; /**< Speed in 3 dimensional space in pixels per game-tick */ + float mGravity; /**< Downward acceleration in pixels per game-tick²*/ + int mRandomnes; /**< Ammount of random vector change*/ + float mBounce; /**< How much the particle bounces off when hitting the ground*/ + //follow-point particles + Particle *mTarget; /**< The particle that attracts this particle*/ + float mAcceleration; /**< Acceleration towards the target particle in pixels per game-tick²*/ + float mInvDieDistance; /**< Distance in pixels from the target particle that causes the destruction of the particle*/ + float mMomentum; /**< How much speed the particle retains after each game tick*/ +}; + +extern Particle *particleEngine; + +#endif -- cgit v1.2.3-60-g2f50 From 016faf8449aeb7dba2738da4fefa3609b3af589c Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 8 Jul 2007 13:39:11 +0000 Subject: Merged 0.0 changes from revision 3317 to 3362 to trunk. --- ChangeLog | 57 ++++++++++++++++++++++++++++++++++++++++- INSTALL | 2 +- data/icons/The Mana World.icns | Bin 0 -> 65136 bytes src/being.cpp | 13 ++++++++-- src/gui/chatinput.cpp | 4 ++- src/gui/chatinput.h | 6 +++-- src/gui/gui.cpp | 4 --- src/gui/setup_video.cpp | 2 +- src/main.cpp | 2 ++ src/particle.cpp | 8 +++--- src/particle.h | 3 +++ src/particleemitter.cpp | 12 ++++----- 12 files changed, 92 insertions(+), 21 deletions(-) create mode 100644 data/icons/The Mana World.icns (limited to 'src/particle.h') diff --git a/ChangeLog b/ChangeLog index c0bc698b..8b2b536d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,38 @@ -2007-06-30 Philipp Sehmisch +2007-07-07 Bjørn Lindeijer + + * src/gui/gui.cpp, src/gui/chatinput.h, src/gui/chatinput.cpp, + INSTALL: Ported to Guichan 0.7.0. Unfortunately, since Guichan 0.6.x + didn't have a FocusListener, compatibility with older versions is + broken. + +2007-06-30 Philipp Sehmisch * src/main.cpp: Changed include order to avoid a problem with guichan on windows. * src/net/beinghandler.cpp: Implemented getting the direction of attacks from the server. +2007-06-29 Philipp Sehmisch + + * src/particle.cpp, src/particleemitter.cpp: Corrected some perspective + issues of the particle engine and fixed a crash caused by particles + with child emitters that have an image than isn't used elsewhere. + * data/maps/new-3-1.tmx.gz: Added a particle effect at the spawn point + in Tulimshar. + +2007-06-21 Philipp Sehmisch + + * data/monsters.xml, data/graphics/sprites/monster-logmonster.png, + data/graphics/sprites/monster-logmonster.xml: Added logmonster by + Enigmatik (Monster ID is 23). + * data/items.xml, data/equipment.xml, + data/graphics/items/armor-chest-lightplatemail.png, + data/graphics/sprites/chest-lightplatemail-male.xml, + data/graphics/sprites/chest-lightplatemail-male.png, + data/graphics/sprites/chest-lightplatemail-female.png, + data/graphics/sprites/chest-lightplatemail-female.xml: + Added light platemail (see entry in items.xml for proposed specs). + 2007-06-16 Guillaume Melquiond * src/resources/image.cpp: Set GL texture index to zero when an image @@ -14,6 +42,33 @@ * tmw.cbp: Updated Code::Blocks project file. +2007-06-13 Philipp Sehmisch + + * The Mana World.dev: Updated DevCpp project file. + +2007-06-13 Philipp Sehmisch + + * src/main.cpp: Added logging of version number. + +2007-06-12 David Athay + + * data/icons/The Mana World.icns: Added Mac OSX icon. + +2007-06-11 Philipp Sehmisch + + * src/particle.h, src/being.cpp: Fixed a bug that prevented + being-controlled particles from being deleted (thanks to tuchs for + reporting). + +2007-06-06 Bjørn Lindeijer + + * data/items.xml: Fixed defense of silk headband. + +2007-06-04 Philipp Sehmisch + + * data/graphics/maps/new_17-1.tmx.gz: Changed the minimap image of the + lamp snake cave to the correct one. + 2007-06-03 David Athay * src/main.cpp, src/game.cpp: Fixed screenshot taking on OSX. diff --git a/INSTALL b/INSTALL index fb168106..697a0c17 100644 --- a/INSTALL +++ b/INSTALL @@ -20,7 +20,7 @@ and some libraries. The required libraries are: * SDL_mixer http://www.libsdl.org/projects/SDL_mixer/ * SDL_image http://www.libsdl.org/projects/SDL_image/ * ENet 1.0 http://enet.bespin.org/ -* Guichan 0.6.x http://guichan.sourceforge.net/ +* Guichan 0.7.0 http://guichan.sourceforge.net/ * libxml2 http://www.xmlsoft.org/ * physfs 1.0.x http://icculus.org/physfs/ * zlib 1.2.x http://www.gzip.org/zlib/ diff --git a/data/icons/The Mana World.icns b/data/icons/The Mana World.icns new file mode 100644 index 00000000..7230a099 Binary files /dev/null and b/data/icons/The Mana World.icns differ diff --git a/src/being.cpp b/src/being.cpp index 7ba9ddb9..bdb27384 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -535,10 +535,19 @@ Being::logic() //Update particle effects for ( std::list::iterator i = mChildParticleEffects.begin(); - i != mChildParticleEffects.end(); - i++) + i != mChildParticleEffects.end(); + + ) { (*i)->setPosition((float)mPx + 16.0f, (float)mPy + 32.0f); + if (!(*i)->isAlive()) + { + (*i)->kill(); + i = mChildParticleEffects.erase(i); + } + else { + i++; + } } } diff --git a/src/gui/chatinput.cpp b/src/gui/chatinput.cpp index 2aa5a159..fc5d6aab 100644 --- a/src/gui/chatinput.cpp +++ b/src/gui/chatinput.cpp @@ -26,9 +26,11 @@ ChatInput::ChatInput() { setVisible(false); + + addFocusListener(this); } -void ChatInput::focusLost() +void ChatInput::focusLost(const gcn::Event &event) { setVisible(false); } diff --git a/src/gui/chatinput.h b/src/gui/chatinput.h index 59d0daf3..da2342ae 100644 --- a/src/gui/chatinput.h +++ b/src/gui/chatinput.h @@ -26,10 +26,12 @@ #include "textfield.h" +#include + /** * The chat input hides when it loses focus. It is also invisible by default. */ -class ChatInput : public TextField +class ChatInput : public TextField, public gcn::FocusListener { public: /** @@ -41,7 +43,7 @@ class ChatInput : public TextField * Called if the chat input loses focus. It will set itself to * invisible as result. */ - void focusLost(); + void focusLost(const gcn::Event &event); }; #endif diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index fb7144a1..b9b15429 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -199,10 +199,6 @@ void Gui::logic() { gcn::Gui::logic(); - - // Work around Guichan bug of only applying focus on mouse or keyboard - // events. - mFocusHandler->applyChanges(); } void diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 8930af3e..cd1507a7 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -264,7 +264,7 @@ void Setup_Video::apply() } } } else { - new OkDialog("Switching to FullScreen", + new OkDialog("Switching to full screen", "Restart needed for changes to take effect."); } config.setValue("screen", fullscreen ? 1 : 0); diff --git a/src/main.cpp b/src/main.cpp index 3550c298..79ba49b4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -678,6 +678,8 @@ int main(int argc, char *argv[]) // Log the tmw version #ifdef PACKAGE_VERSION logger->log("The Mana World v%s", PACKAGE_VERSION); +#else + logger->log("The Mana World - version not defined"); #endif initXML(); diff --git a/src/particle.cpp b/src/particle.cpp index 509c20ee..805da102 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -39,6 +39,8 @@ #include "utils/fastsqrt.h" #include "utils/xml.h" +#define SIN45 0.707106781f + class Graphics; class Image; @@ -122,7 +124,7 @@ Particle::update() if (mTarget && mAcceleration != 0.0f) { - float distX = mPosX - mTarget->getPosX(); + float distX = (mPosX - mTarget->getPosX()) * SIN45; float distY = mPosY - mTarget->getPosY(); float distZ = mPosZ - mTarget->getPosZ(); float invHypotenuse; @@ -167,8 +169,8 @@ Particle::update() // Update position mPosX += mVectorX; - mPosY += mVectorY; - mPosZ += mVectorZ; + mPosY += mVectorY * SIN45; + mPosZ += mVectorZ * SIN45; // Update other stuff if (mLifetimeLeft > 0) diff --git a/src/particle.h b/src/particle.h index 7a747a5f..9e9223c7 100644 --- a/src/particle.h +++ b/src/particle.h @@ -243,6 +243,9 @@ class Particle : public Sprite void setDieDistance(float dist) { mInvDieDistance = 1.0f / dist; } + bool isAlive() + { return mAlive; } + /** * Manually marks the particle for deletion */ diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 2387c652..5b5e86b9 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -76,10 +76,14 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * { mParticlePosY = readMinMax(propertyNode, 0.0f); + mParticlePosY.minVal *= SIN45; + mParticlePosY.maxVal *= SIN45; } else if (name == "position-z") { mParticlePosZ = readMinMax(propertyNode, 0.0f); + mParticlePosZ.minVal *= SIN45; + mParticlePosZ.maxVal *= SIN45; } else if (name == "image") { @@ -236,10 +240,6 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * ParticleEmitter::~ParticleEmitter() { - if (mParticleImage) - { - mParticleImage->decRef(); - } } @@ -294,8 +294,8 @@ ParticleEmitter::createParticles() float power = mParticlePower.value(); newParticle->setVector( cos(angleH) * cos(angleV) * power, - sin(angleH) * cos(angleV) * SIN45 * power, - sin(angleV) * SIN45 * power + sin(angleH) * cos(angleV) * power, + sin(angleV) * power ); newParticle->setRandomnes(mParticleRandomnes.value()); -- cgit v1.2.3-60-g2f50 From 1a9320fafb23940d0463e6f384713d0f99fc0c61 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 19 Sep 2007 17:28:33 +0000 Subject: Merged 0.0 changes from revision 3362 to 3580 to trunk. --- ChangeLog | 306 ++++++++++++++++++++++++++++++- data/graphics/gui/CMakeLists.txt | 4 + data/graphics/gui/Makefile.am | 4 + data/graphics/gui/close_button.png | Bin 0 -> 650 bytes data/graphics/gui/hits_yellow.png | Bin 356 -> 894 bytes data/graphics/gui/item_shortcut_bgr.png | Bin 0 -> 1026 bytes data/graphics/gui/mouse.png | Bin 1134 -> 4508 bytes data/graphics/gui/unknown-item.png | Bin 0 -> 540 bytes data/graphics/images/login_wallpaper.png | Bin 215527 -> 643307 bytes src/CMakeLists.txt | 22 ++- src/Makefile.am | 38 ++-- src/animationparticle.cpp | 3 +- src/being.cpp | 90 ++------- src/being.h | 42 +---- src/game.cpp | 179 ++++++++++-------- src/gui/button.cpp | 20 +- src/gui/button.h | 10 +- src/gui/buy.cpp | 125 ++++++++----- src/gui/buy.h | 10 +- src/gui/char_select.cpp | 12 +- src/gui/char_select.h | 31 ++-- src/gui/chat.cpp | 10 +- src/gui/debugwindow.cpp | 14 +- src/gui/debugwindow.h | 9 +- src/gui/equipmentwindow.cpp | 1 + src/gui/gui.cpp | 45 +++-- src/gui/gui.h | 43 +++-- src/gui/inventorywindow.cpp | 13 +- src/gui/inventorywindow.h | 11 +- src/gui/itemcontainer.cpp | 4 + src/gui/itemshortcutcontainer.cpp | 224 ++++++++++++++++++++++ src/gui/itemshortcutcontainer.h | 115 ++++++++++++ src/gui/itemshortcutwindow.cpp | 74 ++++++++ src/gui/itemshortcutwindow.h | 69 +++++++ src/gui/menuwindow.cpp | 12 +- src/gui/popupmenu.cpp | 6 - src/gui/selectionlistener.h | 16 +- src/gui/sell.cpp | 127 +++++++------ src/gui/sell.h | 16 +- src/gui/setup.cpp | 10 +- src/gui/setup_keyboard.cpp | 187 +++++++++++++++++++ src/gui/setup_keyboard.h | 84 +++++++++ src/gui/shoplistbox.cpp | 20 +- src/gui/skill.cpp | 6 +- src/gui/skill.h | 1 - src/gui/status.cpp | 6 +- src/gui/status.h | 3 +- src/gui/updatewindow.cpp | 4 +- src/gui/viewport.cpp | 25 +-- src/gui/viewport.h | 13 -- src/gui/window.cpp | 198 +++++++++++++++++--- src/gui/window.h | 99 +++++++++- src/gui/windowlistener.h | 86 +++++++++ src/imageparticle.cpp | 8 +- src/itemshortcut.cpp | 87 +++++++++ src/itemshortcut.h | 130 +++++++++++++ src/keyboardconfig.cpp | 144 +++++++++++++++ src/keyboardconfig.h | 185 +++++++++++++++++++ src/localplayer.cpp | 43 ++++- src/localplayer.h | 22 +++ src/main.cpp | 19 +- src/monster.cpp | 10 +- src/net/beinghandler.cpp | 84 +++++---- src/net/chathandler.cpp | 2 + src/net/inventoryhandler.cpp | 2 + src/net/playerhandler.cpp | 3 +- src/particle.cpp | 96 +++++----- src/particle.h | 112 +++++------ src/particleemitter.cpp | 30 ++- src/player.cpp | 50 ++--- src/player.h | 3 - src/resources/equipmentdb.cpp | 156 ---------------- src/resources/equipmentdb.h | 55 ------ src/resources/equipmentinfo.h | 52 ------ src/resources/itemdb.cpp | 126 ++++++++++--- src/resources/iteminfo.cpp | 86 ++++++++- src/resources/iteminfo.h | 118 +++++++----- src/resources/mapreader.cpp | 2 +- src/resources/monsterdb.cpp | 8 +- src/resources/monsterinfo.cpp | 12 +- src/resources/monsterinfo.h | 16 +- src/resources/spritedef.h | 4 +- src/textparticle.cpp | 11 +- src/textparticle.h | 17 +- src/utils/fastsqrt.h | 2 + src/utils/minmax.h | 1 + src/utils/trim.h | 53 ++++++ src/vector.h | 134 ++++++++++++++ tools/adler32.c | 67 +++++++ 89 files changed, 3257 insertions(+), 1140 deletions(-) create mode 100644 data/graphics/gui/close_button.png create mode 100644 data/graphics/gui/item_shortcut_bgr.png create mode 100644 data/graphics/gui/unknown-item.png create mode 100644 src/gui/itemshortcutcontainer.cpp create mode 100644 src/gui/itemshortcutcontainer.h create mode 100644 src/gui/itemshortcutwindow.cpp create mode 100644 src/gui/itemshortcutwindow.h create mode 100644 src/gui/setup_keyboard.cpp create mode 100644 src/gui/setup_keyboard.h create mode 100644 src/gui/windowlistener.h create mode 100644 src/itemshortcut.cpp create mode 100644 src/itemshortcut.h create mode 100644 src/keyboardconfig.cpp create mode 100644 src/keyboardconfig.h delete mode 100644 src/resources/equipmentdb.cpp delete mode 100644 src/resources/equipmentdb.h delete mode 100644 src/resources/equipmentinfo.h create mode 100644 src/utils/trim.h create mode 100644 src/vector.h create mode 100644 tools/adler32.c (limited to 'src/particle.h') diff --git a/ChangeLog b/ChangeLog index 082c9b94..d0e43d40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,19 @@ * src/gui/button.cpp: Fixed improper const qualifier. +2007-09-12 Bjørn Lindeijer + + * data/items.xml, data/equipment.xml: Added temporary weapon IDs below + 256 to use as view-ID in eAthena's item DB. + * src/gui/shoplistbox.cpp, src/gui/buy.h, src/gui/buy.cpp: Allowed + selection of items that cannot be afforded, so that their descriptions + are still accessible. Also made sure the player's money value of + ShopItemList gets updated. + +2007-09-11 Eugenio Favalli + + * src/gui/chat.cpp, tmw.cbp: Fixed admin commands. + 2007-09-10 Eugenio Favalli * configure.ac, data/fonts/dejavusans.ttf, @@ -18,17 +31,103 @@ * po/LINGUAS: Added German to the list of available languages. * po/de.po: Fixed two syntax errors preventing compilation. -2007-08-27 Matthias Hartmann +2007-09-08 Philipp Sehmisch + + * data/graphics/particles/aniblaze.png, + data/graphics/particles/cookingfire.particle.xml, + data/graphics/particles/fireplace.particle.xml, + data/graphics/particles/flame.particle.xml: Improved fire effects by + using animated particles. - * po/de.po: Added german translation. +2007-09-06 Philipp Sehmisch + + * src/animationparticle.cpp, src/imageparticle.cpp: Fixed animated + particles. + +2007-09-01 Bjørn Lindeijer + + * src/Makefile.am: Fixed the entry for windowlistener.h. + +2007-08-30 Bjørn Lindeijer + + * src/localplayer.cpp, src/player.cpp, src/main.cpp, src/being.cpp, + src/CMakeLists.txt, src/Makefile.am, src/resources/iteminfo.h, + src/resources/equipmentdb.h, src/resources/equipmentinfo.h, + src/resources/itemdb.cpp, src/resources/iteminfo.cpp, + src/resources/equipmentdb.cpp, src/resources/equipmentinfo.cpp, + src/resources/spritedef.h, src/being.h, data/items.xml, + data/equipment.xml: Merged equipment database with items database and + got rid of the unused item art attribute. + * src/net/beinghandler.cpp, src/net/charserverhandler.cpp: Removed the + now unnecessary multiplication of weapon IDs with 10000. + * src/resources/iteminfo.cpp, data/graphics/items/unknown.png: Added + fallback item icon and use it for unknown items or when item image + fails to load. + * NEWS: Updated with changes since last update. + * data/items.xml, data/equipment.xml: Reverted equipment database and + included original low-ID items in items.xml for compatibility with + eAthena, which doesn't support View ID to come above 255. + * src/resources/itemdb.cpp: Accept items without a name. + +2007-08-29 Bjørn Lindeijer + + * src/gui/sell.cpp, src/gui/inventorywindow.cpp, src/gui/sell.h: Made + sell dialog resizable and tweaked inventory resize code a bit. + * data/items.xml: Fixed typo in chainmail description. + +2007-08-28 Bjørn Lindeijer + + * src/gui/window.cpp, src/gui/inventorywindow.h, + src/gui/selectionlistener.h, src/gui/buy.h, + src/gui/itemshortcutwindow.cpp, src/gui/inventorywindow.cpp, + src/gui/buy.cpp, src/gui/window.h, src/gui/windowlistener.h, + src/gui/itemshortcutwindow.h, src/CMakeLists.txt, src/Makefile.am: + Made buy dialog resizable and added a WindowListener class for + listening for window resize and move events. + * src/textparticle.h, src/particle.h, src/CMakeLists.txt, + src/particle.cpp, src/imageparticle.cpp, src/vector.h, + src/textparticle.cpp, src/Makefile.am: Added Vector class and used it + in the particle engine. + +2007-08-27 Bjørn Lindeijer + + * src/engine.cpp, src/resources/mapreader.cpp: Made client search for + both compressed and non-compressed map files. 2007-08-27 Eugenio Favalli + * src/game.cpp: Assigned unused emotions to Alt +/-. (applied a patch + by Quiche_on_a_leash). + * data/maps/new_1-1.tmx, data/maps/new_1-1.tmx.gz, + data/maps/new_10-1.tmx, data/maps/new_10-1.tmx.gz, + data/maps/new_11-1.tmx, data/maps/new_11-1.tmx.gz, + data/maps/new_12-1.tmx, data/maps/new_12-1.tmx.gz, + data/maps/new_13-1.tmx, data/maps/new_13-1.tmx.gz, + data/maps/new_14-1.tmx, data/maps/new_14-1.tmx.gz, + data/maps/new_15-1.tmx, data/maps/new_15-1.tmx.gz, + data/maps/new_16-1.tmx, data/maps/new_16-1.tmx.gz, + data/maps/new_17-1.tmx, data/maps/new_17-1.tmx.gz, + data/maps/new_18-1.tmx, data/maps/new_18-1.tmx.gz, + data/maps/new_19-1.tmx, data/maps/new_19-1.tmx.gz, + data/maps/new_2-1.tmx, data/maps/new_2-1.tmx.gz, + data/maps/new_20-1.tmx, data/maps/new_20-1.tmx.gz, + data/maps/new_3-1.tmx, data/maps/new_3-1.tmx.gz, + data/maps/new_4-1.tmx, data/maps/new_4-1.tmx.gz, + data/maps/new_5-1.tmx, data/maps/new_5-1.tmx.gz, + data/maps/new_6-1.tmx, data/maps/new_6-1.tmx.gz, + data/maps/new_7-1.tmx, data/maps/new_7-1.tmx.gz, + data/maps/new_8-1.tmx, data/maps/new_8-1.tmx.gz, + data/maps/new_9-1.tmx, data/maps/new_9-1.tmx.gz: Replaced compressed + maps with layer compressed maps. * data/maps/new_1-1.tmx.gz: Added test npcs. * src/openglgraphics.cpp, tmw.cbp: Fixed compilation with old OpenGL headers. * po/it.po: Updated italian translation. +2007-08-27 Matthias Hartmann + + * po/de.po: Added German translation. + 2007-08-27 Guillaume Melquiond * src/gui/chat.h, src/gui/chat.cpp: Added "/admin" chat command for @@ -36,6 +135,11 @@ * src/engine.cpp, src/resources/mapreader.cpp: Ported patch from 0.0, in order to support missing extensions and uncompressed maps. +2007-08-26 Eugenio Favalli + + * src/gui/updatewindow.cpp, src/main.cpp, tmw.cbp: Removed home dir + from config file to avoid encoding issues. + 2007-08-26 Guillaume Melquiond * src/gui/button.cpp: Fixed incorrect button dimensions, as they mess @@ -58,10 +162,103 @@ for rectangle OpenGL textures when available, in order to reduce video memory usage. +2007-08-24 Bjørn Lindeijer + + * src/gui/gui.h, src/gui/gui.cpp: Removed useless logic method and + reverted mouse cursor to non-static since there can be only one Gui + instance so there is no point in supporting a shared resource. + * src/gui/window.cpp, src/gui/gui.h: Removed unnecessary + Gui::isCustomCursor method. + * src/gui/char_select.h, src/gui/char_select.cpp, src/utils/trim.h: + Added trimming of name for new character creation. + * src/net/chathandler.cpp: Added trimming of chat messages appearing + above players. + * src/gui/window.cpp, src/gui/window.h: Improved resize mouse cursor + indication, removing duplicated code and fixing indicator above resize + grip. + +2007-08-23 Bjørn Lindeijer + + * src/gui/viewport.h, src/gui/viewport.cpp: Removed two useless popup + related methods. + * src/gui/debugwindow.h, src/gui/debugwindow.cpp: Use generic close + button functionality. + * src/particle.h, src/particleemitter.cpp, src/particle.cpp: Renamed + Particle::mVector to Particle::mVelocity for clarity. + * src/localplayer.cpp, src/gui/ministatus.cpp, src/gui/status.cpp, + src/being.cpp, src/net/charserverhandler.cpp, + src/net/playerhandler.cpp, src/localplayer.h, src/being.h: Changed XP + gaining effect to appear on the player instead. + * data/graphics/gui/hits_yellow.png: Restored shadow of yellow font. + +2007-08-22 Bjørn Lindeijer + + * src/gui/itemshortcutcontainer.h: Fixed compiler warning. + * src/CMakeLists.txt, src/Makefile.am: Updated source lists. + * data/graphics/gui/CMakeLists.txt, data/graphics/gui/Makefile.am: + Added close button and item shortcut backgrounds to files that will be + installed. + * src/gui/itemshortcutcontainer.cpp: Make sure mGridWidth and + mGridHeight are initialized properly (fixes arithmetic exception in + ItemShortcutContainer::draw). + * src/keyboardconfig.cpp: Changed default sitting key back to 's'. + * src/net/equipmenthandler.cpp: Removed a line that attempted to set + the player's weapon sprite with each kind of equipment. Seems to work + fine without as well. + * src/gui/chat.cpp, src/utils/trim.h, src/CMakeLists.txt, + src/Makefile.am: Added trimming of chat messages. + +2007-08-22 Philipp Sehmisch + + * data/graphics/sprites/chest-lightplatemail-male.png, + data/graphics/sprites/chest-lightplatemail-female.png, + data/graphics/items/armor-chest-lightplatemail.png, + data/graphics/tiles/woodland_indoor_x2.png: Another color correction + at the light platemail (looks more metalic now) + * data/maps/new_18-1.tmx.gz, data/maps/new_19-1.tmx.gz, + data/images/minimap_new_18-1.png, data/images/minimap_new_19-1.png: + Removed a tree that prevented people from sitting on one of the + benches properly. Added correct minimap to woodland village and + surrounding. + +2007-08-22 Joshua Langley + + * data/graphics/gui/item_shortcut_bgr.png, src/game.cpp, + src/gui/gui.cpp, src/gui/itemcontainer.cpp, + src/gui/itemshortcutcontainer.cpp, src/gui/itemshortcutcontainer.h, + src/gui/itemshortcutwindow.cpp, src/gui/itemshortcutwindow.h, + src/gui/menuwindow.cpp, src/gui/setup_keyboard.cpp, src/gui/window.h, + src/itemshortcut.cpp, src/itemshortcut.h, src/keyboardconfig.cpp, + src/keyboardconfig.h, src/localplayer.cpp, src/localplayer.h, + src/main.cpp, src/net/inventoryhandler.cpp, src/utils/tostring.h, + tmw.cbp: Added item shortcut bar. + +2007-08-20 Joshua Langley + + * data/graphics/gui/mouse.png, src/gui/equipmentwindow.cpp, + src/gui/gui.cpp, src/gui/gui.h, src/gui/inventorywindow.cpp, + src/gui/setup.cpp, src/gui/skill.cpp, src/gui/skill.h, + src/gui/status.cpp, src/gui/window.cpp, src/gui/window.h, + data/graphics/gui/close_button.png: Added close button functionality, + resize cursor cues. + * data/graphics/gui/hits_yellow.png, src/being.cpp, src/being.h, + src/gui/gui.cpp, src/localplayer.cpp, src/localplayer.h, + src/net/charserverhandler.cpp, src/net/playerhandler.cpp, + src/particle.cpp, src/particle.h: Added monster killed xp notification + effect. + 2007-08-19 Bjørn Lindeijer - * src/CMakeLists.txt: Updated CMake file. * data/equipment.xml: Fixed typo in female light plate mail. + * NEWS: Updated with changes since 0.0.23. + * src/CMakeLists.txt: Updated CMake file. + +2007-08-19 Joshua Langley + + * src/keyboardconfig.cpp, src/keyboardconfig.h: Minor cleanup. + * src/gui/buy.cpp, src/gui/sell.cpp: Buy/sell fixed minimum quantity. + * src/gui/setup_keyboard.cpp, src/gui/setup_keyboard.h: Fixed bug - + reverts unassigned key. 2007-08-19 Guillaume Melquiond @@ -73,6 +270,23 @@ src/net/playerhandler.cpp, src/localplayer.h: Adapted to new server handling of character attributes. +2007-08-17 Bjørn Lindeijer + + * tools/adler32.c: Added little program for calculating adler32 + checksums of files. + * src/gui/setup_keyboard.cpp: Fixed compile issue related to array + bound not being an integer constant. + +2007-08-15 Philipp Sehmisch + + * data/graphics/sprites/npcs.png, data/graphics/sprites/npc.xml: + Added farmer NPC for woodland village. + +2007-08-14 Eugenio Favalli + + * src/gui/popupmenu.cpp, src/gui/viewport.cpp, src/gui/viewport.h, + tmw.cbp: Fixed popup menu requiring one more click after being used. + 2007-08-14 Guillaume Melquiond * src/net/messagein.h, src/net/messagein.cpp: Fixed error-prone @@ -111,6 +325,15 @@ * src/gui/npclistdialog.cpp, src/gui/npclistdialog.h, src/net/npchandler.cpp: Removed colon in NPC choice messages. +2007-08-09 Philipp Sehmisch + + * data/graphics/sprites/chest-lightplatemail-male.png, + data/graphics/sprites/chest-lightplatemail-female.png, + data/graphics/items/armor-chest-lightplatemail.png, + data/graphics/tiles/woodland_indoor_x2.png: Gave the platemail + armor a blue tint. Looks less boring and makes recoloring through + hue shifting possible. + 2007-08-09 Guillaume Melquiond * po/POTFILES.in: Updated list of translatable source files. @@ -133,9 +356,29 @@ data/graphics/images/EquipBackground.png: Re-designed equipment window, un-equip created. +2007-08-08 Philipp Sehmisch + + * data/graphics/particles/cookingfire.particle.xml, + data/graphics/particles/fireplace.particle.xml, + data/maps/new_20-1.tmx.gz: Added particle effects and music to the + woodland village indoor map. + * data/maps/new_19-1.tmx.gz: Added overlay effect and music to + woodland village outdoor map. + * data/maps/new_18-1.tmx.gz: Fixed some collision map errors and added + music and overlay effect to the surrounding of the woodland village. + +2007-08-07 Philipp Sehmisch + + * data/graphics/sprites/npcs.png: Added two new NPCs and gave some + of the older NPCs a makeover to look more like the style of the new + playerset. + * data/maps/new_20-1.tmx.gz: Corrected a few mapping errors in the + new woodland village. + * data/items.xml: Tweaked description and values of the scythe. + 2007-08-07 Guillaume Melquiond - * po/Makevars, src/main.cpp: Replaced PACKAGE by tmw to reduce + * po/Makevars, src/main.cpp: Replaced PACKAGE by tmw to reduce preprocessing hell. Set gettext charset to utf8. * src/gui/menuwindow.cpp, src/gui/connection.cpp, src/gui/register.cpp, src/gui/equipmentwindow.cpp, @@ -172,6 +415,14 @@ Makefile.am, autogen.sh: Used autopoint for generating gettext environment, and removed conflicting files. +2007-08-05 Philipp Sehmisch + + * data/graphics/tiles/woodland_indoor.png, + data/graphics/tiles/woodland_indoor_x2.png, + data/graphics/tiles/woodland_indoor_x3.png: Added woodland + village indoor tilesets. + * data/maps/new_20-1.tmx.gz: Added woodland village indoor map. + 2007-08-05 Guillaume Melquiond * configure.ac, Makefile.am, po, src/Makefile.am, src/main.cpp, @@ -222,12 +473,22 @@ src/gui/itemcontainer.cpp, src/gui/checkbox.cpp, src/gui/minimap.cpp, src/gui/scrollarea.cpp, src/gui/popupmenu.cpp: Removed useless yet costly dynamic casts. - -2007-07-25 Guillaume Melquiond - * src/net/beinghandler.cpp, src/net/protocol.h: Added being speed to protocol. +2007-07-25 Joshua Langley + + * src/gui/setup.cpp, src/gui/setup_keyboard.cpp, + src/gui/setup_keyboard.h, src/keyboardconfig.cpp, + src/keyboardconfig.h, src/main.cpp: Minor changes to keyboard config, + keyboard setup gui re-designed. + +2007-07-24 Bjørn Lindeijer + + * src/CMakeLists.txt, src/Makefile.am: Added setup_keyboard.* and + keyboardconfig.* to the list of source files. + * src/keyboardconfig.h: Fixed initialization order. + 2007-07-23 Eugenio Favalli * data/maps/new_1-1.tar.gz, data/maps/new_3-1.tar.gz: Fixed warp @@ -247,8 +508,21 @@ * data/maps/new_1-1.tar.gz: Fixed insecure filenames. +2007-07-17 Joshua Langley + + * src/game.cpp: Only one key per function. + * src/main.cpp: Keyboard configuration included. + * src/gui/button.cpp, src/gui/button.h: Default constructor and + init function added. + * src/gui/setup.cpp: Keyboard setup tab added. + * src/gui/setup_keyboard.cpp, src/gui/setup_keyboard.h: Add to project + file, it is the keyboard setup tab. + * src/keyboardconfig.cpp, src/keyboardconfig.h: Add to project file, + the main keyboard config operations. + 2007-07-16 Eugenio Favalli + * data/items.xml: Fixed description of silk headband. * data/maps/new_1-1.tar.gz, data/maps/new_3-1.tar.gz: Added warp and spawn areas. @@ -262,6 +536,24 @@ * src/net/beinghandler.cpp, src/net/beinghandler.h, src/net/protocol.h: Added support for visible equipment. +2007-07-11 Philipp Sehmisch + + * src/resources/monsterdb.cpp, src/resources/monsterinfo.cpp, + src/resources/monsterinfo.h, src/monster.cpp: Renamed SoundEvent + to MonsterSoundEvent. + * src/resources/equipmentdb.cpp, src/resources/equipmentinfo.cpp, + src/resources/equipmentinfo.h: EquipmentDB now holds the type of + attack animation and the sounds of weapons. + * src/being.cpp. src/being.h, src/localplayer.cpp, + src/net/beinghandler.cpp, src/net/charserverhandler.cpp, + src/net/equipmenthandler.cpp, src/player.cpp, src/player.h: The + type of weapon player characters are using is now set using + setVisibleEquipment() instead of setWeapon() or setWeaponById(). + * src/CMakeLists.txt, src/Makefile.AM, tmw.cbp, The Mana World.dev: + Updated project files and buildscripts. + * data/graphics/images/login-wallpaper.png: Replaced login wallpaper + with a new one by Irukard. + 2007-07-11 Bjørn Lindeijer * src/gui/window.cpp: Fixed resizing windows by their resize grip. diff --git a/data/graphics/gui/CMakeLists.txt b/data/graphics/gui/CMakeLists.txt index 5a02d7f1..649e0917 100644 --- a/data/graphics/gui/CMakeLists.txt +++ b/data/graphics/gui/CMakeLists.txt @@ -7,6 +7,7 @@ SET (FILES button.png buttonpress.png checkbox.png + close_button.png deepbox.png fixedfont.png hits_blue.png @@ -18,6 +19,8 @@ SET (FILES hscroll_right_default.png hscroll_right_highlight.png hscroll_right_pressed.png + item_shortcut_bgr.png + mouse.png menuitemD.png menuitemF.png menuitemN.png @@ -37,6 +40,7 @@ SET (FILES target-cursor-red-m.png target-cursor-red-s.png thickborder.png + unknown-item.png vscroll_blue.png vscroll_down_default.png vscroll_down_highlight.png diff --git a/data/graphics/gui/Makefile.am b/data/graphics/gui/Makefile.am index 92e4f3bb..7287d717 100644 --- a/data/graphics/gui/Makefile.am +++ b/data/graphics/gui/Makefile.am @@ -10,6 +10,7 @@ gui_DATA = \ buttonhi.png \ buttonpress.png \ checkbox.png \ + close_button.png \ deepbox.png \ equip_bg.png \ fixedfont.png \ @@ -22,6 +23,8 @@ gui_DATA = \ hscroll_right_default.png \ hscroll_right_highlight.png \ hscroll_right_pressed.png \ + item_shortcut_bgr.png \ + mouse.png \ menuitemD.png \ menuitemF.png \ menuitemN.png \ @@ -41,6 +44,7 @@ gui_DATA = \ target-cursor-red-m.png \ target-cursor-red-s.png \ thickborder.png \ + unknown-item.png \ vscroll_blue.png \ vscroll_down_default.png \ vscroll_down_highlight.png \ diff --git a/data/graphics/gui/close_button.png b/data/graphics/gui/close_button.png new file mode 100644 index 00000000..f87cc2a9 Binary files /dev/null and b/data/graphics/gui/close_button.png differ diff --git a/data/graphics/gui/hits_yellow.png b/data/graphics/gui/hits_yellow.png index f917bc67..d77b7c05 100644 Binary files a/data/graphics/gui/hits_yellow.png and b/data/graphics/gui/hits_yellow.png differ diff --git a/data/graphics/gui/item_shortcut_bgr.png b/data/graphics/gui/item_shortcut_bgr.png new file mode 100644 index 00000000..e878fc7a Binary files /dev/null and b/data/graphics/gui/item_shortcut_bgr.png differ diff --git a/data/graphics/gui/mouse.png b/data/graphics/gui/mouse.png index 2eeb0e51..84dc2ad1 100644 Binary files a/data/graphics/gui/mouse.png and b/data/graphics/gui/mouse.png differ diff --git a/data/graphics/gui/unknown-item.png b/data/graphics/gui/unknown-item.png new file mode 100644 index 00000000..9201d688 Binary files /dev/null and b/data/graphics/gui/unknown-item.png differ diff --git a/data/graphics/images/login_wallpaper.png b/data/graphics/images/login_wallpaper.png index 54692dfd..7af4f913 100644 Binary files a/data/graphics/images/login_wallpaper.png and b/data/graphics/images/login_wallpaper.png differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fa19cfb5..96338338 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -97,6 +97,12 @@ SET(SRCS gui/item_amount.h gui/itemcontainer.cpp gui/itemcontainer.h + gui/itemshortcutcontainer.cpp + gui/itemshortcutcontainer.h + gui/itemshortcutwindow.cpp + gui/itemshortcutwindow.h + gui/item_amount.cpp + gui/item_amount.h gui/linkhandler.h gui/listbox.cpp gui/listbox.h @@ -143,6 +149,8 @@ SET(SRCS gui/setup.h gui/setup_joystick.cpp gui/setup_joystick.h + gui/setup_keyboard.cpp + gui/setup_keyboard.h gui/setuptab.h gui/setup_video.cpp gui/setup_video.h @@ -170,12 +178,13 @@ SET(SRCS gui/updatewindow.h gui/vbox.cpp gui/vbox.h - gui/windowcontainer.cpp - gui/windowcontainer.h gui/viewport.cpp gui/viewport.h gui/window.cpp gui/window.h + gui/windowcontainer.cpp + gui/windowcontainer.h + gui/windowlistener.h gui/widgets/dropdown.cpp gui/widgets/dropdown.h net/beinghandler.cpp @@ -239,9 +248,6 @@ SET(SRCS resources/buddylist.h resources/animation.cpp resources/animation.h - resources/equipmentdb.cpp - resources/equipmentdb.h - resources/equipmentinfo.h resources/image.cpp resources/image.h resources/imagewriter.cpp @@ -281,6 +287,7 @@ SET(SRCS utils/strprintf.cpp utils/strprintf.h utils/tostring.h + utils/trim.h utils/xml.cpp utils/xml.h animatedsprite.cpp @@ -317,8 +324,12 @@ SET(SRCS inventory.h item.cpp item.h + itemshortcut.cpp + itemshortcut.h joystick.cpp joystick.h + keyboardconfig.cpp + keyboardconfig.h localplayer.cpp localplayer.h lockedarray.h @@ -351,6 +362,7 @@ SET(SRCS textparticle.cpp textparticle.h tileset.h + vector.h ) ADD_EXECUTABLE(tmw ${SRCS}) diff --git a/src/Makefile.am b/src/Makefile.am index 7006f66e..2f29e299 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,6 +5,8 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ gui/widgets/dropdown.h \ gui/widgets/resizegrip.cpp \ gui/widgets/resizegrip.h \ + gui/box.h \ + gui/box.cpp \ gui/browserbox.cpp \ gui/browserbox.h \ gui/buddywindow.cpp \ @@ -39,12 +41,20 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ gui/gccontainer.h \ gui/gui.cpp \ gui/gui.h \ + gui/hbox.h \ + gui/hbox.cpp \ gui/help.cpp \ gui/help.h \ + gui/inttextbox.h \ + gui/inttextbox.cpp \ gui/inventorywindow.cpp \ gui/inventorywindow.h \ gui/itemcontainer.cpp \ gui/itemcontainer.h \ + gui/itemshortcutcontainer.cpp \ + gui/itemshortcutcontainer.h \ + gui/itemshortcutwindow.cpp \ + gui/itemshortcutwindow.h \ gui/item_amount.cpp \ gui/item_amount.h \ gui/linkhandler.h \ @@ -95,6 +105,8 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ gui/setup.h \ gui/setup_joystick.cpp \ gui/setup_joystick.h \ + gui/setup_keyboard.cpp \ + gui/setup_keyboard.h \ gui/setuptab.h \ gui/setup_video.cpp \ gui/setup_video.h \ @@ -118,22 +130,17 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ gui/trade.h \ gui/unregisterdialog.cpp \ gui/unregisterdialog.h \ + gui/updatewindow.h \ + gui/updatewindow.cpp \ + gui/vbox.h \ + gui/vbox.cpp \ gui/viewport.cpp \ gui/viewport.h \ gui/window.cpp \ gui/window.h \ gui/windowcontainer.cpp \ gui/windowcontainer.h \ - gui/inttextbox.h \ - gui/inttextbox.cpp \ - gui/box.h \ - gui/box.cpp \ - gui/vbox.h \ - gui/vbox.cpp \ - gui/hbox.h \ - gui/hbox.cpp \ - gui/updatewindow.h \ - gui/updatewindow.cpp \ + gui/windowlistener.h \ net/beinghandler.h \ net/beinghandler.cpp \ net/buysellhandler.h \ @@ -193,9 +200,6 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ resources/ambientoverlay.h \ resources/animation.cpp \ resources/animation.h \ - resources/equipmentdb.cpp \ - resources/equipmentdb.h \ - resources/equipmentinfo.h \ resources/image.cpp \ resources/image.h \ resources/imageloader.cpp \ @@ -235,6 +239,7 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ utils/strprintf.h \ utils/strprintf.cpp \ utils/tostring.h \ + utils/trim.h \ utils/xml.cpp \ utils/xml.h \ animatedsprite.cpp \ @@ -271,8 +276,12 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ inventory.h \ item.cpp \ item.h \ + itemshortcut.cpp \ + itemshortcut.h \ joystick.cpp \ joystick.h \ + keyboardconfig.cpp \ + keyboardconfig.h \ localplayer.cpp \ localplayer.h \ lockedarray.h \ @@ -304,7 +313,8 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ sprite.h \ textparticle.cpp \ textparticle.h \ - tileset.h + tileset.h \ + vector.h # set the include path found by configure INCLUDES = \ diff --git a/src/animationparticle.cpp b/src/animationparticle.cpp index 30c33da7..c79a5bc4 100644 --- a/src/animationparticle.cpp +++ b/src/animationparticle.cpp @@ -26,7 +26,7 @@ #include "simpleanimation.h" AnimationParticle::AnimationParticle(Map *map, Animation *animation): - ImageParticle(map, 0), + ImageParticle(map, NULL), mAnimation(new SimpleAnimation(animation)) { } @@ -40,6 +40,7 @@ AnimationParticle::AnimationParticle(Map *map, xmlNodePtr animationNode): AnimationParticle::~AnimationParticle() { delete mAnimation; + mImage = NULL; } bool AnimationParticle::update() diff --git a/src/being.cpp b/src/being.cpp index bdb27384..81bed667 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -36,12 +36,10 @@ #include "resources/resourcemanager.h" #include "resources/imageset.h" +#include "resources/iteminfo.h" #include "gui/gui.h" -#include "resources/resourcemanager.h" -#include "resources/imageset.h" - #include "utils/dtor.h" #include "utils/tostring.h" @@ -58,11 +56,11 @@ Being::Being(Uint16 id, Uint16 job, Map *map): mEquipment(new Equipment()), mId(id), mSex(2), - mWeapon(0), mWalkSpeed(150), mSpeedModifier(1024), mSpriteDirection(DIRECTION_DOWN), mDirection(DOWN), mMap(NULL), + mEquippedWeapon(NULL), mHairStyle(0), mHairColor(0), mSpeechTime(0), mPx(0), mPy(0), @@ -302,7 +300,7 @@ Being::setSpeech(const std::string &text, Uint32 time) void Being::takeDamage(int amount) { - gcn::Font* font; + gcn::Font *font; std::string damage = amount ? toString(amount) : "miss"; // Selecting the right color @@ -312,8 +310,9 @@ Being::takeDamage(int amount) } else { - // hit particle effect - controlParticle(particleEngine->addEffect("graphics/particles/hit.particle.xml", 0, 0)); + // Hit particle effect + controlParticle(particleEngine->addEffect( + "graphics/particles/hit.particle.xml", 0, 0)); if (getType() == MONSTER) { @@ -325,7 +324,7 @@ Being::takeDamage(int amount) } } - // show damage number + // Show damage number particleEngine->addTextSplashEffect(damage, 255, 255, 255, font, mPx + 16, mPy + 16); } @@ -340,7 +339,7 @@ void Being::setMap(Map *map) { // Remove sprite from potential previous map - if (mMap != NULL) + if (mMap) { mMap->removeSprite(mSpriteIterator); } @@ -348,12 +347,12 @@ Being::setMap(Map *map) mMap = map; // Add sprite to potential new map - if (mMap != NULL) + if (mMap) { mSpriteIterator = mMap->addSprite(this); } - //clear particle effect list because child particles became invalid + // Clear particle effect list because child particles became invalid mChildParticleEffects.clear(); } @@ -362,7 +361,8 @@ Being::controlParticle(Particle *particle) { if (particle) { - particle->disableAutoDelete(); //the effect may not die without the beings permission or we segvault + // The effect may not die without the beings permission or we segfault + particle->disableAutoDelete(); mChildParticleEffects.push_back(particle); } } @@ -380,20 +380,12 @@ Being::setAction(Action action) currentAction = ACTION_SIT; break; case ATTACK: - switch (getWeapon()) + if (mEquippedWeapon) { - case 3: - currentAction = ACTION_ATTACK; - break; - case 2: - currentAction = ACTION_ATTACK_BOW; - break; - case 1: - currentAction = ACTION_ATTACK_STAB; - break; - case 0: - currentAction = ACTION_ATTACK; - break; + currentAction = mEquippedWeapon->getAttackType(); + } + else { + currentAction = ACTION_ATTACK; } for (int i = 0; i < VECTOREND_SPRITE; i++) { @@ -533,11 +525,9 @@ Being::logic() } } - //Update particle effects - for ( std::list::iterator i = mChildParticleEffects.begin(); - i != mChildParticleEffects.end(); - - ) + // Update particle effects + for (std::list::iterator i = mChildParticleEffects.begin(); + i != mChildParticleEffects.end();) { (*i)->setPosition((float)mPx + 16.0f, (float)mPy + 32.0f); if (!(*i)->isAlive()) @@ -599,46 +589,6 @@ Being::getType() const return UNKNOWN; } -void -Being::setWeaponById(Uint16 weapon) -{ - //TODO: Use an external file to map weapon IDs to weapon types - switch (weapon) - { - case 529: // iron arrows - case 1199: // arrows - break; - - case 623: //scythe - setWeapon(3); - break; - - case 1200: // bow - case 530: // short bow - case 545: // forest bow - setWeapon(2); - break; - - case 521: // sharp knife - /* UNCOMMENT TO TEST SHARP KNIFE AS SCYTHE - * setWeapon(3) - * break; - */ - case 522: // dagger - case 536: // short sword - case 1201: // knife - setWeapon(1); - break; - - case 0: // unequip - setWeapon(0); - break; - - default: - logger->log("Not a weapon: %d", weapon); - } -} - int Being::getOffset(int step) const { // Check whether we're walking in the requested direction diff --git a/src/being.h b/src/being.h index afb3cb8b..fadf9656 100644 --- a/src/being.h +++ b/src/being.h @@ -38,6 +38,7 @@ class AnimatedSprite; class Equipment; +class ItemInfo; class Item; class Map; class Graphics; @@ -161,8 +162,7 @@ class Being : public Sprite void setSpeech(const std::string &text, Uint32 time); /** - * Puts a damage bubble above this being for the specified amount of - * time. + * Puts a damage bubble above this being. * * @param amount The amount of damage. */ @@ -266,27 +266,6 @@ class Being : public Sprite */ virtual Type getType() const; - /** - * Gets the weapon picture id. - */ - Uint16 getWeapon() const { return mWeapon; } - - /** - * Sets the weapon picture id. - * - * @param weapon the picture id - */ - virtual void - setWeapon(Uint16 weapon) { mWeapon = weapon; } - - /** - * Sets the weapon picture id with the weapon id. - * - * @param weapon the weapon id - */ - void - setWeaponById(Uint16 weapon); - /** * Gets the walk speed. */ @@ -380,30 +359,26 @@ class Being : public Sprite getHeight() const; /** - * Returns the required size of a target cursor for this being + * Returns the required size of a target cursor for this being. */ - virtual Being::TargetCursorSize - getTargetCursorSize() const + virtual Being::TargetCursorSize getTargetCursorSize() const { return TC_MEDIUM; } std::auto_ptr mEquipment; /** - * Take control of a particle + * Take control of a particle. */ - void - controlParticle(Particle *particle); + void controlParticle(Particle *particle); protected: /** * Sets the new path for this being. */ - void - setPath(const Path &path, int mod = 1024); + void setPath(const Path &path, int mod = 1024); Uint16 mId; /**< Unique being id */ Uint8 mSex; /**< Character's gender */ - Uint16 mWeapon; /**< Weapon picture id */ Uint16 mWalkSpeed; /**< Walking speed */ Uint16 mSpeedModifier; /**< Modifier to keep course on sync (1024 = normal speed) */ Uint8 mSpriteDirection; /**< Facing direction */ @@ -411,6 +386,9 @@ class Being : public Sprite Map *mMap; /**< Map on which this being resides */ SpriteIterator mSpriteIterator; + /** Engine-related infos about weapon. */ + const ItemInfo* mEquippedWeapon; + Path mPath; std::string mSpeech; Uint16 mHairStyle, mHairColor; diff --git a/src/game.cpp b/src/game.cpp index 495f9a8d..a40bfa28 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -37,7 +37,9 @@ #include "engine.h" #include "flooritemmanager.h" #include "graphics.h" +#include "itemshortcut.h" #include "joystick.h" +#include "keyboardconfig.h" #include "localplayer.h" #include "log.h" #include "npc.h" @@ -53,6 +55,7 @@ #include "gui/gui.h" #include "gui/help.h" #include "gui/inventorywindow.h" +#include "gui/itemshortcutwindow.h" #include "gui/menuwindow.h" #include "gui/minimap.h" #include "gui/ministatus.h" @@ -116,6 +119,7 @@ TradeWindow *tradeWindow; //BuddyWindow *buddyWindow; HelpWindow *helpWindow; DebugWindow *debugWindow; +ItemShortcutWindow *itemShortcutWindow; BeingManager *beingManager = NULL; FloorItemManager *floorItemManager = NULL; @@ -181,6 +185,7 @@ void createGuiWindows() //buddyWindow = new BuddyWindow(); helpWindow = new HelpWindow(); debugWindow = new DebugWindow(); + itemShortcutWindow = new ItemShortcutWindow(); // Initialize window positions //chargeDialog->setPosition( @@ -193,6 +198,7 @@ void createGuiWindows() chatWindow->setVisible(true); miniStatusWindow->setVisible(true); menuWindow->setVisible(true); + itemShortcutWindow->setVisible(true); } /** @@ -220,6 +226,7 @@ void destroyGuiWindows() //delete buddyWindow; delete helpWindow; delete debugWindow; + delete itemShortcutWindow; } Game::Game(): @@ -420,6 +427,14 @@ void Game::handleInput() { gcn::Window *requestedWindow = NULL; + if (setupWindow->isVisible() && + keyboard.getNewKeyIndex() > keyboard.KEY_NO_VALUE) + { + keyboard.setNewKey((int) event.key.keysym.sym); + keyboard.callbackNewKey(); + keyboard.setNewKeyIndex(keyboard.KEY_NO_VALUE); + return; + } switch (event.key.keysym.sym) { case SDLK_F1: @@ -473,65 +488,7 @@ void Game::handleInput() used = true; } break; - - // Hide certain windows - case SDLK_h: - if (!chatWindow->isFocused()) - { - statusWindow->setVisible(false); - inventoryWindow->setVisible(false); - skillDialog->setVisible(false); - setupWindow->setVisible(false); - equipmentWindow->setVisible(false); - helpWindow->setVisible(false); - debugWindow->setVisible(false); - } - break; - - // Picking up items on the floor - case SDLK_g: - case SDLK_z: - if (!chatWindow->isFocused()) - { - Uint16 x = player_node->mX / 32, y = player_node->mY / 32; - FloorItem *item = floorItemManager->findByCoordinates(x, y); - - // If none below the player, try the tile in front of - // the player - if (!item) - { - // Temporary until tile-based picking is removed. - switch (player_node->getSpriteDirection()) - { - case DIRECTION_UP : --y; break; - case DIRECTION_DOWN : ++y; break; - case DIRECTION_LEFT : --x; break; - case DIRECTION_RIGHT: ++x; break; - default: break; - } - - item = floorItemManager->findByCoordinates(x, y); - } - - if (item) - player_node->pickUp(item); - - used = true; - } - break; - - // attacking - // TODO: Reimplement attacking with joystick buttons - // (old code allowed permanent attacking and not 1 attack - // with each button push) - // I would like to do this but i don't own a joystick. - case SDLK_LCTRL: - case SDLK_RCTRL: - player_node->attack(); - used = true; - break; - - // Quitting confirmation dialog + // Quitting confirmation dialog case SDLK_ESCAPE: if (!quitDialog) { @@ -547,6 +504,74 @@ void Game::handleInput() break; } + if (keyboard.isEnabled() && !chatWindow->isFocused()) + { + const int tKey = keyboard.getKeyIndex(event.key.keysym.sym); + // Checks if any item shortcut is pressed. + for (int i = KeyboardConfig::KEY_SHORTCUT_0; + i <= KeyboardConfig::KEY_SHORTCUT_9; + i++) + { + if (tKey == i) { + itemShortcut->useItem( + i - KeyboardConfig::KEY_SHORTCUT_0); + break; + } + } + switch (tKey) { + case KeyboardConfig::KEY_PICKUP: + { + Uint16 x = player_node->mX / 32; + Uint16 y = player_node->mY / 32; + FloorItem *item = + floorItemManager->findByCoordinates(x, y); + + // If none below the player, try the tile in front + // of the player + if (!item) + { + // Temporary until tile-based picking is + // removed. + switch (player_node->getSpriteDirection()) + { + case DIRECTION_UP : --y; break; + case DIRECTION_DOWN : ++y; break; + case DIRECTION_LEFT : --x; break; + case DIRECTION_RIGHT: ++x; break; + default: break; + } + + item = + floorItemManager->findByCoordinates(x, y); + } + + if (item) + player_node->pickUp(item); + + used = true; + } + break; + case KeyboardConfig::KEY_SIT: + // Player sit action + player_node->toggleSit(); + used = true; + break; + case KeyboardConfig::KEY_HIDE_WINDOWS: + // Hide certain windows + if (!chatWindow->isFocused()) + { + statusWindow->setVisible(false); + inventoryWindow->setVisible(false); + skillDialog->setVisible(false); + setupWindow->setVisible(false); + equipmentWindow->setVisible(false); + helpWindow->setVisible(false); + debugWindow->setVisible(false); + } + break; + } + } + if (requestedWindow) { requestedWindow->setVisible(!requestedWindow->isVisible()); @@ -563,19 +588,14 @@ void Game::handleInput() { switch (event.key.keysym.sym) { - case SDLK_s: - // Player sit action - player_node->toggleSit(); - used = true; - break; - case SDLK_p: // Screenshot (picture, hence the p) { SDL_Surface *screenshot = graphics->getScreenshot(); if (!saveScreenshot(screenshot)) { - logger->log("Error: could not save Screenshot."); + logger->log( + "Error: could not save Screenshot."); } SDL_FreeSurface(screenshot); } @@ -606,6 +626,8 @@ void Game::handleInput() case SDLK_8: emotion = 8; break; case SDLK_9: emotion = 9; break; case SDLK_0: emotion = 10; break; + case SDLK_MINUS: emotion = 11; break; + case SDLK_EQUALS: emotion = 12; break; default: emotion = 0; break; } @@ -638,41 +660,41 @@ void Game::handleInput() } } // End while - + // If the user is configuring the keys then don't respond. + if (!keyboard.isEnabled()) + { + return; + } // Moving player around if (player_node->mAction != Being::DEAD && current_npc == 0 && !chatWindow->isFocused()) { // Get the state of the keyboard keys - Uint8* keys; - keys = SDL_GetKeyState(NULL); + keyboard.refreshActiveKeys(); Uint16 x = player_node->mX / 32, y = player_node->mY / 32; unsigned char direction = 0; // Translate pressed keys to movement and direction - if (keys[SDLK_UP] || keys[SDLK_KP8] || - keys[SDLK_KP7] || keys[SDLK_KP9] || + if ( keyboard.isKeyActive(keyboard.KEY_MOVE_UP) || joystick && joystick->isUp()) { direction |= Being::UP; } - else if (keys[SDLK_DOWN] || keys[SDLK_KP2] || - keys[SDLK_KP1] || keys[SDLK_KP3] || + else if ( keyboard.isKeyActive(keyboard.KEY_MOVE_DOWN) || joystick && joystick->isDown()) { direction |= Being::DOWN; } - if (keys[SDLK_LEFT] || keys[SDLK_KP4] || - keys[SDLK_KP1] || keys[SDLK_KP7] || + + if ( keyboard.isKeyActive(keyboard.KEY_MOVE_LEFT) || joystick && joystick->isLeft()) { direction |= Being::LEFT; } - else if (keys[SDLK_RIGHT] || keys[SDLK_KP6] || - keys[SDLK_KP3] || keys[SDLK_KP9] || + else if ( keyboard.isKeyActive(keyboard.KEY_MOVE_RIGHT) || joystick && joystick->isRight()) { direction |= Being::RIGHT; @@ -681,7 +703,8 @@ void Game::handleInput() player_node->setWalkingDir(direction); // Target the nearest monster if 'a' pressed - if (keys[SDLK_a]) + if ( keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) ) + //if (keys[SDLK_a]) { Being *target = beingManager->findNearestLivingBeing(x, y, 20, Being::MONSTER); diff --git a/src/gui/button.cpp b/src/gui/button.cpp index 4e236c33..0379ebc0 100644 --- a/src/gui/button.cpp +++ b/src/gui/button.cpp @@ -60,10 +60,25 @@ static ButtonData const data[BUTTON_COUNT] = { ImageRect Button::button[BUTTON_COUNT]; +Button::Button(): + mIsLogged(false) +{ + init(); +} + Button::Button(const std::string& caption, const std::string &actionEventId, gcn::ActionListener *listener): gcn::Button(caption), mIsLogged(false) +{ + init(); + setActionEventId(actionEventId); + if (listener) { + addActionListener(listener); + } +} + +void Button::init() { setBorderSize(0); @@ -91,12 +106,7 @@ Button::Button(const std::string& caption, const std::string &actionEventId, btn[mode]->decRef(); } } - mInstances++; - setActionEventId(actionEventId); - if (listener) { - addActionListener(listener); - } } Button::~Button() diff --git a/src/gui/button.h b/src/gui/button.h index eb73e311..d12173b2 100644 --- a/src/gui/button.h +++ b/src/gui/button.h @@ -38,7 +38,13 @@ class ImageRect; class Button : public gcn::Button { public: /** - * Constructor, sets the caption of the button to the given string. + * Default constructor. + */ + Button(); + + /** + * Constructor, sets the caption of the button to the given string and + * adds the given action listener. */ Button(const std::string& caption, const std::string &actionEventId, gcn::ActionListener *listener); @@ -60,6 +66,8 @@ class Button : public gcn::Button { { mIsLogged = enable; } private: + void init(); + static ImageRect button[4]; /**< Button state graphics */ static int mInstances; /**< Number of button instances */ bool mIsLogged; /**< Makes the button appear pressed all the time */ diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 6cfe5e18..bbf2102e 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -28,6 +28,7 @@ #include "button.h" #include "scrollarea.h" #include "shop.h" +#include "shoplistbox.h" #include "slider.h" #include "../npc.h" @@ -35,11 +36,15 @@ #include "../resources/itemdb.h" #include "../utils/tostring.h" - BuyDialog::BuyDialog(): Window("Buy"), mMoney(0), mAmountItems(0), mMaxItems(0) { + setResizable(true); + setMinWidth(260); + setMinHeight(230); + setDefaultSize(0, 0, 260, 230); + mShopItems = new ShopItems; mShopItemList = new ShopListBox(mShopItems, mShopItems); @@ -54,32 +59,15 @@ BuyDialog::BuyDialog(): mItemDescLabel = new gcn::Label("Description:"); mItemEffectLabel = new gcn::Label("Effect:"); - setContentSize(260, 210); - mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - mScrollArea->setDimension(gcn::Rectangle(5, 5, 250, 110)); - mShopItemList->setDimension(gcn::Rectangle(5, 5, 238, 110)); - - mSlider->setDimension(gcn::Rectangle(5, 120, 200, 10)); - mSlider->setEnabled(false); - - mQuantityLabel->setPosition(215, 120); - mMoneyLabel->setPosition(5, 130); - - mIncreaseButton->setPosition(40, 186); mIncreaseButton->setSize(20, 20); - mIncreaseButton->setEnabled(false); - - mDecreaseButton->setPosition(10, 186); mDecreaseButton->setSize(20, 20); - mDecreaseButton->setEnabled(false); + mQuantityLabel->setWidth(60); - mBuyButton->setPosition(180, 186); + mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); + mIncreaseButton->setEnabled(false); + mDecreaseButton->setEnabled(false); mBuyButton->setEnabled(false); - - mQuitButton->setPosition(212, 186); - - mItemEffectLabel->setDimension(gcn::Rectangle(5, 150, 240, 14)); - mItemDescLabel->setDimension(gcn::Rectangle(5, 169, 240, 14)); + mSlider->setEnabled(false); mShopItemList->setActionEventId("item"); mSlider->setActionEventId("slider"); @@ -98,6 +86,8 @@ BuyDialog::BuyDialog(): add(mItemDescLabel); add(mItemEffectLabel); + addWindowListener(this); + loadWindowState("Buy"); setLocationRelativeTo(getParent()); } @@ -118,13 +108,12 @@ void BuyDialog::reset() { mShopItems->clear(); mShopItemList->adjustSize(); - mMoney = 0; - mSlider->setValue(0.0); - // Reset Previous Selected Items to prevent failing asserts + // Reset previous selected items to prevent failing asserts mShopItemList->setSelected(-1); + mSlider->setValue(0); - updateButtonsAndLabels(); + setMoney(0); } void BuyDialog::addItem(int id, int amount, int price) @@ -141,6 +130,7 @@ void BuyDialog::action(const gcn::ActionEvent &event) { setVisible(false); current_npc = 0; + return; } // The following actions require a valid selection @@ -152,21 +142,19 @@ void BuyDialog::action(const gcn::ActionEvent &event) if (event.getId() == "slider") { - mAmountItems = (int)(mSlider->getValue() * mMaxItems); + mAmountItems = (int) mSlider->getValue(); updateButtonsAndLabels(); } else if (event.getId() == "+" && mAmountItems < mMaxItems) { mAmountItems++; - - mSlider->setValue((double) mAmountItems / (double) mMaxItems); + mSlider->setValue(mAmountItems); updateButtonsAndLabels(); } - else if (event.getId() == "-" && mAmountItems > 0) + else if (event.getId() == "-" && mAmountItems > 1) { mAmountItems--; - - mSlider->setValue((double) mAmountItems / (double) mMaxItems); + mSlider->setValue(mAmountItems); updateButtonsAndLabels(); } // TODO: Actually we'd have a bug elsewhere if this check for the number @@ -178,25 +166,69 @@ void BuyDialog::action(const gcn::ActionEvent &event) Net::GameServer::Player::tradeWithNPC (mShopItems->at(selectedItem).id, mAmountItems); - // Update money and adjust the max number of items that can be bought - mMoney -= mAmountItems * mShopItems->at(selectedItem).price; - mMaxItems -= mAmountItems; - // Reset selection - mAmountItems = 0; - mSlider->setValue(0.0); + mAmountItems = 1; + mSlider->setValue(1); + mSlider->gcn::Slider::setScale(1, mMaxItems); - updateButtonsAndLabels(); + // Update money and adjust the max number of items that can be bought + mMaxItems -= mAmountItems; + setMoney(mMoney - mAmountItems * mShopItems->at(selectedItem).price); } } void BuyDialog::selectionChanged(const SelectionEvent &event) { + // Reset amount of items and update labels - mAmountItems = 0; - mSlider->setValue(0.0); + mAmountItems = 1; + mSlider->setValue(1); updateButtonsAndLabels(); + mSlider->gcn::Slider::setScale(1, mMaxItems); +} + +void BuyDialog::windowResized(const WindowEvent &event) +{ + gcn::Rectangle area = getChildrenArea(); + int width = area.width; + int height = area.height; + + mDecreaseButton->setPosition(8, height - 8 - mDecreaseButton->getHeight()); + mIncreaseButton->setPosition( + mDecreaseButton->getX() + mDecreaseButton->getWidth() + 5, + mDecreaseButton->getY()); + + mQuitButton->setPosition( + width - 8 - mQuitButton->getWidth(), + height - 8 - mQuitButton->getHeight()); + mBuyButton->setPosition( + mQuitButton->getX() - 5 - mBuyButton->getWidth(), + mQuitButton->getY()); + + mItemDescLabel->setDimension(gcn::Rectangle(8, + mBuyButton->getY() - 5 - mItemDescLabel->getHeight(), + width - 16, + mItemDescLabel->getHeight())); + mItemEffectLabel->setDimension(gcn::Rectangle(8, + mItemDescLabel->getY() - 5 - mItemEffectLabel->getHeight(), + width - 16, + mItemEffectLabel->getHeight())); + mMoneyLabel->setDimension(gcn::Rectangle(8, + mItemEffectLabel->getY() - 5 - mMoneyLabel->getHeight(), + width - 16, + mMoneyLabel->getHeight())); + + mQuantityLabel->setPosition( + width - mQuantityLabel->getWidth() - 8, + mMoneyLabel->getY() - 5 - mQuantityLabel->getHeight()); + mSlider->setDimension(gcn::Rectangle(8, + mQuantityLabel->getY(), + mQuantityLabel->getX() - 8 - 8, + 10)); + + mScrollArea->setDimension(gcn::Rectangle(8, 8, width - 16, + mSlider->getY() - 5 - 8)); } void @@ -232,14 +264,13 @@ BuyDialog::updateButtonsAndLabels() // Enable or disable buttons and slider mIncreaseButton->setEnabled(mAmountItems < mMaxItems); - mDecreaseButton->setEnabled(mAmountItems > 0); + mDecreaseButton->setEnabled(mAmountItems > 1); mBuyButton->setEnabled(mAmountItems > 0); - mSlider->setEnabled(mMaxItems > 0); + mSlider->setEnabled(mMaxItems > 1); // Update quantity and money labels - mQuantityLabel->setCaption(toString(mAmountItems)); - mQuantityLabel->adjustSize(); + mQuantityLabel->setCaption( + toString(mAmountItems) + " / " + toString(mMaxItems)); mMoneyLabel->setCaption("Price: " + toString(price) + " GP / " + toString(mMoney - price) + " GP" ); - mMoneyLabel->adjustSize(); } diff --git a/src/gui/buy.h b/src/gui/buy.h index 875deef9..63d25583 100644 --- a/src/gui/buy.h +++ b/src/gui/buy.h @@ -28,11 +28,11 @@ #include "window.h" #include "selectionlistener.h" -#include "shoplistbox.h" #include "../guichanfwd.h" class ShopItems; +class ShopListBox; class ListBox; /** @@ -40,7 +40,8 @@ class ListBox; * * \ingroup Interface */ -class BuyDialog : public Window, public gcn::ActionListener, SelectionListener +class BuyDialog : public Window, public gcn::ActionListener, SelectionListener, + WindowListener { public: /** @@ -98,6 +99,11 @@ class BuyDialog : public Window, public gcn::ActionListener, SelectionListener void updateButtonsAndLabels(); + /** + * Called whenever the window is resized. + */ + void windowResized(const WindowEvent &event); + private: gcn::Button *mBuyButton; gcn::Button *mQuitButton; diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index d752cdb3..e8381bef 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -48,6 +48,7 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" #include "../utils/tostring.h" +#include "../utils/trim.h" // Defined in main.cpp, used here for setting the char create dialog extern CharServerHandler charServerHandler; @@ -255,11 +256,6 @@ bool CharSelectDialog::selectByName(const std::string &name) return false; } -std::string CharSelectDialog::getName() -{ - return mNameLabel->getCaption(); -} - CharCreateDialog::CharCreateDialog(Window *parent, int slot): Window(_("Create Character"), true, parent), mSlot(slot) { @@ -410,10 +406,12 @@ CharCreateDialog::action(const gcn::ActionEvent &event) } } -const std::string& +std::string CharCreateDialog::getName() { - return mNameField->getText(); + std::string name = mNameField->getText(); + trim(name); + return name; } void CharCreateDialog::UpdateSliders() diff --git a/src/gui/char_select.h b/src/gui/char_select.h index 9d9184ea..5d0b42fa 100644 --- a/src/gui/char_select.h +++ b/src/gui/char_select.h @@ -60,11 +60,6 @@ class CharSelectDialog : public Window, public gcn::ActionListener bool selectByName(const std::string &name); - /** - * Returns name of selected player - */ - std::string getName(); - private: LockedArray *mCharInfo; @@ -114,22 +109,28 @@ class CharCreateDialog : public Window, public gcn::ActionListener */ ~CharCreateDialog(); - void - action(const gcn::ActionEvent &event); - - const std::string& - getName(); + void action(const gcn::ActionEvent &event); /** * Unlocks the dialog, enabling the create character button again. */ - void - unlock(); + void unlock(); private: int getDistributedPoints(); + void UpdateSliders(); + /** + * Returns the name of the character to create. + */ + std::string getName(); + + /** + * Communicate character creation to the server. + */ + void attemptCharCreate(); + gcn::TextField *mNameField; gcn::Label *mNameLabel; gcn::Button *mNextHairColorButton; @@ -154,12 +155,6 @@ class CharCreateDialog : public Window, public gcn::ActionListener static const int mMaxPoints = 70; int mUsedPoints; - - - /** - * Communicate character creation to the server. - */ - void attemptCharCreate(); }; #endif diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index ba7c7f02..4ed8bb97 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -44,6 +44,7 @@ #include "../net/gameserver/player.h" #include "../utils/dtor.h" +#include "../utils/trim.h" ChatWindow::ChatWindow(): Window(), @@ -125,7 +126,7 @@ void ChatWindow::chatLog(std::string line, int own, std::string channelName) { // Delete overhead from the end of the list - while ((int)mChatlog.size() > mItemsKeep) { + while ((int) mChatlog.size() > mItemsKeep) { mChatlog.pop_back(); } @@ -142,12 +143,15 @@ ChatWindow::chatLog(std::string line, int own, std::string channelName) own = BY_SERVER; } - int pos = line.find(" : "); - if (pos > 0) { + std::string::size_type pos = line.find(" : "); + if (pos != std::string::npos) { tmp.nick = line.substr(0, pos); line.erase(0, pos + 3); } + // Trim whitespace + trim(line); + std::string lineColor = "##0"; // Equiv. to BrowserBox::BLACK switch (own) { case BY_GM: diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index 11ad37c2..884cdf7e 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -42,6 +42,7 @@ DebugWindow::DebugWindow(): Window("Debug") { setResizable(true); + setCloseButton(true); setDefaultSize(0, 0, 400, 100); loadWindowState("Debug"); @@ -60,15 +61,11 @@ DebugWindow::DebugWindow(): mParticleCountLabel = new gcn::Label("[Particle count: 0]"); mParticleCountLabel->setPosition(100, 60); - Button *closeButton = new Button("Close", "close", this); - closeButton->setPosition(5, 60); - add(mFPSLabel); add(mMusicFileLabel); add(mMapFileLabel); add(mTileMouseLabel); add(mParticleCountLabel); - add(closeButton); } void @@ -106,12 +103,3 @@ DebugWindow::logic() +"]"); mParticleCountLabel->adjustSize(); } - -void -DebugWindow::action(const gcn::ActionEvent &event) -{ - if (event.getId() == "close") - { - setVisible(false); - } -} diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h index d082b2ca..9b6f2017 100644 --- a/src/gui/debugwindow.h +++ b/src/gui/debugwindow.h @@ -33,11 +33,11 @@ #include "../guichanfwd.h" /** - * The chat window. + * The debug window. * * \ingroup Interface */ -class DebugWindow : public Window, public gcn::ActionListener +class DebugWindow : public Window { public: /** @@ -50,11 +50,6 @@ class DebugWindow : public Window, public gcn::ActionListener */ void logic(); - /** - * Performs action. - */ - void action(const gcn::ActionEvent &event); - private: gcn::Label *mMusicFileLabel, *mMapFileLabel; gcn::Label *mTileMouseLabel, *mFPSLabel; diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 5e835985..c86a27fc 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -59,6 +59,7 @@ EquipmentWindow::EquipmentWindow(Equipment *equipment): mBackground(NULL), mSelected(-1) { + setCloseButton(true); setDefaultSize(5, 195, 216, 260); loadWindowState("Equipment"); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index dc51054c..97dd4d44 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -42,7 +42,7 @@ #include "../graphics.h" #include "../log.h" -#include "../resources/image.h" +#include "../resources/imageset.h" #include "../resources/resourcemanager.h" #include "../resources/imageloader.h" @@ -77,8 +77,9 @@ class GuiConfigListener : public ConfigListener }; Gui::Gui(Graphics *graphics): - mMouseCursor(NULL), - mCustomCursor(false) + mCustomCursor(false), + mMouseCursors(NULL), + mCursorType(CURSOR_POINTER) { logger->log("Initializing GUI..."); // Set graphics @@ -106,7 +107,7 @@ Gui::Gui(Graphics *graphics): // Set global font try { - mGuiFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 12); + mGuiFont = new TrueTypeFont("data/fonts/dejavusans.ttf", 11); } catch (gcn::Exception e) { @@ -139,7 +140,7 @@ Gui::Gui(Graphics *graphics): hitBlueFont = new gcn::ImageFont("graphics/gui/hits_blue.png", "0123456789"); hitYellowFont = new gcn::ImageFont("graphics/gui/hits_yellow.png", - "mis"); + "0123456789misxp "); } catch (gcn::Exception e) { @@ -169,8 +170,8 @@ Gui::~Gui() delete hitBlueFont; delete hitYellowFont; - if (mMouseCursor) { - mMouseCursor->decRef(); + if (mMouseCursors) { + mMouseCursors->decRef(); } delete mGuiFont; @@ -181,12 +182,6 @@ Gui::~Gui() delete guiInput; } -void -Gui::logic() -{ - gcn::Gui::logic(); -} - void Gui::draw() { @@ -196,11 +191,13 @@ Gui::draw() int mouseX, mouseY; Uint8 button = SDL_GetMouseState(&mouseX, &mouseY); - if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS || button & SDL_BUTTON(1)) - && mCustomCursor) + if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS || button & SDL_BUTTON(1)) && + mCustomCursor) { - static_cast(mGraphics)-> - drawImage(mMouseCursor, mouseX - 5, mouseY - 2); + static_cast(mGraphics)->drawImage( + mMouseCursors->get(mCursorType), + mouseX - 15, + mouseY - 17); } mGraphics->popClipArea(); @@ -220,9 +217,11 @@ Gui::setUseCustomCursor(bool customCursor) // Load the mouse cursor ResourceManager *resman = ResourceManager::getInstance(); - mMouseCursor = resman->getImage("graphics/gui/mouse.png"); - if (!mMouseCursor) { - logger->error("Unable to load mouse cursor."); + mMouseCursors = + resman->getImageSet("graphics/gui/mouse.png", 40, 40); + + if (!mMouseCursors) { + logger->error("Unable to load mouse cursors."); } } else @@ -231,9 +230,9 @@ Gui::setUseCustomCursor(bool customCursor) SDL_ShowCursor(SDL_ENABLE); // Unload the mouse cursor - if (mMouseCursor) { - mMouseCursor->decRef(); - mMouseCursor = NULL; + if (mMouseCursors) { + mMouseCursors->decRef(); + mMouseCursors = NULL; } } } diff --git a/src/gui/gui.h b/src/gui/gui.h index 5f2cc810..1e4b9348 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -30,7 +30,7 @@ class GuiConfigListener; class Graphics; -class Image; +class ImageSet; class Viewport; /** @@ -59,36 +59,49 @@ class Gui : public gcn::Gui */ ~Gui(); - /** - * Works around Guichan bug - */ - void - logic(); - /** * Draws the whole Gui by calling draw functions down in the * Gui hierarchy. It also draws the mouse pointer. */ - void - draw(); + void draw(); /** - * Return game font + * Return game font. */ - gcn::Font* - getFont() { return mGuiFont; } + gcn::Font* getFont() const + { return mGuiFont; } /** * Sets whether a custom cursor should be rendered. */ - void - setUseCustomCursor(bool customCursor); + void setUseCustomCursor(bool customCursor); + + /** + * Sets which cursor should be used. + */ + void setCursorType(int index) + { mCursorType = index; } + + /** + * Cursors are in graphic order from left to right. + * CURSOR_POINTER should be left untouched. + * CURSOR_TOTAL should always be last. + */ + enum { + CURSOR_POINTER = 0, + CURSOR_RESIZE_ACROSS, + CURSOR_RESIZE_DOWN, + CURSOR_RESIZE_DOWN_LEFT, + CURSOR_RESIZE_DOWN_RIGHT, + CURSOR_TOTAL + }; private: GuiConfigListener *mConfigListener; gcn::Font *mGuiFont; /**< The global GUI font */ - Image *mMouseCursor; /**< Mouse cursor image */ bool mCustomCursor; /**< Show custom cursor */ + ImageSet *mMouseCursors; /**< Mouse cursor images */ + int mCursorType; }; extern Gui *gui; /**< The GUI system */ diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 085ab188..1e62b130 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -51,6 +51,7 @@ InventoryWindow::InventoryWindow(): mSplit(false) { setResizable(true); + setCloseButton(true); setMinWidth(240); setMinHeight(172); // If you adjust these defaults, don't forget to adjust the trade window's. @@ -69,7 +70,6 @@ InventoryWindow::InventoryWindow(): mItems->addSelectionListener(this); mInvenScroll = new ScrollArea(mItems); - mInvenScroll->setPosition(8, 8); mItemNameLabel = new gcn::Label(strprintf(_("Name: %s"), "")); mItemDescriptionLabel = new gcn::Label( @@ -100,8 +100,8 @@ InventoryWindow::InventoryWindow(): mSplitButton->setWidth(48); } + addWindowListener(this); loadWindowState("Inventory"); - updateContentSize(); } InventoryWindow::~InventoryWindow() @@ -130,7 +130,6 @@ void InventoryWindow::logic() mWeightLabel->setCaption( strprintf(_("Total Weight: %d - Maximum Weight: %d"), player_node->getTotalWeight(), player_node->getMaxWeight())); - mWeightLabel->adjustSize(); } void InventoryWindow::action(const gcn::ActionEvent &event) @@ -215,7 +214,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) } } -void InventoryWindow::updateContentSize() +void InventoryWindow::windowResized(const WindowEvent &event) { const gcn::Rectangle area = getChildrenArea(); @@ -260,8 +259,7 @@ Item* InventoryWindow::getItem() return mItems->getItem(); } -void -InventoryWindow::keyPressed(gcn::KeyEvent &event) +void InventoryWindow::keyPressed(gcn::KeyEvent &event) { switch (event.getKey().getValue()) { @@ -271,8 +269,7 @@ InventoryWindow::keyPressed(gcn::KeyEvent &event) } } -void -InventoryWindow::keyReleased(gcn::KeyEvent &event) +void InventoryWindow::keyReleased(gcn::KeyEvent &event) { switch (event.getKey().getValue()) { diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 37ef0406..a9fdadf2 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -29,8 +29,9 @@ #include -#include "window.h" #include "selectionlistener.h" +#include "window.h" +#include "windowlistener.h" #include "../guichanfwd.h" @@ -45,7 +46,8 @@ class ItemContainer; class InventoryWindow : public Window, public gcn::ActionListener, public gcn::KeyListener, - public SelectionListener + public SelectionListener, + public WindowListener { public: /** @@ -92,7 +94,10 @@ class InventoryWindow : public Window, */ void selectionChanged(const SelectionEvent &event); - void updateContentSize(); /**< Updates widgets size/position. */ + /** + * Called whenever the window is resized. + */ + void windowResized(const WindowEvent &event); private: void updateButtons(); /**< Updates button states. */ diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index b032bd49..bddf7cee 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -30,6 +30,7 @@ #include "../graphics.h" #include "../inventory.h" #include "../item.h" +#include "../itemshortcut.h" #include "../localplayer.h" #include "../resources/image.h" @@ -38,6 +39,9 @@ #include "../utils/tostring.h" +// TODO: Add support for adding items to the item shortcut window (global +// itemShortcut). + static const int BOX_WIDTH = 36; static const int BOX_HEIGHT = 44; diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp new file mode 100644 index 00000000..1943ef93 --- /dev/null +++ b/src/gui/itemshortcutcontainer.cpp @@ -0,0 +1,224 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "itemshortcutcontainer.h" + +#include "../graphics.h" +#include "../item.h" +#include "../itemshortcut.h" +#include "../keyboardconfig.h" + +#include "../resources/image.h" +#include "../resources/resourcemanager.h" + +#include "../utils/tostring.h" + +ItemShortcutContainer::ItemShortcutContainer(): + mGridWidth(1), + mGridHeight(1), + mItemClicked(false), + mItemMoved(NULL) +{ + addMouseListener(this); + + ResourceManager *resman = ResourceManager::getInstance(); + + mBackgroundImg = resman->getImage("graphics/gui/item_shortcut_bgr.png"); + mMaxItems = itemShortcut->getItemCount(); + + mBoxHeight = 42; + mBoxWidth = 36; +} + +ItemShortcutContainer::~ItemShortcutContainer() +{ + mBackgroundImg->decRef(); +} + +void +ItemShortcutContainer::logic() +{ + gcn::Widget::logic(); + + int i = itemShortcut->getItemCount(); + + if (i != mMaxItems) + { + mMaxItems = i; + setWidth(getWidth()); + } +} + +void +ItemShortcutContainer::draw(gcn::Graphics *graphics) +{ + Graphics *g = static_cast(graphics); + + for (int i = 0; i < mMaxItems; i++) + { + const int itemX = (i % mGridWidth) * mBoxWidth; + const int itemY = (i / mGridWidth) * mBoxHeight; + + g->drawImage(mBackgroundImg, itemX, itemY); + + // Draw item keyboard shortcut. + const char *key = SDL_GetKeyName( + (SDLKey) keyboard.getKeyValue(keyboard.KEY_SHORTCUT_0+i)); + g->drawText(key, itemX + 2, itemY + 2, gcn::Graphics::LEFT); + + Item *item = itemShortcut->getItem(i); + if (item) { + // Draw item icon. + Image* image = item->getInfo().getImage(); + if (image) { + g->drawImage(image, itemX, itemY); + g->drawText( + toString(item->getQuantity()), + itemX + mBoxWidth / 2, + itemY + mBoxHeight - 14, + gcn::Graphics::CENTER); + } + } + } + if (mItemMoved) + { + // Draw the item image being dragged by the cursor. + Image* image = mItemMoved->getInfo().getImage(); + if (image) + { + const int tPosX = mCursorPosX - (image->getWidth() / 2); + const int tPosY = mCursorPosY - (image->getHeight() / 2); + + g->drawImage(image, tPosX, tPosY); + g->drawText( + toString(mItemMoved->getQuantity()), + tPosX + mBoxWidth / 2, + tPosY + mBoxHeight - 14, + gcn::Graphics::CENTER); + } + } +} + +void +ItemShortcutContainer::setWidth(int width) +{ + gcn::Widget::setWidth(width); + + mGridWidth = getWidth() / mBoxWidth; + if (mGridWidth < 1) { + mGridWidth = 1; + } + + setHeight((mMaxItems / mGridWidth + + (mMaxItems % mGridWidth > 0 ? 1 : 0)) * mBoxHeight); + + mGridHeight = getHeight() / mBoxHeight; + if (mGridHeight < 1) { + mGridHeight = 1; + } +} + +void +ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event) +{ + if (event.getButton() == gcn::MouseEvent::LEFT) { + if (!mItemMoved && mItemClicked) { + const int index = getIndexFromGrid(event.getX(), event.getY()); + if (index == -1) { + return; + } + Item *item = itemShortcut->getItem(index); + if (item) + { + mItemMoved = item; + itemShortcut->removeItem(index); + } + } + if (mItemMoved) { + mCursorPosX = event.getX(); + mCursorPosY = event.getY(); + } + } +} + +void +ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) +{ + const int index = getIndexFromGrid(event.getX(), event.getY()); + if (index == -1) { + return; + } + + // Stores the selected item if theirs one. + if (itemShortcut->isItemSelected()) { + itemShortcut->setItem(index); + itemShortcut->setItemSelected(NULL); + } + else if (itemShortcut->getItem(index)) { + mItemClicked = true; + } +} + +void +ItemShortcutContainer::mouseReleased(gcn::MouseEvent &event) +{ + if (event.getButton() == gcn::MouseEvent::LEFT) + { + if (itemShortcut->isItemSelected()) + { + itemShortcut->setItemSelected(NULL); + } + const int index = getIndexFromGrid(event.getX(), event.getY()); + if (index == -1) { + mItemMoved = NULL; + return; + } + if (mItemMoved) { + itemShortcut->setItems(index, mItemMoved); + mItemMoved = NULL; + } + else if (itemShortcut->getItem(index) && mItemClicked) + { + itemShortcut->useItem(index); + } + if (mItemClicked) { + mItemClicked = false; + } + } +} + +int +ItemShortcutContainer::getIndexFromGrid(int pointX, int pointY) const +{ + const gcn::Rectangle tRect = gcn::Rectangle( + 0, 0, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); + if (!tRect.isPointInRect(pointX, pointY)) { + return -1; + } + const int index = ((pointY / mBoxHeight) * mGridWidth) + + pointX / mBoxWidth; + if (index >= mMaxItems) + { + return -1; + } + return index; +} diff --git a/src/gui/itemshortcutcontainer.h b/src/gui/itemshortcutcontainer.h new file mode 100644 index 00000000..4b154cbb --- /dev/null +++ b/src/gui/itemshortcutcontainer.h @@ -0,0 +1,115 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _TMW_ITEMSHORTCUTCONTAINER_H__ +#define _TMW_ITEMSHORTCUTCONTAINER_H__ + +#include +#include + +#include + +class Image; +class Item; + +/** + * An item shortcut container. Used to quickly use items. + * + * \ingroup GUI + */ +class ItemShortcutContainer : public gcn::Widget, public gcn::MouseListener +{ + public: + /** + * Constructor. Initializes the graphic. + */ + ItemShortcutContainer(); + + /** + * Destructor. + */ + virtual ~ItemShortcutContainer(); + + /** + * Handles the logic of the ItemContainer + */ + void logic(); + + /** + * Draws the items. + */ + void draw(gcn::Graphics *graphics); + + /** + * Sets the width of the container. This is used to determine the new + * height of the container. + */ + void setWidth(int width); + + /** + * Handles mouse when dragged. + */ + void mouseDragged(gcn::MouseEvent &event); + + /** + * Handles mouse when pressed. + */ + void mousePressed(gcn::MouseEvent &event); + + /** + * Handles mouse release. + */ + void mouseReleased(gcn::MouseEvent &event); + + + int getMaxItems() + { return mMaxItems; } + + int getBoxWidth() + { return mBoxWidth; } + + int getBoxHeight() + { return mBoxHeight; } + + private: + /** + * Gets the index from the grid provided the point is in an item box. + * + * @param pointX X coordinate of the point. + * @param pointY Y coordinate of the point. + * @return index on success, -1 on failure. + */ + int getIndexFromGrid(int pointX, int pointY) const; + + Image *mBackgroundImg; + + int mMaxItems; + int mBoxWidth; + int mBoxHeight; + int mCursorPosX, mCursorPosY; + int mGridWidth, mGridHeight; + bool mItemClicked; + Item *mItemMoved; + +}; + +#endif diff --git a/src/gui/itemshortcutwindow.cpp b/src/gui/itemshortcutwindow.cpp new file mode 100644 index 00000000..dd97a7db --- /dev/null +++ b/src/gui/itemshortcutwindow.cpp @@ -0,0 +1,74 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "itemshortcutwindow.h" + +#include "itemshortcutcontainer.h" +#include "scrollarea.h" + +static const int SCROLL_PADDING = 0; + +ItemShortcutWindow::ItemShortcutWindow() +{ + // no title presented, title bar is padding so window can be moved. + gcn::Window::setTitleBarHeight(gcn::Window::getPadding()); + setShowTitle(false); + setResizable(true); + setDefaultSize(758, 174, 42, 426); + + mItems = new ItemShortcutContainer(); + + int border = SCROLL_PADDING * 2 + getPadding() * 2; + setMinWidth(mItems->getBoxWidth() + border); + setMinHeight(mItems->getBoxHeight() + border); + setMaxWidth(mItems->getBoxWidth() * mItems->getMaxItems() + border); + setMaxHeight(mItems->getBoxHeight() * mItems->getMaxItems() + border); + + mInvenScroll = new ScrollArea(mItems); + mInvenScroll->setPosition(SCROLL_PADDING, SCROLL_PADDING); + mInvenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); + + add(mInvenScroll); + + addWindowListener(this); + loadWindowState("ItemShortcut"); +} + +ItemShortcutWindow::~ItemShortcutWindow() +{ + delete mItems; + delete mInvenScroll; +} + +void ItemShortcutWindow::logic() +{ + Window::logic(); +} + +void ItemShortcutWindow::windowResized(const WindowEvent &event) +{ + const gcn::Rectangle area = getChildrenArea(); + + mInvenScroll->setSize( + area.width - SCROLL_PADDING, + area.height - SCROLL_PADDING); +} diff --git a/src/gui/itemshortcutwindow.h b/src/gui/itemshortcutwindow.h new file mode 100644 index 00000000..83bc348d --- /dev/null +++ b/src/gui/itemshortcutwindow.h @@ -0,0 +1,69 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _TMW_ITEMSHORTCUTWINDOW_H +#define _TMW_ITEMSHORTCUTWINDOW_H + +#include "window.h" +#include "windowlistener.h" + +#include "../guichanfwd.h" + +class ItemShortcutContainer; + +/** + * Inventory dialog. + * + * \ingroup Interface + */ +class ItemShortcutWindow : public Window, WindowListener +{ + public: + /** + * Constructor. + */ + ItemShortcutWindow(); + + /** + * Destructor. + */ + ~ItemShortcutWindow(); + + /** + * Logic (updates buttons and weight information). + */ + void logic(); + + /** + * Called whenever the window is resized. + */ + void windowResized(const WindowEvent &event); + + private: + ItemShortcutContainer *mItems; + + gcn::ScrollArea *mInvenScroll; +}; + +extern ItemShortcutWindow *itemShortcutWindow; + +#endif diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp index bfa2f1f2..8d4d184d 100644 --- a/src/gui/menuwindow.cpp +++ b/src/gui/menuwindow.cpp @@ -37,6 +37,7 @@ extern Window *inventoryWindow; extern Window *equipmentWindow; extern Window *skillDialog; extern Window *statusWindow; +extern Window *itemShortcutWindow; namespace { struct MenuWindowListener : public gcn::ActionListener @@ -62,6 +63,7 @@ MenuWindow::MenuWindow(): N_("Equipment"), N_("Inventory"), N_("Skills"), + N_("Shortcut"), N_("Setup"), 0 }; @@ -109,14 +111,20 @@ void MenuWindowListener::action(const gcn::ActionEvent &event) { window = skillDialog; } + else if (event.getId() == "Shortcut") + { + window = itemShortcutWindow; + } else if (event.getId() == "Setup") { window = setupWindow; } - if (window) { + if (window) + { window->setVisible(!window->isVisible()); - if (window->isVisible()) { + if (window->isVisible()) + { window->requestMoveToTop(); } } diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 48bbd3d0..aeb6637d 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -200,12 +200,6 @@ void PopupMenu::handleLink(const std::string& link) setVisible(false); - /* - * This is need cause of a bug in guichan that leave - * the focus on the popup menu even if is not visible. - */ - _getFocusHandler()->focusNone(); - mBeing = NULL; mFloorItem = NULL; mItem = NULL; diff --git a/src/gui/selectionlistener.h b/src/gui/selectionlistener.h index b39672b5..917a4871 100644 --- a/src/gui/selectionlistener.h +++ b/src/gui/selectionlistener.h @@ -25,33 +25,23 @@ #define _TMW_SELECTIONLISTENER_H__ #include +#include /** * An event that characterizes a change in the current selection. * * \ingroup GUI */ -class SelectionEvent +class SelectionEvent : public gcn::Event { public: /** * Constructor. */ SelectionEvent(gcn::Widget *source): - mSource(source) + gcn::Event(source) { } - - /** - * The widget from which the event originated. - */ - gcn::Widget* getSource() const - { - return mSource; - } - - private: - gcn::Widget *mSource; }; /** diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index b601d70c..5f1011c1 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -44,58 +44,44 @@ SellDialog::SellDialog(): Window("Sell"), mMaxItems(0), mAmountItems(0) { + setResizable(true); + setMinWidth(260); + setMinHeight(230); + setDefaultSize(0, 0, 260, 230); + mShopItems = new ShopItems(); mShopItemList = new ShopListBox(mShopItems, mShopItems); - ScrollArea *scrollArea = new ScrollArea(mShopItemList); + mScrollArea = new ScrollArea(mShopItemList); mSlider = new Slider(1.0); mQuantityLabel = new gcn::Label("0"); mMoneyLabel = new gcn::Label("Money: 0 GP / Total: 0 GP"); - mItemDescLabel = new gcn::Label("Description:"); - mItemEffectLabel = new gcn::Label("Effect:"); mIncreaseButton = new Button("+", "+", this); mDecreaseButton = new Button("-", "-", this); mSellButton = new Button("Sell", "sell", this); - Button *quitButton = new Button("Quit", "quit", this); - mSellButton->setEnabled(false); - - setContentSize(260, 210); - scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - scrollArea->setDimension(gcn::Rectangle(5, 5, 250, 110)); - mShopItemList->setDimension(gcn::Rectangle(5, 5, 238, 110)); - - mSlider->setDimension(gcn::Rectangle(5, 120, 200, 10)); - mSlider->setEnabled(false); - - mQuantityLabel->setPosition(215, 120); + mQuitButton = new Button("Quit", "quit", this); + mItemDescLabel = new gcn::Label("Description:"); + mItemEffectLabel = new gcn::Label("Effect:"); - mIncreaseButton->setPosition(40, 186); mIncreaseButton->setSize(20, 20); - mIncreaseButton->setEnabled(false); - - mDecreaseButton->setPosition(10, 186); mDecreaseButton->setSize(20, 20); - mDecreaseButton->setEnabled(false); + mQuantityLabel->setWidth(60); - mMoneyLabel->setPosition(5, 130); - mItemEffectLabel->setDimension(gcn::Rectangle(5, 150, 240, 14)); - mItemDescLabel->setDimension(gcn::Rectangle(5, 169, 240, 14)); - - mSellButton->setPosition(175, 186); + mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); + mIncreaseButton->setEnabled(false); + mDecreaseButton->setEnabled(false); mSellButton->setEnabled(false); + mSlider->setEnabled(false); - quitButton->setPosition(208, 186); - + mShopItemList->setPriceCheck(false); mShopItemList->setActionEventId("item"); mSlider->setActionEventId("slider"); - mShopItemList->setPriceCheck(false); - mShopItemList->addActionListener(this); mShopItemList->addSelectionListener(this); mSlider->addActionListener(this); - add(scrollArea); + add(mScrollArea); add(mSlider); add(mQuantityLabel); add(mMoneyLabel); @@ -104,8 +90,10 @@ SellDialog::SellDialog(): add(mIncreaseButton); add(mDecreaseButton); add(mSellButton); - add(quitButton); + add(mQuitButton); + addWindowListener(this); + loadWindowState("Sell"); setLocationRelativeTo(getParent()); } @@ -117,7 +105,7 @@ SellDialog::~SellDialog() void SellDialog::reset() { mShopItems->clear(); - mSlider->setValue(0.0); + mSlider->setValue(0); // Reset previous selected item to prevent failing asserts mShopItemList->setSelected(-1); @@ -135,16 +123,11 @@ void SellDialog::action(const gcn::ActionEvent &event) { int selectedItem = mShopItemList->getSelected(); - if (event.getId() == "item") - { - mAmountItems = 0; - mSlider->setValue(0); - updateButtonsAndLabels(); - } - else if (event.getId() == "quit") + if (event.getId() == "quit") { setVisible(false); current_npc = 0; + return; } // The following actions require a valid item selection @@ -156,21 +139,19 @@ void SellDialog::action(const gcn::ActionEvent &event) if (event.getId() == "slider") { - mAmountItems = (int) (mSlider->getValue() * mMaxItems); + mAmountItems = (int) mSlider->getValue(); updateButtonsAndLabels(); } else if (event.getId() == "+" && mAmountItems < mMaxItems) { mAmountItems++; - - mSlider->setValue((double) mAmountItems /(double) mMaxItems); + mSlider->setValue(mAmountItems); updateButtonsAndLabels(); } - else if (event.getId() == "-" && mAmountItems > 0) + else if (event.getId() == "-" && mAmountItems > 1) { mAmountItems--; - - mSlider->setValue((double) mAmountItems / (double) mMaxItems); + mSlider->setValue(mAmountItems); updateButtonsAndLabels(); } else if (event.getId() == "sell" && mAmountItems > 0 @@ -182,8 +163,7 @@ void SellDialog::action(const gcn::ActionEvent &event) mMaxItems -= mAmountItems; mShopItems->getShop()->at(selectedItem).quantity = mMaxItems; mPlayerMoney += (mAmountItems * mShopItems->at(selectedItem).price); - mAmountItems = 0; - mSlider->setValue(0); + mAmountItems = 1; if (!mMaxItems) { @@ -194,6 +174,7 @@ void SellDialog::action(const gcn::ActionEvent &event) } else { + mSlider->gcn::Slider::setScale(1, mMaxItems); // Update only when there are items left, the entry doesn't exist // otherwise and can't be updated updateButtonsAndLabels(); @@ -204,10 +185,54 @@ void SellDialog::action(const gcn::ActionEvent &event) void SellDialog::selectionChanged(const SelectionEvent &event) { // Reset amount of items and update labels - mAmountItems = 0; + mAmountItems = 1; mSlider->setValue(0); updateButtonsAndLabels(); + mSlider->gcn::Slider::setScale(1, mMaxItems); +} + +void SellDialog::windowResized(const WindowEvent &event) +{ + gcn::Rectangle area = getChildrenArea(); + int width = area.width; + int height = area.height; + + mDecreaseButton->setPosition(8, height - 8 - mDecreaseButton->getHeight()); + mIncreaseButton->setPosition( + mDecreaseButton->getX() + mDecreaseButton->getWidth() + 5, + mDecreaseButton->getY()); + + mQuitButton->setPosition( + width - 8 - mQuitButton->getWidth(), + height - 8 - mQuitButton->getHeight()); + mSellButton->setPosition( + mQuitButton->getX() - 5 - mSellButton->getWidth(), + mQuitButton->getY()); + + mItemDescLabel->setDimension(gcn::Rectangle(8, + mSellButton->getY() - 5 - mItemDescLabel->getHeight(), + width - 16, + mItemDescLabel->getHeight())); + mItemEffectLabel->setDimension(gcn::Rectangle(8, + mItemDescLabel->getY() - 5 - mItemEffectLabel->getHeight(), + width - 16, + mItemEffectLabel->getHeight())); + mMoneyLabel->setDimension(gcn::Rectangle(8, + mItemEffectLabel->getY() - 5 - mMoneyLabel->getHeight(), + width - 16, + mMoneyLabel->getHeight())); + + mQuantityLabel->setPosition( + width - mQuantityLabel->getWidth() - 8, + mMoneyLabel->getY() - 5 - mQuantityLabel->getHeight()); + mSlider->setDimension(gcn::Rectangle(8, + mQuantityLabel->getY(), + mQuantityLabel->getX() - 8 - 8, + 10)); + + mScrollArea->setDimension(gcn::Rectangle(8, 8, width - 16, + mSlider->getY() - 5 - 8)); } void SellDialog::setMoney(int amount) @@ -246,15 +271,13 @@ SellDialog::updateButtonsAndLabels() // Update Buttons and slider mSellButton->setEnabled(mAmountItems > 0); - mDecreaseButton->setEnabled(mAmountItems > 0); + mDecreaseButton->setEnabled(mAmountItems > 1); mIncreaseButton->setEnabled(mAmountItems < mMaxItems); - mSlider->setEnabled(selectedItem > -1); + mSlider->setEnabled(mMaxItems > 1); // Update the quantity and money labels mQuantityLabel->setCaption( toString(mAmountItems) + " / " + toString(mMaxItems)); - mQuantityLabel->adjustSize(); mMoneyLabel->setCaption("Money: " + toString(income) + " GP / Total: " + toString(mPlayerMoney + income) + " GP"); - mMoneyLabel->adjustSize(); } diff --git a/src/gui/sell.h b/src/gui/sell.h index fc42fd1c..d1e2ddd2 100644 --- a/src/gui/sell.h +++ b/src/gui/sell.h @@ -28,6 +28,7 @@ #include "window.h" #include "selectionlistener.h" +#include "windowlistener.h" #include "../guichanfwd.h" @@ -40,7 +41,8 @@ class ShopListBox; * * \ingroup Interface */ -class SellDialog : public Window, gcn::ActionListener, SelectionListener +class SellDialog : public Window, gcn::ActionListener, SelectionListener, + WindowListener { public: /** @@ -77,22 +79,28 @@ class SellDialog : public Window, gcn::ActionListener, SelectionListener */ void selectionChanged(const SelectionEvent &event); + /** + * Called whenever the window is resized. + */ + void windowResized(const WindowEvent &event); + /** * Gives Player's Money amount */ void setMoney(int amount); + private: /** * Updates the state of buttons and labels. */ - void - updateButtonsAndLabels(); + void updateButtonsAndLabels(); - private: gcn::Button *mSellButton; + gcn::Button *mQuitButton; gcn::Button *mIncreaseButton; gcn::Button *mDecreaseButton; ShopListBox *mShopItemList; + gcn::ScrollArea *mScrollArea; gcn::Label *mMoneyLabel; gcn::Label *mItemDescLabel; gcn::Label *mItemEffectLabel; diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 3ea19059..6a13232a 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -27,6 +27,7 @@ #include "setup_audio.h" #include "setup_joystick.h" #include "setup_video.h" +#include "setup_keyboard.h" #include "tabbedcontainer.h" #include "../utils/dtor.h" @@ -43,7 +44,8 @@ extern Window *skillDialog; Setup::Setup(): Window(_("Setup")) { - int width = 230; + setCloseButton(true); + int width = 250; int height = 245; setContentSize(width, height); @@ -59,7 +61,7 @@ Setup::Setup(): } TabbedContainer *panel = new TabbedContainer(); - panel->setDimension(gcn::Rectangle(5, 5, 220, 205)); + panel->setDimension(gcn::Rectangle(5, 5, 250, 205)); panel->setOpaque(false); SetupTab *tab; @@ -76,6 +78,10 @@ Setup::Setup(): panel->addTab(tab, _("Joystick")); mTabs.push_back(tab); + tab = new Setup_Keyboard(); + panel->addTab(tab, "Keyboard"); + mTabs.push_back(tab); + add(panel); setLocationRelativeTo(getParent()); diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp new file mode 100644 index 00000000..e88080b5 --- /dev/null +++ b/src/gui/setup_keyboard.cpp @@ -0,0 +1,187 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#include "setup_keyboard.h" + +#include +#include + +#include "button.h" +#include "listbox.h" +#include "ok_dialog.h" +#include "scrollarea.h" + +#include "../configuration.h" +#include "../keyboardconfig.h" + +#include "../utils/tostring.h" + +#include + +/** + * The list model for key function list. + * + * \ingroup Interface + */ +class KeyListModel : public gcn::ListModel +{ + public: + /** + * Returns the number of elements in container. + */ + int getNumberOfElements() { return keyboard.KEY_TOTAL; } + + /** + * Returns element from container. + */ + std::string getElementAt(int i) { return mKeyFunctions[i]; } + + /** + * Sets element from container. + */ + void setElementAt(int i, std::string caption) + { + mKeyFunctions[i] = caption; + } + + private: + std::string mKeyFunctions[KeyboardConfig::KEY_TOTAL]; +}; + +Setup_Keyboard::Setup_Keyboard(): + mKeyListModel(new KeyListModel()), + mKeyList(new ListBox(mKeyListModel)), + mKeySetting(false) +{ + keyboard.setSetupKeyboard(this); + setOpaque(false); + + refreshKeys(); + + mKeyList->setDimension(gcn::Rectangle(0, 0, 185, 140)); + mKeyList->addActionListener(this); + mKeyList->setSelected(-1); + + ScrollArea *scrollArea = new ScrollArea(mKeyList); + scrollArea->setDimension(gcn::Rectangle(10, 10, 200, 140)); + add(scrollArea); + + mAssignKeyButton = new Button("Assign", "assign", this); + mAssignKeyButton->setPosition(165, 155); + mAssignKeyButton->addActionListener(this); + mAssignKeyButton->setEnabled(false); + add(mAssignKeyButton); + + mMakeDefaultButton = new Button("Default", "makeDefault", this); + mMakeDefaultButton->setPosition(10, 155); + mMakeDefaultButton->addActionListener(this); + add(mMakeDefaultButton); +} + +Setup_Keyboard::~Setup_Keyboard() +{ + delete mKeyList; + delete mKeyListModel; + + delete mAssignKeyButton; + delete mMakeDefaultButton; +} + +void Setup_Keyboard::apply() +{ + keyUnresolved(); + + if (keyboard.hasConflicts()) + { + new OkDialog("Key Conflict(s) Detected.", + "Resolve them, or gameplay may result in strange behaviour."); + } + keyboard.setEnabled(true); + keyboard.store(); +} + +void Setup_Keyboard::cancel() +{ + keyUnresolved(); + + keyboard.retrieve(); + keyboard.setEnabled(true); + + refreshKeys(); +} + +void Setup_Keyboard::action(const gcn::ActionEvent &event) +{ + if (event.getSource() == mKeyList) + { + if (!mKeySetting) { + mAssignKeyButton->setEnabled(true); + } + } + else if (event.getId() == "assign") + { + mKeySetting = true; + mAssignKeyButton->setEnabled(false); + keyboard.setEnabled(false); + int i(mKeyList->getSelected()); + keyboard.setNewKeyIndex(i); + mKeyListModel->setElementAt(i, keyboard.getKeyCaption(i) + ": ?"); + } + else if (event.getId() == "makeDefault") + { + keyboard.makeDefault(); + refreshKeys(); + } +} + +void Setup_Keyboard::refreshAssignedKey(int index) +{ + std::string caption; + char *temp = SDL_GetKeyName( + (SDLKey) keyboard.getKeyValue(index)); + caption = keyboard.getKeyCaption(index) + ": " + toString(temp); + mKeyListModel->setElementAt(index, caption); +} + +void Setup_Keyboard::newKeyCallback(int index) +{ + mKeySetting = false; + refreshAssignedKey(index); + mAssignKeyButton->setEnabled(true); +} + +void Setup_Keyboard::refreshKeys() +{ + for(int i = 0; i < keyboard.KEY_TOTAL; i++) + { + refreshAssignedKey(i); + } +} + +void Setup_Keyboard::keyUnresolved() +{ + if (mKeySetting) { + newKeyCallback(keyboard.getNewKeyIndex()); + keyboard.setNewKeyIndex(keyboard.KEY_NO_VALUE); + } +} diff --git a/src/gui/setup_keyboard.h b/src/gui/setup_keyboard.h new file mode 100644 index 00000000..b72e8746 --- /dev/null +++ b/src/gui/setup_keyboard.h @@ -0,0 +1,84 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _TMW_GUI_SETUP_KEYBOARD_H +#define _TMW_GUI_SETUP_KEYBOARD_H + +#include "setuptab.h" +#include "button.h" +#include "../guichanfwd.h" + +#include + + +#include + +class Setup_Keyboard : public SetupTab, public gcn::ActionListener +{ + public: + /** + * Constructor + */ + Setup_Keyboard(); + + /** + * Destructor + */ + ~Setup_Keyboard(); + + void apply(); + void cancel(); + + void action(const gcn::ActionEvent &event); + + /** + * Get an update on the assigned key. + */ + void refreshAssignedKey(int index); + + /** + * The callback function when a new key has been pressed. + */ + void newKeyCallback(int index); + + /** + * Shorthand method to update all the keys. + */ + void refreshKeys(); + + /** + * If a key function is unresolved, then this reverts it. + */ + void keyUnresolved(); + + private: + class KeyListModel *mKeyListModel; + gcn::ListBox *mKeyList; + + gcn::Button *mAssignKeyButton; + gcn::Button *mMakeDefaultButton; + + bool mKeySetting; /**< flag to check if key being set. */ +}; + +#endif diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp index 0e2ea6d3..ae787ab7 100644 --- a/src/gui/shoplistbox.cpp +++ b/src/gui/shoplistbox.cpp @@ -129,24 +129,8 @@ void ShopListBox::mousePressed(gcn::MouseEvent &event) { if (event.getButton() == gcn::MouseEvent::LEFT) { - bool enoughMoney = false; - int y = event.getY(); - - if (mShopItems && mPriceCheck) - { - if (mPlayerMoney >= mShopItems->at(y / mRowHeight).price) - enoughMoney = true; - } - else // Old Behaviour - { - enoughMoney = true; - } - - if (enoughMoney) - { - setSelected(y / mRowHeight); - generateAction(); - } + setSelected(event.getY() / mRowHeight); + generateAction(); } } diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 884b3744..d5cfe76a 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -63,22 +63,18 @@ const char *skill_db[] = { SkillDialog::SkillDialog(): Window("Skills") { + setCloseButton(true); setDefaultSize(windowContainer->getWidth() - 255, 25, 240, 240); mSkillListBox = new ListBox(this); ScrollArea *skillScrollArea = new ScrollArea(mSkillListBox); - mCloseButton = new Button("Close", "close", this); mSkillListBox->setActionEventId("skill"); skillScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); skillScrollArea->setDimension(gcn::Rectangle(5, 5, 230, 180)); - mCloseButton->setPosition( - skillScrollArea->getX() + skillScrollArea->getWidth() - mCloseButton->getWidth(), - 210); add(skillScrollArea); - add(mCloseButton); mSkillListBox->addActionListener(this); diff --git a/src/gui/skill.h b/src/gui/skill.h index b8794e35..f1a14d50 100644 --- a/src/gui/skill.h +++ b/src/gui/skill.h @@ -71,7 +71,6 @@ class SkillDialog : public Window, public gcn::ActionListener, private: gcn::ListBox *mSkillListBox; - gcn::Button *mCloseButton; std::vector mSkillList; }; diff --git a/src/gui/status.cpp b/src/gui/status.cpp index 7da3b905..323a6b16 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -39,6 +39,7 @@ StatusWindow::StatusWindow(LocalPlayer *player): mPlayer(player) { setResizable(true); + setCloseButton(true); setDefaultSize((windowContainer->getWidth() - 365) / 2, (windowContainer->getHeight() - 255) / 2, 365, 280); loadWindowState("Status"); @@ -219,7 +220,7 @@ void StatusWindow::update() mHpBar->setColor(0, 171, 34); // Green } - mHpBar->setProgress((float)hp / maxHp); + mHpBar->setProgress((float) hp / maxHp); // Stats Part // ---------- @@ -235,7 +236,8 @@ void StatusWindow::update() int statusPoints = mPlayer->getAttributeIncreasePoints(); // Update labels - for (int i = 0; i < 7; i++) { + for (int i = 0; i < 7; i++) + { mStatsLabel[i]->setCaption(attrNames[i]); mStatsDisplayLabel[i]->setCaption( strprintf("%d / %d", diff --git a/src/gui/status.h b/src/gui/status.h index 40d25a2a..62cd8805 100644 --- a/src/gui/status.h +++ b/src/gui/status.h @@ -41,7 +41,8 @@ class ProgressBar; * * \ingroup Interface */ -class StatusWindow : public Window, public gcn::ActionListener { +class StatusWindow : public Window, public gcn::ActionListener +{ public: /** * Constructor. diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index ed75e5b3..5d81bb9c 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -46,6 +46,8 @@ #include "../resources/resourcemanager.h" +extern std::string homeDir; + /** * Calculates the Alder-32 checksum for the given file. */ @@ -119,7 +121,7 @@ UpdaterWindow::UpdaterWindow(): mUpdateHost = config.getValue("updatehost", "http://updates.themanaworld.org"); - mBasePath = config.getValue("homeDir", "."); + mBasePath = homeDir; // Try to download the updates list download(); diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 2af1d960..4c6b04a2 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -55,8 +55,7 @@ Viewport::Viewport(): mCameraX(0), mCameraY(0), mShowDebugPath(false), - mPlayerFollowMouse(false), - mPopupActive(false) + mPlayerFollowMouse(false) { setOpaque(false); addMouseListener(this); @@ -372,21 +371,20 @@ Viewport::mousePressed(gcn::MouseEvent &event) if ((being = beingManager->findBeing(tilex, tiley)) && being->getType() != Being::LOCALPLAYER) { - showPopup(event.getX(), event.getY(), being); + mPopupMenu->showPopup(event.getX(), event.getY(), being); return; } else if((floorItem = floorItemManager->findByCoordinates(tilex, tiley))) { - showPopup(event.getX(), event.getY(), floorItem); + mPopupMenu->showPopup(event.getX(), event.getY(), floorItem); return; } } // If a popup is active, just remove it - if (mPopupActive) + if (mPopupMenu->isVisible()) { mPopupMenu->setVisible(false); - mPopupActive = false; return; } @@ -450,21 +448,6 @@ void Viewport::showPopup(int x, int y, Item *item) { mPopupMenu->showPopup(x, y, item); - mPopupActive = true; -} - -void -Viewport::showPopup(int x, int y, FloorItem *floorItem) -{ - mPopupMenu->showPopup(x, y, floorItem); - mPopupActive = true; -} - -void -Viewport::showPopup(int x, int y, Being *being) -{ - mPopupMenu->showPopup(x, y, being); - mPopupActive = true; } void diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 22d0f249..eeb31bae 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -129,18 +129,6 @@ class Viewport : public WindowContainer, public gcn::MouseListener, getCameraY() { return mCameraY; } private: - /** - * Shows a popup for a floor item. - * TODO Find some way to get rid of FloorItem here - */ - void showPopup(int x, int y, FloorItem *floorItem); - - /** - * Shows a popup for a being. - * TODO Find some way to get rid of Being here - */ - void showPopup(int x, int y, Being *being); - /** * Helper function for loading target cursors */ @@ -187,7 +175,6 @@ class Viewport : public WindowContainer, public gcn::MouseListener, int mWalkTime; PopupMenu *mPopupMenu; /**< Popup menu. */ - bool mPopupActive; }; #endif diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 84f4466c..17447009 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -26,6 +26,7 @@ #include #include +#include "gui.h" #include "gccontainer.h" #include "windowcontainer.h" @@ -42,7 +43,9 @@ ConfigListener *Window::windowConfigListener = 0; WindowContainer *Window::windowContainer = 0; int Window::instances = 0; +int Window::mouseResize = 0; ImageRect Window::border; +Image *Window::closeImage = NULL; class WindowConfigListener : public ConfigListener { @@ -60,7 +63,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent): mParent(parent), mModal(modal), mResizable(false), - mMouseResize(0), + mCloseButton(false), mSticky(false), mMinWinWidth(100), mMinWinHeight(40), @@ -88,6 +91,8 @@ Window::Window(const std::string& caption, bool modal, Window *parent): border.grid[7] = dBorders->getSubImage(4, 15, 3, 4); border.grid[8] = dBorders->getSubImage(7, 15, 4, 4); dBorders->decRef(); + closeImage = resman->getImage("graphics/gui/close_button.png"); + windowConfigListener = new WindowConfigListener(); // Send GUI alpha changed for initialization windowConfigListener->optionChanged("guialpha"); @@ -110,6 +115,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent): if (mModal) { + gui->setCursorType(Gui::CURSOR_POINTER); requestModalFocus(); } @@ -153,6 +159,7 @@ Window::~Window() delete border.grid[6]; delete border.grid[7]; delete border.grid[8]; + closeImage->decRef(); } delete mChrome; @@ -173,11 +180,19 @@ void Window::draw(gcn::Graphics *graphics) // Draw title if (getTitleBarHeight()) { - graphics->setColor(gcn::Color(0, 0, 0)); - graphics->setFont(getFont()); - graphics->drawText(getCaption(), 7, 5, gcn::Graphics::LEFT); + g->setColor(gcn::Color(0, 0, 0)); + g->setFont(getFont()); + g->drawText(getCaption(), 7, 5, gcn::Graphics::LEFT); } + // Draw Close Button + if (mCloseButton) + { + g->drawImage(closeImage, + getWidth() - closeImage->getWidth() - getPadding(), + getPadding() + ); + } drawChildren(graphics); } @@ -207,6 +222,8 @@ void Window::setWidth(int width) { mGrip->setX(getWidth() - mGrip->getWidth() - getChildrenArea().x); } + + fireWindowEvent(WindowEvent(this, WindowEvent::WINDOW_RESIZED)); } void Window::setHeight(int height) @@ -217,6 +234,8 @@ void Window::setHeight(int height) { mGrip->setY(getHeight() - mGrip->getHeight() - getChildrenArea().y); } + + fireWindowEvent(WindowEvent(this, WindowEvent::WINDOW_RESIZED)); } void Window::setDimension(const gcn::Rectangle &dimension) @@ -228,6 +247,27 @@ void Window::setDimension(const gcn::Rectangle &dimension) mGrip->setX(getWidth() - mGrip->getWidth() - getChildrenArea().x); mGrip->setY(getHeight() - mGrip->getHeight() - getChildrenArea().y); } + + fireWindowEvent(WindowEvent(this, WindowEvent::WINDOW_RESIZED)); + fireWindowEvent(WindowEvent(this, WindowEvent::WINDOW_MOVED)); +} + +void Window::setPosition(int x, int y) +{ + gcn::Window::setPosition(x, y); + fireWindowEvent(WindowEvent(this, WindowEvent::WINDOW_MOVED)); +} + +void Window::setX(int x) +{ + gcn::Window::setX(x); + fireWindowEvent(WindowEvent(this, WindowEvent::WINDOW_MOVED)); +} + +void Window::setY(int y) +{ + gcn::Window::setY(y); + fireWindowEvent(WindowEvent(this, WindowEvent::WINDOW_MOVED)); } void Window::setLocationRelativeTo(gcn::Widget *widget) @@ -280,6 +320,11 @@ void Window::setResizable(bool r) } } +void Window::setCloseButton(bool flag) +{ + mCloseButton = flag; +} + bool Window::isResizable() { return mResizable; @@ -327,27 +372,73 @@ void Window::mousePressed(gcn::MouseEvent &event) // Let Guichan move window to top and figure out title bar drag gcn::Window::mousePressed(event); - const int x = event.getX(); - const int y = event.getY(); - mMouseResize = 0; + if (event.getButton() == gcn::MouseEvent::LEFT) + { + const int x = event.getX(); + const int y = event.getY(); + + // Handle close button + if (mCloseButton) + { + gcn::Rectangle closeButtonRect( + getWidth() - closeImage->getWidth() - getPadding(), + getPadding(), + closeImage->getWidth(), + closeImage->getHeight()); + + if (closeButtonRect.isPointInRect(x, y)) + { + setVisible(false); + } + } + + // Handle window resizing + mouseResize = getResizeHandles(event); + } +} + +void Window::mouseReleased(gcn::MouseEvent &event) +{ + if (mResizable && mouseResize) + { + mouseResize = 0; + gui->setCursorType(Gui::CURSOR_POINTER); + } + + // This should be the responsibility of Guichan (and is from 0.8.0 on) + mIsMoving = false; +} - // Activate resizing handles as appropriate - if (event.getSource() == this && isResizable() && - event.getButton() == gcn::MouseEvent::LEFT && - !getChildrenArea().isPointInRect(x, y)) +void Window::mouseExited(gcn::MouseEvent &event) +{ + if (mResizable && !mouseResize) { - mMouseResize |= (x > getWidth() - resizeBorderWidth) ? RIGHT : - (x < resizeBorderWidth) ? LEFT : 0; - mMouseResize |= (y > getHeight() - resizeBorderWidth) ? BOTTOM : - (y < resizeBorderWidth) ? TOP : 0; + gui->setCursorType(Gui::CURSOR_POINTER); } - else if (event.getSource() == mGrip && - event.getButton() == gcn::MouseEvent::LEFT) +} + +void Window::mouseMoved(gcn::MouseEvent &event) +{ + int resizeHandles = getResizeHandles(event); + + // Changes the custom mouse cursor based on it's current position. + switch (resizeHandles) { - mDragOffsetX = x; - mDragOffsetY = y; - mMouseResize |= BOTTOM | RIGHT; - mIsMoving = false; + case BOTTOM | RIGHT: + gui->setCursorType(Gui::CURSOR_RESIZE_DOWN_RIGHT); + break; + case BOTTOM | LEFT: + gui->setCursorType(Gui::CURSOR_RESIZE_DOWN_LEFT); + break; + case BOTTOM: + gui->setCursorType(Gui::CURSOR_RESIZE_DOWN); + break; + case RIGHT: + case LEFT: + gui->setCursorType(Gui::CURSOR_RESIZE_ACROSS); + break; + default: + gui->setCursorType(Gui::CURSOR_POINTER); } } @@ -366,31 +457,31 @@ void Window::mouseDragged(gcn::MouseEvent &event) setPosition(newX, newY); } - if (mMouseResize && !mIsMoving) + if (mouseResize && !mIsMoving) { const int dx = event.getX() - mDragOffsetX; const int dy = event.getY() - mDragOffsetY; gcn::Rectangle newDim = getDimension(); - if (mMouseResize & (TOP | BOTTOM)) + if (mouseResize & (TOP | BOTTOM)) { - int newHeight = newDim.height + ((mMouseResize & TOP) ? -dy : dy); + int newHeight = newDim.height + ((mouseResize & TOP) ? -dy : dy); newDim.height = std::min(mMaxWinHeight, std::max(mMinWinHeight, newHeight)); - if (mMouseResize & TOP) + if (mouseResize & TOP) { newDim.y -= newDim.height - getHeight(); } } - if (mMouseResize & (LEFT | RIGHT)) + if (mouseResize & (LEFT | RIGHT)) { - int newWidth = newDim.width + ((mMouseResize & LEFT) ? -dx : dx); + int newWidth = newDim.width + ((mouseResize & LEFT) ? -dx : dx); newDim.width = std::min(mMaxWinWidth, std::max(mMinWinWidth, newWidth)); - if (mMouseResize & LEFT) + if (mouseResize & LEFT) { newDim.x -= newDim.width - getWidth(); } @@ -417,11 +508,11 @@ void Window::mouseDragged(gcn::MouseEvent &event) } // Update mouse offset when dragging bottom or right border - if (mMouseResize & BOTTOM) + if (mouseResize & BOTTOM) { mDragOffsetY += newDim.height - getHeight(); } - if (mMouseResize & RIGHT) + if (mouseResize & RIGHT) { mDragOffsetX += newDim.width - getWidth(); } @@ -469,3 +560,50 @@ void Window::resetToDefaultSize() setContentSize(mDefaultWidth, mDefaultHeight); updateContentSize(); } + +int Window::getResizeHandles(gcn::MouseEvent &event) +{ + int resizeHandles = 0; + const int y = event.getY(); + + if (mResizable && y > (int) mTitleBarHeight) + { + const int x = event.getX(); + + if (!getChildrenArea().isPointInRect(x, y) && + event.getSource() == this) + { + resizeHandles |= (x > getWidth() - resizeBorderWidth) ? RIGHT : + (x < resizeBorderWidth) ? LEFT : 0; + resizeHandles |= (y > getHeight() - resizeBorderWidth) ? BOTTOM : + (y < resizeBorderWidth) ? TOP : 0; + } + + if (event.getSource() == mGrip) + { + mDragOffsetX = x; + mDragOffsetY = y; + resizeHandles |= BOTTOM | RIGHT; + } + } + + return resizeHandles; +} + +void Window::fireWindowEvent(const WindowEvent &event) +{ + WindowListeners::iterator i_end = mListeners.end(); + WindowListeners::iterator i = mListeners.begin(); + + switch (event.getType()) + { + case WindowEvent::WINDOW_MOVED: + for (; i != i_end; ++i) + { (*i)->windowMoved(event); } + break; + case WindowEvent::WINDOW_RESIZED: + for (; i != i_end; ++i) + { (*i)->windowResized(event); } + break; + } +} diff --git a/src/gui/window.h b/src/gui/window.h index 1ba23fb2..ab266422 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -28,11 +28,14 @@ #include "../guichanfwd.h" +#include "windowlistener.h" + class ConfigListener; class GCContainer; class ImageRect; class ResizeGrip; class WindowContainer; +class Image; /** * A window. This window can be dragged around and has a title bar. Windows are @@ -119,16 +122,36 @@ class Window : public gcn::Window */ void setDimension(const gcn::Rectangle &dimension); + /** + * Sets the position of this window. + */ + void setPosition(int x, int y); + + /** + * Sets the window x coordinate. + */ + void setX(int x); + + /** + * Sets the window y coordinate. + */ + void setY(int y); + /** * Sets the location relative to the given widget. */ void setLocationRelativeTo(gcn::Widget *widget); /** - * Sets whether of not the window can be resized. + * Sets whether or not the window can be resized. */ void setResizable(bool resize); + /** + * Sets whether or not the window has a close button. + */ + void setCloseButton(bool flag); + /** * Returns whether the window can be resized. */ @@ -155,9 +178,14 @@ class Window : public gcn::Window void setMaxHeight(unsigned int height); /** - * Sets whether the window is sticky. - * A sticky window will not have its visibility set to false - * on a general setVisible(false) call. + * Sets flag to show a title or not. + */ + void setShowTitle(bool flag) + { mShowTitle = flag; } + + /** + * Sets whether the window is sticky. A sticky window will not have + * its visibility set to false on a general setVisible(false) call. */ void setSticky(bool sticky); @@ -167,10 +195,9 @@ class Window : public gcn::Window bool isSticky(); /** - * Overloads window setVisible by guichan to allow sticky window - * Handling + * Overloads window setVisible by Guichan to allow sticky window + * handling. */ - void setVisible(bool visible); /** @@ -198,6 +225,24 @@ class Window : public gcn::Window */ void mouseDragged(gcn::MouseEvent &event); + /** + * Implements custom cursor image changing context, based on mouse + * relative position. + */ + void mouseMoved(gcn::MouseEvent &event); + + /** + * When the mouse button has been let go, this ensures that the mouse + * custom cursor is restored back to it's standard image. + */ + void mouseReleased(gcn::MouseEvent &event); + + /** + * When the mouse leaves the window this ensures that the custom cursor + * is restored back to it's standard image. + */ + void mouseExited(gcn::MouseEvent &event); + /** * Read the x, y, and width and height for resizables in the config * based on the given string. @@ -216,11 +261,25 @@ class Window : public gcn::Window int defaultWidth, int defaultHeight); /** - * Reset the win pos and size to default. - * Don't forget to set defaults first. + * Reset the win pos and size to default. Don't forget to set defaults + * first. */ void resetToDefaultSize(); + /** + * Adds a listener to the list that's notified when the window is + * moved or resized. + */ + void addWindowListener(WindowListener *listener) + { mListeners.push_back(listener); } + + /** + * Removes a listener from the list that's notified when the window is + * moved or resized. + */ + void removeWindowListener(WindowListener *listener) + { mListeners.remove(listener); } + enum ResizeHandles { TOP = 0x01, @@ -233,13 +292,23 @@ class Window : public gcn::Window static WindowContainer *windowContainer; private: + /** + * Determines if the mouse is in a resize area and returns appropriate + * resize handles. Also initializes drag offset in case the resize + * grip is used. + * + * @see ResizeHandles + */ + int getResizeHandles(gcn::MouseEvent &event); + GCContainer *mChrome; /**< Contained container */ ResizeGrip *mGrip; /**< Resize grip */ Window *mParent; /**< The parent window */ std::string mConfigName; /**< Name used for saving window-related data */ + bool mShowTitle; /**< Window has a title bar */ bool mModal; /**< Window is modal */ bool mResizable; /**< Window can be resized */ - int mMouseResize; /**< Window is being resized */ + bool mCloseButton; /**< Window has a close button */ bool mSticky; /**< Window resists minimization */ int mMinWinWidth; /**< Minimum window width */ int mMinWinHeight; /**< Minimum window height */ @@ -255,8 +324,10 @@ class Window : public gcn::Window */ static ConfigListener *windowConfigListener; + static int mouseResize; /**< Active resize handles */ static int instances; /**< Number of Window instances */ static ImageRect border; /**< The window border and background */ + static Image *closeImage; /**< Close Button Image */ /** * The width of the resize border. Is independent of the actual window @@ -264,6 +335,14 @@ class Window : public gcn::Window * where two borders are moved at the same time. */ static const int resizeBorderWidth = 10; + + private: + /** + * Sends out a window event to the list of selection listeners. + */ + void fireWindowEvent(const WindowEvent &event); + + WindowListeners mListeners; }; #endif diff --git a/src/gui/windowlistener.h b/src/gui/windowlistener.h new file mode 100644 index 00000000..08aab71d --- /dev/null +++ b/src/gui/windowlistener.h @@ -0,0 +1,86 @@ +/* + * The Mana World + * Copyright 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _TMW_WINDOW_LISTENER_H_ +#define _TMW_WINDOW_LISTENER_H_ + +#include +#include + +/** + * An event that characterizes a window move or resize. + * + * \ingroup GUI + */ +class WindowEvent : public gcn::Event +{ + public: + /** + * Constructor. + */ + WindowEvent(gcn::Window *source, int type): + gcn::Event(source) + { + mType = type; + } + + /** + * Returns the event type. + */ + int getType() const + { return mType; } + + enum WindowEventType + { + WINDOW_MOVED, + WINDOW_RESIZED + }; +}; + +/** + * The listener that's notified when a window is moved or resized. + * + * \ingroup GUI + */ +class WindowListener +{ + public: + /** + * Virtual destructor. + */ + virtual ~WindowListener() {} + + /** + * Called whenever the window is moved. + */ + virtual void windowMoved(const WindowEvent &event) {} + + /** + * Called whenever the window is resized. + */ + virtual void windowResized(const WindowEvent &event) {} +}; + +typedef std::list WindowListeners; + +#endif diff --git a/src/imageparticle.cpp b/src/imageparticle.cpp index 35cc21ad..17581a2a 100644 --- a/src/imageparticle.cpp +++ b/src/imageparticle.cpp @@ -31,12 +31,12 @@ ImageParticle::ImageParticle(Map *map, Image *image): Particle(map), mImage(image) { - mImage->incRef(); + if (mImage) mImage->incRef(); } ImageParticle::~ImageParticle() { - mImage->decRef(); + if (mImage) mImage->decRef(); } void ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const @@ -44,8 +44,8 @@ void ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const if (!mAlive) return; - int screenX = (int) mPosX + offsetX - mImage->getWidth() / 2; - int screenY = (int) mPosY - (int) mPosZ + offsetY - mImage->getHeight()/2; + int screenX = (int) mPos.x + offsetX - mImage->getWidth() / 2; + int screenY = (int) mPos.y - (int)mPos.z + offsetY - mImage->getHeight()/2; // Check if on screen if (screenX + mImage->getWidth() < 0 || diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp new file mode 100644 index 00000000..8a514c7e --- /dev/null +++ b/src/itemshortcut.cpp @@ -0,0 +1,87 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "itemshortcut.h" + +#include "localplayer.h" +#include "configuration.h" + +#include "utils/tostring.h" + +ItemShortcut::ItemShortcut *itemShortcut; + +ItemShortcut::ItemShortcut(): + mItemSelected(NULL) +{ + for (int i = 0; i < SHORTCUT_ITEMS; i++) + { + mItems[i] = NULL; + } +} + +ItemShortcut::~ItemShortcut() +{ + save(); +} + +void ItemShortcut::load() +{ + for (int i = 0; i < SHORTCUT_ITEMS; i++) + { + int itemId = (int) config.getValue("itemShortcut" + toString(i), -1); + + if (itemId != -1) + { + ItemPtr item = player_node->searchForItem(itemId); + if (item) + { + mItems[i] = item; + } + } + } +} + +void ItemShortcut::save() +{ + for (int i = 0; i < SHORTCUT_ITEMS; i++) + { + if (mItems[i]) + { + config.setValue("shortcut" + toString(i), mItems[i]->getId()); + } + else + { + config.setValue("shortcut" + toString(i), -1); + } + } +} + +void ItemShortcut::useItem(int index) +{ + if (mItems[index]) + { + if (mItems[index]->getQuantity()) { + // TODO: Fix this (index vs. pointer mismatch) + //player_node->useItem(mItems[index]); + } + } +} diff --git a/src/itemshortcut.h b/src/itemshortcut.h new file mode 100644 index 00000000..d211c7f3 --- /dev/null +++ b/src/itemshortcut.h @@ -0,0 +1,130 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _TMW_ITEMSHORTCUT_H__ +#define _TMW_ITEMSHORTCUT_H__ + +#include "item.h" + +#define SHORTCUT_ITEMS 10 + +/** + * The item pointer + */ +typedef Item* ItemPtr; + +class ItemShortcut +{ + public: + /** + * Constructor. + */ + ItemShortcut(); + + /** + * Destructor. + */ + ~ItemShortcut(); + + /** + * Load the configuration information. + */ + void load(); + + /** + * Returns the shortcut item specified by the index. + * + * @param index Index of the shortcut item. + */ + ItemPtr getItem(int index) const + { return mItems[index]; } + + /** + * Returns the amount of shortcut items. + */ + int getItemCount() const + { return SHORTCUT_ITEMS; } + + /** + * Returns the item that is currently selected. + */ + ItemPtr getItemSelected() const + { return mItemSelected; } + + /** + * Adds the selected item to the items specified by the index. + * + * @param index Index of the items. + */ + void setItem(int index) + { mItems[index] = mItemSelected; } + + /** + * Adds an item to the items store specified by the index. + * + * @param index Index of the items. + * @param item Item to store. + */ + void setItems(int index, Item *item) + { mItems[index] = item; } + + /** + * Set the item that is selected. + * + * @param item The item that is to be assigned. + */ + void setItemSelected(ItemPtr item) + { mItemSelected = item; } + + /** + * A flag to check if the item is selected. + */ + bool isItemSelected() + { return (mItemSelected) ? true : false; } + + /** + * Remove a item from the shortcut. + */ + void removeItem(int index) + { mItems[index] = NULL; } + + /** + * Try to use the item specified by the index. + * + * @param index Index of the item shortcut. + */ + void useItem(int index); + + private: + /** + * Save the configuration information. + */ + void save(); + + ItemPtr mItems[SHORTCUT_ITEMS]; /**< the items stored */ + ItemPtr mItemSelected; /**< the item held by cursor */ + +}; + +extern ItemShortcut *itemShortcut; + +#endif diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp new file mode 100644 index 00000000..271961c8 --- /dev/null +++ b/src/keyboardconfig.cpp @@ -0,0 +1,144 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#include "keyboardconfig.h" +#include "configuration.h" +#include "log.h" + +#include + +#include "gui/setup_keyboard.h" + +struct KeyData +{ + const char *configField; + int defaultValue; + const char *caption; +}; + +// keyData must be in same order as enum keyAction. +static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { + {"keyMoveUp", SDLK_UP, "Move Up"}, + {"keyMoveDown", SDLK_DOWN, "Move Down"}, + {"keyMoveLeft", SDLK_LEFT, "Move Left"}, + {"keyMoveRight", SDLK_RIGHT, "Move Right"}, + {"keyAttack", SDLK_LCTRL, "Attack"}, + {"keyTarget", SDLK_LSHIFT, "Target"}, + {"keyTargetClosest", SDLK_a, "Target Closest"}, + {"keyPickup", SDLK_z, "Pickup"}, + {"keyHideWindows", SDLK_h, "Hide Windows"}, + {"keyBeingSit", SDLK_s, "Sit"}, + {"keyShortcut0", SDLK_0, "Item Shortcut 0"}, + {"keyShortcut1", SDLK_1, "Item Shortcut 1"}, + {"keyShortcut2", SDLK_2, "Item Shortcut 2"}, + {"keyShortcut3", SDLK_3, "Item Shortcut 3"}, + {"keyShortcut4", SDLK_4, "Item Shortcut 4"}, + {"keyShortcut5", SDLK_5, "Item Shortcut 5"}, + {"keyShortcut6", SDLK_6, "Item Shortcut 6"}, + {"keyShortcut7", SDLK_7, "Item Shortcut 7"}, + {"keyShortcut8", SDLK_8, "Item Shortcut 8"}, + {"keyShortcut9", SDLK_9, "Item Shortcut 9"} +}; + +void KeyboardConfig::init() +{ + for (int i = 0; i < KEY_TOTAL; i++) + { + mKey[i].configField = keyData[i].configField; + mKey[i].defaultValue = keyData[i].defaultValue; + mKey[i].caption = keyData[i].caption; + mKey[i].value = KEY_NO_VALUE; + } + mNewKeyIndex = KEY_NO_VALUE; + mEnabled = true; + + retrieve(); +} + +void KeyboardConfig::retrieve() +{ + for (int i = 0; i < KEY_TOTAL; i++) + { + mKey[i].value = (int) config.getValue( + mKey[i].configField, mKey[i].defaultValue); + } +} + +void KeyboardConfig::store() +{ + for (int i = 0; i < KEY_TOTAL; i++) + { + config.setValue(mKey[i].configField, mKey[i].value); + } +} + +void KeyboardConfig::makeDefault() +{ + for (int i = 0; i < KEY_TOTAL; i++) + { + mKey[i].value = mKey[i].defaultValue; + } +} + +bool KeyboardConfig::hasConflicts() +{ + int i, j; + for (i = 0; i < KEY_TOTAL; i++) + { + for (j = 0; j < KEY_TOTAL; j++) + { + if (i != j && mKey[i].value == mKey[j].value) + { + return true; + } + } + } + return false; +} + +void KeyboardConfig::callbackNewKey() +{ + mSetupKey->newKeyCallback(mNewKeyIndex); +} + +int KeyboardConfig::getKeyIndex(int keyValue) const +{ + for (int i = 0; i < KEY_TOTAL; i++) + { + if(keyValue == mKey[i].value) + { + return i; + } + } + return KEY_NO_VALUE; +} + +bool KeyboardConfig::isKeyActive(int index) +{ + return mActiveKeys[ mKey[index].value]; +} + +void KeyboardConfig::refreshActiveKeys() +{ + mActiveKeys = SDL_GetKeyState(NULL); +} diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h new file mode 100644 index 00000000..46394fa5 --- /dev/null +++ b/src/keyboardconfig.h @@ -0,0 +1,185 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _TMW_KEYBOARDCONFIG_H +#define _TMW_KEYBOARDCONFIG_H + +#include + +#include "gui/setup_keyboard.h" + +#include + +/** + * Each key represents a key function. Such as 'Move up', 'Attack' etc. + */ +struct KeyFunction +{ + const char* configField; /** Field index that is in the config file. */ + int defaultValue; /** The default key value used. */ + std::string caption; /** The caption value for the key function. */ + int value; /** The actual value that is used. */ +}; + +class KeyboardConfig +{ + public: + /** + * Initializes the keyboard config explicitly. + */ + void init(); + + /** + * Retrieve the key values from config file. + */ + void retrieve(); + + /** + * Store the key values to config file. + */ + void store(); + + /** + * Make the keys their default values. + */ + void makeDefault(); + + /** + * Determines if any key assignments are the same as each other. + */ + bool hasConflicts(); + + /** + * Calls a function back so the key re-assignment(s) can be seen. + */ + void callbackNewKey(); + + /** + * Obtain the value stored in memory. + */ + int getKeyValue(int index) const + { return mKey[index].value; } + + /** + * Get the index of the new key to be assigned. + */ + int getNewKeyIndex() const + { return mNewKeyIndex; } + + /** + * Get the enable flag, which will stop the user from doing actions. + */ + bool isEnabled() const + { return mEnabled; } + + /** + * Get the key caption, providing more meaning to the user. + */ + const std::string &getKeyCaption(int index) const + { return mKey[index].caption; } + + /** + * Get the key function index by providing the keys value. + */ + int getKeyIndex(int keyValue) const; + + /** + * Set the enable flag, which will stop the user from doing actions. + */ + void setEnabled(bool flag) + { mEnabled = flag; } + + /** + * Set the index of the new key to be assigned. + */ + void setNewKeyIndex(int value) + { mNewKeyIndex = value; } + + /** + * Set the value of the new key. + */ + void setNewKey(int value) + { mKey[mNewKeyIndex].value = value; } + + /** + * Set a reference to the key setup window. + */ + void setSetupKeyboard(Setup_Keyboard *setupKey) + { mSetupKey = setupKey; } + + /** + * Checks if the key is active, by providing the key function index. + */ + bool isKeyActive(int index); + + /** + * Takes a snapshot of all the active keys. + */ + void refreshActiveKeys(); + + /** + * All the key functions. + * KEY_NO_VALUE is used in initialization, and should be unchanged. + * KEY_TOTAL should always be last (used as a conditional in loops). + * The key assignment view gets arranged according to the order of + * these values. + */ + enum KeyAction { + KEY_NO_VALUE = -1, + KEY_MOVE_UP, + KEY_MOVE_DOWN, + KEY_MOVE_LEFT, + KEY_MOVE_RIGHT, + KEY_ATTACK, + KEY_TARGET, + KEY_TARGET_CLOSEST, + KEY_PICKUP, + KEY_HIDE_WINDOWS, + KEY_SIT, + KEY_SHORTCUT_0, + KEY_SHORTCUT_1, + KEY_SHORTCUT_2, + KEY_SHORTCUT_3, + KEY_SHORTCUT_4, + KEY_SHORTCUT_5, + KEY_SHORTCUT_6, + KEY_SHORTCUT_7, + KEY_SHORTCUT_8, + KEY_SHORTCUT_9, + KEY_TOTAL + }; + + private: + int mNewKeyIndex; /**< Index of new key to be assigned */ + bool mEnabled; /**< Flag to respond to key input */ + + Setup_Keyboard *mSetupKey; /**< Reference to setup window */ + + KeyFunction mKey[KEY_TOTAL]; /**< Pointer to all the key data */ + + Uint8 *mActiveKeys; /**< Stores a list of all the keys */ +}; + +extern KeyboardConfig keyboard; + +#endif diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 95e7a478..f4ad7587 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -29,11 +29,19 @@ #include "inventory.h" #include "item.h" #include "main.h" +#include "particle.h" #include "sound.h" #include "log.h" #include "net/gameserver/player.h" +#include "gui/gui.h" + +#include "net/messageout.h" +#include "net/protocol.h" + +#include "utils/tostring.h" + LocalPlayer *player_node = NULL; LocalPlayer::LocalPlayer(): @@ -46,6 +54,7 @@ LocalPlayer::LocalPlayer(): mLevel(1), mMoney(0), mTotalWeight(1), mMaxWeight(1), mHP(1), mMaxHP(1), + mXp(0), mTarget(NULL), mPickUpTarget(NULL), mTrading(false), mLastAction(-1), mWalkingDir(0), @@ -112,6 +121,17 @@ LocalPlayer::moveInvItem(Item *item, int newIndex) item->getInvIndex(), newIndex, item->getQuantity()); } +Item* LocalPlayer::searchForItem(int itemId) +{ + for (int i = 0; i < INVENTORY_SIZE; i++) + { + if (itemId == mInventory->getItem(i)->getId()) { + return mInventory->getItem(i); + } + } + return NULL; +} + void LocalPlayer::equipItem(Item *item) { Net::GameServer::Player::equip(item->getInvIndex()); @@ -302,10 +322,14 @@ void LocalPlayer::attack() setAction(ATTACK); - if (getWeapon() == 2) - sound.playSfx("sfx/bow_shoot_1.ogg"); - else + if (mEquippedWeapon) + { + std::string soundFile = mEquippedWeapon->getSound(EQUIP_EVENT_STRIKE); + if (soundFile != "") sound.playSfx(soundFile); + } + else { sound.playSfx("sfx/fist-swish.ogg"); + } Net::GameServer::Player::attack(getSpriteDirection()); } @@ -329,3 +353,16 @@ void LocalPlayer::raiseAttribute(size_t attr) mAttributeBase.at(attr)++; // TODO: Inform the server about our desire to raise the attribute } + +void LocalPlayer::setXp(int xp) +{ + if (mMap && xp > mXp) + { + const std::string text = toString(xp - mXp) + " xp"; + + // Show XP number + particleEngine->addTextRiseFadeOutEffect(text, hitYellowFont, + mPx + 16, mPy - 16); + } + mXp = xp; +} diff --git a/src/localplayer.h b/src/localplayer.h index 4f38fdad..ff7bf0b7 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -151,6 +151,14 @@ class LocalPlayer : public Player */ void moveInvItem(Item *item, int newIndex); + /** + * Searches for the specified item by it's identification. + * + * @param itemId The id of the item to be searched. + * @return Item found on success, NULL on failure. + */ + Item* searchForItem(int itemId); + /** * Equips an item. */ @@ -237,6 +245,19 @@ class LocalPlayer : public Player int getHP() const { return mHP; } + /** + * Sets the amount of XP. Shows XP gaining effect if the player is on + * a map. + */ + void setXp(int xp); + + /** + * Returns the amount of experience points. + */ + int getXp() const { return mXp; } + + Uint32 mCharId; + int getMaxHP() const { return mMaxHP; } @@ -298,6 +319,7 @@ class LocalPlayer : public Player int mMaxWeight; int mHP; int mMaxHP; + int mXp; /**< Experience points. */ Being *mTarget; FloorItem *mPickUpTarget; diff --git a/src/main.cpp b/src/main.cpp index 1f4eafde..30fb7c1c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -48,8 +48,10 @@ #endif #include "configuration.h" +#include "keyboardconfig.h" #include "game.h" #include "graphics.h" +#include "itemshortcut.h" #include "lockedarray.h" #include "localplayer.h" #include "log.h" @@ -84,7 +86,6 @@ #include "net/gameserver/gameserver.h" -#include "resources/equipmentdb.h" #include "resources/image.h" #include "resources/itemdb.h" #include "resources/monsterdb.h" @@ -108,6 +109,7 @@ Music *bgm; Configuration config; /**< XML file configuration reader */ Logger *logger; /**< Log object */ +KeyboardConfig keyboard; Net::Connection *accountServerConnection = 0; Net::Connection *gameServerConnection = 0; @@ -189,7 +191,6 @@ void initConfiguration(const Options &options) config.setValue("fpslimit", 0); config.setValue("updatehost", "http://updates.themanaworld.org"); config.setValue("customcursor", 1); - config.setValue("homeDir", homeDir); // Checking if the configuration file exists... otherwise create it with // default options. @@ -319,6 +320,9 @@ void initEngine() // Initialize for drawing graphics->_beginDraw(); + // Initialize the item shortcuts. + itemShortcut = new ItemShortcut(); + gui = new Gui(graphics); state = STATE_CHOOSE_SERVER; /**< Initial game state */ @@ -337,12 +341,19 @@ void initEngine() errorMessage = err; logger->log("Warning: %s", err); } + + // Initialize keyboard + keyboard.init(); } /** Clear the engine */ void exit_engine() { + // Before config.write() since it writes the shortcuts to the config + delete itemShortcut; + config.write(); + delete gui; delete graphics; @@ -353,7 +364,6 @@ void exit_engine() sound.close(); // Unload XML databases - EquipmentDB::unload(); ItemDB::unload(); MonsterDB::unload(); @@ -457,7 +467,6 @@ void loadUpdates() const std::string updatesFile = "updates/resources2.txt"; ResourceManager *resman = ResourceManager::getInstance(); std::vector lines = resman->loadTextFile(updatesFile); - std::string homeDir = config.getValue("homeDir", ""); for (unsigned int i = 0; i < lines.size(); ++i) { @@ -895,7 +904,6 @@ int main(int argc, char *argv[]) false); // Load XML databases - EquipmentDB::load(); ItemDB::load(); MonsterDB::load(); state = STATE_LOGIN; @@ -1039,7 +1047,6 @@ int main(int argc, char *argv[]) } } } - } catch (...) { diff --git a/src/monster.cpp b/src/monster.cpp index 768bf16a..2522a3e1 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -57,7 +57,7 @@ Monster::setAction(Action action) break; case DEAD: currentAction = ACTION_DEAD; - sound.playSfx(getInfo().getSound(EVENT_DIE)); + sound.playSfx(getInfo().getSound(MONSTER_EVENT_DIE)); break; case ATTACK: currentAction = ACTION_ATTACK; @@ -87,10 +87,10 @@ Monster::handleAttack() const MonsterInfo &mi = getInfo(); - // TODO: It's not possible to determine hit or miss here, so this stuff probably needs - // to be moved somewhere else. We may lose synchronization between attack animation and - // the sound, unless we adapt the protocol... - sound.playSfx(mi.getSound(EVENT_HIT)); + // TODO: It's not possible to determine hit or miss here, so this stuff + // probably needs to be moved somewhere else. We may lose synchronization + // between attack animation and the sound, unless we adapt the protocol... + sound.playSfx(mi.getSound(MONSTER_EVENT_HIT)); } Being::TargetCursorSize diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 87972212..b88d443e 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -114,7 +114,7 @@ void BeingHandler::handleMessage(MessageIn &msg) dstBeing = beingManager->findBeing(id); - if (dstBeing == NULL) + if (!dstBeing) { // Being with id >= 110000000 and job 0 are better // known as ghosts, so don't create those. @@ -138,30 +138,32 @@ void BeingHandler::handleMessage(MessageIn &msg) dstBeing->setWalkSpeed(speed); dstBeing->mJob = job; - dstBeing->setHairStyle(msg.readShort()); - dstBeing->setWeapon(msg.readShort()); + dstBeing->setHairStyle(msg->readShort()); + dstBeing->setVisibleEquipment( + Being::WEAPON_SPRITE, msg->readShort()); dstBeing->setVisibleEquipment( - Being::BOTTOMCLOTHES_SPRITE, msg.readShort()); + Being::BOTTOMCLOTHES_SPRITE, msg->readShort()); if (msg.getId() == SMSG_BEING_MOVE) { msg.readLong(); // server tick } - msg.readShort(); // shield - dstBeing->setVisibleEquipment(Being::HAIT_SPRITE, msg.readShort()); - dstBeing->setVisibleEquipment( - Being::TOPCLOTHES_SPRITE, msg.readShort()); - dstBeing->setHairColor(msg.readShort()); - msg.readShort(); // unknown - msg.readShort(); // head dir - msg.readShort(); // guild - msg.readShort(); // unknown - msg.readShort(); // unknown - msg.readShort(); // manner - msg.readShort(); // karma - msg.readByte(); // unknown - dstBeing->setSex(1 - msg.readByte()); // sex + msg->readShort(); // shield + headTop = msg->readShort(); + headMid = msg->readShort(); + dstBeing->setVisibleEquipment(Being::HAT_SPRITE, headTop); + dstBeing->setVisibleEquipment(Being::TOPCLOTHES_SPRITE, headMid); + dstBeing->setHairColor(msg->readShort()); + msg->readShort(); // unknown + msg->readShort(); // head dir + msg->readShort(); // guild + msg->readShort(); // unknown + msg->readShort(); // unknown + msg->readShort(); // manner + msg->readShort(); // karma + msg->readByte(); // unknown + dstBeing->setSex(1 - msg->readByte()); // sex if (msg.getId() == SMSG_BEING_MOVE) { @@ -256,10 +258,12 @@ void BeingHandler::handleMessage(MessageIn &msg) } Particle *levelupFX; if (msg->readLong() == 0) { // type - levelupFX = particleEngine->addEffect("graphics/particles/levelup.particle.xml", 0, 0); + levelupFX = particleEngine->addEffect( + "graphics/particles/levelup.particle.xml", 0, 0); } else { - levelupFX = particleEngine->addEffect("graphics/particles/skillup.particle.xml", 0, 0); + levelupFX = particleEngine->addEffect( + "graphics/particles/skillup.particle.xml", 0, 0); } beingManager->findBeing(id)->controlParticle(levelupFX); break; @@ -289,28 +293,26 @@ void BeingHandler::handleMessage(MessageIn &msg) dstBeing->setHairStyle(id); break; case 2: - dstBeing->setWeapon(id); + dstBeing->setVisibleEquipment(Being::WEAPON_SPRITE, id); break; case 3: // Change lower headgear for eAthena, pants for us dstBeing->setVisibleEquipment( - Being::BOTTOMCLOTHES_SPRITE, - id); + Being::BOTTOMCLOTHES_SPRITE, id); break; case 4: // Change upper headgear for eAthena, hat for us dstBeing->setVisibleEquipment( - Being::HAT_SPRITE, - id); + Being::HAT_SPRITE, id); break; case 5: // Change middle headgear for eathena, armor for us dstBeing->setVisibleEquipment( - Being::TOPCLOTHES_SPRITE, - id); + Being::TOPCLOTHES_SPRITE, id); break; case 6: dstBeing->setHairColor(id); break; default: - logger->log("c3: %i\n", id); // unsupported + logger->log("SMSG_BEING_CHANGE_LOOKS: unsupported type: " + "%d, id: %d", type, id); break; } } @@ -336,17 +338,18 @@ void BeingHandler::handleMessage(MessageIn &msg) dstBeing = beingManager->findBeing(id); - if (dstBeing == NULL) + if (!dstBeing) { dstBeing = beingManager->createBeing(id, job); } dstBeing->setWalkSpeed(speed); dstBeing->mJob = job; - dstBeing->setHairStyle(msg.readShort()); - dstBeing->setWeaponById(msg.readShort()); // item id 1 - msg.readShort(); // item id 2 - headBottom = msg.readShort(); + dstBeing->setHairStyle(msg->readShort()); + dstBeing->setVisibleEquipment( + Being::WEAPON_SPRITE, msg->readShort()); + msg->readShort(); // item id 2 + headBottom = msg->readShort(); if (msg.getId() == SMSG_PLAYER_MOVE) { @@ -407,9 +410,9 @@ void BeingHandler::handleMessage(MessageIn &msg) case 0x0119: // Change in players look - logger->log("0x0119 %li %i %i %x %i\n", msg.readLong(), - msg.readShort(), msg.readShort(), msg.readShort(), - msg.readByte()); + logger->log("0x0119 %i %i %i %x %i", msg->readLong(), + msg->readShort(), msg->readShort(), msg->readShort(), + msg->readByte()); break; */ } @@ -428,11 +431,9 @@ static void handleLooks(Being *being, MessageIn &msg) if (mask & (1 << 7)) { // The equipment has to be cleared first. - being->setWeaponById(0); for (int i = 0; i < nb_slots; ++i) { - if (slots[i] != Being::WEAPON_SPRITE) - being->setVisibleEquipment(slots[i], 0); + being->setVisibleEquipment(slots[i], 0); } } @@ -441,10 +442,7 @@ static void handleLooks(Being *being, MessageIn &msg) { if (!(mask & (1 << i))) continue; int id = msg.readShort(); - if (slots[i] != Being::WEAPON_SPRITE) - being->setVisibleEquipment(slots[i], id); - else - being->setWeaponById(id); + being->setVisibleEquipment(slots[i], id); } } diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp index 3efe3174..afdc2ab5 100644 --- a/src/net/chathandler.cpp +++ b/src/net/chathandler.cpp @@ -37,6 +37,7 @@ #include "../gui/chat.h" #include "../utils/tostring.h" +#include "../utils/trim.h" extern Being *player_node; @@ -167,6 +168,7 @@ void ChatHandler::handleMessage(MessageIn &msg) chatMsg = msg.readString(chatMsgLength); chatWindow->chatLog(chatMsg, BY_OTHER); chatMsg.erase(0, chatMsg.find(" : ", 0) + 3); + trim(chatMsg); being->setSpeech(chatMsg, SPEECH_TIME); break; diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp index 354dd685..de74e8f5 100644 --- a/src/net/inventoryhandler.cpp +++ b/src/net/inventoryhandler.cpp @@ -31,6 +31,7 @@ #include "../equipment.h" #include "../inventory.h" #include "../item.h" +#include "../itemshortcut.h" #include "../localplayer.h" #include "../gui/chat.h" @@ -77,6 +78,7 @@ void InventoryHandler::handleMessage(MessageIn &msg) it->setQuantity(amount); } }; + itemShortcut->load(); break; } } diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index b94b5128..afaeca69 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -133,7 +133,8 @@ void PlayerHandler::handleMessage(MessageIn &msg) } else { - logger->log("Warning: server wants to update unknown attribute %d to %d", stat, value); + logger->log("Warning: server wants to update unknown " + "attribute %d to %d", stat, value); } } } break; diff --git a/src/particle.cpp b/src/particle.cpp index 805da102..148bbf6f 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -52,14 +52,12 @@ const float Particle::PARTICLE_SKY = 800.0f; Particle::Particle(Map *map): mAlive(true), - mPosX(0.0f), mPosY(0.0f), mPosZ(0.0f), mLifetimeLeft(-1), mLifetimePast(0), mFadeOut(0), mFadeIn(0), mAutoDelete(true), mMap(map), - mVectorX(0.0f), mVectorY(0.0f), mVectorZ(0.0f), mGravity(0.0f), mRandomnes(0), mBounce(0.0f), @@ -109,7 +107,7 @@ Particle::update() p++ ) { - (*p)->moveBy(mPosX, mPosY, mPosZ); + (*p)->moveBy(mPos.x, mPos.y, mPos.z); mChildParticles.push_back (*p); } } @@ -117,31 +115,28 @@ Particle::update() if (mMomentum != 1.0f) { - mVectorX *= mMomentum; - mVectorY *= mMomentum; - mVectorZ *= mMomentum; + mVelocity *= mMomentum; } if (mTarget && mAcceleration != 0.0f) { - float distX = (mPosX - mTarget->getPosX()) * SIN45; - float distY = mPosY - mTarget->getPosY(); - float distZ = mPosZ - mTarget->getPosZ(); + Vector dist = mPos - mTarget->getPosition(); + dist.x *= SIN45; float invHypotenuse; - switch(Particle::fastPhysics) + switch (Particle::fastPhysics) { case 1: invHypotenuse = fastInvSqrt( - distX * distX + distY * distY + distZ * distZ); + dist.x * dist.x + dist.y * dist.y + dist.z * dist.z); break; case 2: invHypotenuse = 2.0f / - fabs(distX) + fabs(distY) + fabs(distZ); + fabs(dist.x) + fabs(dist.y) + fabs(dist.z); break; default: invHypotenuse = 1.0f / sqrt( - distX * distX + distY * distY + distZ * distZ); + dist.x * dist.x + dist.y * dist.y + dist.z * dist.z); break; } @@ -152,25 +147,23 @@ Particle::update() mAlive = false; } float accFactor = invHypotenuse * mAcceleration; - mVectorX -= distX * accFactor; - mVectorY -= distY * accFactor; - mVectorZ -= distZ * accFactor; + mVelocity -= dist * accFactor; } } if (mRandomnes > 0) { - mVectorX += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; - mVectorY += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; - mVectorZ += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; + mVelocity.x += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; + mVelocity.y += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; + mVelocity.z += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; } - mVectorZ -= mGravity; + mVelocity.z -= mGravity; // Update position - mPosX += mVectorX; - mPosY += mVectorY * SIN45; - mPosZ += mVectorZ * SIN45; + mPos.x += mVelocity.x; + mPos.y += mVelocity.y * SIN45; + mPos.z += mVelocity.z * SIN45; // Update other stuff if (mLifetimeLeft > 0) @@ -179,14 +172,13 @@ Particle::update() } mLifetimePast++; - if (mPosZ > PARTICLE_SKY || mPosZ < 0.0f) + if (mPos.z > PARTICLE_SKY || mPos.z < 0.0f) { if (mBounce > 0.0f) { - mPosZ *= -mBounce; - mVectorX *= mBounce; - mVectorY *= mBounce; - mVectorZ *= -mBounce; + mPos.z *= -mBounce; + mVelocity *= mBounce; + mVelocity.z = -mVelocity.z; } else { mAlive = false; @@ -195,10 +187,8 @@ Particle::update() } // Update child particles - for ( ParticleIterator p = mChildParticles.begin(); - p != mChildParticles.end(); - - ) + for (ParticleIterator p = mChildParticles.begin(); + p != mChildParticles.end();) { if ((*p)->update()) { @@ -217,14 +207,9 @@ Particle::update() return true; } - -void Particle::draw(Graphics *graphics, int offsetX, int offsetY) const -{ -} - - Particle* -Particle::addEffect(std::string particleEffectFile, int pixelX, int pixelY) +Particle::addEffect(const std::string &particleEffectFile, + int pixelX, int pixelY) { Particle *newParticle = NULL; @@ -289,9 +274,9 @@ Particle::addEffect(std::string particleEffectFile, int pixelX, int pixelY) int offsetY = XML::getProperty(effectChildNode, "position-y", 0); int offsetZ = XML::getProperty(effectChildNode, "position-z", 0); - int particleX = (int)mPosX + pixelX + offsetX; - int particleY = (int)mPosY + pixelY + offsetY; - int particleZ = (int)mPosZ + offsetZ; + int particleX = (int) mPos.x + pixelX + offsetX; + int particleY = (int) mPos.y + pixelY + offsetY; + int particleZ = (int) mPos.z + offsetZ; int lifetime = XML::getProperty(effectChildNode, "lifetime", -1); @@ -317,17 +302,16 @@ Particle::addEffect(std::string particleEffectFile, int pixelX, int pixelY) Particle* -Particle::addTextSplashEffect(std::string text, +Particle::addTextSplashEffect(const std::string &text, int colorR, int colorG, int colorB, gcn::Font *font, int x, int y) { Particle *newParticle = new TextParticle(mMap, text, colorR, colorG, colorB, font); newParticle->setPosition(x, y, 0); - newParticle->setVector ( ((rand()%100) - 50) / 200.0f, // X vector - ((rand()%100) - 50) / 200.0f, // Y vector - ((rand()%100) / 200.0f) + 4.0f // Z vector - ); + newParticle->setVelocity(((rand() % 100) - 50) / 200.0f, // X + ((rand() % 100) - 50) / 200.0f, // Y + ((rand() % 100) / 200.0f) + 4.0f); // Z newParticle->setGravity(0.1f); newParticle->setBounce(0.5f); newParticle->setLifetime(200); @@ -338,14 +322,28 @@ Particle::addTextSplashEffect(std::string text, return newParticle; } +Particle* +Particle::addTextRiseFadeOutEffect(const std::string &text, gcn::Font *font, + int x, int y) +{ + Particle *newParticle = new TextParticle(mMap, text, 255, 255, 255, font); + newParticle->setPosition(x, y, 0); + newParticle->setVelocity(0.0f, 0.0f, 0.5f); + newParticle->setGravity(0.0015f); + newParticle->setLifetime(300); + newParticle->setFadeOut(50); + newParticle->setFadeIn(200); + + mChildParticles.push_back(newParticle); + + return newParticle; +} void Particle::setMap(Map *map) { mMap = map; if (mMap) setSpriteIterator(mMap->addSprite(this)); - - // TODO: Create map emitters based on emitter data in map data } diff --git a/src/particle.h b/src/particle.h index 9e9223c7..dd7c5ee2 100644 --- a/src/particle.h +++ b/src/particle.h @@ -31,7 +31,7 @@ #include "guichanfwd.h" #include "sprite.h" - +#include "vector.h" class Map; class Particle; @@ -67,43 +67,37 @@ class Particle : public Sprite ~Particle(); /** - * Deletes all child particles and emitters + * Deletes all child particles and emitters. */ void clear(); /** * Gives a particle the properties of an engine root particle and loads - * the particle-related config settings + * the particle-related config settings. */ void setupEngine(); /** * Updates particle position, returns false when the particle should - * be deleted + * be deleted. */ virtual bool update(); /** - * Draws the particle image + * Draws the particle image. */ virtual void - draw(Graphics *graphics, int offsetX, int offsetY) const; + draw(Graphics *graphics, int offsetX, int offsetY) const {} /** - * Necessary for sorting with the other sprites + * Necessary for sorting with the other sprites. */ virtual int getPixelY() const - { - return (int)(mPosY + mPosZ) - 64; - }; - - /* - Basic Particle properties: - */ + { return (int) (mPos.y + mPos.z) - 64; } /** * Sets the map the particle is on. @@ -115,15 +109,24 @@ class Particle : public Sprite * particleEffectFile. */ Particle* - addEffect(std::string particleEffectFile, int pixelX, int pixelY); + addEffect(const std::string &particleEffectFile, + int pixelX, int pixelY); /** * Creates a standalone text particle. */ Particle* - addTextSplashEffect(std::string text, int colorR, int colorG, int colorB, + addTextSplashEffect(const std::string &text, + int colorR, int colorG, int colorB, gcn::Font *font, int x, int y); + /** + * Creates a standalone text particle. + */ + Particle* + addTextRiseFadeOutEffect(const std::string &text, gcn::Font *font, + int x, int y); + /** * Adds an emitter to the particle. */ @@ -132,34 +135,31 @@ class Particle : public Sprite { mChildEmitters.push_back(emitter); } /** - * Sets the position in 3 dimensional space in pixels relative to map + * Sets the position in 3 dimensional space in pixels relative to map. */ void setPosition(float x, float y, float z) - { mPosX = x; mPosY = y; mPosZ = z; } + { mPos.x = x; mPos.y = y; mPos.z = z; } /** - * Sets the position in 2 dimensional space in pixels relative to map + * Sets the position in 2 dimensional space in pixels relative to map. */ void setPosition(float x, float y) - { mPosX = x; mPosY = y; } - - float getPosX() const - { return mPosX; } + { mPos.x = x; mPos.y = y; } - float getPosY() const - { return mPosY; } - - float getPosZ() const - { return mPosZ; } + /** + * Returns the particle position. + */ + const Vector& getPosition() const + { return mPos; } /** * Changes the particle position relative */ void moveBy(float x, float y, float z) - { mPosX += x; mPosY += y; mPosZ += z; } + { mPos.x += x; mPos.y += y; mPos.z += z; } /** * Sets the time in game ticks until the particle is destroyed. @@ -170,48 +170,48 @@ class Particle : public Sprite /** * Sets the age of the pixel in game ticks where the particle has - * faded in completely + * faded in completely. */ void - setFadeOut (int fadeOut) + setFadeOut(int fadeOut) { mFadeOut = fadeOut; } /** * Sets the remaining particle lifetime where the particle starts to - * fade out + * fade out. */ void - setFadeIn (int fadeIn) + setFadeIn(int fadeIn) { mFadeIn = fadeIn; } /** * Sets the sprite iterator of the particle on the current map to make - * it easier to remove the particle from the map when it is destroyed + * it easier to remove the particle from the map when it is destroyed. */ void setSpriteIterator(std::list::iterator spriteIterator) { mSpriteIterator = spriteIterator; } /** - * Gets the sprite iterator of the particle on the current map + * Gets the sprite iterator of the particle on the current map. */ std::list::iterator getSpriteIterator() const { return mSpriteIterator; } /** - * Sets the current velocity in 3 dimensional space + * Sets the current velocity in 3 dimensional space. */ void - setVector(float x, float y, float z) - { mVectorX = x; mVectorY = y; mVectorZ = z; } + setVelocity(float x, float y, float z) + { mVelocity.x = x; mVelocity.y = y; mVelocity.z = z; } /** - * Sets the downward acceleration + * Sets the downward acceleration. */ void - setGravity(float g) - { mGravity = g; } + setGravity(float gravity) + { mGravity = gravity; } /** * Sets the ammount of random vector changes @@ -237,8 +237,8 @@ class Particle : public Sprite /** * Sets the distance in pixel the particle can come near the target - * particle before it is destroyed. Does only make sense after a - * target particle has been set using setDestination. + * particle before it is destroyed. Does only make sense after a target + * particle has been set using setDestination. */ void setDieDistance(float dist) { mInvDieDistance = 1.0f / dist; } @@ -247,7 +247,7 @@ class Particle : public Sprite { return mAlive; } /** - * Manually marks the particle for deletion + * Manually marks the particle for deletion. */ void kill() { mAlive = false; mAutoDelete = true; } @@ -261,7 +261,7 @@ class Particle : public Sprite protected: bool mAlive; /**< Is the particle supposed to be drawn and updated?*/ - float mPosX, mPosY, mPosZ; /**< Position in 3 dimensonal space - pixel based relative to map */ + Vector mPos; /**< Position in pixels relative to map. */ int mLifetimeLeft; /**< Lifetime left in game ticks*/ int mLifetimePast; /**< Age of the particle in game ticks*/ int mFadeOut; /**< Lifetime in game ticks left where fading out begins*/ @@ -269,17 +269,19 @@ class Particle : public Sprite private: // generic properties - bool mAutoDelete; /**< May the particle request its deletion by the parent particle?*/ - Map *mMap; /**< Map the particle is on*/ + bool mAutoDelete; /**< May the particle request its deletion by the parent particle? */ + Map *mMap; /**< Map the particle is on. */ std::list::iterator mSpriteIterator; /**< iterator of the particle on the current map */ - Emitters mChildEmitters; /**< List of child emitters*/ - Particles mChildParticles; /**< List of particles controlled by this particle*/ - //dynamic particle - float mVectorX, mVectorY, mVectorZ; /**< Speed in 3 dimensional space in pixels per game-tick */ - float mGravity; /**< Downward acceleration in pixels per game-tick²*/ - int mRandomnes; /**< Ammount of random vector change*/ - float mBounce; /**< How much the particle bounces off when hitting the ground*/ - //follow-point particles + Emitters mChildEmitters; /**< List of child emitters. */ + Particles mChildParticles; /**< List of particles controlled by this particle */ + + // dynamic particle + Vector mVelocity; /**< Speed in pixels per game-tick. */ + float mGravity; /**< Downward acceleration in pixels per game-tick. */ + int mRandomnes; /**< Ammount of random vector change */ + float mBounce; /**< How much the particle bounces off when hitting the ground */ + + // follow-point particles Particle *mTarget; /**< The particle that attracts this particle*/ float mAcceleration; /**< Acceleration towards the target particle in pixels per game-tick²*/ float mInvDieDistance; /**< Distance in pixels from the target particle that causes the destruction of the particle*/ diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 60a98cc5..035882b6 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -248,10 +248,9 @@ ParticleEmitter::readMinMax(xmlNodePtr propertyNode, T def) { MinMax retval; - def = (T)XML::getFloatProperty(propertyNode, "value", (double)def); - retval.set ( (T)XML::getFloatProperty(propertyNode, "min", (double)def), - (T)XML::getFloatProperty(propertyNode, "max", (double)def) - ); + def = (T) XML::getFloatProperty(propertyNode, "value", (double) def); + retval.set((T) XML::getFloatProperty(propertyNode, "min", (double) def), + (T) XML::getFloatProperty(propertyNode, "max", (double) def)); return retval; } @@ -284,19 +283,17 @@ ParticleEmitter::createParticles() newParticle->setPosition( - mParticlePosX.value(), - mParticlePosY.value(), - mParticlePosZ.value() - ); + mParticlePosX.value(), + mParticlePosY.value(), + mParticlePosZ.value()); float angleH = mParticleAngleHorizontal.value(); float angleV = mParticleAngleVertical.value(); float power = mParticlePower.value(); - newParticle->setVector( - cos(angleH) * cos(angleV) * power, - sin(angleH) * cos(angleV) * power, - sin(angleV) * power - ); + newParticle->setVelocity( + cos(angleH) * cos(angleV) * power, + sin(angleH) * cos(angleV) * power, + sin(angleV) * power); newParticle->setRandomnes(mParticleRandomnes.value()); newParticle->setGravity(mParticleGravity.value()); @@ -312,10 +309,9 @@ ParticleEmitter::createParticles() newParticle->setFadeOut(mParticleFadeOut.value()); newParticle->setFadeIn(mParticleFadeIn.value()); - for ( std::list::iterator i = mParticleChildEmitters.begin(); - i != mParticleChildEmitters.end(); - i++ - ) + for (std::list::iterator i = mParticleChildEmitters.begin(); + i != mParticleChildEmitters.end(); + i++) { newParticle->addEmitter(new ParticleEmitter(*i)); } diff --git a/src/player.cpp b/src/player.cpp index d3c27aa0..b63dcd5b 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -28,7 +28,8 @@ #include "graphics.h" #include "log.h" -#include "resources/equipmentdb.h" +#include "resources/itemdb.h" +#include "resources/iteminfo.h" #include "utils/tostring.h" @@ -37,7 +38,6 @@ Player::Player(Uint16 id, Uint16 job, Map *map): Being(id, job, map) { - setWeapon(0); } Being::Type @@ -93,8 +93,8 @@ Player::setSex(Uint8 sex) if (i != HAIR_SPRITE && mEquipmentSpriteIDs.at(i) != 0) { AnimatedSprite *newEqSprite = new AnimatedSprite( - "graphics/sprites/" + EquipmentDB::get( - mEquipmentSpriteIDs.at(i))->getSprite(sex)); + "graphics/sprites/" + ItemDB::get( + mEquipmentSpriteIDs.at(i)).getSprite(sex)); delete mSprites[i]; mSprites[i] = newEqSprite; } @@ -102,39 +102,6 @@ Player::setSex(Uint8 sex) } } -void -Player::setWeapon(Uint16 weapon) -{ - if (weapon != mWeapon) - { - AnimatedSprite *newWeaponSprite = NULL; - - switch (weapon) - { - case 0: - newWeaponSprite = - new AnimatedSprite("graphics/sprites/weapon-fist.xml"); - break; - case 1: - newWeaponSprite = - new AnimatedSprite("graphics/sprites/weapon-dagger.xml"); - break; - case 2: - newWeaponSprite = - new AnimatedSprite("graphics/sprites/weapon-bow.xml"); - break; - case 3: - newWeaponSprite = - new AnimatedSprite("graphics/sprites/weapon-scythe.xml"); - break; - } - - delete mSprites[WEAPON_SPRITE]; - mSprites[WEAPON_SPRITE] = newWeaponSprite; - } - Being::setWeapon(weapon); -} - void Player::setHairColor(Uint16 color) { @@ -189,11 +156,11 @@ Player::setVisibleEquipment(Uint8 slot, int id) if (mSex == 0) { equipmentSprite = new AnimatedSprite( - "graphics/sprites/" + EquipmentDB::get(id)->getSprite(0)); + "graphics/sprites/" + ItemDB::get(id).getSprite(0)); } else { equipmentSprite = new AnimatedSprite( - "graphics/sprites/" + EquipmentDB::get(id)->getSprite(1)); + "graphics/sprites/" + ItemDB::get(id).getSprite(1)); } equipmentSprite->setDirection(getSpriteDirection()); @@ -201,6 +168,11 @@ Player::setVisibleEquipment(Uint8 slot, int id) delete mSprites[slot]; mSprites[slot] = equipmentSprite; + if (slot == WEAPON_SPRITE) + { + mEquippedWeapon = &ItemDB::get(id); + } + setAction(mAction); } diff --git a/src/player.h b/src/player.h index 8aa84992..2c06bfba 100644 --- a/src/player.h +++ b/src/player.h @@ -59,9 +59,6 @@ class Player : public Being virtual void setVisibleEquipment(Uint8 slot, int id); - - virtual void - setWeapon(Uint16 weapon); }; #endif diff --git a/src/resources/equipmentdb.cpp b/src/resources/equipmentdb.cpp deleted file mode 100644 index 38ac6415..00000000 --- a/src/resources/equipmentdb.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - * The Mana World - * Copyright 2006 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ - */ - -#include "equipmentdb.h" - -#include "resourcemanager.h" - -#include "../log.h" - -#include "../utils/dtor.h" -#include "../utils/xml.h" - -namespace -{ - EquipmentDB::EquipmentInfos mEquipmentInfos; - EquipmentInfo mUnknown; - bool mLoaded = false; -} - -void -EquipmentDB::load() -{ - if (mLoaded) - return; - - logger->log("Initializing equipment database..."); - mUnknown.setSprite("error.xml", 0); - mUnknown.setSprite("error.xml", 1); - - ResourceManager *resman = ResourceManager::getInstance(); - int size; - char *data = (char*)resman->loadFile("equipment.xml", size); - - if (!data) - { - logger->error("Equipment Database: Could not find equipment.xml!"); - } - - xmlDocPtr doc = xmlParseMemory(data, size); - free(data); - - if (!doc) - { - logger->error("Equipment Database: Error while parsing equipment database (equipment.xml)!"); - } - - xmlNodePtr rootNode = xmlDocGetRootElement(doc); - if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "equipments")) - { - logger->error("Equipment Database: equipment.xml is not a valid database file!"); - } - - //iterate s - for_each_xml_child_node(equipmentNode, rootNode) - { - if (!xmlStrEqual(equipmentNode->name, BAD_CAST "equipment")) - { - continue; - } - - EquipmentInfo *currentInfo = new EquipmentInfo(); - - currentInfo->setSlot (XML::getProperty(equipmentNode, "slot", 0)); - - //iterate s - for_each_xml_child_node(spriteNode, equipmentNode) - { - if (!xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) - { - continue; - } - - std::string gender = XML::getProperty(spriteNode, "gender", "unisex"); - std::string filename = (const char*) spriteNode->xmlChildrenNode->content; - - if (gender == "male" || gender == "unisex") - { - currentInfo->setSprite(filename, 0); - } - - if (gender == "female" || gender == "unisex") - { - currentInfo->setSprite(filename, 1); - } - } - - setEquipment( XML::getProperty(equipmentNode, "id", 0), - currentInfo); - } - - mLoaded = true; -} - -void -EquipmentDB::unload() -{ - // kill EquipmentInfos - for_each ( mEquipmentInfos.begin(), mEquipmentInfos.end(), - make_dtor(mEquipmentInfos)); - mEquipmentInfos.clear(); - - mLoaded = false; -} - -EquipmentInfo* -EquipmentDB::get(int id) -{ - if (!mLoaded) { - logger->error("Error: Equipment database used before initialization!"); - } - - EquipmentInfoIterator i = mEquipmentInfos.find(id); - - if (i == mEquipmentInfos.end() ) - { - logger->log("EquipmentDB: Error, unknown equipment ID# %d", id); - return &mUnknown; - } - else - { - return i->second; - } -} - -void -EquipmentDB::setEquipment(int id, EquipmentInfo* equipmentInfo) -{ - if (mEquipmentInfos.find(id) != mEquipmentInfos.end()) { - logger->log("Warning: Equipment Piece with ID %d defined multiple times", - id); - delete equipmentInfo; - } - else { - mEquipmentInfos[id] = equipmentInfo; - }; -} diff --git a/src/resources/equipmentdb.h b/src/resources/equipmentdb.h deleted file mode 100644 index 1c1db7d1..00000000 --- a/src/resources/equipmentdb.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The Mana World - * Copyright 2006 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ - */ - -#ifndef _TMW_EQUIPMENT_DB_H -#define _TMW_EQUIPMENT_DB_H - -#include - -#include "equipmentinfo.h" - -/** - * Equipment information database. - */ -namespace EquipmentDB -{ - /** - * Loads the equipment info from Items.xml - */ - void load(); - - /** - * Frees equipment data - */ - void unload(); - - void setEquipment(int id, EquipmentInfo* equipmentInfo); - - EquipmentInfo* get(int id); - - // Equipment database types - typedef std::map EquipmentInfos; - typedef EquipmentInfos::iterator EquipmentInfoIterator; -} - -#endif diff --git a/src/resources/equipmentinfo.h b/src/resources/equipmentinfo.h deleted file mode 100644 index 75ed1b8a..00000000 --- a/src/resources/equipmentinfo.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The Mana World - * Copyright 2006 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: - */ - -#ifndef _TMW_EQUIPMENTINFO_H_ -#define _TMW_EQUIPMENTINFO_H_ - -#include -#include - -class EquipmentInfo -{ - public: - EquipmentInfo(): - mSlot (0) - { - }; - - void - setSlot (int slot) { mSlot = slot; }; - - const std::string& - getSprite(int gender) {return animationFiles[gender]; }; - - void - setSprite(std::string animationFile, int gender) {animationFiles[gender] = animationFile; }; - - private: - int mSlot; //not used at the moment but maybe useful on our own server - std::map animationFiles; -}; - -#endif diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 7b16339c..18952ae9 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -18,9 +18,11 @@ * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: + * $Id$ */ +#include + #include "itemdb.h" #include @@ -36,10 +38,13 @@ namespace { ItemDB::ItemInfos mItemInfos; - ItemInfo mUnknown; + ItemInfo *mUnknown; bool mLoaded = false; } +// Forward declarations +static void loadSpriteRef(ItemInfo *itemInfo, xmlNodePtr node); +static void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node); void ItemDB::load() { @@ -47,11 +52,16 @@ void ItemDB::load() return; logger->log("Initializing item database..."); - mUnknown.setName("Unknown item"); + + mUnknown = new ItemInfo(); + mUnknown->setName("Unknown item"); + mUnknown->setImage(""); + mUnknown->setSprite("error.xml", 0); + mUnknown->setSprite("error.xml", 1); ResourceManager *resman = ResourceManager::getInstance(); int size; - char *data = (char*)resman->loadFile("items.xml", size); + char *data = (char*) resman->loadFile("items.xml", size); if (!data) { logger->error("ItemDB: Could not find items.xml!"); @@ -73,48 +83,66 @@ void ItemDB::load() for_each_xml_child_node(node, rootNode) { - if (!xmlStrEqual(node->name, BAD_CAST "item")) { + if (!xmlStrEqual(node->name, BAD_CAST "item")) continue; - } int id = XML::getProperty(node, "id", 0); - int art = XML::getProperty(node, "art", 0); + + if (id == 0) + { + logger->log("ItemDB: Invalid or missing item ID in items.xml!"); + continue; + } + else if (mItemInfos.find(id) != mItemInfos.end()) + { + logger->log("ItemDB: Redefinition of item ID %d", id); + } + int type = XML::getProperty(node, "type", 0); int weight = XML::getProperty(node, "weight", 0); + int view = XML::getProperty(node, "view", 0); int slot = XML::getProperty(node, "slot", 0); std::string name = XML::getProperty(node, "name", ""); std::string image = XML::getProperty(node, "image", ""); std::string description = XML::getProperty(node, "description", ""); std::string effect = XML::getProperty(node, "effect", ""); + std::string attackType = XML::getProperty(node, "attacktype", ""); - if (id && name != "") + if (id) { ItemInfo *itemInfo = new ItemInfo(); itemInfo->setImage(image); - itemInfo->setArt(art); - itemInfo->setName(name); + itemInfo->setName((name == "") ? "Unnamed" : name); itemInfo->setDescription(description); itemInfo->setEffect(effect); itemInfo->setType(type); + itemInfo->setView(view); itemInfo->setWeight(weight); itemInfo->setSlot(slot); - mItemInfos[id] = itemInfo; - } + itemInfo->setAttackType(attackType); + + for_each_xml_child_node(itemChild, node) + { + if (xmlStrEqual(itemChild->name, BAD_CAST "sprite")) + { + loadSpriteRef(itemInfo, itemChild); + } + else if (xmlStrEqual(itemChild->name, BAD_CAST "sound")) + { + loadSoundRef(itemInfo, itemChild); + } + } - if (id == 0) - { - logger->log("ItemDB: An item has no ID in items.xml!"); + mItemInfos[id] = itemInfo; } #define CHECK_PARAM(param, error_value) \ if (param == error_value) \ - logger->log("ItemDB: Missing" #param " parameter for item %i! %s", \ - id, name.c_str()) + logger->log("ItemDB: Missing " #param " attribute for item %i!",id) CHECK_PARAM(name, ""); CHECK_PARAM(image, ""); - // CHECK_PARAM(art, 0); // CHECK_PARAM(description, ""); // CHECK_PARAM(effect, ""); // CHECK_PARAM(type, 0); @@ -131,19 +159,65 @@ void ItemDB::load() void ItemDB::unload() { - for (ItemInfoIterator i = mItemInfos.begin(); i != mItemInfos.end(); i++) - { - delete i->second; - } - mItemInfos.clear(); + logger->log("Unloading item database..."); + + delete mUnknown; + mUnknown = NULL; + for_each(mItemInfos.begin(), mItemInfos.end(), make_dtor(mItemInfos)); + mItemInfos.clear(); mLoaded = false; } -const ItemInfo& -ItemDB::get(int id) +const ItemInfo& ItemDB::get(int id) { + assert(mLoaded); + ItemInfoIterator i = mItemInfos.find(id); - return (i != mItemInfos.end()) ? *(i->second) : mUnknown; + if (i == mItemInfos.end()) + { + logger->log("ItemDB: Error, unknown item ID# %d", id); + return *mUnknown; + } + else + { + return *(i->second); + } +} + +void loadSpriteRef(ItemInfo *itemInfo, xmlNodePtr node) +{ + std::string gender = XML::getProperty(node, "gender", "unisex"); + std::string filename = (const char*) node->xmlChildrenNode->content; + + if (gender == "male" || gender == "unisex") + { + itemInfo->setSprite(filename, 0); + } + + if (gender == "female" || gender == "unisex") + { + itemInfo->setSprite(filename, 1); + } +} + +void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node) +{ + std::string event = XML::getProperty(node, "event", ""); + std::string filename = (const char*) node->xmlChildrenNode->content; + + if (event == "hit") + { + itemInfo->addSound(EQUIP_EVENT_HIT, filename); + } + else if (event == "strike") + { + itemInfo->addSound(EQUIP_EVENT_STRIKE, filename); + } + else + { + logger->log("ItemDB: Ignoring unknown sound event '%s'", + event.c_str()); + } } diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 3a41c657..b5b25ac0 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -25,11 +25,11 @@ #include "resourcemanager.h" #include "image.h" - +#include "itemdb.h" ItemInfo::~ItemInfo() { - if (mImage != NULL) + if (mImage) { mImage->decRef(); } @@ -38,19 +38,87 @@ ItemInfo::~ItemInfo() void ItemInfo::setImage(const std::string &image) { + if (mImage) + { + mImage->decRef(); + } + + ResourceManager *resman = ResourceManager::getInstance(); mImageName = "graphics/items/" + image; + mImage = ResourceManager::getInstance()->getImage(mImageName); - if (mImageName != "") + if (!mImage) { - if (mImage != NULL) - { - mImage->decRef(); - } + mImage = resman->getImage("graphics/gui/unknown-item.png"); + } +} - mImage = ResourceManager::getInstance()->getImage(mImageName); +const std::string& +ItemInfo::getSprite(int gender) const +{ + if (mView) + { + // Forward the request to the item defining how to view this item + return ItemDB::get(mView).getSprite(gender); } else { - mImage = NULL; + static const std::string empty = ""; + std::map::const_iterator i = + mAnimationFiles.find(gender); + + return (i != mAnimationFiles.end()) ? i->second : empty; + } +} + +void +ItemInfo::setAttackType(const std::string &attackType) +{ + if (attackType == "swing") + { + mAttackType = ACTION_ATTACK_SWING; + } + else if (attackType == "stab") + { + mAttackType = ACTION_ATTACK_STAB; + } + else if (attackType == "bow") + { + mAttackType = ACTION_ATTACK_BOW; } + else if (attackType == "throw") + { + mAttackType = ACTION_ATTACK_THROW; + } + else if (attackType == "none") + { + mAttackType = ACTION_DEFAULT; + } + else + { + mAttackType = ACTION_ATTACK; + } +} + +void +ItemInfo::addSound(EquipmentSoundEvent event, const std::string &filename) +{ + if (mSounds.find(event) == mSounds.end()) + { + mSounds[event] = new std::vector; + } + + mSounds[event]->push_back("sfx/" + filename); +} + + +const std::string& +ItemInfo::getSound(EquipmentSoundEvent event) const +{ + static const std::string empty = ""; + std::map*>::const_iterator i; + i = mSounds.find(event); + + return (i == mSounds.end()) ? empty : + i->second->at(rand() % i->second->size()); } diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index e4f851bb..4fd1638e 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -24,12 +24,23 @@ #ifndef _TMW_ITEMINFO_H_ #define _TMW_ITEMINFO_H_ +#include #include +#include + +#include "spritedef.h" class Image; +enum EquipmentSoundEvent +{ + EQUIP_EVENT_STRIKE, + EQUIP_EVENT_HIT +}; + /** - * Defines a class for storing item infos. + * Defines a class for storing item infos. This includes information used when + * the item is equipped. */ class ItemInfo { @@ -40,10 +51,11 @@ class ItemInfo ItemInfo(): mImageName(""), mImage(NULL), - mArt(0), mType(0), mWeight(0), - mSlot(0) + mView(0), + mSlot(0), + mAttackType(ACTION_DEFAULT) { } @@ -52,73 +64,89 @@ class ItemInfo */ ~ItemInfo(); - void - setArt(short art) { mArt = art; } + void setName(const std::string &name) + { mName = name; } - short - getArt() const { return mArt; } + const std::string& getName() const + { return mName; } - void - setName(const std::string &name) { mName = name; } + void setImage(const std::string &image); - const std::string& - getName() const { return mName; } + Image* getImage() const + { return mImage; } - void - setImage(const std::string &image); + void setDescription(const std::string &description) + { mDescription = description; } - Image* - getImage() const { return mImage; } + const std::string& getDescription() const + { return mDescription; } - void - setDescription(const std::string &description) - { - mDescription = description; - } + void setEffect(const std::string &effect) + { mEffect = effect; } const std::string& - getDescription() const { return mDescription; } + getEffect() const { return mEffect; } - void - setEffect(const std::string &effect) { mEffect = effect; } + void setType(short type) + { mType = type; } - const std::string& - getEffect() const { return mEffect; } + short getType() const + { return mType; } + + void setWeight(short weight) + { mWeight = weight; } + + short getWeight() const + { return mWeight; } + + void setView(int view) + { mView = view; } + + void setSlot(char slot) + { mSlot = slot; } - void - setType(short type) { mType = type; } + char getSlot() const + { return mSlot; } - short - getType() const { return mType; } + void setSprite(const std::string &animationFile, int gender) + { mAnimationFiles[gender] = animationFile; } - void - setWeight(short weight) { mWeight = weight; } + const std::string& getSprite(int gender) const; - short - getWeight() const { return mWeight; } + void setAttackType(const std::string &attackType); - void - setSlot(char slot) { mSlot = slot; } + const SpriteAction getAttackType() const + { return mAttackType; } - char - getSlot() const { return mSlot; } + void addSound(EquipmentSoundEvent event, const std::string &filename); + + const std::string& getSound(EquipmentSoundEvent event) const; protected: - std::string mImageName; + std::string mImageName; /**< The filename of the icon image. */ /* TODO (BL): I do not think the item info should keep a reference to * the item icon. It would probably be better if this was kept in the * Item class, so that the images can be lazily instantiated and also * unloaded when no longer used. */ - Image *mImage; - short mArt; + Image *mImage; /**< The loaded icon image. */ std::string mName; - std::string mDescription; - std::string mEffect; - short mType; - short mWeight; - char mSlot; + std::string mDescription; /**< Short description. */ + std::string mEffect; /**< Description of effects. */ + short mType; /**< Item type (never used). */ + short mWeight; /**< Weight in grams. */ + int mView; /**< Item ID of how this item looks. */ + + // Equipment related members + char mSlot; /**< Equipment slot. */ + SpriteAction mAttackType; /**< Attack type, in case of weapon. */ + + /** Maps gender to sprite filenames. */ + std::map mAnimationFiles; + + /** Stores the names of sounds to be played at certain event. */ + std::map* > mSounds; }; #endif diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 260d5aa9..940ded36 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -156,7 +156,7 @@ MapReader::readMap(const std::string &filename) if (buffer == NULL) { - logger->log("Map file not found (%s)\n", filename.c_str()); + logger->log("Map file not found (%s)", filename.c_str()); return NULL; } diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 339ed6ba..f4864eea 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -120,19 +120,19 @@ MonsterDB::load() if (event == "hit") { - currentInfo->addSound(EVENT_HIT, filename); + currentInfo->addSound(MONSTER_EVENT_HIT, filename); } else if (event == "miss") { - currentInfo->addSound(EVENT_MISS, filename); + currentInfo->addSound(MONSTER_EVENT_MISS, filename); } else if (event == "hurt") { - currentInfo->addSound(EVENT_HURT, filename); + currentInfo->addSound(MONSTER_EVENT_HURT, filename); } else if (event == "die") { - currentInfo->addSound(EVENT_DIE, filename); + currentInfo->addSound(MONSTER_EVENT_DIE, filename); } else { diff --git a/src/resources/monsterinfo.cpp b/src/resources/monsterinfo.cpp index 2a59419e..2e896237 100644 --- a/src/resources/monsterinfo.cpp +++ b/src/resources/monsterinfo.cpp @@ -33,15 +33,15 @@ MonsterInfo::MonsterInfo(): MonsterInfo::~MonsterInfo() { - //kill vectors in mSoundEffects - for_each ( mSounds.begin(), mSounds.end(), - make_dtor(mSounds)); + // kill vectors in mSoundEffects + for_each (mSounds.begin(), mSounds.end(), + make_dtor(mSounds)); mSounds.clear(); } void -MonsterInfo::addSound (SoundEvent event, std::string filename) +MonsterInfo::addSound(MonsterSoundEvent event, std::string filename) { if (mSounds.find(event) == mSounds.end()) { @@ -53,9 +53,9 @@ MonsterInfo::addSound (SoundEvent event, std::string filename) std::string -MonsterInfo::getSound (SoundEvent event) const +MonsterInfo::getSound(MonsterSoundEvent event) const { - std::map* >::const_iterator i; + std::map* >::const_iterator i; i = mSounds.find(event); diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index aa7db9f0..c9fbd4c9 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -31,12 +31,12 @@ #include "../being.h" -enum SoundEvent +enum MonsterSoundEvent { - EVENT_HIT, - EVENT_MISS, - EVENT_HURT, - EVENT_DIE + MONSTER_EVENT_HIT, + MONSTER_EVENT_MISS, + MONSTER_EVENT_HURT, + MONSTER_EVENT_DIE }; /** @@ -69,7 +69,7 @@ class MonsterInfo { mTargetCursorSize = targetCursorSize; } void - addSound(SoundEvent event, std::string filename); + addSound(MonsterSoundEvent event, std::string filename); const std::string& getName () const { return mName; }; @@ -81,13 +81,13 @@ class MonsterInfo getTargetCursorSize() const { return mTargetCursorSize; } std::string - getSound (SoundEvent event) const; + getSound(MonsterSoundEvent event) const; private: std::string mName; std::string mSprite; Being::TargetCursorSize mTargetCursorSize; - std::map* > mSounds; + std::map* > mSounds; }; #endif diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 6d335b02..55d7f459 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -24,11 +24,11 @@ #ifndef _TMW_SPRITEDEF_H #define _TMW_SPRITEDEF_H -#include "resource.h" - #include #include +#include "resource.h" + #include class Action; diff --git a/src/textparticle.cpp b/src/textparticle.cpp index dd01d2fe..4bc859cd 100644 --- a/src/textparticle.cpp +++ b/src/textparticle.cpp @@ -26,7 +26,8 @@ #include "graphics.h" TextParticle::TextParticle(Map *map, const std::string &text, - int colorR, int colorG, int colorB, gcn::Font *font): + int colorR, int colorG, int colorB, + gcn::Font *font): Particle(map), mText(text), mTextFont(font), @@ -41,8 +42,8 @@ void TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const if (!mAlive) return; - int screenX = (int)mPosX + offsetX; - int screenY = (int)mPosY - int(mPosZ) + offsetY; + int screenX = (int) mPos.x + offsetX; + int screenY = (int) mPos.y - (int) mPos.z + offsetY; int alpha = 255; @@ -50,7 +51,7 @@ void TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const { alpha *= mLifetimeLeft; alpha /= mFadeOut; - }; + } if (mLifetimePast < mFadeIn) { @@ -59,6 +60,6 @@ void TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const } graphics->setFont(mTextFont); - graphics->setColor(gcn::Color (mColorR, mColorG, mColorB, alpha)); + graphics->setColor(gcn::Color(mColorR, mColorG, mColorB, alpha)); graphics->drawText(mText, screenX, screenY, gcn::Graphics::CENTER); } diff --git a/src/textparticle.h b/src/textparticle.h index b365c885..34badb57 100644 --- a/src/textparticle.h +++ b/src/textparticle.h @@ -33,21 +33,26 @@ class TextParticle : public Particle { public: + /** + * Constructor. + */ TextParticle(Map *map, const std::string &text, - int colorR, int colorG, int colorB, gcn::Font *font); + int colorR, int colorG, int colorB, + gcn::Font *font); /** - * Draws the particle image + * Draws the particle image. */ virtual void draw(Graphics *graphics, int offsetX, int offsetY) const; // hack to improve text visibility - virtual int getPixelY() const { return (int)(mPosY + mPosZ); } + virtual int getPixelY() const + { return (int) (mPos.y + mPos.z); } private: - std::string mText; /**< Text of the particle */ - gcn::Font *mTextFont; /**< Font used for drawing the text */ - int mColorR, mColorG, mColorB; /**< Color used for drawing the text */ + std::string mText; /**< Text of the particle. */ + gcn::Font *mTextFont; /**< Font used for drawing the text. */ + int mColorR, mColorG, mColorB; /**< Color used for drawing the text. */ }; #endif diff --git a/src/utils/fastsqrt.h b/src/utils/fastsqrt.h index 78768149..b7b036e9 100644 --- a/src/utils/fastsqrt.h +++ b/src/utils/fastsqrt.h @@ -5,6 +5,8 @@ * http://www.math.purdue.edu/~clomont/Math/Papers/2003/InvSqrt.pdf * * Unfortunately the original creator of this function seems to be unknown. + * + * $Id$ */ float fastInvSqrt(float x) diff --git a/src/utils/minmax.h b/src/utils/minmax.h index 27eb2565..ea6ad9e0 100644 --- a/src/utils/minmax.h +++ b/src/utils/minmax.h @@ -18,6 +18,7 @@ * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * $Id$ */ /** diff --git a/src/utils/trim.h b/src/utils/trim.h new file mode 100644 index 00000000..1b5311e6 --- /dev/null +++ b/src/utils/trim.h @@ -0,0 +1,53 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _TMW_UTILS_TRIM_H_ +#define _TMW_UTILS_TRIM_H_ + +#include + +/** + * Trims spaces off the end and the beginning of the given string. + * + * @param str the string to trim spaces off + */ +static void trim(std::string &str) +{ + std::string::size_type pos = str.find_last_not_of(' '); + if (pos != std::string::npos) + { + str.erase(pos + 1); + pos = str.find_first_not_of(' '); + if (pos != std::string::npos) + { + str.erase(0, pos); + } + } + else + { + // There is nothing else but whitespace in the string + str.clear(); + } +} + +#endif diff --git a/src/vector.h b/src/vector.h new file mode 100644 index 00000000..7a5da241 --- /dev/null +++ b/src/vector.h @@ -0,0 +1,134 @@ +/* + * The Mana World + * Copyright 2007 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _TMW_VECTOR_H_ +#define _TMW_VECTOR_H_ + +/** + * Vector class. Represents either a 3D point in space, a velocity or a force. + * Provides several convenient operator overloads. + */ +class Vector +{ + public: + /** + * Constructor. + */ + Vector(): + x(0.0f), + y(0.0f), + z(0.0f) + {} + + /** + * Constructor. + */ + Vector(float x, float y, float z): + x(x), + y(y), + z(z) + {} + + /** + * Copy constructor. + */ + Vector(const Vector &v): + x(v.x), + y(v.y), + z(v.z) + {} + + /** + * Scale vector operator. + */ + Vector operator*(float c) const + { + return Vector(x * c, + y * c, + z * c); + } + + /** + * In-place scale vector operator. + */ + void operator*=(float c) + { + x *= c; + y *= c; + z *= c; + } + + /** + * Scale vector operator. + */ + Vector operator/(float c) const + { + return Vector(x / c, + y / c, + z / c); + } + + /** + * Add vector operator. + */ + Vector operator+(const Vector &v) const + { + return Vector(x + v.x, + y + v.y, + z + v.z); + } + + /** + * In-place add vector operator. + */ + void operator+=(const Vector &v) + { + x += v.x; + y += v.y; + z += v.z; + } + + /** + * Substract vector operator. + */ + Vector operator-(const Vector &v) const + { + return Vector(x - v.x, + y - v.y, + z - v.z); + } + + /** + * In-place substract vector operator. + */ + void operator-=(const Vector &v) + { + x -= v.x; + y -= v.y; + z -= v.z; + } + + float x, y, z; +}; + +#endif diff --git a/tools/adler32.c b/tools/adler32.c new file mode 100644 index 00000000..4e851713 --- /dev/null +++ b/tools/adler32.c @@ -0,0 +1,67 @@ +/* + * adler32.c (c) 2006 Bjorn Lindeijer + * License: GPL, v2 or later + * + * Calculates Adler-32 checksums for all files passed as argument. + * + * Usage: adler32 [file]... + */ + +#include +#include + +/** + * Calculates the Adler-32 checksum for the given file. + */ +unsigned long fadler32(FILE *file) +{ + // Obtain file size + fseek(file, 0, SEEK_END); + long fileSize = ftell(file); + rewind(file); + + // Calculate Adler-32 checksum + char *buffer = (char*) malloc(fileSize); + fread(buffer, 1, fileSize, file); + unsigned long adler = adler32(0L, Z_NULL, 0); + adler = adler32(adler, (Bytef*) buffer, fileSize); + free(buffer); + + return adler; +} + +/** + * Prints out usage and exists. + */ +void print_usage() +{ + printf("Usage: adler32 [file]...\n"); + exit(0); +} + +int main(int argc, char *argv[]) +{ + int i; /**< Loops through arguments. */ + + if (argc == 1) + { + print_usage(); + } + + for (i = 1; i < argc; ++i) + { + FILE *file = fopen(argv[i], "r"); + + if (!file) + { + printf("Error while opening '%s' for reading!\n", argv[i]); + exit(1); + } + + unsigned long adler = fadler32(file); + printf("%s %lx\n", argv[i], adler); + fclose(file); + } + + return 0; +} -- cgit v1.2.3-60-g2f50 From 9cfafa755012bfd68c661996ddaea76e2e265f81 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Thu, 20 Sep 2007 20:31:24 +0000 Subject: Fixed some compilation warning. --- ChangeLog | 8 ++++++++ src/gui/browserbox.cpp | 4 ++-- src/gui/windowlistener.h | 4 ++-- src/net/chathandler.cpp | 1 - src/particle.cpp | 2 ++ src/particle.h | 3 +-- src/utils/trim.h | 2 +- 7 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src/particle.h') diff --git a/ChangeLog b/ChangeLog index d0e43d40..83d447bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-09-20 Guillaume Melquiond + + * src/gui/browserbox.cpp: Fixed missing const qualifier. + * src/gui/windowlistener.h: Reduced warning about unused parameter. + * src/particle.h, src/particle.cpp: Moved function out of header file. + * src/net/chathandler.cpp: Removed useless include. + * src/utils/trim.h: Fixed storage qualifier. + 2007-09-16 Guillaume Melquiond * src/gui/button.cpp: Fixed improper const qualifier. diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index c618fa69..717342de 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -140,7 +140,7 @@ void BrowserBox::addRow(const std::string &row) { unsigned int i, j, y = 0; unsigned int nextChar; - char *hyphen = "~"; + char const *hyphen = "~"; int hyphenWidth = font->getWidth(hyphen); int x = 0; for (i = 0; i < mTextRows.size(); i++) @@ -362,7 +362,7 @@ BrowserBox::draw(gcn::Graphics *graphics) if (mMode == AUTO_WRAP) { unsigned int nextChar = j + 1; - char *hyphen = "~"; + char const *hyphen = "~"; int hyphenWidth = font->getWidth(hyphen); // Wraping between words (at blank spaces) diff --git a/src/gui/windowlistener.h b/src/gui/windowlistener.h index 08aab71d..24f6a7b8 100644 --- a/src/gui/windowlistener.h +++ b/src/gui/windowlistener.h @@ -73,12 +73,12 @@ class WindowListener /** * Called whenever the window is moved. */ - virtual void windowMoved(const WindowEvent &event) {} + virtual void windowMoved(const WindowEvent &) {} /** * Called whenever the window is resized. */ - virtual void windowResized(const WindowEvent &event) {} + virtual void windowResized(const WindowEvent &) {} }; typedef std::list WindowListeners; diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp index afdc2ab5..713b8f22 100644 --- a/src/net/chathandler.cpp +++ b/src/net/chathandler.cpp @@ -37,7 +37,6 @@ #include "../gui/chat.h" #include "../utils/tostring.h" -#include "../utils/trim.h" extern Being *player_node; diff --git a/src/particle.cpp b/src/particle.cpp index 148bbf6f..cdd6af41 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -81,6 +81,8 @@ Particle::setupEngine() logger->log("Particle engine set up"); } +void Particle::draw(Graphics *, int, int) const {} + bool Particle::update() { diff --git a/src/particle.h b/src/particle.h index dd7c5ee2..045ab9b9 100644 --- a/src/particle.h +++ b/src/particle.h @@ -89,8 +89,7 @@ class Particle : public Sprite /** * Draws the particle image. */ - virtual void - draw(Graphics *graphics, int offsetX, int offsetY) const {} + virtual void draw(Graphics *graphics, int offsetX, int offsetY) const; /** * Necessary for sorting with the other sprites. diff --git a/src/utils/trim.h b/src/utils/trim.h index 1b5311e6..fec99100 100644 --- a/src/utils/trim.h +++ b/src/utils/trim.h @@ -31,7 +31,7 @@ * * @param str the string to trim spaces off */ -static void trim(std::string &str) +inline void trim(std::string &str) { std::string::size_type pos = str.find_last_not_of(' '); if (pos != std::string::npos) -- cgit v1.2.3-60-g2f50 From 5ff0cd265460ef3fcc30f663094dc2c99b9926e9 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Mon, 28 Jan 2008 07:57:49 +0000 Subject: Added weapon skill system and leveling system. --- ChangeLog | 19 ++++++ src/CMakeLists.txt | 2 - src/Makefile.am | 2 - src/game.cpp | 3 - src/game.h | 1 - src/gui/skill.cpp | 125 ++++++++++++------------------------- src/gui/skill.h | 21 ++----- src/gui/status.cpp | 139 ++++++++++++++++++++++++++---------------- src/gui/status.h | 7 ++- src/localplayer.cpp | 66 +++++++++++++++----- src/localplayer.h | 88 +++++++++++++++++--------- src/net/charserverhandler.cpp | 4 +- src/net/gameserver/player.cpp | 14 +++++ src/net/gameserver/player.h | 2 + src/net/playerhandler.cpp | 128 ++++++++++++++++++++++++++++++++++++++ src/net/protocol.h | 16 ++++- src/net/skillhandler.cpp | 93 ---------------------------- src/net/skillhandler.h | 37 ----------- src/particle.cpp | 6 +- src/particle.h | 4 +- src/resources/itemdb.cpp | 6 +- src/resources/iteminfo.cpp | 2 +- src/resources/iteminfo.h | 23 +++---- 23 files changed, 448 insertions(+), 360 deletions(-) delete mode 100644 src/net/skillhandler.cpp delete mode 100644 src/net/skillhandler.h (limited to 'src/particle.h') diff --git a/ChangeLog b/ChangeLog index 9286fb40..83b8ffac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2007-01-28 Philipp Sehmisch + + * src/game.cpp, src/game.h, src/net/skillhandler.cpp, + src/net/skillhandler.h, src/Makefile.am, src/CMakeLists.txt: + Removed skill handler (relict from eAthena) + * src/gui/skill.cpp, src/gui/skill.h: Implemented provisorical + dialog for viewing skill experience and skill levels. + * src/gui/status.cpp, src/gui/status.h: Implemented raising and + correcting of attributes in the character status GUI. + * src/localplayer.cpp, src/localplayer.h, + src/net/charserverhandler.cpp, src/net/gameserver/player.cpp, + src/net/gameserver/player.h, src/net/playerhandler.cpp, + src/net/protocol.h: Implemented netcode for skill system and + attribute increase system. + * src/resources/itemdp.cpp, src/resources/iteminfo.cpp, + src/resources/iteminfo.h: Updated skill palette to the latest + design decisions. + * data/items.xml: Fixed a few messed up slot numbers. + 2008-01-26 Bjørn Lindeijer * src/gui/truetypefont.cpp: Image alpha should also be set to 1, in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6606c33..4d774f1b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -226,8 +226,6 @@ SET(SRCS net/playerhandler.cpp net/playerhandler.h net/protocol.h - net/skillhandler.cpp - net/skillhandler.h net/tradehandler.cpp net/tradehandler.h net/accountserver/account.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 31c17edb..a3a7bc1b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -178,8 +178,6 @@ tmw_SOURCES = gui/widgets/dropdown.cpp \ net/playerhandler.cpp \ net/playerhandler.h \ net/protocol.h \ - net/skillhandler.cpp \ - net/skillhandler.h \ net/tradehandler.cpp \ net/tradehandler.h \ net/accountserver/account.cpp \ diff --git a/src/game.cpp b/src/game.cpp index 4bf42a2d..1ad99268 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -77,7 +77,6 @@ #include "net/network.h" #include "net/npchandler.h" #include "net/playerhandler.h" -#include "net/skillhandler.h" #include "net/tradehandler.h" #include "resources/imagewriter.h" @@ -236,7 +235,6 @@ Game::Game(): mItemHandler(new ItemHandler()), mNpcHandler(new NPCHandler()), mPlayerHandler(new PlayerHandler()), - mSkillHandler(new SkillHandler()), mTradeHandler(new TradeHandler()), mLogicCounterId(0), mSecondsCounterId(0) { @@ -279,7 +277,6 @@ Game::Game(): Net::registerHandler(mItemHandler.get()); Net::registerHandler(mNpcHandler.get()); Net::registerHandler(mPlayerHandler.get()); - Net::registerHandler(mSkillHandler.get()); Net::registerHandler(mTradeHandler.get()); } diff --git a/src/game.h b/src/game.h index d1b438bd..fc7e33df 100644 --- a/src/game.h +++ b/src/game.h @@ -67,7 +67,6 @@ class Game : public ConfigListener MessageHandlerPtr mItemHandler; MessageHandlerPtr mNpcHandler; MessageHandlerPtr mPlayerHandler; - MessageHandlerPtr mSkillHandler; MessageHandlerPtr mTradeHandler; SDL_TimerID mLogicCounterId; diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index c553863f..8c47c4ad 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -24,6 +24,7 @@ #include #include +#include #include "skill.h" @@ -35,32 +36,8 @@ #include "../localplayer.h" #include "../utils/dtor.h" - -const char *skill_db[] = { - // 0-99 - "", "Basic", "Sword", "Two hand", "HP regeneration", "Bash", "Provoke", "Magnum", "Endure", "MP regeneration", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "MAX weight", "Discount", "Overcharge", "", - "Identify", "", "", "", "", "", "", "", "Double", "Miss", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - // 100-199 - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "First aid", "Play as dead", "Moving recovery", "Fatal blow", "Auto berserk", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", -}; - +#include "../utils/toString.h" +#include "../utils/gettext.h" SkillDialog::SkillDialog(): Window("Skills") @@ -68,25 +45,32 @@ SkillDialog::SkillDialog(): setCloseButton(true); setDefaultSize(windowContainer->getWidth() - 255, 25, 240, 240); - mSkillListBox = new ListBox(this); - ScrollArea *skillScrollArea = new ScrollArea(mSkillListBox); - - mSkillListBox->setActionEventId("skill"); - - skillScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - skillScrollArea->setDimension(gcn::Rectangle(5, 5, 230, 180)); + mSkillNameLabels.resize(CHAR_SKILL_NB); + mSkillLevelLabels.resize(CHAR_SKILL_NB); + mSkillExpLabels.resize(CHAR_SKILL_NB); - add(skillScrollArea); + for (int a=0; a < CHAR_SKILL_NB; a++) + { + mSkillNameLabels.at(a) = new gcn::Label(""); + mSkillNameLabels.at(a)->setPosition(1, a*10); + add(mSkillNameLabels.at(a)); + mSkillLevelLabels.at(a) = new gcn::Label(""); + mSkillLevelLabels.at(a)->setPosition(75, a*10); + add(mSkillLevelLabels.at(a)); + mSkillExpLabels.at(a) = new gcn::Label(""); + mSkillExpLabels.at(a)->setPosition(150, a*10); + add(mSkillExpLabels.at(a)); + } - mSkillListBox->addActionListener(this); + update(); setLocationRelativeTo(getParent()); - loadWindowState("Skills"); + loadWindowState(_("Skills")); } SkillDialog::~SkillDialog() { - cleanList(); + } void SkillDialog::action(const gcn::ActionEvent &event) @@ -100,60 +84,29 @@ void SkillDialog::action(const gcn::ActionEvent &event) } } -void SkillDialog::update() +void SkillDialog::draw(gcn::Graphics *g) { -} + update(); -int SkillDialog::getNumberOfElements() -{ - return mSkillList.size(); + Window::draw(g); } -std::string SkillDialog::getElementAt(int i) +void SkillDialog::update() { - if (i >= 0 && i < (int)mSkillList.size()) + for (int a = 0; a < CHAR_SKILL_NB; a++) { - char tmp[128]; - sprintf(tmp, "%s Lv: %i Sp: %i", - skill_db[mSkillList[i]->id], - mSkillList[i]->lv, - mSkillList[i]->sp); - return tmp; + int baseLevel = player_node->getAttributeBase(a + CHAR_SKILL_BEGIN); + int effLevel = player_node->getAttributeEffective(a + CHAR_SKILL_BEGIN); + std::string skillLevel("Lvl:" + toString(effLevel) + " / " + toString(baseLevel)); + + std::pair exp = player_node->getExperience(a); + std::string sExp (toString(exp.first) + " / " + toString(exp.second)); + + mSkillNameLabels.at(a)->setCaption("Skill" + toString(a)); + mSkillNameLabels.at(a)->adjustSize(); + mSkillLevelLabels.at(a)->setCaption(skillLevel); + mSkillLevelLabels.at(a)->adjustSize(); + mSkillExpLabels.at(a)->setCaption(sExp); + mSkillExpLabels.at(a)->adjustSize(); } - return ""; -} - -bool SkillDialog::hasSkill(int id) -{ - for (unsigned int i = 0; i < mSkillList.size(); i++) { - if (mSkillList[i]->id == id) { - return true; - } - } - return false; -} - -void SkillDialog::addSkill(int id, int lvl, int mp) -{ - SKILL *tmp = new SKILL(); - tmp->id = id; - tmp->lv = lvl; - tmp->sp = mp; - mSkillList.push_back(tmp); -} - -void SkillDialog::setSkill(int id, int lvl, int mp) -{ - for (unsigned int i = 0; i < mSkillList.size(); i++) { - if (mSkillList[i]->id == id) { - mSkillList[i]->lv = lvl; - mSkillList[i]->sp = mp; - } - } -} - -void SkillDialog::cleanList() -{ - for_each(mSkillList.begin(), mSkillList.end(), make_dtor(mSkillList)); - mSkillList.clear(); } diff --git a/src/gui/skill.h b/src/gui/skill.h index f1a14d50..55d94d82 100644 --- a/src/gui/skill.h +++ b/src/gui/skill.h @@ -33,18 +33,13 @@ #include "../guichanfwd.h" -struct SKILL { - short id; /**< Index into "skill_db" array */ - short lv, sp; -}; /** * The skill dialog. * * \ingroup Interface */ -class SkillDialog : public Window, public gcn::ActionListener, - public gcn::ListModel +class SkillDialog : public Window, public gcn::ActionListener { public: /** @@ -61,18 +56,14 @@ class SkillDialog : public Window, public gcn::ActionListener, void update(); - int getNumberOfElements(); - std::string getElementAt(int); + void setExp(int id, int exp); - bool hasSkill(int id); - void addSkill(int id, int lv, int sp); - void setSkill(int id, int lv, int sp); - void cleanList(); + void draw(gcn::Graphics *g); private: - gcn::ListBox *mSkillListBox; - - std::vector mSkillList; + std::vector mSkillNameLabels; + std::vector mSkillLevelLabels; + std::vector mSkillExpLabels; }; extern SkillDialog *skillDialog; diff --git a/src/gui/status.cpp b/src/gui/status.cpp index b0a92665..b9ebfecf 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -87,7 +87,6 @@ StatusWindow::StatusWindow(LocalPlayer *player): // Static Labels gcn::Label *mStatsTitleLabel = new gcn::Label("Stats"); gcn::Label *mStatsTotalLabel = new gcn::Label("Total"); - gcn::Label *mStatsCostLabel = new gcn::Label("Cost"); // Derived Stats /* @@ -111,37 +110,44 @@ StatusWindow::StatusWindow(LocalPlayer *player): for (int i = 0; i < 6; i++) { mStatsLabel[i] = new gcn::Label(); mStatsDisplayLabel[i] = new gcn::Label(); - mPointsLabel[i] = new gcn::Label("0"); } - mRemainingStatsPointsLabel = new gcn::Label(); + mCharacterPointsLabel = new gcn::Label(); + mCorrectionPointsLabel = new gcn::Label(); // Set button events Id - mStatsButton[0] = new Button("+", "STR", this); - mStatsButton[1] = new Button("+", "AGI", this); - mStatsButton[2] = new Button("+", "DEX", this); - mStatsButton[3] = new Button("+", "VIT", this); - mStatsButton[4] = new Button("+", "INT", this); - mStatsButton[5] = new Button("+", "WIL", this); - mStatsButton[6] = new Button("+", "CHR", this); + mStatsPlus[0] = new Button("+", "STR+", this); + mStatsPlus[1] = new Button("+", "AGI+", this); + mStatsPlus[2] = new Button("+", "DEX+", this); + mStatsPlus[3] = new Button("+", "VIT+", this); + mStatsPlus[4] = new Button("+", "INT+", this); + mStatsPlus[5] = new Button("+", "WIL+", this); + + mStatsMinus[0] = new Button("-", "STR-", this); + mStatsMinus[1] = new Button("-", "AGI-", this); + mStatsMinus[2] = new Button("-", "DEX-", this); + mStatsMinus[3] = new Button("-", "VIT-", this); + mStatsMinus[4] = new Button("-", "INT-", this); + mStatsMinus[5] = new Button("-", "WIL-", this); + // Set position mStatsTitleLabel->setPosition(mHpLabel->getX(), mHpLabel->getY() + 23 ); mStatsTotalLabel->setPosition(110, mStatsTitleLabel->getY() + 15); int totalLabelY = mStatsTotalLabel->getY(); - mStatsCostLabel->setPosition(170, totalLabelY); for (int i = 0; i < 6; i++) { mStatsLabel[i]->setPosition(5, mStatsTotalLabel->getY() + (i * 23) + 15); - mStatsDisplayLabel[i]->setPosition(85, + mStatsMinus[i]->setPosition(85, totalLabelY + (i * 23) + 15); + mStatsDisplayLabel[i]->setPosition(125, totalLabelY + (i * 23) + 15); - mStatsButton[i]->setPosition(145, totalLabelY + (i * 23) + 10); - mPointsLabel[i]->setPosition(165, totalLabelY + (i * 23) + 15); + mStatsPlus[i]->setPosition(185, totalLabelY + (i * 23) + 15); } - mRemainingStatsPointsLabel->setPosition(5, mPointsLabel[6]->getY() + 25); + mCharacterPointsLabel->setPosition(5, mStatsDisplayLabel[5]->getY() + 25); + mCorrectionPointsLabel->setPosition(5, mStatsDisplayLabel[5]->getY() + 35); /* mStatsAttackLabel->setPosition(220, mStatsLabel[0]->getY()); mStatsDefenseLabel->setPosition(220, mStatsLabel[1]->getY()); @@ -162,13 +168,12 @@ StatusWindow::StatusWindow(LocalPlayer *player): // Assemble add(mStatsTitleLabel); add(mStatsTotalLabel); - add(mStatsCostLabel); for(int i = 0; i < 6; i++) { add(mStatsLabel[i]); add(mStatsDisplayLabel[i]); - add(mStatsButton[i]); - add(mPointsLabel[i]); + add(mStatsPlus[i]); + add(mStatsMinus[i]); }/* add(mStatsAttackLabel); add(mStatsDefenseLabel); @@ -186,14 +191,19 @@ StatusWindow::StatusWindow(LocalPlayer *player): add(mStatsEvadePoints); add(mStatsReflexPoints);*/ - add(mRemainingStatsPointsLabel); + add(mCharacterPointsLabel); + add(mCorrectionPointsLabel); } void StatusWindow::update() { // Status Part // ----------- - mLvlLabel->setCaption("Level: " + toString(mPlayer->getLevel())); + mLvlLabel->setCaption( "Level: " + + toString(mPlayer->getLevel()) + + " (" + + toString(mPlayer->getLevelProgress()) + + "%)"); mLvlLabel->adjustSize(); mMoneyLabel->setCaption("Money: " + toString(mPlayer->getMoney()) + " GP"); @@ -232,8 +242,8 @@ void StatusWindow::update() "Intelligence", "Willpower" }; - int statusPoints = mPlayer->getAttributeIncreasePoints(); - + int characterPoints = mPlayer->getCharacterPoints(); + int correctionPoints = mPlayer->getCorrectionPoints(); // Update labels for (int i = 0; i < 6; i++) { @@ -246,11 +256,16 @@ void StatusWindow::update() mStatsLabel[i]->adjustSize(); mStatsDisplayLabel[i]->adjustSize(); - mStatsButton[i]->setEnabled(statusPoints); + mStatsPlus[i]->setEnabled(characterPoints); + mStatsMinus[i]->setEnabled(correctionPoints); } - mRemainingStatsPointsLabel->setCaption("Remaining Status Points: " + - toString(statusPoints)); - mRemainingStatsPointsLabel->adjustSize(); + mCharacterPointsLabel->setCaption("Character Points: " + + toString(characterPoints)); + mCharacterPointsLabel->adjustSize(); + + mCorrectionPointsLabel->setCaption("Correction Points: " + + toString(correctionPoints)); + mCorrectionPointsLabel->adjustSize(); /* // Derived Stats Points @@ -304,31 +319,53 @@ void StatusWindow::action(const gcn::ActionEvent &event) const std::string &eventId = event.getId(); // Stats Part - if (eventId.length() == 3) + if (eventId == "STR+") + { + mPlayer->raiseAttribute(LocalPlayer::STR); + } + else if (eventId == "AGI+") + { + mPlayer->raiseAttribute(LocalPlayer::AGI); + } + else if (eventId == "DEX+") + { + mPlayer->raiseAttribute(LocalPlayer::DEX); + } + else if (eventId == "VIT+") + { + mPlayer->raiseAttribute(LocalPlayer::VIT); + } + else if (eventId == "INT+") + { + mPlayer->raiseAttribute(LocalPlayer::INT); + } + else if (eventId == "WIL+") + { + mPlayer->raiseAttribute(LocalPlayer::WIL); + } + + else if (eventId == "STR-") + { + mPlayer->lowerAttribute(LocalPlayer::STR); + } + else if (eventId == "AGI-") + { + mPlayer->lowerAttribute(LocalPlayer::AGI); + } + else if (eventId == "DEX-") + { + mPlayer->lowerAttribute(LocalPlayer::DEX); + } + else if (eventId == "VIT-") + { + mPlayer->lowerAttribute(LocalPlayer::VIT); + } + else if (eventId == "INT-") + { + mPlayer->lowerAttribute(LocalPlayer::INT); + } + else if (eventId == "WIL-") { - if (eventId == "STR") - { - mPlayer->raiseAttribute(LocalPlayer::STR); - } - else if (eventId == "AGI") - { - mPlayer->raiseAttribute(LocalPlayer::AGI); - } - else if (eventId == "DEX") - { - mPlayer->raiseAttribute(LocalPlayer::DEX); - } - else if (eventId == "VIT") - { - mPlayer->raiseAttribute(LocalPlayer::VIT); - } - else if (eventId == "INT") - { - mPlayer->raiseAttribute(LocalPlayer::INT); - } - else if (eventId == "WIL") - { - mPlayer->raiseAttribute(LocalPlayer::WIL); - } + mPlayer->lowerAttribute(LocalPlayer::WIL); } } diff --git a/src/gui/status.h b/src/gui/status.h index f3475263..6e613495 100644 --- a/src/gui/status.h +++ b/src/gui/status.h @@ -91,14 +91,15 @@ class StatusWindow : public Window, public gcn::ActionListener * Stats captions. */ gcn::Label *mStatsLabel[6]; - gcn::Label *mPointsLabel[6]; gcn::Label *mStatsDisplayLabel[6]; - gcn::Label *mRemainingStatsPointsLabel; + gcn::Label *mCharacterPointsLabel; + gcn::Label *mCorrectionPointsLabel; /** * Stats buttons. */ - gcn::Button *mStatsButton[6]; + gcn::Button *mStatsPlus[6]; + gcn::Button *mStatsMinus[6]; }; extern StatusWindow *statusWindow; diff --git a/src/localplayer.cpp b/src/localplayer.cpp index d01b613e..12de3de4 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -49,17 +49,21 @@ LocalPlayer::LocalPlayer(): mAttackRange(0), mInventory(new Inventory), mEquipment(new Equipment), - mAttributeBase(NB_CHARACTER_ATTRIBUTES, 0), - mAttributeEffective(NB_CHARACTER_ATTRIBUTES, 0), - mAttributeIncreasePoints(0), - mLevel(1), mMoney(0), + mAttributeBase(NB_CHARACTER_ATTRIBUTES, -1), + mAttributeEffective(NB_CHARACTER_ATTRIBUTES, -1), + mExpCurrent(CHAR_SKILL_NB, -1), + mExpNext(CHAR_SKILL_NB, -1), + mCharacterPoints(-1), + mCorrectionPoints(-1), + mLevel(1), mLevelProgress(0), + mMoney(0), mTotalWeight(1), mMaxWeight(1), mHP(1), mMaxHP(1), - mXp(0), mTarget(NULL), mPickUpTarget(NULL), mTrading(false), mLastAction(-1), mWalkingDir(0), - mDestX(0), mDestY(0) + mDestX(0), mDestY(0), + mExpMessageTime(0) { } @@ -74,6 +78,21 @@ void LocalPlayer::logic() mLastAction = -1; } + // Show XP messages + if(!mExpMessages.empty()) + { + if (mExpMessageTime == 0) + { + particleEngine->addTextRiseFadeOutEffect(mExpMessages.front(), + 0, 128, 255, + speechFont, + mPx + 16, mPy - 16); + mExpMessages.pop_front(); + mExpMessageTime = 30; + } + mExpMessageTime--; + } + Being::logic(); } @@ -326,7 +345,6 @@ void LocalPlayer::attack() else { sound.playSfx("sfx/fist-swish.ogg"); } - Net::GameServer::Player::attack(getSpriteDirection()); } @@ -346,19 +364,35 @@ void LocalPlayer::revive() void LocalPlayer::raiseAttribute(size_t attr) { + // we assume that the server allows the change. When not we will undo it later. + mCharacterPoints--; mAttributeBase.at(attr)++; - // TODO: Inform the server about our desire to raise the attribute + Net::GameServer::Player::raiseAttribute(attr + CHAR_ATTR_BEGIN); } -void LocalPlayer::setXp(int xp) +void LocalPlayer::lowerAttribute(size_t attr) { - if (mMap && xp > mXp) - { - const std::string text = toString(xp - mXp) + " xp"; + // we assume that the server allows the change. When not we will undo it later. + mCorrectionPoints--; + mCharacterPoints++; + mAttributeBase.at(attr)--; + Net::GameServer::Player::lowerAttribute(attr + CHAR_ATTR_BEGIN); +} - // Show XP number - particleEngine->addTextRiseFadeOutEffect(text, hitYellowFont, - mPx + 16, mPy - 16); +void LocalPlayer::setExperience(int skill, int current, int next) +{ + int diff = current - mExpCurrent.at(skill); + if (mMap && mExpCurrent.at(skill) != -1 && diff > 0) + { + const std::string text = toString(diff) + " xp skill" + toString(skill); + mExpMessages.push_back(text); } - mXp = xp; + + mExpCurrent.at(skill) = current; + mExpNext.at(skill) = next; +} + +std::pair LocalPlayer::getExperience(int skill) +{ + return std::pair (mExpCurrent.at(skill), mExpNext.at(skill)); } diff --git a/src/localplayer.h b/src/localplayer.h index 9deb2475..fca6f993 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -82,30 +82,39 @@ enum CHAR_ATTR_END, CHAR_ATTR_NB = CHAR_ATTR_END - CHAR_ATTR_BEGIN, - CHAR_SKILL_WEAPON_BEGIN = CHAR_ATTR_END, + CHAR_SKILL_BEGIN = CHAR_ATTR_END, + + CHAR_SKILL_WEAPON_BEGIN = CHAR_SKILL_BEGIN, CHAR_SKILL_WEAPON_NONE = CHAR_SKILL_WEAPON_BEGIN, CHAR_SKILL_WEAPON_KNIFE, CHAR_SKILL_WEAPON_SWORD, - CHAR_SKILL_WEAPON_SPEAR, - CHAR_SKILL_WEAPON_JAVELIN, - CHAR_SKILL_WEAPON_ROD, + CHAR_SKILL_WEAPON_POLEARM, CHAR_SKILL_WEAPON_STAFF, CHAR_SKILL_WEAPON_WHIP, - CHAR_SKILL_WEAPON_PROJECTILE, - CHAR_SKILL_WEAPON_BOOMERANG, CHAR_SKILL_WEAPON_BOW, - CHAR_SKILL_WEAPON_SICKLE, - CHAR_SKILL_WEAPON_CROSSBOW, - CHAR_SKILL_WEAPON_STICK, - CHAR_SKILL_WEAPON_HAMMER, + CHAR_SKILL_WEAPON_SHOOTING, + CHAR_SKILL_WEAPON_MACE, CHAR_SKILL_WEAPON_AXE, - CHAR_SKILL_WEAPON_HAND_PROJECTILE, + CHAR_SKILL_WEAPON_THROWN, CHAR_SKILL_WEAPON_END, CHAR_SKILL_WEAPON_NB = CHAR_SKILL_WEAPON_END - CHAR_SKILL_WEAPON_BEGIN, - // Magic skills should follow. + CHAR_SKILL_MAGIC_BEGIN = CHAR_SKILL_WEAPON_END, + CHAR_SKILL_MAGIC_IAMJUSTAPLACEHOLDER = CHAR_SKILL_MAGIC_BEGIN, + // add magic skills here + CHAR_SKILL_MAGIC_END, + CHAR_SKILL_MAGIC_NB = CHAR_SKILL_MAGIC_END - CHAR_SKILL_MAGIC_BEGIN, + + CHAR_SKILL_CRAFT_BEGIN = CHAR_SKILL_MAGIC_END, + CHAR_SKILL_CRAFT_IAMJUSTAPLACEHOLDER = CHAR_SKILL_CRAFT_BEGIN, + // add crafting skills here + CHAR_SKILL_CRAFT_END, + CHAR_SKILL_CRAFT_NB = CHAR_SKILL_CRAFT_END - CHAR_SKILL_CRAFT_BEGIN, + + CHAR_SKILL_END = CHAR_SKILL_CRAFT_END, + CHAR_SKILL_NB = CHAR_SKILL_END - CHAR_SKILL_BEGIN, - NB_CHARACTER_ATTRIBUTES = CHAR_SKILL_WEAPON_END + NB_CHARACTER_ATTRIBUTES = CHAR_SKILL_END }; @@ -235,8 +244,16 @@ class LocalPlayer : public Player */ void setWalkingDir(int dir); + /** + * Uses a character point to raise an attribute + */ void raiseAttribute(size_t attr); + /** + * Uses a correction point to lower an attribute + */ + void lowerAttribute(size_t attr); + void toggleSit(); void emote(Uint8 emotion); @@ -245,17 +262,6 @@ class LocalPlayer : public Player int getHP() const { return mHP; } - /** - * Sets the amount of XP. Shows XP gaining effect if the player is on - * a map. - */ - void setXp(int xp); - - /** - * Returns the amount of experience points. - */ - int getXp() const { return mXp; } - Uint32 mCharId; int getMaxHP() const @@ -275,6 +281,12 @@ class LocalPlayer : public Player void setLevel(int value) { mLevel = value; } + void setLevelProgress(int percent) + { mLevelProgress = percent; } + + int getLevelProgress() const + { return mLevelProgress; } + int getMoney() const { return mMoney; } @@ -299,8 +311,21 @@ class LocalPlayer : public Player void setAttributeEffective(int num, int value) { mAttributeEffective[num] = value; } - int getAttributeIncreasePoints() const - { return mAttributeIncreasePoints; } + int getCharacterPoints() const + { return mCharacterPoints; } + + void setCharacterPoints(int n) + { mCharacterPoints = n; } + + int getCorrectionPoints() const + { return mCorrectionPoints; } + + void setCorrectionPoints(int n) + { mCorrectionPoints = n; } + + void setExperience(int skill, int current, int next); + + std::pair getExperience(int skill); float mLastAttackTime; /**< Used to synchronize the charge dialog */ @@ -313,14 +338,17 @@ class LocalPlayer : public Player // Character status: std::vector mAttributeBase; std::vector mAttributeEffective; - int mAttributeIncreasePoints; + std::vector mExpCurrent; + std::vector mExpNext; + int mCharacterPoints; + int mCorrectionPoints; int mLevel; + int mLevelProgress; int mMoney; int mTotalWeight; int mMaxWeight; int mHP; int mMaxHP; - int mXp; /**< Experience points. */ Being *mTarget; FloorItem *mPickUpTarget; @@ -330,6 +358,10 @@ class LocalPlayer : public Player int mWalkingDir; /**< The direction the player is walking in. */ int mDestX; /**< X coordinate of destination. */ int mDestY; /**< Y coordinate of destination. */ + + std::list mExpMessages; /**< Queued exp messages*/ + int mExpMessageTime; + }; extern LocalPlayer *player_node; diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index bbfa82a4..c83b68f1 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -215,7 +215,9 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn &msg, int &slot) tempPlayer->setGender(msg.readInt8()); int hs = msg.readInt8(), hc = msg.readInt8(); tempPlayer->setHairStyle(hs, hc); - tempPlayer->setLevel(msg.readInt8()); + tempPlayer->setLevel(msg.readInt16()); + tempPlayer->setCharacterPoints(msg.readInt16()); + tempPlayer->setCorrectionPoints(msg.readInt16()); tempPlayer->setMoney(msg.readInt32()); for (int i = 0; i < 7; i++) diff --git a/src/net/gameserver/player.cpp b/src/net/gameserver/player.cpp index bb3567d3..67edc7ad 100644 --- a/src/net/gameserver/player.cpp +++ b/src/net/gameserver/player.cpp @@ -154,3 +154,17 @@ void Net::GameServer::Player::tradeWithNPC(int item, int amount) msg.writeInt16(amount); Net::GameServer::connection->send(msg); } + +void Net::GameServer::Player::raiseAttribute(int attribute) +{ + MessageOut msg(PGMSG_RAISE_ATTRIBUTE); + msg.writeInt8(attribute); + Net::GameServer::connection->send(msg); +} + +void Net::GameServer::Player::lowerAttribute(int attribute) +{ + MessageOut msg(PGMSG_LOWER_ATTRIBUTE); + msg.writeInt8(attribute); + Net::GameServer::connection->send(msg); +} diff --git a/src/net/gameserver/player.h b/src/net/gameserver/player.h index b5f3e6d7..7ebb2830 100644 --- a/src/net/gameserver/player.h +++ b/src/net/gameserver/player.h @@ -51,6 +51,8 @@ namespace Net void tradeItem(int slot, int amount); void tradeMoney(int amount); void tradeWithNPC(int item, int amount); + void raiseAttribute(int attribute); + void lowerAttribute(int attribute); } } } diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index f6f7a8fa..951d6d4e 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -29,6 +29,7 @@ #include "../engine.h" #include "../localplayer.h" #include "../log.h" +#include "../particle.h" #include "../npc.h" #include "../gui/buy.h" @@ -90,6 +91,11 @@ PlayerHandler::PlayerHandler() GPMSG_PLAYER_MAP_CHANGE, GPMSG_PLAYER_SERVER_CHANGE, GPMSG_PLAYER_ATTRIBUTE_CHANGE, + GPMSG_PLAYER_EXP_CHANGE, + GPMSG_LEVELUP, + GPMSG_LEVEL_PROGRESS, + GPMSG_RAISE_ATTRIBUTE_RESPONSE, + GPMSG_LOWER_ATTRIBUTE_RESPONSE, 0 }; handledMessages = _messages; @@ -128,6 +134,14 @@ void PlayerHandler::handleMessage(MessageIn &msg) } else if (stat < NB_CHARACTER_ATTRIBUTES) { + if (stat >= CHAR_SKILL_BEGIN && stat < CHAR_SKILL_END + && player_node->getAttributeBase(stat) < base + && player_node->getAttributeBase(stat) > -1) + { + Particle* effect = particleEngine->addEffect("graphics/particles/skillup.particle.xml", 0, 0); + player_node->controlParticle(effect); + } + player_node->setAttributeBase(stat, base); player_node->setAttributeEffective(stat, value); } @@ -138,6 +152,120 @@ void PlayerHandler::handleMessage(MessageIn &msg) } } } break; + + case GPMSG_PLAYER_EXP_CHANGE: + { + logger->log("EXP Update"); + while (msg.getUnreadLength()) + { + int skill = msg.readInt8(); + int current = msg.readInt32(); + int next = msg.readInt32(); + + if (skill < CHAR_SKILL_NB) + { + player_node->setExperience(skill, current, next); + } + else + { + logger->log("Warning: server wants to update experience of unknown " + "skill %d to %d / %d", skill, current, next); + } + } + } break; + + case GPMSG_LEVELUP: + { + player_node->setLevel(msg.readInt16()); + player_node->setCharacterPoints(msg.readInt16()); + player_node->setCorrectionPoints(msg.readInt16()); + Particle* effect = particleEngine->addEffect("graphics/particles/levelup.particle.xml", 0, 0); + player_node->controlParticle(effect); + } break; + + + case GPMSG_LEVEL_PROGRESS: + { + logger->log("Level Progress Update"); + player_node->setLevelProgress(msg.readInt8()); + } break; + + + case GPMSG_RAISE_ATTRIBUTE_RESPONSE: + { + int errCode = msg.readInt8(); + int attrNum = msg.readInt8() - CHAR_ATTR_BEGIN; + switch (errCode) + { + case ATTRIBMOD_OK: + { + // feel(acknowledgment); + } break; + case ATTRIBMOD_INVALID_ATTRIBUTE: + { + logger->log("Warning: Server denied increase of attribute %d (unknown attribute) ", attrNum); + } break; + case ATTRIBMOD_NO_POINTS_LEFT: + { + // when the server says "you got no points" it + // has to be correct. The server is always right! + // undo attribute change and set points to 0 + logger->log("Warning: Server denied increase of attribute %d (no points left) ", attrNum); + int attrValue = player_node->getAttributeBase(attrNum) - 1; + player_node->setCharacterPoints(0); + player_node->setAttributeBase(attrNum, attrValue); + } break; + case ATTRIBMOD_DENIED: + { + // undo attribute change + logger->log("Warning: Server denied increase of attribute %d (reason unknown) ", attrNum); + int points = player_node->getCharacterPoints() - 1; + player_node->setCharacterPoints(points); + int attrValue = player_node->getAttributeBase(attrNum) - 1; + player_node->setAttributeBase(attrNum, attrValue); + } break; + } + } break; + + case GPMSG_LOWER_ATTRIBUTE_RESPONSE: + { + int errCode = msg.readInt8(); + int attrNum = msg.readInt8() - CHAR_ATTR_BEGIN; + switch (errCode) + { + case ATTRIBMOD_OK: + { + // feel(acknowledgment); + } break; + case ATTRIBMOD_INVALID_ATTRIBUTE: + { + logger->log("Warning: Server denied reduction of attribute %d (unknown attribute) ", attrNum); + } break; + case ATTRIBMOD_NO_POINTS_LEFT: + { + // when the server says "you got no points" it + // has to be correct. The server is always right! + // undo attribute change and set points to 0 + logger->log("Warning: Server denied reduction of attribute %d (no points left) ", attrNum); + int attrValue = player_node->getAttributeBase(attrNum) + 1; + player_node->setCorrectionPoints(0); + player_node->setAttributeBase(attrNum, attrValue); + break; + } break; + case ATTRIBMOD_DENIED: + { + // undo attribute change + logger->log("Warning: Server denied reduction of attribute %d (reason unknown) ", attrNum); + int charaPoints = player_node->getCharacterPoints() - 1; + player_node->setCharacterPoints(charaPoints); + int correctPoints = player_node->getCharacterPoints() + 1; + player_node->setCorrectionPoints(correctPoints); + int attrValue = player_node->getAttributeBase(attrNum) + 1; + player_node->setAttributeBase(attrNum, attrValue); + } break; + } + + } break; /* case SMSG_PLAYER_ARROW_MESSAGE: { diff --git a/src/net/protocol.h b/src/net/protocol.h index d8b9fcb2..e6f5869b 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -49,7 +49,7 @@ enum { APMSG_CHAR_CREATE_RESPONSE = 0x0021, // B error PAMSG_CHAR_DELETE = 0x0022, // B index APMSG_CHAR_DELETE_RESPONSE = 0x0023, // B error - APMSG_CHAR_INFO = 0x0024, // B index, S name, B gender, B hair style, B hair color, B level, W money, W*6 stats + APMSG_CHAR_INFO = 0x0024, // B index, S name, B gender, B hair style, B hair color, W level, W character points, W correction points, D money, W*6 stats PAMSG_CHAR_SELECT = 0x0026, // B index APMSG_CHAR_SELECT_RESPONSE = 0x0027, // B error, B*32 token, S game address, W game port, S chat address, W chat port PAMSG_EMAIL_CHANGE = 0x0030, // S email @@ -83,6 +83,13 @@ enum { GPMSG_INVENTORY = 0x0120, // { B slot, W item id [, B amount] }* GPMSG_INVENTORY_FULL = 0x0121, // { B slot, W item id [, B amount] }* GPMSG_PLAYER_ATTRIBUTE_CHANGE = 0x0130, // { B attribute, W base value, W modified value }* + GPMSG_PLAYER_EXP_CHANGE = 0x0140, // { B skill, D exp got, D exp needed }* + GPMSG_LEVELUP = 0x0150, // W new level + GPMSG_LEVEL_PROGRESS = 0x0151, // B percent completed to next levelup + PGMSG_RAISE_ATTRIBUTE = 0x0160, // B attribute + GPMSG_RAISE_ATTRIBUTE_RESPONSE = 0x0161, // B error, B attribute + PGMSG_LOWER_ATTRIBUTE = 0x0170, // B attribute + GPMSG_LOWER_ATTRIBUTE_RESPONSE = 0x0171, // B error, B attribute GPMSG_BEING_ENTER = 0x0200, // B type, W being id, B action, W*2 position // player: S name, B hair style, B hair color, B gender, B item bitmask, { W item id }* // monster: W type id @@ -183,6 +190,13 @@ enum { CREATE_TOO_MUCH_CHARACTERS }; +// Character attribute modification specific return value +enum AttribmodResponseCode { + ATTRIBMOD_OK = ERRMSG_OK, + ATTRIBMOD_INVALID_ATTRIBUTE = 0x40, + ATTRIBMOD_NO_POINTS_LEFT, + ATTRIBMOD_DENIED +}; // Object type enumeration enum { // A simple item diff --git a/src/net/skillhandler.cpp b/src/net/skillhandler.cpp deleted file mode 100644 index 8a19fe45..00000000 --- a/src/net/skillhandler.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ - */ - -#include "skillhandler.h" - -#include "messagein.h" -#include "protocol.h" - -#include "../log.h" - -#include "../gui/chat.h" -#include "../gui/skill.h" - -SkillHandler::SkillHandler() -{ - static const Uint16 _messages[] = { - 0 - }; - handledMessages = _messages; -} - -void SkillHandler::handleMessage(MessageIn &msg) -{ - switch (msg.getId()) - { -#if 0 - case SMSG_PLAYER_SKILLS: - msg.readInt16(); // length - skillCount = (msg.getLength() - 4) / 37; - skillDialog->cleanList(); - - for (int k = 0; k < skillCount; k++) - { - Sint16 skillId = msg.readInt16(); - msg.readInt16(); // target type - msg.readInt16(); // unknown - Sint16 level = msg.readInt16(); - Sint16 sp = msg.readInt16(); - msg.readInt16(); // range - std::string skillName = msg.readString(24); - Sint8 up = msg.readInt8(); - - if (level != 0 || up != 0) - { - if (skillDialog->hasSkill(skillId)) { - skillDialog->setSkill(skillId, level, sp); - } - else { - skillDialog->addSkill(skillId, level, sp); - } - } - } - break; - - case SMSG_SKILL_FAILED: - // Action failed (ex. sit because you have not reached the - // right level) - CHATSKILL action; - action.skill = msg.readInt16(); - action.bskill = msg.readInt16(); - action.unused = msg.readInt16(); // unknown - action.success = msg.readInt8(); - action.reason = msg.readInt8(); - if (action.success != SKILL_FAILED && - action.bskill == BSKILL_EMOTE) - { - logger->log("Action: %d/%d", action.bskill, action.success); - } - chatWindow->chatLog(action); - break; -#endif - } -} diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h deleted file mode 100644 index 8c0653d4..00000000 --- a/src/net/skillhandler.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * The Mana World is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ - */ - -#ifndef _TMW_NET_SKILLHANDLER_H -#define _TMW_NET_SKILLHANDLER_H - -#include "messagehandler.h" - -class SkillHandler : public MessageHandler -{ - public: - SkillHandler(); - - void handleMessage(MessageIn &msg); -}; - -#endif diff --git a/src/particle.cpp b/src/particle.cpp index 93fc7893..dac8c62e 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -329,10 +329,12 @@ Particle::addTextSplashEffect(const std::string &text, } Particle* -Particle::addTextRiseFadeOutEffect(const std::string &text, gcn::Font *font, +Particle::addTextRiseFadeOutEffect(const std::string &text, + int colorR, int colorG, int colorB, + gcn::Font *font, int x, int y) { - Particle *newParticle = new TextParticle(mMap, text, 255, 255, 255, font); + Particle *newParticle = new TextParticle(mMap, text, colorR, colorG, colorB, font); newParticle->setPosition(x, y, 0); newParticle->setVelocity(0.0f, 0.0f, 0.5f); newParticle->setGravity(0.0015f); diff --git a/src/particle.h b/src/particle.h index 045ab9b9..0dd34065 100644 --- a/src/particle.h +++ b/src/particle.h @@ -123,7 +123,9 @@ class Particle : public Sprite * Creates a standalone text particle. */ Particle* - addTextRiseFadeOutEffect(const std::string &text, gcn::Font *font, + addTextRiseFadeOutEffect(const std::string &text, + int colorR, int colorG, int colorB, + gcn::Font *font, int x, int y); /** diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index c03e42a2..5f6846ba 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -79,16 +79,14 @@ WeaponType weaponTypeFromString (std::string name, int id = 0) if (name=="knife") return WPNTYPE_KNIFE; else if (name=="sword") return WPNTYPE_SWORD; else if (name=="polearm") return WPNTYPE_POLEARM; - else if (name=="javelin") return WPNTYPE_JAVELIN; else if (name=="staff") return WPNTYPE_STAFF; else if (name=="whip") return WPNTYPE_WHIP; - else if (name=="boomerang") return WPNTYPE_BOOMERANG; else if (name=="bow") return WPNTYPE_BOW; - else if (name=="sickle") return WPNTYPE_SICKLE; - else if (name=="crossbow") return WPNTYPE_CROSSBOW; + else if (name=="shooting") return WPNTYPE_SHOOTING; else if (name=="mace") return WPNTYPE_MACE; else if (name=="axe") return WPNTYPE_AXE; else if (name=="thrown") return WPNTYPE_THROWN; + else return WPNTYPE_NONE; } diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index ade7f685..ad4c9797 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -60,7 +60,7 @@ void ItemInfo::setWeaponType(int type) case WPNTYPE_BOW: mAttackType = ACTION_ATTACK_BOW; break; - case WPNTYPE_SICKLE: + case WPNTYPE_POLEARM: mAttackType = ACTION_ATTACK_SWING; break; default: diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index c637b010..90675a17 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -62,19 +62,16 @@ enum ItemType enum WeaponType { WPNTYPE_NONE = 0, - WPNTYPE_KNIFE,// 1 - WPNTYPE_SWORD,// 2 - WPNTYPE_POLEARM,// 3 - WPNTYPE_JAVELIN,// 4 - WPNTYPE_STAFF,// 5 - WPNTYPE_WHIP,// 6 - WPNTYPE_BOOMERANG,// 7 - WPNTYPE_BOW,// 8 - WPNTYPE_SICKLE,// 9 - WPNTYPE_CROSSBOW,// 10 - WPNTYPE_MACE,// 11 - WPNTYPE_AXE,// 12 - WPNTYPE_THROWN// 13 + WPNTYPE_KNIFE, + WPNTYPE_SWORD, + WPNTYPE_POLEARM, + WPNTYPE_STAFF, + WPNTYPE_WHIP, + WPNTYPE_BOW, + WPNTYPE_SHOOTING, + WPNTYPE_MACE, + WPNTYPE_AXE, + WPNTYPE_THROWN }; /** -- cgit v1.2.3-60-g2f50 From 4e2ced304a2013808b2481cceb7622848b073e5b Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Sun, 9 Mar 2008 20:41:27 +0000 Subject: Implemented possibility to rotate particle emitters. Implemented interpretation of the attacktype parameter of attack messages and visualize monster attacks other than id 1 with a particle effect. Prepared to get attack particle effects and animation types from the monster database. --- ChangeLog | 12 ++++++++++++ src/being.cpp | 2 +- src/being.h | 2 +- src/monster.cpp | 27 ++++++++++++++++++++++++--- src/monster.h | 2 +- src/net/beinghandler.cpp | 9 +++++++-- src/particle.cpp | 4 ++-- src/particle.h | 2 +- src/particleemitter.cpp | 9 ++++----- src/particleemitter.h | 2 +- src/resources/monsterinfo.cpp | 15 +++++++++++++++ src/resources/monsterinfo.h | 8 ++++++++ src/utils/minmax.h | 21 +++++++++++++++++++++ 13 files changed, 98 insertions(+), 17 deletions(-) (limited to 'src/particle.h') diff --git a/ChangeLog b/ChangeLog index 0df6b3fc..658239ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-03-09 Philipp Sehmisch + + * src/particle.cpp, src/particle.h, src/particleemitter.cpp, + src/particleemitter.h, src/utils/minmax.h: Implemented possibility + to rotate particle emitters. + * src/being.cpp, src/being.h, src/monster.cpp, src/monster.h, + src/net/beinghandler.cpp, src/resources/monsterinfo.cpp, + src/resources/monsterinfo.h: Implemented interpretation of the + attacktype parameter of attack messages and visualize monster attacks + other than id 1 with a particle effect. Prepared to get attack particle + effects and animation types from the monster database. + 2008-03-06 David Athay * src/net/guildhandler.cpp, src/net/guildhandler.hpp: Fixed diff --git a/src/being.cpp b/src/being.cpp index 20684d8d..a55158c6 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -373,7 +373,7 @@ Being::controlParticle(Particle *particle) } void -Being::setAction(Action action) +Being::setAction(Action action, int attackType) { SpriteAction currentAction = ACTION_INVALID; switch (action) diff --git a/src/being.h b/src/being.h index a2d977db..0b56994e 100644 --- a/src/being.h +++ b/src/being.h @@ -262,7 +262,7 @@ class Being : public Sprite * Sets the current action. */ virtual void - setAction(Action action); + setAction(Action action, int attackType = 0); /** * Returns the direction the being is facing. diff --git a/src/monster.cpp b/src/monster.cpp index ae749017..5fbcfaea 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -25,6 +25,7 @@ #include "animatedsprite.h" #include "game.h" +#include "particle.h" #include "sound.h" #include "resources/monsterdb.h" @@ -50,9 +51,11 @@ Monster::getType() const } void -Monster::setAction(Action action) +Monster::setAction(Action action, int attackType) { SpriteAction currentAction = ACTION_INVALID; + int rotation = 0; + std::string particleEffect; switch (action) { @@ -64,8 +67,26 @@ Monster::setAction(Action action) sound.playSfx(getInfo().getSound(MONSTER_EVENT_DIE)); break; case ATTACK: - currentAction = ACTION_ATTACK; - mSprites[BASE_SPRITE]->reset(); + currentAction = getInfo().getAttackAction(attackType); + + //attack particle effect + particleEffect = getInfo().getAttackParticleEffect(attackType); + if (particleEffect != "") + { + switch (mDirection) + { + case DOWN: rotation = 0; break; + case LEFT: rotation = 90; break; + case UP: rotation = 180; break; + case RIGHT: rotation = 270; break; + default: break; + } + mSprites[BASE_SPRITE]->reset(); + Particle *p; + p = particleEngine->addEffect( + particleEffect, 0, 0, rotation); + controlParticle(p); + } break; case STAND: currentAction = ACTION_STAND; diff --git a/src/monster.h b/src/monster.h index fc46e11a..585f6f09 100644 --- a/src/monster.h +++ b/src/monster.h @@ -33,7 +33,7 @@ class Monster : public Being public: Monster(Uint16 id, Uint16 job, Map *map); - virtual void setAction(Action action); + virtual void setAction(Action action, int attackType); virtual Type getType() const; diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 3e55cce9..05795cb1 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -569,10 +569,11 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg) void BeingHandler::handleBeingAttackMessage(MessageIn &msg) { Being *being = beingManager->findBeing(msg.readInt16()); + int direction = msg.readInt8(); + int attackType = msg.readInt8(); + if (!being) return; - being->setAction(Being::ATTACK); - int direction = msg.readInt8(); switch (direction) { case DIRECTION_UP: being->setDirection(Being::UP); break; @@ -580,6 +581,10 @@ void BeingHandler::handleBeingAttackMessage(MessageIn &msg) case DIRECTION_LEFT: being->setDirection(Being::LEFT); break; case DIRECTION_RIGHT: being->setDirection(Being::RIGHT); break; } + + logger->log("Attacktype: %d", attackType); + + being->setAction(Being::ATTACK, attackType); } void BeingHandler::handleBeingsDamageMessage(MessageIn &msg) diff --git a/src/particle.cpp b/src/particle.cpp index dac8c62e..11d91b47 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -212,7 +212,7 @@ Particle::update() Particle* Particle::addEffect(const std::string &particleEffectFile, - int pixelX, int pixelY) + int pixelX, int pixelY, int rotation) { Particle *newParticle = NULL; @@ -294,7 +294,7 @@ Particle::addEffect(const std::string &particleEffectFile, continue; ParticleEmitter *newEmitter; - newEmitter = new ParticleEmitter(emitterNode, newParticle, mMap); + newEmitter = new ParticleEmitter(emitterNode, newParticle, mMap, rotation); newParticle->addEmitter(newEmitter); } diff --git a/src/particle.h b/src/particle.h index 0dd34065..1859fe62 100644 --- a/src/particle.h +++ b/src/particle.h @@ -109,7 +109,7 @@ class Particle : public Sprite */ Particle* addEffect(const std::string &particleEffectFile, - int pixelX, int pixelY); + int pixelX, int pixelY, int rotation = 0); /** * Creates a standalone text particle. diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 6f66b632..f03490ac 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -38,7 +38,7 @@ #define SIN45 0.707106781f #define DEG_RAD_FACTOR 0.017453293f -ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map *map): +ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map *map, int rotation): mParticleImage(0) { mMap = map; @@ -98,14 +98,13 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * else if (name == "horizontal-angle") { mParticleAngleHorizontal = readMinMax(propertyNode, 0.0f); - mParticleAngleHorizontal.minVal *= DEG_RAD_FACTOR; - mParticleAngleHorizontal.maxVal *= DEG_RAD_FACTOR; + mParticleAngleHorizontal += rotation; + mParticleAngleHorizontal *= DEG_RAD_FACTOR; } else if (name == "vertical-angle") { mParticleAngleVertical = readMinMax(propertyNode, 0.0f); - mParticleAngleVertical.minVal *= DEG_RAD_FACTOR; - mParticleAngleVertical.maxVal *= DEG_RAD_FACTOR; + mParticleAngleVertical *= DEG_RAD_FACTOR; } else if (name == "power") { diff --git a/src/particleemitter.h b/src/particleemitter.h index c9524488..f5ca6232 100644 --- a/src/particleemitter.h +++ b/src/particleemitter.h @@ -45,7 +45,7 @@ class ParticleEmitter /** * Constructor. */ - ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map *map); + ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map *map, int rotation = 0); /** * Copy Constructor (necessary for reference counting of particle images) diff --git a/src/resources/monsterinfo.cpp b/src/resources/monsterinfo.cpp index 0a7e18dc..0ee08e42 100644 --- a/src/resources/monsterinfo.cpp +++ b/src/resources/monsterinfo.cpp @@ -70,3 +70,18 @@ MonsterInfo::getSound(MonsterSoundEvent event) const return i->second->at(rand()%i->second->size()); } } + +const std::string & +MonsterInfo::getAttackParticleEffect(int attackType) const +{ + static std::string something("graphics/particles/attack.particle.xml"); + static std::string nothing(""); + + if (attackType > 1) return something; else return nothing; +} + +SpriteAction +MonsterInfo::getAttackAction(int attackType) const +{ + return ACTION_ATTACK; +} diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index 3034f10e..3dd18c0f 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -83,6 +83,14 @@ class MonsterInfo std::string getSound(MonsterSoundEvent event) const; + const std::string & + getAttackParticleEffect(int attackType) const; + + SpriteAction + getAttackAction(int attackType) const; + + + private: std::string mName; std::string mSprite; diff --git a/src/utils/minmax.h b/src/utils/minmax.h index 427c5da7..353c60e7 100644 --- a/src/utils/minmax.h +++ b/src/utils/minmax.h @@ -40,6 +40,27 @@ template struct MinMax set(val, val); } + bool operator+= (T arg) + { + minVal += arg; + maxVal += arg; + return true; + } + + bool operator-= (T arg) + { + minVal -= arg; + maxVal -= arg; + return true; + } + + bool operator*= (T arg) + { + minVal *= arg; + maxVal *= arg; + return true; + } + T value() { return (T)(minVal + (maxVal - minVal) * (rand() / ((double) RAND_MAX + 1))); -- cgit v1.2.3-60-g2f50 From 3925d9c41709dece19fe60c0e4bb111247f1886e Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 26 Oct 2008 15:41:57 +0000 Subject: Merged revisions 4302,4338,4360-4362,4526,4528,4534,4547 via svnmerge from https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/branches/0.0 ........ r4302 | crush_tmw | 2008-05-28 18:51:26 +0200 (Wed, 28 May 2008) | 1 line Changed the way particle emitter skip is handled to make linear and circular emitters work with particleEmitterSkip enabled. ........ r4338 | crush_tmw | 2008-06-05 20:41:39 +0200 (Thu, 05 Jun 2008) | 1 line Lowered default particle detail level. ........ r4360 | crush_tmw | 2008-06-23 16:44:20 +0200 (Mon, 23 Jun 2008) | 1 line Implemented "alpha" particle property. ........ r4361 | crush_tmw | 2008-06-23 22:20:05 +0200 (Mon, 23 Jun 2008) | 1 line Forgot changelog with last commit. ........ r4362 | crush_tmw | 2008-06-24 14:29:33 +0200 (Tue, 24 Jun 2008) | 1 line Added particle property "follow-parent" which makes the particle move when its parent particle is moved. ........ r4526 | crush_tmw | 2008-08-24 20:52:00 +0200 (Sun, 24 Aug 2008) | 1 line Added new particle emitter property "output-pause" which allows to define a fixed (or random) interval between two outputs. ........ r4528 | crush_tmw | 2008-08-24 20:58:39 +0200 (Sun, 24 Aug 2008) | 1 line fix for an error in the last commit ........ r4534 | b_lindeijer | 2008-08-27 20:48:13 +0200 (Wed, 27 Aug 2008) | 3 lines Renamed "randomnes" to "randomness", so that it won't show up as part of Fate's patch. ........ r4547 | crush_tmw | 2008-08-29 00:44:43 +0200 (Fri, 29 Aug 2008) | 1 line Added output-pause to copy constructor of particle emitters. ........ --- ChangeLog | 34 ++++++++++++++++++++++++++++++++++ src/imageparticle.cpp | 2 +- src/particle.cpp | 27 ++++++++++++++++++++------- src/particle.h | 33 ++++++++++++++++++++++++++++++--- src/particleemitter.cpp | 41 ++++++++++++++++++++++++++++++++++++----- src/particleemitter.h | 13 +++++++++---- src/textparticle.cpp | 4 ++-- 7 files changed, 132 insertions(+), 22 deletions(-) (limited to 'src/particle.h') diff --git a/ChangeLog b/ChangeLog index 938fd1db..52c3df51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -147,6 +147,22 @@ another template to make deleting all values in a container easier. Inspired by qDeleteAll() from Qt. +2008-08-28 Philipp Sehmisch + + * src/particleemitter.cpp: Added output-pause to copy constructor. + +2008-08-27 Bjørn Lindeijer + + * src/particleemitter.h, src/particle.h, src/particleemitter.cpp, + src/particle.cpp: Renamed "randomnes" to "randomness", so that it + won't show up as part of Fate's patch. + +2008-08-24 Philipp Sehmisch + + * src/particleemitter.cpp, src/particleemitter.h: Added new particle + emitter property "output-pause" which allows to define a fixed (or + random) interval between two outputs. + 2008-08-20 Roderic Morris * src/gui/guildlistbox.cpp, src/gui/guildwindow.h, @@ -292,6 +308,18 @@ * src/net/guildhandler.cpp, src/net/protocol.h: Handle guild list update events, and update protocol definitions. +2008-06-24 Philipp Sehmisch + + * src/particle.cpp, src/particle.h, src/particleemitter.cpp, + src/particleemitter.h: Added particle property "follow-parent" which + makes the particle move when its parent particle is moved. + +2008-06-23 Philipp Sehmisch + + * src/imageparticle.cpp, src/particle.cpp, src/particle.h, + src/particleemitter.cpp, src/particleemitter.h, src/textparticle.cpp: + Implemented "alpha" particle property. + 2008-06-14 Roderic Morris * src/gui/viewport.cpp, data/graphics/images/CMakeLists.txt, @@ -336,6 +364,12 @@ announce messages and private messages. Don't cut off the last character from pm recipient's name. Got rid of old eAthena code. +2008-05-28 Philipp Sehmisch + + * src/particle.cpp: Changed the way particle emitter skip is handled + to make linear and circular emitters work with particleEmitterSkip + enabled. + 2008-05-22 Roderic Morris * src/gui/widgets/tab.cpp, src/utils/sha256.cpp: Fix compile errors diff --git a/src/imageparticle.cpp b/src/imageparticle.cpp index 17581a2a..965434b0 100644 --- a/src/imageparticle.cpp +++ b/src/imageparticle.cpp @@ -56,7 +56,7 @@ void ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const return; } - float alphafactor = 1.0f; + float alphafactor = mAlpha; if (mLifetimeLeft > -1 && mLifetimeLeft < mFadeOut) alphafactor *= (float) mLifetimeLeft / (float) mFadeOut; diff --git a/src/particle.cpp b/src/particle.cpp index ba5386f6..c59d2c03 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -57,11 +57,13 @@ Particle::Particle(Map *map): mLifetimePast(0), mFadeOut(0), mFadeIn(0), + mAlpha(1.0f), mAutoDelete(true), mMap(map), mGravity(0.0f), - mRandomnes(0), + mRandomness(0), mBounce(0.0f), + mFollow(false), mTarget(NULL), mAcceleration(0.0f), mInvDieDistance(-1.0f), @@ -77,7 +79,7 @@ Particle::setupEngine() { Particle::maxCount = (int)config.getValue("particleMaxCount", 3000); Particle::fastPhysics = (int)config.getValue("particleFastPhysics", 0); - Particle::emitterSkip = (int)config.getValue("particleEmitterSkip", 0) + 1; + Particle::emitterSkip = (int)config.getValue("particleEmitterSkip", 1) + 1; disableAutoDelete(); logger->log("Particle engine set up"); } @@ -94,6 +96,8 @@ Particle::update() mAlive = false; } + Vector oldPos = mPos; + if (mAlive) { //calculate particle movement @@ -135,11 +139,11 @@ Particle::update() } } - if (mRandomnes > 0) + if (mRandomness > 0) { - mVelocity.x += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; - mVelocity.y += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; - mVelocity.z += (rand()%mRandomnes - rand()%mRandomnes) / 1000.0f; + mVelocity.x += (rand()%mRandomness - rand()%mRandomness) / 1000.0f; + mVelocity.y += (rand()%mRandomness - rand()%mRandomness) / 1000.0f; + mVelocity.z += (rand()%mRandomness - rand()%mRandomness) / 1000.0f; } mVelocity.z -= mGravity; @@ -170,7 +174,7 @@ Particle::update() } // Update child emitters - if (mLifetimePast%Particle::emitterSkip == 0) + if ((mLifetimePast-1)%Particle::emitterSkip == 0) { for ( EmitterIterator e = mChildEmitters.begin(); e != mChildEmitters.end(); @@ -190,10 +194,19 @@ Particle::update() } } + Vector change = mPos - oldPos; + // Update child particles + for (ParticleIterator p = mChildParticles.begin(); p != mChildParticles.end();) { + //move particle with its parent if desired + if ((*p)->doesFollow()) + { + (*p)->moveBy(change); + } + //update particle if ((*p)->update()) { p++; diff --git a/src/particle.h b/src/particle.h index 1859fe62..7b46a641 100644 --- a/src/particle.h +++ b/src/particle.h @@ -162,6 +162,10 @@ class Particle : public Sprite moveBy(float x, float y, float z) { mPos.x += x; mPos.y += y; mPos.z += z; } + void + moveBy (Vector change) + { mPos += change; } + /** * Sets the time in game ticks until the particle is destroyed. */ @@ -185,6 +189,13 @@ class Particle : public Sprite setFadeIn(int fadeIn) { mFadeIn = fadeIn; } + /** + * Sets the alpha value of the particle + */ + void + setAlpha(float alpha) + { mAlpha = alpha; } + /** * Sets the sprite iterator of the particle on the current map to make * it easier to remove the particle from the map when it is destroyed. @@ -218,8 +229,8 @@ class Particle : public Sprite * Sets the ammount of random vector changes */ void - setRandomnes(int r) - { mRandomnes = r; } + setRandomness(int r) + { mRandomness = r; } /** * Sets the ammount of velocity particles retain after @@ -229,6 +240,20 @@ class Particle : public Sprite setBounce(float bouncieness) { mBounce = bouncieness; } + /** + * Sets the flag if the particle is supposed to be moved by its parent + */ + void + setFollow(bool follow) + { mFollow = follow; } + + /** + * Gets the flag if the particle is supposed to be moved by its parent + */ + bool + doesFollow() + { return mFollow; } + /** * Makes the particle move toward another particle with a * given acceleration and momentum @@ -267,6 +292,7 @@ class Particle : public Sprite int mLifetimePast; /**< Age of the particle in game ticks*/ int mFadeOut; /**< Lifetime in game ticks left where fading out begins*/ int mFadeIn; /**< Age in game ticks where fading in is finished*/ + float mAlpha; /**< Opacity of the graphical representation of the particle */ private: // generic properties @@ -279,8 +305,9 @@ class Particle : public Sprite // dynamic particle Vector mVelocity; /**< Speed in pixels per game-tick. */ float mGravity; /**< Downward acceleration in pixels per game-tick. */ - int mRandomnes; /**< Ammount of random vector change */ + int mRandomness; /**< Ammount of random vector change */ float mBounce; /**< How much the particle bounces off when hitting the ground */ + bool mFollow; /**< is this particle moved when its parent particle moves? */ // follow-point particles Particle *mTarget; /**< The particle that attracts this particle*/ diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 23c6879e..cd80fb58 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -39,6 +39,7 @@ #define DEG_RAD_FACTOR 0.017453293f ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map *map, int rotation): + mOutputPauseLeft(0), mParticleImage(0) { mMap = map; @@ -52,8 +53,9 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * mParticleAngleVertical.set(0.0f); mParticlePower.set(0.0f); mParticleGravity.set(0.0f); - mParticleRandomnes.set(0); + mParticleRandomness.set(0); mParticleBounce.set(0.0f); + mParticleFollow = false; mParticleAcceleration.set(0.0f); mParticleDieDistance.set(-1.0f); mParticleMomentum.set(1.0f); @@ -61,6 +63,8 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * mParticleFadeOut.set(0); mParticleFadeIn.set(0); mOutput.set(1); + mOutputPause.set(0); + mParticleAlpha.set(1.0f); for_each_xml_child_node(propertyNode, emitterNode) { @@ -114,9 +118,9 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * { mParticleGravity = readMinMax(propertyNode, 0.0f); } - else if (name == "randomnes") + else if (name == "randomnes" || name == "randomness") // legacy bug { - mParticleRandomnes = readMinMax(propertyNode, 0); + mParticleRandomness = readMinMax(propertyNode, 0); } else if (name == "bounce") { @@ -132,6 +136,11 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * mOutput = readMinMax(propertyNode, 0); mOutput.maxVal +=1; } + else if (name == "output-pause") + { + mOutputPause = readMinMax(propertyNode, 0); + mOutputPauseLeft = mOutputPause.value(); + } else if (name == "acceleration") { mParticleAcceleration = readMinMax(propertyNode, 0.0f); @@ -152,6 +161,14 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * { mParticleFadeIn = readMinMax(propertyNode, 0); } + else if (name == "alpha") + { + mParticleAlpha = readMinMax(propertyNode, 1.0f); + } + else if (name == "follow-parent") + { + mParticleFollow = true; + } else { logger->log("Particle Engine: Warning, unknown emitter property \"%s\"", @@ -249,8 +266,9 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) mParticleAngleVertical = o.mParticleAngleVertical; mParticlePower = o.mParticlePower; mParticleGravity = o.mParticleGravity; - mParticleRandomnes = o.mParticleRandomnes; + mParticleRandomness = o.mParticleRandomness; mParticleBounce = o.mParticleBounce; + mParticleFollow = o.mParticleFollow; mParticleTarget = o.mParticleTarget; mParticleAcceleration = o.mParticleAcceleration; mParticleDieDistance = o.mParticleDieDistance; @@ -258,12 +276,16 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) mParticleLifetime = o.mParticleLifetime; mParticleFadeOut = o.mParticleFadeOut; mParticleFadeIn = o.mParticleFadeIn; + mParticleAlpha = o.mParticleAlpha; mMap = o.mMap; mOutput = o.mOutput; + mOutputPause = o.mOutputPause; mParticleImage = o.mParticleImage; mParticleAnimation = o.mParticleAnimation; mParticleChildEmitters = o.mParticleChildEmitters; + mOutputPauseLeft = 0; + if (mParticleImage) mParticleImage->incRef(); return *this; @@ -294,6 +316,13 @@ ParticleEmitter::createParticles() { std::list newParticles; + if (mOutputPauseLeft > 0) + { + mOutputPauseLeft--; + return newParticles; + } + mOutputPauseLeft = mOutputPause.value(); + for (int i = mOutput.value(); i > 0; i--) { // Limit maximum particles @@ -328,9 +357,10 @@ ParticleEmitter::createParticles() sin(angleH) * cos(angleV) * power, sin(angleV) * power); - newParticle->setRandomnes(mParticleRandomnes.value()); + newParticle->setRandomness(mParticleRandomness.value()); newParticle->setGravity(mParticleGravity.value()); newParticle->setBounce(mParticleBounce.value()); + newParticle->setFollow(mParticleFollow); newParticle->setDestination(mParticleTarget, mParticleAcceleration.value(), @@ -341,6 +371,7 @@ ParticleEmitter::createParticles() newParticle->setLifetime(mParticleLifetime.value()); newParticle->setFadeOut(mParticleFadeOut.value()); newParticle->setFadeIn(mParticleFadeIn.value()); + newParticle->setAlpha(mParticleAlpha.value()); for (std::list::iterator i = mParticleChildEmitters.begin(); i != mParticleChildEmitters.end(); diff --git a/src/particleemitter.h b/src/particleemitter.h index f5ca6232..c237c1ba 100644 --- a/src/particleemitter.h +++ b/src/particleemitter.h @@ -97,8 +97,9 @@ class ParticleEmitter * Vector changing of particles: */ MinMax mParticleGravity; - MinMax mParticleRandomnes; + MinMax mParticleRandomness; MinMax mParticleBounce; + bool mParticleFollow; /* * Properties of targeting particles: @@ -118,11 +119,15 @@ class ParticleEmitter Map *mMap; /**< Map the particles are spawned on */ MinMax mOutput; /**< Number of particles spawned per update */ + MinMax mOutputPause; /**< Pause in frames between two spawns */ + int mOutputPauseLeft; + /* + * Graphical representation of the particle + */ Image *mParticleImage; /**< Particle image, if used */ - - /** Filename of particle animation file */ - Animation mParticleAnimation; + Animation mParticleAnimation; /**< Filename of particle animation file */ + MinMax mParticleAlpha; /**< Opacity of the graphical representation of the particles */ /** List of emitters the spawned particles are equipped with */ std::list mParticleChildEmitters; diff --git a/src/textparticle.cpp b/src/textparticle.cpp index 4bc859cd..89466006 100644 --- a/src/textparticle.cpp +++ b/src/textparticle.cpp @@ -45,7 +45,7 @@ void TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const int screenX = (int) mPos.x + offsetX; int screenY = (int) mPos.y - (int) mPos.z + offsetY; - int alpha = 255; + float alpha = mAlpha * 255.0f; if (mLifetimeLeft > -1 && mLifetimeLeft < mFadeOut) { @@ -60,6 +60,6 @@ void TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const } graphics->setFont(mTextFont); - graphics->setColor(gcn::Color(mColorR, mColorG, mColorB, alpha)); + graphics->setColor(gcn::Color(mColorR, mColorG, mColorB, (int)alpha)); graphics->drawText(mText, screenX, screenY, gcn::Graphics::CENTER); } -- cgit v1.2.3-60-g2f50 From ff61662640c4053220464f34413568f06f51154a Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 16 Nov 2008 15:37:13 +0100 Subject: Got rid of CVS/Subversion $Id$ markers I don't know why we dealt with these things for so long. Did we ever get anything out of it? --- src/animatedsprite.cpp | 2 -- src/animatedsprite.h | 2 -- src/animationparticle.cpp | 1 - src/animationparticle.h | 1 - src/being.cpp | 2 -- src/being.h | 2 -- src/beingmanager.cpp | 2 -- src/beingmanager.h | 2 -- src/channel.cpp | 2 -- src/channel.h | 2 -- src/channelmanager.cpp | 2 -- src/channelmanager.h | 2 -- src/commandhandler.cpp | 2 -- src/commandhandler.h | 2 -- src/configlistener.h | 2 -- src/configuration.cpp | 2 -- src/configuration.h | 2 -- src/effectmanager.cpp | 1 - src/effectmanager.h | 1 - src/engine.cpp | 2 -- src/engine.h | 2 -- src/equipment.cpp | 2 -- src/equipment.h | 2 -- src/floor_item.cpp | 2 -- src/floor_item.h | 2 -- src/flooritemmanager.cpp | 2 -- src/flooritemmanager.h | 2 -- src/game.cpp | 2 -- src/game.h | 2 -- src/graphics.cpp | 2 -- src/graphics.h | 2 -- src/gui/box.cpp | 2 -- src/gui/box.h | 2 -- src/gui/browserbox.cpp | 2 -- src/gui/browserbox.h | 2 -- src/gui/buddywindow.cpp | 2 -- src/gui/buddywindow.h | 2 -- src/gui/button.cpp | 2 -- src/gui/button.h | 2 -- src/gui/buy.cpp | 2 -- src/gui/buy.h | 2 -- src/gui/buysell.cpp | 2 -- src/gui/buysell.h | 2 -- src/gui/changeemaildialog.cpp | 2 -- src/gui/changeemaildialog.h | 2 -- src/gui/changepassworddialog.cpp | 2 -- src/gui/changepassworddialog.h | 2 -- src/gui/char_select.cpp | 2 -- src/gui/char_select.h | 2 -- src/gui/chargedialog.cpp | 1 - src/gui/chargedialog.h | 1 - src/gui/chat.cpp | 2 -- src/gui/chat.h | 2 -- src/gui/chatinput.cpp | 2 -- src/gui/chatinput.h | 2 -- src/gui/checkbox.cpp | 2 -- src/gui/checkbox.h | 2 -- src/gui/confirm_dialog.cpp | 2 -- src/gui/confirm_dialog.h | 2 -- src/gui/connection.cpp | 2 -- src/gui/connection.h | 2 -- src/gui/debugwindow.cpp | 2 -- src/gui/debugwindow.h | 2 -- src/gui/equipmentwindow.cpp | 2 -- src/gui/equipmentwindow.h | 2 -- src/gui/focushandler.cpp | 2 -- src/gui/focushandler.h | 2 -- src/gui/gccontainer.cpp | 2 -- src/gui/gccontainer.h | 2 -- src/gui/gui.cpp | 2 -- src/gui/gui.h | 2 -- src/gui/guildlistbox.cpp | 2 -- src/gui/guildlistbox.h | 2 -- src/gui/guildwindow.cpp | 1 - src/gui/guildwindow.h | 2 -- src/gui/hbox.cpp | 2 -- src/gui/hbox.h | 2 -- src/gui/help.cpp | 2 -- src/gui/help.h | 2 -- src/gui/icon.cpp | 2 -- src/gui/icon.h | 2 -- src/gui/inttextbox.cpp | 2 -- src/gui/inttextbox.h | 2 -- src/gui/inventorywindow.cpp | 2 -- src/gui/inventorywindow.h | 2 -- src/gui/item_amount.cpp | 2 -- src/gui/item_amount.h | 2 -- src/gui/itemcontainer.cpp | 2 -- src/gui/itemcontainer.h | 2 -- src/gui/itempopup.cpp | 2 -- src/gui/itempopup.h | 3 --- src/gui/itemshortcutcontainer.cpp | 2 -- src/gui/itemshortcutcontainer.h | 2 -- src/gui/itemshortcutwindow.cpp | 2 -- src/gui/itemshortcutwindow.h | 2 -- src/gui/linkhandler.h | 2 -- src/gui/listbox.cpp | 2 -- src/gui/listbox.h | 2 -- src/gui/login.cpp | 2 -- src/gui/login.h | 2 -- src/gui/magic.cpp | 2 -- src/gui/magic.h | 3 --- src/gui/menuwindow.cpp | 2 -- src/gui/menuwindow.h | 2 -- src/gui/minimap.cpp | 2 -- src/gui/minimap.h | 2 -- src/gui/ministatus.cpp | 2 -- src/gui/ministatus.h | 2 -- src/gui/newskill.cpp | 2 -- src/gui/newskill.h | 2 -- src/gui/npc_text.cpp | 2 -- src/gui/npc_text.h | 2 -- src/gui/npclistdialog.cpp | 2 -- src/gui/npclistdialog.h | 2 -- src/gui/npcpostdialog.cpp | 2 -- src/gui/npcpostdialog.h | 2 -- src/gui/ok_dialog.cpp | 2 -- src/gui/ok_dialog.h | 2 -- src/gui/partywindow.cpp | 2 -- src/gui/partywindow.h | 2 -- src/gui/passwordfield.cpp | 2 -- src/gui/passwordfield.h | 2 -- src/gui/playerbox.cpp | 2 -- src/gui/playerbox.h | 2 -- src/gui/popupmenu.cpp | 2 -- src/gui/popupmenu.h | 2 -- src/gui/progressbar.cpp | 2 -- src/gui/progressbar.h | 2 -- src/gui/quitdialog.cpp | 1 - src/gui/quitdialog.h | 1 - src/gui/radiobutton.cpp | 2 -- src/gui/radiobutton.h | 2 -- src/gui/register.cpp | 2 -- src/gui/register.h | 2 -- src/gui/scrollarea.cpp | 2 -- src/gui/scrollarea.h | 2 -- src/gui/sdlinput.cpp | 2 -- src/gui/sdlinput.h | 2 -- src/gui/sell.cpp | 2 -- src/gui/sell.h | 2 -- src/gui/serverdialog.cpp | 2 -- src/gui/serverdialog.h | 2 -- src/gui/setup.cpp | 2 -- src/gui/setup.h | 2 -- src/gui/setup_audio.cpp | 2 -- src/gui/setup_audio.h | 2 -- src/gui/setup_joystick.cpp | 2 -- src/gui/setup_joystick.h | 2 -- src/gui/setup_keyboard.cpp | 2 -- src/gui/setup_keyboard.h | 2 -- src/gui/setup_video.cpp | 2 -- src/gui/setup_video.h | 2 -- src/gui/setuptab.h | 2 -- src/gui/shop.cpp | 2 -- src/gui/shop.h | 2 -- src/gui/shoplistbox.cpp | 2 -- src/gui/shoplistbox.h | 2 -- src/gui/skill.cpp | 2 -- src/gui/skill.h | 2 -- src/gui/slider.cpp | 2 -- src/gui/slider.h | 2 -- src/gui/speechbubble.cpp | 2 -- src/gui/speechbubble.h | 2 -- src/gui/status.cpp | 2 -- src/gui/status.h | 2 -- src/gui/textbox.cpp | 2 -- src/gui/textbox.h | 2 -- src/gui/textdialog.cpp | 2 -- src/gui/textdialog.h | 2 -- src/gui/textfield.cpp | 2 -- src/gui/textfield.h | 2 -- src/gui/trade.cpp | 2 -- src/gui/trade.h | 2 -- src/gui/truetypefont.cpp | 2 -- src/gui/truetypefont.h | 2 -- src/gui/unregisterdialog.cpp | 2 -- src/gui/unregisterdialog.h | 2 -- src/gui/updatewindow.cpp | 2 -- src/gui/updatewindow.h | 2 -- src/gui/vbox.cpp | 2 -- src/gui/vbox.h | 2 -- src/gui/viewport.cpp | 2 -- src/gui/viewport.h | 2 -- src/gui/widgets/avatar.cpp | 2 -- src/gui/widgets/avatar.h | 2 -- src/gui/widgets/dropdown.cpp | 2 -- src/gui/widgets/dropdown.h | 2 -- src/gui/widgets/layout.cpp | 2 -- src/gui/widgets/layout.h | 2 -- src/gui/widgets/resizegrip.cpp | 2 -- src/gui/widgets/resizegrip.h | 2 -- src/gui/widgets/tab.cpp | 2 -- src/gui/widgets/tab.h | 2 -- src/gui/widgets/tabbedarea.cpp | 2 -- src/gui/widgets/tabbedarea.h | 2 -- src/gui/window.cpp | 2 -- src/gui/window.h | 2 -- src/gui/windowcontainer.cpp | 2 -- src/gui/windowcontainer.h | 2 -- src/guichanfwd.h | 2 -- src/guild.cpp | 2 -- src/guild.h | 2 -- src/imageparticle.cpp | 2 -- src/imageparticle.h | 2 -- src/inventory.cpp | 2 -- src/inventory.h | 2 -- src/item.cpp | 2 -- src/item.h | 2 -- src/itemshortcut.cpp | 2 -- src/itemshortcut.h | 2 -- src/joystick.cpp | 2 -- src/joystick.h | 2 -- src/keyboardconfig.cpp | 2 -- src/keyboardconfig.h | 2 -- src/localplayer.cpp | 2 -- src/localplayer.h | 2 -- src/lockedarray.h | 2 -- src/logindata.h | 2 -- src/main.cpp | 2 -- src/main.h | 2 -- src/map.cpp | 2 -- src/map.h | 2 -- src/monster.cpp | 2 -- src/monster.h | 2 -- src/net/accountserver/account.cpp | 2 -- src/net/accountserver/account.h | 2 -- src/net/accountserver/accountserver.cpp | 2 -- src/net/accountserver/accountserver.h | 2 -- src/net/accountserver/internal.cpp | 2 -- src/net/accountserver/internal.h | 2 -- src/net/beinghandler.cpp | 2 -- src/net/beinghandler.h | 2 -- src/net/buysellhandler.cpp | 2 -- src/net/buysellhandler.h | 2 -- src/net/charserverhandler.cpp | 2 -- src/net/charserverhandler.h | 2 -- src/net/chathandler.cpp | 2 -- src/net/chathandler.h | 2 -- src/net/chatserver/chatserver.cpp | 2 -- src/net/chatserver/chatserver.h | 2 -- src/net/chatserver/guild.cpp | 2 -- src/net/chatserver/guild.h | 2 -- src/net/chatserver/internal.cpp | 2 -- src/net/chatserver/internal.h | 2 -- src/net/chatserver/party.cpp | 2 -- src/net/chatserver/party.h | 2 -- src/net/connection.cpp | 2 -- src/net/connection.h | 2 -- src/net/effecthandler.cpp | 1 - src/net/effecthandler.h | 1 - src/net/gameserver/gameserver.cpp | 2 -- src/net/gameserver/gameserver.h | 2 -- src/net/gameserver/internal.cpp | 2 -- src/net/gameserver/internal.h | 2 -- src/net/gameserver/player.cpp | 2 -- src/net/gameserver/player.h | 2 -- src/net/guildhandler.cpp | 2 -- src/net/guildhandler.h | 2 -- src/net/internal.cpp | 2 -- src/net/internal.h | 2 -- src/net/inventoryhandler.cpp | 2 -- src/net/inventoryhandler.h | 2 -- src/net/itemhandler.cpp | 2 -- src/net/itemhandler.h | 2 -- src/net/loginhandler.cpp | 2 -- src/net/loginhandler.h | 2 -- src/net/logouthandler.cpp | 2 -- src/net/logouthandler.h | 2 -- src/net/messagehandler.cpp | 2 -- src/net/messagehandler.h | 2 -- src/net/messagein.cpp | 2 -- src/net/messagein.h | 2 -- src/net/messageout.cpp | 2 -- src/net/messageout.h | 2 -- src/net/network.cpp | 2 -- src/net/network.h | 2 -- src/net/npchandler.cpp | 2 -- src/net/npchandler.h | 2 -- src/net/partyhandler.cpp | 2 -- src/net/partyhandler.h | 2 -- src/net/playerhandler.cpp | 2 -- src/net/playerhandler.h | 2 -- src/net/protocol.h | 2 -- src/net/tradehandler.cpp | 2 -- src/net/tradehandler.h | 2 -- src/npc.cpp | 2 -- src/npc.h | 2 -- src/openglgraphics.cpp | 2 -- src/openglgraphics.h | 2 -- src/particle.cpp | 2 -- src/particle.h | 2 -- src/particleemitter.cpp | 2 -- src/particleemitter.h | 2 -- src/player.cpp | 2 -- src/player.h | 2 -- src/position.cpp | 2 -- src/position.h | 2 -- src/properties.h | 2 -- src/resources/action.cpp | 2 -- src/resources/action.h | 2 -- src/resources/ambientoverlay.cpp | 2 -- src/resources/ambientoverlay.h | 2 -- src/resources/animation.cpp | 2 -- src/resources/animation.h | 2 -- src/resources/buddylist.cpp | 2 -- src/resources/buddylist.h | 2 -- src/resources/dye.cpp | 2 -- src/resources/dye.h | 2 -- src/resources/image.cpp | 2 -- src/resources/image.h | 2 -- src/resources/imageloader.cpp | 2 -- src/resources/imageloader.h | 2 -- src/resources/imageset.cpp | 2 -- src/resources/imageset.h | 2 -- src/resources/imagewriter.cpp | 2 -- src/resources/imagewriter.h | 2 -- src/resources/itemdb.cpp | 2 -- src/resources/itemdb.h | 2 -- src/resources/iteminfo.cpp | 2 -- src/resources/iteminfo.h | 2 -- src/resources/mapreader.cpp | 2 -- src/resources/mapreader.h | 2 -- src/resources/monsterdb.cpp | 2 -- src/resources/monsterdb.h | 2 -- src/resources/monsterinfo.cpp | 2 -- src/resources/monsterinfo.h | 2 -- src/resources/music.cpp | 2 -- src/resources/music.h | 2 -- src/resources/npcdb.cpp | 2 -- src/resources/npcdb.h | 2 -- src/resources/resource.cpp | 2 -- src/resources/resource.h | 2 -- src/resources/resourcemanager.cpp | 2 -- src/resources/resourcemanager.h | 2 -- src/resources/soundeffect.cpp | 2 -- src/resources/soundeffect.h | 2 -- src/resources/spritedef.cpp | 2 -- src/resources/spritedef.h | 2 -- src/serverinfo.h | 2 -- src/shopitem.cpp | 2 -- src/shopitem.h | 2 -- src/simpleanimation.cpp | 2 -- src/simpleanimation.h | 2 -- src/sound.cpp | 2 -- src/sound.h | 2 -- src/sprite.h | 2 -- src/textparticle.cpp | 2 -- src/textparticle.h | 2 -- src/tileset.h | 2 -- src/utils/base64.cpp | 1 - src/utils/base64.h | 1 - src/utils/dtor.h | 2 -- src/utils/fastsqrt.h | 2 -- src/utils/gettext.h | 2 -- src/utils/minmax.h | 2 -- src/utils/sha256.cpp | 2 -- src/utils/sha256.h | 2 -- src/utils/strprintf.cpp | 2 -- src/utils/strprintf.h | 2 -- src/utils/tostring.h | 2 -- src/utils/trim.h | 2 -- src/utils/xml.cpp | 2 -- src/utils/xml.h | 2 -- src/vector.cpp | 2 -- src/vector.h | 2 -- tools/dyecmd/src/dye.cpp | 2 -- tools/dyecmd/src/dye.h | 2 -- tools/dyecmd/src/dyecmd.cpp | 2 -- tools/dyecmd/src/imagewriter.cpp | 2 -- tools/dyecmd/src/imagewriter.h | 2 -- tools/tmxcopy/base64.cpp | 1 - tools/tmxcopy/base64.h | 1 - tools/tmxcopy/tostring.h | 2 -- tools/tmxcopy/xmlutils.cpp | 1 - tools/tmxcopy/xmlutils.h | 1 - 375 files changed, 735 deletions(-) (limited to 'src/particle.h') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index 13596a70..b2bb1f28 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "animatedsprite.h" diff --git a/src/animatedsprite.h b/src/animatedsprite.h index a1fbe7a0..405bf42e 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ANIMATEDSPRITE_H diff --git a/src/animationparticle.cpp b/src/animationparticle.cpp index c79a5bc4..eb260157 100644 --- a/src/animationparticle.cpp +++ b/src/animationparticle.cpp @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include "animationparticle.h" diff --git a/src/animationparticle.h b/src/animationparticle.h index 054b1b73..eabc2742 100644 --- a/src/animationparticle.h +++ b/src/animationparticle.h @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #ifndef _ANIMATION_PARTICLE diff --git a/src/being.cpp b/src/being.cpp index bac66d48..a267d033 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "being.h" diff --git a/src/being.h b/src/being.h index a0475910..bf11e3ed 100644 --- a/src/being.h +++ b/src/being.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_BEING_H diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp index 40f438df..6d9267d2 100644 --- a/src/beingmanager.cpp +++ b/src/beingmanager.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/beingmanager.h b/src/beingmanager.h index f7a3b8f0..d3fb9888 100644 --- a/src/beingmanager.h +++ b/src/beingmanager.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_BEINGMANAGER_H diff --git a/src/channel.cpp b/src/channel.cpp index 969386f1..c62d6590 100644 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/channel.h b/src/channel.h index 3cb38a1c..01bd2728 100644 --- a/src/channel.h +++ b/src/channel.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/channelmanager.cpp b/src/channelmanager.cpp index 3c66f4bb..a332edbb 100644 --- a/src/channelmanager.cpp +++ b/src/channelmanager.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/channelmanager.h b/src/channelmanager.h index 5e6b5ba1..c19c548a 100644 --- a/src/channelmanager.h +++ b/src/channelmanager.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_CHANNELMANAGER_H diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 5c7b5e52..4b1a0225 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/commandhandler.h b/src/commandhandler.h index 10a4376f..eab0f077 100644 --- a/src/commandhandler.h +++ b/src/commandhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_COMMANDHANDLER_H diff --git a/src/configlistener.h b/src/configlistener.h index 7ce5d949..b740720f 100644 --- a/src/configlistener.h +++ b/src/configlistener.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_CONFIGLISTENER_H diff --git a/src/configuration.cpp b/src/configuration.cpp index 864ad7c3..e801083f 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/configuration.h b/src/configuration.h index 28246a02..a2d3b55d 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_CONFIGURATION_H diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index 87d98834..52f1eb31 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include "effectmanager.h" diff --git a/src/effectmanager.h b/src/effectmanager.h index b5451f27..1ae82caf 100644 --- a/src/effectmanager.h +++ b/src/effectmanager.h @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #ifndef _EFFECT_MANAGER_H diff --git a/src/engine.cpp b/src/engine.cpp index e4b25c02..ba5ce5e3 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "engine.h" diff --git a/src/engine.h b/src/engine.h index 0e77bf3d..dbee1258 100644 --- a/src/engine.h +++ b/src/engine.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _ENGINE_H diff --git a/src/equipment.cpp b/src/equipment.cpp index 265f230a..aa56b791 100644 --- a/src/equipment.cpp +++ b/src/equipment.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/equipment.h b/src/equipment.h index 7a0c8238..736074dd 100644 --- a/src/equipment.h +++ b/src/equipment.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_EQUIPMENT_H_ diff --git a/src/floor_item.cpp b/src/floor_item.cpp index 9727093f..7ad3c0c0 100644 --- a/src/floor_item.cpp +++ b/src/floor_item.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "floor_item.h" diff --git a/src/floor_item.h b/src/floor_item.h index a87e3f79..b747310b 100644 --- a/src/floor_item.h +++ b/src/floor_item.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_FLOORITEM_H_ diff --git a/src/flooritemmanager.cpp b/src/flooritemmanager.cpp index c28755fb..68c84b5b 100644 --- a/src/flooritemmanager.cpp +++ b/src/flooritemmanager.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "flooritemmanager.h" diff --git a/src/flooritemmanager.h b/src/flooritemmanager.h index c12883a4..3dbaf988 100644 --- a/src/flooritemmanager.h +++ b/src/flooritemmanager.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_FLOORITEMMANAGER_H diff --git a/src/game.cpp b/src/game.cpp index 421c8aac..df6d5578 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "game.h" diff --git a/src/game.h b/src/game.h index 56923bd0..4035584b 100644 --- a/src/game.h +++ b/src/game.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GAME_ diff --git a/src/graphics.cpp b/src/graphics.cpp index 586f9f49..6920bcb0 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/graphics.h b/src/graphics.h index 564826a2..efdd1ac1 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _GRAPHICS_H diff --git a/src/gui/box.cpp b/src/gui/box.cpp index 6af3ae3e..59d8c135 100644 --- a/src/gui/box.cpp +++ b/src/gui/box.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "box.h" diff --git a/src/gui/box.h b/src/gui/box.h index ed1a7163..46654b48 100644 --- a/src/gui/box.h +++ b/src/gui/box.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index 53a2ac0f..b0b6f48e 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/browserbox.h b/src/gui/browserbox.h index 0a9032e4..465ff497 100644 --- a/src/gui/browserbox.h +++ b/src/gui/browserbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef __TMW_BROWSERBOX_H__ diff --git a/src/gui/buddywindow.cpp b/src/gui/buddywindow.cpp index 0ed383ce..14a941a5 100644 --- a/src/gui/buddywindow.cpp +++ b/src/gui/buddywindow.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "buddywindow.h" diff --git a/src/gui/buddywindow.h b/src/gui/buddywindow.h index a3ca4de2..6b07f470 100644 --- a/src/gui/buddywindow.h +++ b/src/gui/buddywindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_BUDDYWINDOW_H diff --git a/src/gui/button.cpp b/src/gui/button.cpp index c6bc4ccb..40ecd1b7 100644 --- a/src/gui/button.cpp +++ b/src/gui/button.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/button.h b/src/gui/button.h index d12173b2..f451416c 100644 --- a/src/gui/button.h +++ b/src/gui/button.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_BUTTON_H diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 49d19675..a948b136 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "buy.h" diff --git a/src/gui/buy.h b/src/gui/buy.h index ec7419be..24f18742 100644 --- a/src/gui/buy.h +++ b/src/gui/buy.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_BUY_H diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp index ae5c7358..42380882 100644 --- a/src/gui/buysell.cpp +++ b/src/gui/buysell.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "buysell.h" diff --git a/src/gui/buysell.h b/src/gui/buysell.h index 97caf34b..2391ed1c 100644 --- a/src/gui/buysell.h +++ b/src/gui/buysell.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_BUYSELL_H diff --git a/src/gui/changeemaildialog.cpp b/src/gui/changeemaildialog.cpp index 94253d31..c9bc2570 100644 --- a/src/gui/changeemaildialog.cpp +++ b/src/gui/changeemaildialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "changeemaildialog.h" diff --git a/src/gui/changeemaildialog.h b/src/gui/changeemaildialog.h index 862c9d10..8ec3705d 100644 --- a/src/gui/changeemaildialog.h +++ b/src/gui/changeemaildialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_CHANGEEMAIL_H diff --git a/src/gui/changepassworddialog.cpp b/src/gui/changepassworddialog.cpp index e3bb0511..8d667790 100644 --- a/src/gui/changepassworddialog.cpp +++ b/src/gui/changepassworddialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "changepassworddialog.h" diff --git a/src/gui/changepassworddialog.h b/src/gui/changepassworddialog.h index 450cce61..0cf744da 100644 --- a/src/gui/changepassworddialog.h +++ b/src/gui/changepassworddialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_CHANGEPASSWORDDIALOG_H diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index c011aa84..3adfbc08 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "char_select.h" diff --git a/src/gui/char_select.h b/src/gui/char_select.h index 0c1dbe45..ed03cedd 100644 --- a/src/gui/char_select.h +++ b/src/gui/char_select.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _CHAR_SELECT_H diff --git a/src/gui/chargedialog.cpp b/src/gui/chargedialog.cpp index 862378ae..1c9edf45 100644 --- a/src/gui/chargedialog.cpp +++ b/src/gui/chargedialog.cpp @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ /* The window supported by this class shows player stats and keeps a charging diff --git a/src/gui/chargedialog.h b/src/gui/chargedialog.h index c09c692c..9517ef6a 100644 --- a/src/gui/chargedialog.h +++ b/src/gui/chargedialog.h @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #ifndef _TMW_CHARGE_H diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 82e7d372..c94429c8 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/chat.h b/src/gui/chat.h index f7af6480..a41b11fb 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_CHAT_H diff --git a/src/gui/chatinput.cpp b/src/gui/chatinput.cpp index fc5d6aab..afe7f037 100644 --- a/src/gui/chatinput.cpp +++ b/src/gui/chatinput.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "chatinput.h" diff --git a/src/gui/chatinput.h b/src/gui/chatinput.h index da2342ae..e04dfa6e 100644 --- a/src/gui/chatinput.h +++ b/src/gui/chatinput.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_CHATINPUT_H diff --git a/src/gui/checkbox.cpp b/src/gui/checkbox.cpp index 5b300d33..20e24dee 100644 --- a/src/gui/checkbox.cpp +++ b/src/gui/checkbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "checkbox.h" diff --git a/src/gui/checkbox.h b/src/gui/checkbox.h index 262e63ae..839ca97e 100644 --- a/src/gui/checkbox.h +++ b/src/gui/checkbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_CHECKBOX_H diff --git a/src/gui/confirm_dialog.cpp b/src/gui/confirm_dialog.cpp index 65ca27f7..5f2b9cb2 100644 --- a/src/gui/confirm_dialog.cpp +++ b/src/gui/confirm_dialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "confirm_dialog.h" diff --git a/src/gui/confirm_dialog.h b/src/gui/confirm_dialog.h index 8728f83f..c9bfca02 100644 --- a/src/gui/confirm_dialog.h +++ b/src/gui/confirm_dialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_OPTION_DIALOG_H diff --git a/src/gui/connection.cpp b/src/gui/connection.cpp index a9fa2a56..f54c9dd5 100644 --- a/src/gui/connection.cpp +++ b/src/gui/connection.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "connection.h" diff --git a/src/gui/connection.h b/src/gui/connection.h index 51ad5467..36ccd8a9 100644 --- a/src/gui/connection.h +++ b/src/gui/connection.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_CONNECTION_H diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index 3d0690b9..d92c3575 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "debugwindow.h" diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h index 9b6f2017..ae1d8b14 100644 --- a/src/gui/debugwindow.h +++ b/src/gui/debugwindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_DEBUGWINDOW_H diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 9a96b4d6..aee262d0 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #define BOX_WIDTH 36 diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h index 696f4fc6..b6d2e2f4 100644 --- a/src/gui/equipmentwindow.h +++ b/src/gui/equipmentwindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_EQUIPMENT_H diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp index ffdb7896..1bda568e 100644 --- a/src/gui/focushandler.cpp +++ b/src/gui/focushandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "focushandler.h" diff --git a/src/gui/focushandler.h b/src/gui/focushandler.h index 252fdd9d..a5218485 100644 --- a/src/gui/focushandler.h +++ b/src/gui/focushandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_FOCUSHANDLER_H diff --git a/src/gui/gccontainer.cpp b/src/gui/gccontainer.cpp index 1edb4daf..ec3c8a5c 100644 --- a/src/gui/gccontainer.cpp +++ b/src/gui/gccontainer.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "gccontainer.h" diff --git a/src/gui/gccontainer.h b/src/gui/gccontainer.h index 8b8a7ffe..cc7c9336 100644 --- a/src/gui/gccontainer.h +++ b/src/gui/gccontainer.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_GCCONTAINER_H diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index bc2f017b..6803be65 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "gui.h" diff --git a/src/gui/gui.h b/src/gui/gui.h index 84f52a31..a07d236f 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI diff --git a/src/gui/guildlistbox.cpp b/src/gui/guildlistbox.cpp index 5fe62fe5..556df3fe 100644 --- a/src/gui/guildlistbox.cpp +++ b/src/gui/guildlistbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id $ */ #include "guildlistbox.h" diff --git a/src/gui/guildlistbox.h b/src/gui/guildlistbox.h index b3892955..cc8e3ce7 100644 --- a/src/gui/guildlistbox.h +++ b/src/gui/guildlistbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id $ */ #ifndef _TMW_GUI_GUILDLISTBOX_H diff --git a/src/gui/guildwindow.cpp b/src/gui/guildwindow.cpp index 3319489c..ae9684df 100644 --- a/src/gui/guildwindow.cpp +++ b/src/gui/guildwindow.cpp @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * $$ */ diff --git a/src/gui/guildwindow.h b/src/gui/guildwindow.h index e1bd99d7..4f6b9cbb 100644 --- a/src/gui/guildwindow.h +++ b/src/gui/guildwindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_GUILDWINDOW_H diff --git a/src/gui/hbox.cpp b/src/gui/hbox.cpp index 69564fbb..020e85c6 100644 --- a/src/gui/hbox.cpp +++ b/src/gui/hbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "hbox.h" diff --git a/src/gui/hbox.h b/src/gui/hbox.h index 560b1a29..4b241383 100644 --- a/src/gui/hbox.h +++ b/src/gui/hbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef HBOX_H diff --git a/src/gui/help.cpp b/src/gui/help.cpp index 87de1e2f..ffe9c02d 100644 --- a/src/gui/help.cpp +++ b/src/gui/help.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "help.h" diff --git a/src/gui/help.h b/src/gui/help.h index 3c3715a0..053df723 100644 --- a/src/gui/help.h +++ b/src/gui/help.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_HELP_H diff --git a/src/gui/icon.cpp b/src/gui/icon.cpp index 58b3ae8a..1e352292 100644 --- a/src/gui/icon.cpp +++ b/src/gui/icon.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "icon.h" diff --git a/src/gui/icon.h b/src/gui/icon.h index f0d3a70a..9baf1a99 100644 --- a/src/gui/icon.h +++ b/src/gui/icon.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/gui/inttextbox.cpp b/src/gui/inttextbox.cpp index 17e87afd..644601cf 100644 --- a/src/gui/inttextbox.cpp +++ b/src/gui/inttextbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "inttextbox.h" diff --git a/src/gui/inttextbox.h b/src/gui/inttextbox.h index 219c6018..8dad0c39 100644 --- a/src/gui/inttextbox.h +++ b/src/gui/inttextbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef INTTEXTBOX_H diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 2127442a..82b36aef 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "inventorywindow.h" diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index f9ff8ea2..a7130b65 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_INVENTORYWINDOW_H diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp index 6f1c8ae6..c6763014 100644 --- a/src/gui/item_amount.cpp +++ b/src/gui/item_amount.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "item_amount.h" diff --git a/src/gui/item_amount.h b/src/gui/item_amount.h index 03303603..dd1026b7 100644 --- a/src/gui/item_amount.h +++ b/src/gui/item_amount.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ITEM_AMOUNT_WINDOW_H diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 4c528a16..5fb99ffc 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "itemcontainer.h" diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h index 9ae5c9c2..8d93671c 100644 --- a/src/gui/itemcontainer.h +++ b/src/gui/itemcontainer.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ITEMCONTAINER_H__ diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index cf719f9f..02d35570 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -18,8 +18,6 @@ * You should have received a copy of the GNU General Public License * along with The Legend of Mazzeroth; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "itempopup.h" diff --git a/src/gui/itempopup.h b/src/gui/itempopup.h index 499b2e0a..cb55296c 100644 --- a/src/gui/itempopup.h +++ b/src/gui/itempopup.h @@ -1,5 +1,4 @@ /* -* * The Legend of Mazzeroth * Copyright (C) 2008, The Legend of Mazzeroth Development Team * @@ -19,8 +18,6 @@ * You should have received a copy of the GNU General Public License * along with The Legend of Mazzeroth; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _LOM_ITEMPOPUP_H__ diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp index 23b41650..76104e12 100644 --- a/src/gui/itemshortcutcontainer.cpp +++ b/src/gui/itemshortcutcontainer.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "itemshortcutcontainer.h" diff --git a/src/gui/itemshortcutcontainer.h b/src/gui/itemshortcutcontainer.h index 58f0aea7..76ca870c 100644 --- a/src/gui/itemshortcutcontainer.h +++ b/src/gui/itemshortcutcontainer.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ITEMSHORTCUTCONTAINER_H__ diff --git a/src/gui/itemshortcutwindow.cpp b/src/gui/itemshortcutwindow.cpp index fb75e20d..e4d352fe 100644 --- a/src/gui/itemshortcutwindow.cpp +++ b/src/gui/itemshortcutwindow.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "itemshortcutwindow.h" diff --git a/src/gui/itemshortcutwindow.h b/src/gui/itemshortcutwindow.h index 9742abdc..017df5ec 100644 --- a/src/gui/itemshortcutwindow.h +++ b/src/gui/itemshortcutwindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ITEMSHORTCUTWINDOW_H diff --git a/src/gui/linkhandler.h b/src/gui/linkhandler.h index 3a32f825..44f906db 100644 --- a/src/gui/linkhandler.h +++ b/src/gui/linkhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_LINK_HANDLER_H_ diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp index ac18c2cd..204d7961 100644 --- a/src/gui/listbox.cpp +++ b/src/gui/listbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "listbox.h" diff --git a/src/gui/listbox.h b/src/gui/listbox.h index 03a8b541..d42c7d3e 100644 --- a/src/gui/listbox.h +++ b/src/gui/listbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_LISTBOX_H diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 72d7ee51..24c55e37 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "login.h" diff --git a/src/gui/login.h b/src/gui/login.h index d8ae7eaf..1c23a0f5 100644 --- a/src/gui/login.h +++ b/src/gui/login.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_LOGIN_H diff --git a/src/gui/magic.cpp b/src/gui/magic.cpp index 28e7de92..a31b661a 100644 --- a/src/gui/magic.cpp +++ b/src/gui/magic.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: skill.cpp 4569 2008-09-04 20:09:57Z b_lindeijer $ */ #include diff --git a/src/gui/magic.h b/src/gui/magic.h index a8082755..af46c823 100644 --- a/src/gui/magic.h +++ b/src/gui/magic.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: skill.h 4476 2008-08-18 01:23:58Z rhoderyc $ */ #ifndef _TMW_MAGIC_H @@ -32,7 +30,6 @@ #include "../guichanfwd.h" - /** * The skill dialog. * diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp index c3e572a7..dbbb08d2 100644 --- a/src/gui/menuwindow.cpp +++ b/src/gui/menuwindow.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "menuwindow.h" diff --git a/src/gui/menuwindow.h b/src/gui/menuwindow.h index f43b9921..03ec3380 100644 --- a/src/gui/menuwindow.h +++ b/src/gui/menuwindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MENU_H diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 5f768609..501530f1 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "minimap.h" diff --git a/src/gui/minimap.h b/src/gui/minimap.h index 5e9458bf..f91dc22d 100644 --- a/src/gui/minimap.h +++ b/src/gui/minimap.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MINIMAP_H diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index 3742be64..424c3558 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "ministatus.h" diff --git a/src/gui/ministatus.h b/src/gui/ministatus.h index 1192bc1e..f512ef25 100644 --- a/src/gui/ministatus.h +++ b/src/gui/ministatus.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MINISTATUS_H diff --git a/src/gui/newskill.cpp b/src/gui/newskill.cpp index 6783a546..20fc01bd 100644 --- a/src/gui/newskill.cpp +++ b/src/gui/newskill.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ /* This file implements the new skill dialog for use under the latest diff --git a/src/gui/newskill.h b/src/gui/newskill.h index 6e12169f..49476e5e 100644 --- a/src/gui/newskill.h +++ b/src/gui/newskill.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NSKILL_H diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp index fd02a14a..c593feb1 100644 --- a/src/gui/npc_text.cpp +++ b/src/gui/npc_text.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "npc_text.h" diff --git a/src/gui/npc_text.h b/src/gui/npc_text.h index 0ef1b938..2c9771d3 100644 --- a/src/gui/npc_text.h +++ b/src/gui/npc_text.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NPC_TEXT_H diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp index ff017a0e..918031b4 100644 --- a/src/gui/npclistdialog.cpp +++ b/src/gui/npclistdialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "npclistdialog.h" diff --git a/src/gui/npclistdialog.h b/src/gui/npclistdialog.h index 02b9cd49..e21f9e8c 100644 --- a/src/gui/npclistdialog.h +++ b/src/gui/npclistdialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_NPCLISTDIALOG_H diff --git a/src/gui/npcpostdialog.cpp b/src/gui/npcpostdialog.cpp index 2d3fce64..3a72b21b 100644 --- a/src/gui/npcpostdialog.cpp +++ b/src/gui/npcpostdialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "npcpostdialog.h" diff --git a/src/gui/npcpostdialog.h b/src/gui/npcpostdialog.h index e142dac5..1956c877 100644 --- a/src/gui/npcpostdialog.h +++ b/src/gui/npcpostdialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_NPCPOSTDIALOG_H diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp index 37d66353..b03c3964 100644 --- a/src/gui/ok_dialog.cpp +++ b/src/gui/ok_dialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "ok_dialog.h" diff --git a/src/gui/ok_dialog.h b/src/gui/ok_dialog.h index a7b24a90..cba12d72 100644 --- a/src/gui/ok_dialog.h +++ b/src/gui/ok_dialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _OK_DIALOG_H diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp index 1b963dae..262e3b2e 100644 --- a/src/gui/partywindow.cpp +++ b/src/gui/partywindow.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: box.cpp 1456 2005-07-15 23:17:00Z b_lindeijer $ */ #include "partywindow.h" diff --git a/src/gui/partywindow.h b/src/gui/partywindow.h index f09eeb6a..e79bf392 100644 --- a/src/gui/partywindow.h +++ b/src/gui/partywindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: box.cpp 1456 2005-07-15 23:17:00Z b_lindeijer $ */ #ifndef _TMW_PARTYWINDOW_H diff --git a/src/gui/passwordfield.cpp b/src/gui/passwordfield.cpp index 533f54fb..01c7e15d 100644 --- a/src/gui/passwordfield.cpp +++ b/src/gui/passwordfield.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "passwordfield.h" diff --git a/src/gui/passwordfield.h b/src/gui/passwordfield.h index cae1f92e..8a14b72a 100644 --- a/src/gui/passwordfield.h +++ b/src/gui/passwordfield.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_PASSWORDFIELD_H_ diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp index e9237110..0a0c8a17 100644 --- a/src/gui/playerbox.cpp +++ b/src/gui/playerbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/playerbox.h b/src/gui/playerbox.h index c226e750..78eeee91 100644 --- a/src/gui/playerbox.h +++ b/src/gui/playerbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef __TMW_PLAYERBOX_H__ diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 2888382b..59ca0867 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "popupmenu.h" diff --git a/src/gui/popupmenu.h b/src/gui/popupmenu.h index 9fe9f866..2d10e6eb 100644 --- a/src/gui/popupmenu.h +++ b/src/gui/popupmenu.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_POPUP_MENU_H diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp index 90a85478..9a47eefc 100644 --- a/src/gui/progressbar.cpp +++ b/src/gui/progressbar.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "progressbar.h" diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h index ddabbb77..0b1616f5 100644 --- a/src/gui/progressbar.h +++ b/src/gui/progressbar.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_PROGRESSBAR_H diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index 7ed4f913..563ed34a 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include "quitdialog.h" diff --git a/src/gui/quitdialog.h b/src/gui/quitdialog.h index 97a03f2e..018f1e52 100644 --- a/src/gui/quitdialog.h +++ b/src/gui/quitdialog.h @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #ifndef _TMW_QUITDIALOG_H diff --git a/src/gui/radiobutton.cpp b/src/gui/radiobutton.cpp index 57d6772d..619ec84f 100644 --- a/src/gui/radiobutton.cpp +++ b/src/gui/radiobutton.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "radiobutton.h" diff --git a/src/gui/radiobutton.h b/src/gui/radiobutton.h index 3b97ad86..09f703dc 100644 --- a/src/gui/radiobutton.h +++ b/src/gui/radiobutton.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_RADIOBUTTON_H diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 7e236a7d..051c0fa4 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "register.h" diff --git a/src/gui/register.h b/src/gui/register.h index 088e8f9b..79578461 100644 --- a/src/gui/register.h +++ b/src/gui/register.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_REGISTER_H diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp index 255aa2d8..032e3f78 100644 --- a/src/gui/scrollarea.cpp +++ b/src/gui/scrollarea.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/scrollarea.h b/src/gui/scrollarea.h index be361f68..d21dae11 100644 --- a/src/gui/scrollarea.h +++ b/src/gui/scrollarea.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef __TMW_SCROLLAREA_H__ diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index cef53697..ee94b2c6 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -53,8 +53,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id$ */ #include "sdlinput.h" diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h index e23178fa..72d949e1 100644 --- a/src/gui/sdlinput.h +++ b/src/gui/sdlinput.h @@ -53,8 +53,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $Id$ */ #ifndef _TMW_SDLINPUT_ diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index 37626155..30e78368 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "sell.h" diff --git a/src/gui/sell.h b/src/gui/sell.h index 63a16770..742c28fb 100644 --- a/src/gui/sell.h +++ b/src/gui/sell.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SELL_H diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index a6d1d1f0..b11aea6c 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index 53474611..268b1baf 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SERVERDIALOG_H diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index b6b052bc..2a60308b 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/setup.h b/src/gui/setup.h index 77173367..2142a67d 100644 --- a/src/gui/setup.h +++ b/src/gui/setup.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SETUP_H diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp index 1ed4fc94..4f09cde0 100644 --- a/src/gui/setup_audio.cpp +++ b/src/gui/setup_audio.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "setup_audio.h" diff --git a/src/gui/setup_audio.h b/src/gui/setup_audio.h index 6e722f74..eaa55de6 100644 --- a/src/gui/setup_audio.h +++ b/src/gui/setup_audio.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_SETUP_AUDIO_H diff --git a/src/gui/setup_joystick.cpp b/src/gui/setup_joystick.cpp index 57adef28..9de5be9f 100644 --- a/src/gui/setup_joystick.cpp +++ b/src/gui/setup_joystick.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "setup_joystick.h" diff --git a/src/gui/setup_joystick.h b/src/gui/setup_joystick.h index 6d3ad129..0b7ebe98 100644 --- a/src/gui/setup_joystick.h +++ b/src/gui/setup_joystick.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_SETUP_JOYSTICK_H diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp index 2b785dd5..270f4a0e 100644 --- a/src/gui/setup_keyboard.cpp +++ b/src/gui/setup_keyboard.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "setup_keyboard.h" diff --git a/src/gui/setup_keyboard.h b/src/gui/setup_keyboard.h index b72e8746..50fa76fb 100644 --- a/src/gui/setup_keyboard.h +++ b/src/gui/setup_keyboard.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_SETUP_KEYBOARD_H diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 4d9b5d74..51cee8e3 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "setup_video.h" diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h index e4e9fcf1..17ca1241 100644 --- a/src/gui/setup_video.h +++ b/src/gui/setup_video.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_SETUP_VIDEO_H diff --git a/src/gui/setuptab.h b/src/gui/setuptab.h index a7d45b9a..6c276c35 100644 --- a/src/gui/setuptab.h +++ b/src/gui/setuptab.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_SETUPTAB_H diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp index 2a7ea0ce..a521c75b 100644 --- a/src/gui/shop.cpp +++ b/src/gui/shop.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "shop.h" diff --git a/src/gui/shop.h b/src/gui/shop.h index f4329b4d..62b60cae 100644 --- a/src/gui/shop.h +++ b/src/gui/shop.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _SHOP_H diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp index ba77be47..bce6a48c 100644 --- a/src/gui/shoplistbox.cpp +++ b/src/gui/shoplistbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "shoplistbox.h" diff --git a/src/gui/shoplistbox.h b/src/gui/shoplistbox.h index d5e2d836..75f514ab 100644 --- a/src/gui/shoplistbox.h +++ b/src/gui/shoplistbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SHOPLISTBOX_H diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 49037cbd..49bacaf0 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/skill.h b/src/gui/skill.h index 12f619bd..3d010daa 100644 --- a/src/gui/skill.h +++ b/src/gui/skill.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SKILL_H diff --git a/src/gui/slider.cpp b/src/gui/slider.cpp index c94c7bfb..afeecf17 100644 --- a/src/gui/slider.cpp +++ b/src/gui/slider.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "slider.h" diff --git a/src/gui/slider.h b/src/gui/slider.h index dc38b738..3b796425 100644 --- a/src/gui/slider.h +++ b/src/gui/slider.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SLIDER_H diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp index 815238b9..d3ef7bbe 100644 --- a/src/gui/speechbubble.cpp +++ b/src/gui/speechbubble.cpp @@ -18,8 +18,6 @@ * You should have received a copy of the GNU General Public License * along with The Legend of Mazzeroth; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "speechbubble.h" diff --git a/src/gui/speechbubble.h b/src/gui/speechbubble.h index c4ca9109..ed69a8d2 100644 --- a/src/gui/speechbubble.h +++ b/src/gui/speechbubble.h @@ -18,8 +18,6 @@ * You should have received a copy of the GNU General Public License * along with The Legend of Mazzeroth; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _LOM_SPEECHBUBBLE_H__ diff --git a/src/gui/status.cpp b/src/gui/status.cpp index b9ebfecf..43f81135 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "status.h" diff --git a/src/gui/status.h b/src/gui/status.h index 6e613495..262b89f6 100644 --- a/src/gui/status.h +++ b/src/gui/status.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_STATUS_H diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp index 8d16dc46..619265ec 100644 --- a/src/gui/textbox.cpp +++ b/src/gui/textbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "textbox.h" diff --git a/src/gui/textbox.h b/src/gui/textbox.h index f06f98ec..2060e377 100644 --- a/src/gui/textbox.h +++ b/src/gui/textbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef __TMW_TEXTBOX_H__ diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp index 3986ed4e..05e43906 100644 --- a/src/gui/textdialog.cpp +++ b/src/gui/textdialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "textdialog.h" diff --git a/src/gui/textdialog.h b/src/gui/textdialog.h index c03ce7e6..8b4e2cc3 100644 --- a/src/gui/textdialog.h +++ b/src/gui/textdialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUI_GUILD_DIALOG_H diff --git a/src/gui/textfield.cpp b/src/gui/textfield.cpp index 4fd85d36..49c0c91d 100644 --- a/src/gui/textfield.cpp +++ b/src/gui/textfield.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/textfield.h b/src/gui/textfield.h index 36f921ac..b808fad2 100644 --- a/src/gui/textfield.h +++ b/src/gui/textfield.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef __TMW_TEXTFIELD_H__ diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index c098c04c..38064f48 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/trade.h b/src/gui/trade.h index c8ece8d9..c51e0fdd 100644 --- a/src/gui/trade.h +++ b/src/gui/trade.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_TRADE_H diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp index 7f9abd3a..1132c3b5 100644 --- a/src/gui/truetypefont.cpp +++ b/src/gui/truetypefont.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "truetypefont.h" diff --git a/src/gui/truetypefont.h b/src/gui/truetypefont.h index 6dbc6634..3b39329e 100644 --- a/src/gui/truetypefont.h +++ b/src/gui/truetypefont.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_TRUETYPEFONT_H diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp index 4b8755d5..1e09ca23 100644 --- a/src/gui/unregisterdialog.cpp +++ b/src/gui/unregisterdialog.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "unregisterdialog.h" diff --git a/src/gui/unregisterdialog.h b/src/gui/unregisterdialog.h index 8c8eaf64..4056d251 100644 --- a/src/gui/unregisterdialog.h +++ b/src/gui/unregisterdialog.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UNREGISTERDIALOG_H diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 22bf8c13..ff1e600c 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "updatewindow.h" diff --git a/src/gui/updatewindow.h b/src/gui/updatewindow.h index 61ea4a27..d7e3c4c7 100644 --- a/src/gui/updatewindow.h +++ b/src/gui/updatewindow.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _UPDATERWINDOW_H diff --git a/src/gui/vbox.cpp b/src/gui/vbox.cpp index b503508e..2ec1112d 100644 --- a/src/gui/vbox.cpp +++ b/src/gui/vbox.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "vbox.h" diff --git a/src/gui/vbox.h b/src/gui/vbox.h index 06a270ef..2072ab24 100644 --- a/src/gui/vbox.h +++ b/src/gui/vbox.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef VBOX_H diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 14239094..1795836d 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "viewport.h" diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 5dedcea8..dd17fa24 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_VIEWPORT_H_ diff --git a/src/gui/widgets/avatar.cpp b/src/gui/widgets/avatar.cpp index 03fa1aeb..68ce5243 100644 --- a/src/gui/widgets/avatar.cpp +++ b/src/gui/widgets/avatar.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "avatar.h" diff --git a/src/gui/widgets/avatar.h b/src/gui/widgets/avatar.h index 3707e8f8..0f657895 100644 --- a/src/gui/widgets/avatar.h +++ b/src/gui/widgets/avatar.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_AVATAR_H diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index b33a55cf..d4c2bc4b 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index d0dab7d2..58a18a15 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef DROPDOWN_H diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp index 02ed42a1..bcc54cf7 100644 --- a/src/gui/widgets/layout.cpp +++ b/src/gui/widgets/layout.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h index 5914b5c1..d631c154 100644 --- a/src/gui/widgets/layout.h +++ b/src/gui/widgets/layout.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_WIDGET_LAYOUT_H__ diff --git a/src/gui/widgets/resizegrip.cpp b/src/gui/widgets/resizegrip.cpp index 6be50f2c..c3b537db 100644 --- a/src/gui/widgets/resizegrip.cpp +++ b/src/gui/widgets/resizegrip.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "resizegrip.h" diff --git a/src/gui/widgets/resizegrip.h b/src/gui/widgets/resizegrip.h index 04be3db3..f57eda94 100644 --- a/src/gui/widgets/resizegrip.h +++ b/src/gui/widgets/resizegrip.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_RESIZEGRIP_H diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index 990c6a95..c53ac85c 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h index b18c93e3..42964b0f 100644 --- a/src/gui/widgets/tab.h +++ b/src/gui/widgets/tab.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_TAB_H diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 7a4d153a..205fdc99 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "tabbedarea.h" diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 554a68b6..2199264b 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_TABBEDAREA_H diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 2bce49b2..e498236a 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/gui/window.h b/src/gui/window.h index 44982500..22355572 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_WINDOW_H__ diff --git a/src/gui/windowcontainer.cpp b/src/gui/windowcontainer.cpp index 006dbf44..d8535f73 100644 --- a/src/gui/windowcontainer.cpp +++ b/src/gui/windowcontainer.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "windowcontainer.h" diff --git a/src/gui/windowcontainer.h b/src/gui/windowcontainer.h index df255f84..88a13d31 100644 --- a/src/gui/windowcontainer.h +++ b/src/gui/windowcontainer.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_WINDOWCONTAINER_H_ diff --git a/src/guichanfwd.h b/src/guichanfwd.h index 812f3f7a..4fb7ea3e 100644 --- a/src/guichanfwd.h +++ b/src/guichanfwd.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_GUICHANFWD_H diff --git a/src/guild.cpp b/src/guild.cpp index c02af865..68e65cb9 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "guild.h" diff --git a/src/guild.h b/src/guild.h index e262d3df..7c85fe31 100644 --- a/src/guild.h +++ b/src/guild.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef TMW_GUILD_H diff --git a/src/imageparticle.cpp b/src/imageparticle.cpp index 965434b0..65780345 100644 --- a/src/imageparticle.cpp +++ b/src/imageparticle.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "imageparticle.h" diff --git a/src/imageparticle.h b/src/imageparticle.h index 0ad515cc..91c5426c 100644 --- a/src/imageparticle.h +++ b/src/imageparticle.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _IMAGEPARTICLE_H diff --git a/src/inventory.cpp b/src/inventory.cpp index 807e1223..85461f90 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "inventory.h" diff --git a/src/inventory.h b/src/inventory.h index 48ace29c..90d9c7a2 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _INVENTORY_H diff --git a/src/item.cpp b/src/item.cpp index 210589e9..374d5051 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "item.h" diff --git a/src/item.h b/src/item.h index fc71e53d..37db52a4 100644 --- a/src/item.h +++ b/src/item.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _ITEM_H_ diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp index 59c1ee3b..a89da974 100644 --- a/src/itemshortcut.cpp +++ b/src/itemshortcut.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "itemshortcut.h" diff --git a/src/itemshortcut.h b/src/itemshortcut.h index d75db2e8..a0c52468 100644 --- a/src/itemshortcut.h +++ b/src/itemshortcut.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ITEMSHORTCUT_H__ diff --git a/src/joystick.cpp b/src/joystick.cpp index a5dab4f4..b69537cf 100644 --- a/src/joystick.cpp +++ b/src/joystick.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "joystick.h" diff --git a/src/joystick.h b/src/joystick.h index 321e3e7d..4cc1babd 100644 --- a/src/joystick.h +++ b/src/joystick.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_JOYSTICK_H diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index a959e244..37d5f276 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "keyboardconfig.h" diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index 53a5c96d..d9886150 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_KEYBOARDCONFIG_H diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 30ad7b2e..14d253c0 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "localplayer.h" diff --git a/src/localplayer.h b/src/localplayer.h index 16b9715a..5dce5ebe 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_LOCALPLAYER_H diff --git a/src/lockedarray.h b/src/lockedarray.h index f31292d7..8e525191 100644 --- a/src/lockedarray.h +++ b/src/lockedarray.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_LOCKEDARRAY_H diff --git a/src/logindata.h b/src/logindata.h index 689a5aaa..3d959ad4 100644 --- a/src/logindata.h +++ b/src/logindata.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_LOGINDATA_H diff --git a/src/main.cpp b/src/main.cpp index ede00d57..33900d5d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "main.h" diff --git a/src/main.h b/src/main.h index d123834b..49173266 100644 --- a/src/main.h +++ b/src/main.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MAIN_H diff --git a/src/map.cpp b/src/map.cpp index e10e4fad..5c2290d6 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "map.h" diff --git a/src/map.h b/src/map.h index c4a4fc0b..07bf2866 100644 --- a/src/map.h +++ b/src/map.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MAP_H_ diff --git a/src/monster.cpp b/src/monster.cpp index 396d0c06..a62c1f4c 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "monster.h" diff --git a/src/monster.h b/src/monster.h index bde99ed6..5b6fcf61 100644 --- a/src/monster.h +++ b/src/monster.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MONSTER_H diff --git a/src/net/accountserver/account.cpp b/src/net/accountserver/account.cpp index d1fe6863..f734c4eb 100644 --- a/src/net/accountserver/account.cpp +++ b/src/net/accountserver/account.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "account.h" diff --git a/src/net/accountserver/account.h b/src/net/accountserver/account.h index 0cf0758e..581bcb42 100644 --- a/src/net/accountserver/account.h +++ b/src/net/accountserver/account.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_ACCOUNTSERVER_CHARACTER_H diff --git a/src/net/accountserver/accountserver.cpp b/src/net/accountserver/accountserver.cpp index db94563b..b1ce590c 100644 --- a/src/net/accountserver/accountserver.cpp +++ b/src/net/accountserver/accountserver.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "accountserver.h" diff --git a/src/net/accountserver/accountserver.h b/src/net/accountserver/accountserver.h index 8bfe991c..8e0573fc 100644 --- a/src/net/accountserver/accountserver.h +++ b/src/net/accountserver/accountserver.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_ACCOUNTSERVER_ACCOUNTSERVER_H diff --git a/src/net/accountserver/internal.cpp b/src/net/accountserver/internal.cpp index 28a9695e..a3be76a1 100644 --- a/src/net/accountserver/internal.cpp +++ b/src/net/accountserver/internal.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "internal.h" diff --git a/src/net/accountserver/internal.h b/src/net/accountserver/internal.h index 8af5ec04..35f986cd 100644 --- a/src/net/accountserver/internal.h +++ b/src/net/accountserver/internal.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_ACCOUNTSERVER_INTERNAL_H diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index dd7d467b..72371da5 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "beinghandler.h" diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h index 8ac07017..b02728b4 100644 --- a/src/net/beinghandler.h +++ b/src/net/beinghandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_BEINGHANDLER_H diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index 57806edc..596ac434 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "buysellhandler.h" diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h index e242d373..52e9b2f7 100644 --- a/src/net/buysellhandler.h +++ b/src/net/buysellhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_BUYSELLHANDLER_H diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 6cc9e384..bde856a5 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "charserverhandler.h" diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h index 4a4fe0c3..08ba5102 100644 --- a/src/net/charserverhandler.h +++ b/src/net/charserverhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_CHARSERVERHANDLER_H diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp index 0cb59403..d81a8b7d 100644 --- a/src/net/chathandler.cpp +++ b/src/net/chathandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "chathandler.h" diff --git a/src/net/chathandler.h b/src/net/chathandler.h index 7ca4d50d..aeaf5368 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_CHATHANDLER_H diff --git a/src/net/chatserver/chatserver.cpp b/src/net/chatserver/chatserver.cpp index f302a0ef..94e36b94 100644 --- a/src/net/chatserver/chatserver.cpp +++ b/src/net/chatserver/chatserver.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "chatserver.h" diff --git a/src/net/chatserver/chatserver.h b/src/net/chatserver/chatserver.h index 10de1213..1129239a 100644 --- a/src/net/chatserver/chatserver.h +++ b/src/net/chatserver/chatserver.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_CHATSERVER_CHATSERVER_H diff --git a/src/net/chatserver/guild.cpp b/src/net/chatserver/guild.cpp index fb400d5d..042ff013 100644 --- a/src/net/chatserver/guild.cpp +++ b/src/net/chatserver/guild.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/net/chatserver/guild.h b/src/net/chatserver/guild.h index 354ecd82..6c35be9f 100644 --- a/src/net/chatserver/guild.h +++ b/src/net/chatserver/guild.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/net/chatserver/internal.cpp b/src/net/chatserver/internal.cpp index c1f7a3f7..0822d93d 100644 --- a/src/net/chatserver/internal.cpp +++ b/src/net/chatserver/internal.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "internal.h" diff --git a/src/net/chatserver/internal.h b/src/net/chatserver/internal.h index 7579972b..b0f137c5 100644 --- a/src/net/chatserver/internal.h +++ b/src/net/chatserver/internal.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_CHATSERVER_INTERNAL_H diff --git a/src/net/chatserver/party.cpp b/src/net/chatserver/party.cpp index ff465924..56eb57d2 100644 --- a/src/net/chatserver/party.cpp +++ b/src/net/chatserver/party.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/net/chatserver/party.h b/src/net/chatserver/party.h index 1d47c2c5..c1febd66 100644 --- a/src/net/chatserver/party.h +++ b/src/net/chatserver/party.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ diff --git a/src/net/connection.cpp b/src/net/connection.cpp index caaa0ce1..7d3c2328 100644 --- a/src/net/connection.cpp +++ b/src/net/connection.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "connection.h" diff --git a/src/net/connection.h b/src/net/connection.h index 734c8d65..4ab3d24d 100644 --- a/src/net/connection.h +++ b/src/net/connection.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_CONNECTION_H diff --git a/src/net/effecthandler.cpp b/src/net/effecthandler.cpp index 04951d46..f7ff2bf2 100644 --- a/src/net/effecthandler.cpp +++ b/src/net/effecthandler.cpp @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include "effecthandler.h" diff --git a/src/net/effecthandler.h b/src/net/effecthandler.h index d836b341..283c7c10 100644 --- a/src/net/effecthandler.h +++ b/src/net/effecthandler.h @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #ifndef _TMW_NET_EFFECTSHANDLER_H diff --git a/src/net/gameserver/gameserver.cpp b/src/net/gameserver/gameserver.cpp index e451d473..1bdaef26 100644 --- a/src/net/gameserver/gameserver.cpp +++ b/src/net/gameserver/gameserver.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "gameserver.h" diff --git a/src/net/gameserver/gameserver.h b/src/net/gameserver/gameserver.h index 5bf196b6..5ea2c718 100644 --- a/src/net/gameserver/gameserver.h +++ b/src/net/gameserver/gameserver.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_GAMESERVER_GAMESERVER_H diff --git a/src/net/gameserver/internal.cpp b/src/net/gameserver/internal.cpp index 328b4863..6b6ba081 100644 --- a/src/net/gameserver/internal.cpp +++ b/src/net/gameserver/internal.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "internal.h" diff --git a/src/net/gameserver/internal.h b/src/net/gameserver/internal.h index 567e15d2..df9787fe 100644 --- a/src/net/gameserver/internal.h +++ b/src/net/gameserver/internal.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_GAMESERVER_INTERNAL_H diff --git a/src/net/gameserver/player.cpp b/src/net/gameserver/player.cpp index cd85447c..95c13ec2 100644 --- a/src/net/gameserver/player.cpp +++ b/src/net/gameserver/player.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "player.h" diff --git a/src/net/gameserver/player.h b/src/net/gameserver/player.h index 75e28270..9e68ced9 100644 --- a/src/net/gameserver/player.h +++ b/src/net/gameserver/player.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_GAMESERVER_PLAYER_H diff --git a/src/net/guildhandler.cpp b/src/net/guildhandler.cpp index f6677cd8..cf886ab3 100644 --- a/src/net/guildhandler.cpp +++ b/src/net/guildhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/net/guildhandler.h b/src/net/guildhandler.h index 01ad428b..4eb2da0b 100644 --- a/src/net/guildhandler.h +++ b/src/net/guildhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_GUILDHANDLER_H diff --git a/src/net/internal.cpp b/src/net/internal.cpp index 358aa143..4cb88a4e 100644 --- a/src/net/internal.cpp +++ b/src/net/internal.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "internal.h" diff --git a/src/net/internal.h b/src/net/internal.h index e1ef648a..1e411605 100644 --- a/src/net/internal.h +++ b/src/net/internal.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_INTERNAL_H diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp index dde6a954..41032f13 100644 --- a/src/net/inventoryhandler.cpp +++ b/src/net/inventoryhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "inventoryhandler.h" diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index 4190bf83..1326ea71 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_INVENTORYHANDLER_H diff --git a/src/net/itemhandler.cpp b/src/net/itemhandler.cpp index ea65bc3b..af06084f 100644 --- a/src/net/itemhandler.cpp +++ b/src/net/itemhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "itemhandler.h" diff --git a/src/net/itemhandler.h b/src/net/itemhandler.h index 5ffcb134..e3005a6f 100644 --- a/src/net/itemhandler.h +++ b/src/net/itemhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_ITEMHANDLER_H diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 6840d90c..f1898fb5 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "loginhandler.h" diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index 5bac079c..f557c97b 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_LOGINHANDLER_H diff --git a/src/net/logouthandler.cpp b/src/net/logouthandler.cpp index fb27540f..6dea4c83 100644 --- a/src/net/logouthandler.cpp +++ b/src/net/logouthandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "logouthandler.h" diff --git a/src/net/logouthandler.h b/src/net/logouthandler.h index fa906234..369eaa80 100644 --- a/src/net/logouthandler.h +++ b/src/net/logouthandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_LOGOUTHANDLER_H diff --git a/src/net/messagehandler.cpp b/src/net/messagehandler.cpp index b6074690..973c5555 100644 --- a/src/net/messagehandler.cpp +++ b/src/net/messagehandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "messagehandler.h" diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h index a5fc81b3..74226aa5 100644 --- a/src/net/messagehandler.h +++ b/src/net/messagehandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_MESSAGEHANDLER_H diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index b5d5b97a..57c268e7 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "messagein.h" diff --git a/src/net/messagein.h b/src/net/messagein.h index 3cc45a23..444699c8 100644 --- a/src/net/messagein.h +++ b/src/net/messagein.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMWSERV_MESSAGEIN_H_ diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index 10f1b1d4..b08332b6 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/net/messageout.h b/src/net/messageout.h index 032db190..4eadda5f 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMWSERV_MESSAGEOUT_H_ diff --git a/src/net/network.cpp b/src/net/network.cpp index 7cf4bf49..a4ea3def 100644 --- a/src/net/network.cpp +++ b/src/net/network.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "network.h" diff --git a/src/net/network.h b/src/net/network.h index 42590adf..13576e79 100644 --- a/src/net/network.h +++ b/src/net/network.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_NETWORK_H diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp index 4b08ed8d..30507537 100644 --- a/src/net/npchandler.cpp +++ b/src/net/npchandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "npchandler.h" diff --git a/src/net/npchandler.h b/src/net/npchandler.h index 0cb40f64..5560787e 100644 --- a/src/net/npchandler.h +++ b/src/net/npchandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_NPCHANDLER_H diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp index 7a9768fa..60c51821 100644 --- a/src/net/partyhandler.cpp +++ b/src/net/partyhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index dda78d94..b4257c34 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_PARTYHANDLER_H diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 3c0a1835..ad271f15 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "playerhandler.h" diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index 9b6c9e01..9c5f87cc 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_PLAYERHANDLER_H diff --git a/src/net/protocol.h b/src/net/protocol.h index 2ed414a8..5dfa78da 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_PROTOCOL_ diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp index d75350bc..5d93016f 100644 --- a/src/net/tradehandler.cpp +++ b/src/net/tradehandler.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "tradehandler.h" diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h index 33dddf05..1a0fa695 100644 --- a/src/net/tradehandler.h +++ b/src/net/tradehandler.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NET_TRADEHANDLER_H diff --git a/src/npc.cpp b/src/npc.cpp index a7302e0d..5665ad95 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "npc.h" diff --git a/src/npc.h b/src/npc.h index 561ad9f0..60f9e6d8 100644 --- a/src/npc.h +++ b/src/npc.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NPC_H diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index 67248100..48b10a1f 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "main.h" diff --git a/src/openglgraphics.h b/src/openglgraphics.h index e6d4850b..ea30e019 100644 --- a/src/openglgraphics.h +++ b/src/openglgraphics.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_OPENGLGRAPHICS_H diff --git a/src/particle.cpp b/src/particle.cpp index c59d2c03..8a15a132 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/particle.h b/src/particle.h index 7b46a641..4a11c4cb 100644 --- a/src/particle.h +++ b/src/particle.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _PARTICLE_H diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index cd80fb58..d368237c 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "particleemitter.h" diff --git a/src/particleemitter.h b/src/particleemitter.h index c237c1ba..4dc2f6fb 100644 --- a/src/particleemitter.h +++ b/src/particleemitter.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _PARTICLEEMITTER_H diff --git a/src/player.cpp b/src/player.cpp index 97c60789..648b330a 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "player.h" diff --git a/src/player.h b/src/player.h index 7e86b1e1..068e3cf5 100644 --- a/src/player.h +++ b/src/player.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_PLAYER_H diff --git a/src/position.cpp b/src/position.cpp index 334079bb..cc39a1af 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "position.h" diff --git a/src/position.h b/src/position.h index d1aa2ee6..7beb3ef7 100644 --- a/src/position.h +++ b/src/position.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: being.h 4570 2008-09-04 20:59:34Z b_lindeijer $ */ #ifndef TMW_POSITION_H diff --git a/src/properties.h b/src/properties.h index 93148bdf..2eafeeca 100644 --- a/src/properties.h +++ b/src/properties.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_PROPERTIES_H_ diff --git a/src/resources/action.cpp b/src/resources/action.cpp index 6b3c2f52..ffbbffb2 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "action.h" diff --git a/src/resources/action.h b/src/resources/action.h index 8d5e8d11..09eb066e 100644 --- a/src/resources/action.h +++ b/src/resources/action.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ACTION_H diff --git a/src/resources/ambientoverlay.cpp b/src/resources/ambientoverlay.cpp index 058b6083..9eee57f0 100644 --- a/src/resources/ambientoverlay.cpp +++ b/src/resources/ambientoverlay.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "ambientoverlay.h" diff --git a/src/resources/ambientoverlay.h b/src/resources/ambientoverlay.h index a939cbb4..56c70066 100644 --- a/src/resources/ambientoverlay.h +++ b/src/resources/ambientoverlay.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_RESOURCES_AMBIENTOVERLAY_H_ diff --git a/src/resources/animation.cpp b/src/resources/animation.cpp index de96525c..d2794e61 100644 --- a/src/resources/animation.cpp +++ b/src/resources/animation.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "animation.h" diff --git a/src/resources/animation.h b/src/resources/animation.h index aad93cda..8dfe8614 100644 --- a/src/resources/animation.h +++ b/src/resources/animation.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ANIMATION_H diff --git a/src/resources/buddylist.cpp b/src/resources/buddylist.cpp index 32d8d9f4..c85105c5 100644 --- a/src/resources/buddylist.cpp +++ b/src/resources/buddylist.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/buddylist.h b/src/resources/buddylist.h index 3791a03a..6a3de8c4 100644 --- a/src/resources/buddylist.h +++ b/src/resources/buddylist.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_BUDDYLIST_H diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index a43b1204..3be105d8 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/dye.h b/src/resources/dye.h index a11e3365..528a1d91 100644 --- a/src/resources/dye.h +++ b/src/resources/dye.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_DYE_H diff --git a/src/resources/image.cpp b/src/resources/image.cpp index d0dae462..77d77f96 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/image.h b/src/resources/image.h index 52f286f8..3677696f 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_IMAGE_H diff --git a/src/resources/imageloader.cpp b/src/resources/imageloader.cpp index 6ec5fe8f..29458ba3 100644 --- a/src/resources/imageloader.cpp +++ b/src/resources/imageloader.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/imageloader.h b/src/resources/imageloader.h index f41f6472..7979fd2f 100644 --- a/src/resources/imageloader.h +++ b/src/resources/imageloader.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_IMAGELOADER_H diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp index ba612103..1c0f9373 100644 --- a/src/resources/imageset.cpp +++ b/src/resources/imageset.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "imageset.h" diff --git a/src/resources/imageset.h b/src/resources/imageset.h index fa1840ec..58b7a8ea 100644 --- a/src/resources/imageset.h +++ b/src/resources/imageset.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_IMAGESET_H diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp index 7cfa16b4..d6d8a6c2 100644 --- a/src/resources/imagewriter.cpp +++ b/src/resources/imagewriter.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "imagewriter.h" diff --git a/src/resources/imagewriter.h b/src/resources/imagewriter.h index 205e4584..632e2ae4 100644 --- a/src/resources/imagewriter.h +++ b/src/resources/imagewriter.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 306c0e5a..01688619 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h index df7e7be9..20756a52 100644 --- a/src/resources/itemdb.h +++ b/src/resources/itemdb.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ITEM_MANAGER_H diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 4322db8d..cc7a6afc 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "iteminfo.h" diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 5b500dcf..7cc3ba15 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_ITEMINFO_H_ diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 33616c0a..cec74717 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "mapreader.h" diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h index 60056358..0142eb45 100644 --- a/src/resources/mapreader.h +++ b/src/resources/mapreader.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MAPREADER_H_ diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index f531a41d..1d198a96 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/monsterdb.h b/src/resources/monsterdb.h index 46a33b06..f1d69e72 100644 --- a/src/resources/monsterdb.h +++ b/src/resources/monsterdb.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MONSTER_DB_H diff --git a/src/resources/monsterinfo.cpp b/src/resources/monsterinfo.cpp index 263810de..bac9c35f 100644 --- a/src/resources/monsterinfo.cpp +++ b/src/resources/monsterinfo.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "monsterinfo.h" diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index f34a3ea9..f13c2f7c 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MONSTERINFO_H_ diff --git a/src/resources/music.cpp b/src/resources/music.cpp index 161d8b01..2386aa43 100644 --- a/src/resources/music.cpp +++ b/src/resources/music.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "music.h" diff --git a/src/resources/music.h b/src/resources/music.h index 72e76295..d50150b8 100644 --- a/src/resources/music.h +++ b/src/resources/music.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_MUSIC_H diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index bc1c920e..5cd6d20d 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "npcdb.h" diff --git a/src/resources/npcdb.h b/src/resources/npcdb.h index 2abf959b..00b4f99b 100644 --- a/src/resources/npcdb.h +++ b/src/resources/npcdb.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_NPC_DB_H diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp index 8f21f5d2..449caf55 100644 --- a/src/resources/resource.cpp +++ b/src/resources/resource.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/resource.h b/src/resources/resource.h index 5b9a5eb8..e85e3147 100644 --- a/src/resources/resource.h +++ b/src/resources/resource.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_RESOURCE_H diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 9c109257..8ee64452 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index da85e2f9..66813a9c 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_RESOURCE_MANAGER_H diff --git a/src/resources/soundeffect.cpp b/src/resources/soundeffect.cpp index ec9bc65c..e21fd2b0 100644 --- a/src/resources/soundeffect.cpp +++ b/src/resources/soundeffect.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "soundeffect.h" diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h index 866c53ec..c3ff6668 100644 --- a/src/resources/soundeffect.h +++ b/src/resources/soundeffect.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SOUND_EFFECT_H diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index dcfee165..5aea55fa 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index e9946a7a..56b9a713 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SPRITEDEF_H diff --git a/src/serverinfo.h b/src/serverinfo.h index b317b87b..6522da61 100644 --- a/src/serverinfo.h +++ b/src/serverinfo.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SERVERINFO_ diff --git a/src/shopitem.cpp b/src/shopitem.cpp index ed5d30a9..9888f829 100644 --- a/src/shopitem.cpp +++ b/src/shopitem.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "shopitem.h" diff --git a/src/shopitem.h b/src/shopitem.h index 6e7606ac..05a0a67d 100644 --- a/src/shopitem.h +++ b/src/shopitem.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _SHOPITEM_H_ diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index f425d3c1..e8c26df1 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "simpleanimation.h" diff --git a/src/simpleanimation.h b/src/simpleanimation.h index 561c540d..577268a8 100644 --- a/src/simpleanimation.h +++ b/src/simpleanimation.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SIMPLEANIMAION_H diff --git a/src/sound.cpp b/src/sound.cpp index 0a20d3f2..888dcc31 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "sound.h" diff --git a/src/sound.h b/src/sound.h index ebcd6442..0c2af74b 100644 --- a/src/sound.h +++ b/src/sound.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SOUND_H diff --git a/src/sprite.h b/src/sprite.h index 89780519..0e0a95db 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_SPRITE_H_ diff --git a/src/textparticle.cpp b/src/textparticle.cpp index 89466006..308c043d 100644 --- a/src/textparticle.cpp +++ b/src/textparticle.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "textparticle.h" diff --git a/src/textparticle.h b/src/textparticle.h index 34badb57..3a0ba674 100644 --- a/src/textparticle.h +++ b/src/textparticle.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TEXTPARTICLE_H diff --git a/src/tileset.h b/src/tileset.h index 625fac1b..fb855831 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_TILESET_H_ diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp index 9a8f6356..8cea60f9 100644 --- a/src/utils/base64.cpp +++ b/src/utils/base64.cpp @@ -26,7 +26,6 @@ | Author: Jim Winstead (jimw@php.net) | +----------------------------------------------------------------------+ */ -/* $Id$ */ #include #include diff --git a/src/utils/base64.h b/src/utils/base64.h index ff20ac53..c802207b 100644 --- a/src/utils/base64.h +++ b/src/utils/base64.h @@ -26,7 +26,6 @@ | Author: Jim Winstead (jimw@php.net) | +----------------------------------------------------------------------+ */ -/* $Id$ */ #ifndef _TMW_BASE64_H #define _TMW_BASE64_H diff --git a/src/utils/dtor.h b/src/utils/dtor.h index 516fd916..9aa92c84 100644 --- a/src/utils/dtor.h +++ b/src/utils/dtor.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UTILS_DTOR_H diff --git a/src/utils/fastsqrt.h b/src/utils/fastsqrt.h index b7b036e9..78768149 100644 --- a/src/utils/fastsqrt.h +++ b/src/utils/fastsqrt.h @@ -5,8 +5,6 @@ * http://www.math.purdue.edu/~clomont/Math/Papers/2003/InvSqrt.pdf * * Unfortunately the original creator of this function seems to be unknown. - * - * $Id$ */ float fastInvSqrt(float x) diff --git a/src/utils/gettext.h b/src/utils/gettext.h index 72533850..0cd9114b 100644 --- a/src/utils/gettext.h +++ b/src/utils/gettext.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UTILS_GETTEXT_H diff --git a/src/utils/minmax.h b/src/utils/minmax.h index 353c60e7..7e3d84f2 100644 --- a/src/utils/minmax.h +++ b/src/utils/minmax.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/src/utils/sha256.cpp b/src/utils/sha256.cpp index 209d4f96..82d1fc5c 100644 --- a/src/utils/sha256.cpp +++ b/src/utils/sha256.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ /* +------------------------------------+ diff --git a/src/utils/sha256.h b/src/utils/sha256.h index c03efc0c..66152caf 100644 --- a/src/utils/sha256.h +++ b/src/utils/sha256.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UTILS_SHA256_H_ diff --git a/src/utils/strprintf.cpp b/src/utils/strprintf.cpp index 26313fe9..c8a8a247 100644 --- a/src/utils/strprintf.cpp +++ b/src/utils/strprintf.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UTILS_TOSTRING_H diff --git a/src/utils/strprintf.h b/src/utils/strprintf.h index a1fb0f13..382ab6e0 100644 --- a/src/utils/strprintf.h +++ b/src/utils/strprintf.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UTILS_STRPRINTF_H diff --git a/src/utils/tostring.h b/src/utils/tostring.h index 95b8985f..d2dd941a 100644 --- a/src/utils/tostring.h +++ b/src/utils/tostring.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UTILS_TOSTRING_H diff --git a/src/utils/trim.h b/src/utils/trim.h index fec99100..a7c40ca2 100644 --- a/src/utils/trim.h +++ b/src/utils/trim.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UTILS_TRIM_H_ diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 98b474cb..47f1bd04 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "xml.h" diff --git a/src/utils/xml.h b/src/utils/xml.h index 5473b2ca..5a5c756b 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_XML_H diff --git a/src/vector.cpp b/src/vector.cpp index 88092c9b..7d5f055a 100644 --- a/src/vector.cpp +++ b/src/vector.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: vector.h 4592 2008-09-07 20:38:52Z b_lindeijer $ */ #include "vector.h" diff --git a/src/vector.h b/src/vector.h index 7251eff0..f32b201a 100644 --- a/src/vector.h +++ b/src/vector.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_VECTOR_H_ diff --git a/tools/dyecmd/src/dye.cpp b/tools/dyecmd/src/dye.cpp index 73912a96..c93f46c8 100644 --- a/tools/dyecmd/src/dye.cpp +++ b/tools/dyecmd/src/dye.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/tools/dyecmd/src/dye.h b/tools/dyecmd/src/dye.h index a11e3365..528a1d91 100644 --- a/tools/dyecmd/src/dye.h +++ b/tools/dyecmd/src/dye.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_DYE_H diff --git a/tools/dyecmd/src/dyecmd.cpp b/tools/dyecmd/src/dyecmd.cpp index 7254e287..8938aea5 100644 --- a/tools/dyecmd/src/dyecmd.cpp +++ b/tools/dyecmd/src/dyecmd.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/tools/dyecmd/src/imagewriter.cpp b/tools/dyecmd/src/imagewriter.cpp index 36c139b9..9b4b10dc 100644 --- a/tools/dyecmd/src/imagewriter.cpp +++ b/tools/dyecmd/src/imagewriter.cpp @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include "imagewriter.h" diff --git a/tools/dyecmd/src/imagewriter.h b/tools/dyecmd/src/imagewriter.h index 205e4584..632e2ae4 100644 --- a/tools/dyecmd/src/imagewriter.h +++ b/tools/dyecmd/src/imagewriter.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #include diff --git a/tools/tmxcopy/base64.cpp b/tools/tmxcopy/base64.cpp index 9a8f6356..8cea60f9 100644 --- a/tools/tmxcopy/base64.cpp +++ b/tools/tmxcopy/base64.cpp @@ -26,7 +26,6 @@ | Author: Jim Winstead (jimw@php.net) | +----------------------------------------------------------------------+ */ -/* $Id$ */ #include #include diff --git a/tools/tmxcopy/base64.h b/tools/tmxcopy/base64.h index ff20ac53..c802207b 100644 --- a/tools/tmxcopy/base64.h +++ b/tools/tmxcopy/base64.h @@ -26,7 +26,6 @@ | Author: Jim Winstead (jimw@php.net) | +----------------------------------------------------------------------+ */ -/* $Id$ */ #ifndef _TMW_BASE64_H #define _TMW_BASE64_H diff --git a/tools/tmxcopy/tostring.h b/tools/tmxcopy/tostring.h index 95b8985f..d2dd941a 100644 --- a/tools/tmxcopy/tostring.h +++ b/tools/tmxcopy/tostring.h @@ -17,8 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id$ */ #ifndef _TMW_UTILS_TOSTRING_H diff --git a/tools/tmxcopy/xmlutils.cpp b/tools/tmxcopy/xmlutils.cpp index 47bff51a..8b1b62cf 100644 --- a/tools/tmxcopy/xmlutils.cpp +++ b/tools/tmxcopy/xmlutils.cpp @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include "xmlutils.h" diff --git a/tools/tmxcopy/xmlutils.h b/tools/tmxcopy/xmlutils.h index 32d1a960..60e8f3cd 100644 --- a/tools/tmxcopy/xmlutils.h +++ b/tools/tmxcopy/xmlutils.h @@ -17,7 +17,6 @@ * You should have received a copy of the GNU General Public License * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #ifndef _XMLUTILS_H -- cgit v1.2.3-60-g2f50 From 0a2fc4d340911b28b9dc6b3b23c69e9fe7729082 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 28 Aug 2008 18:32:11 +0000 Subject: Added support for being effects through the eAthena levelup message, and check whether the being exists before referencing it. Re-enabled proper MP bar display. Improved handling of a warp to the same map. (patch by Fate) (cherry picked from eAthena client, the part about the levelup message doesn't apply, and we now seem to have a second "effect manager"...) Conflicts: ChangeLog src/being.cpp src/being.h src/engine.cpp src/engine.h src/gui/ministatus.cpp src/net/beinghandler.cpp src/net/playerhandler.cpp src/net/protocol.h --- src/being.cpp | 103 +++++++++++++++++++++++++++++++++++++++++++++- src/being.h | 19 +++++++++ src/engine.cpp | 1 + src/engine.h | 5 +++ src/net/beinghandler.cpp | 4 +- src/net/playerhandler.cpp | 18 +++++++- src/particle.h | 9 ++++ src/player.h | 8 ++++ 8 files changed, 163 insertions(+), 4 deletions(-) (limited to 'src/particle.h') diff --git a/src/being.cpp b/src/being.cpp index fbee967f..3a84ccd0 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -30,6 +30,8 @@ #include "log.h" #include "map.h" #include "particle.h" +#include "sound.h" +#include "localplayer.h" #include "resources/itemdb.h" #include "resources/resourcemanager.h" @@ -49,6 +51,10 @@ const bool debug_movement = true; #define HAIR_FILE "hair.xml" +#include "utils/xml.h" + +#define BEING_EFFECTS_FILE "effects.xml" + int Being::instances = 0; ImageSet *Being::emotionSet = NULL; @@ -525,7 +531,7 @@ void Being::logic() i != mChildParticleEffects.end();) { (*i)->setPosition(mPos.x, mPos.y); - if (!(*i)->isAlive()) + if ((*i)->isExtinct()) { (*i)->kill(); i = mChildParticleEffects.erase(i); @@ -695,3 +701,98 @@ initializeHair(void) hairInitialized = 1; } + + + +struct EffectDescription { + std::string mGFXEffect; + std::string mSFXEffect; +}; + +static EffectDescription *default_effect = NULL; +static std::map effects; +static bool effects_initialized = false; + +static EffectDescription * +getEffectDescription(xmlNodePtr node, int *id) +{ + EffectDescription *ed = new EffectDescription; + + *id = atoi(XML::getProperty(node, "id", "-1").c_str()); + ed->mSFXEffect = XML::getProperty(node, "audio", ""); + ed->mGFXEffect = XML::getProperty(node, "particle", ""); + + return ed; +} + +static EffectDescription * +getEffectDescription(int effectId) +{ + if (!effects_initialized) + { + XML::Document doc(BEING_EFFECTS_FILE); + xmlNodePtr root = doc.rootNode(); + + if (!root || !xmlStrEqual(root->name, BAD_CAST "being-effects")) + { + logger->log("Error loading being effects file: " + BEING_EFFECTS_FILE); + return NULL; + } + + for_each_xml_child_node(node, root) + { + int id; + + if (xmlStrEqual(node->name, BAD_CAST "effect")) + { + EffectDescription *EffectDescription = + getEffectDescription(node, &id); + effects[id] = EffectDescription; + } else if (xmlStrEqual(node->name, BAD_CAST "default")) + { + EffectDescription *EffectDescription = + getEffectDescription(node, &id); + + if (default_effect) + delete default_effect; + + default_effect = EffectDescription; + } + } + + effects_initialized = true; + } // done initializing + + EffectDescription *ed = effects[effectId]; + + if (!ed) + return default_effect; + else + return ed; +} + +void +Being::internalTriggerEffect(int effectId, bool sfx, bool gfx) +{ + logger->log("Special effect #%d on %s", effectId, + getId() == player_node->getId() ? "self" : "other"); + + EffectDescription *ed = getEffectDescription(effectId); + + if (!ed) { + logger->log("Unknown special effect and no default recorded"); + return; + } + + if (gfx && ed->mGFXEffect != "") { + Particle *selfFX; + + selfFX = particleEngine->addEffect(ed->mGFXEffect, 0, 0); + controlParticle(selfFX); + } + + if (sfx && ed->mSFXEffect != "") { + sound.playSfx(ed->mSFXEffect); + } +} diff --git a/src/being.h b/src/being.h index 5e8cb2dc..9bf88d82 100644 --- a/src/being.h +++ b/src/being.h @@ -360,6 +360,15 @@ class Being : public Sprite */ const Path &getPath() const { return mPath; } + /** + * Triggers a visual effect, such as `level up' + * + * Only draws the visual effect, does not play sound effects + * + * \param effectId ID of the effect to trigger + */ + virtual void + triggerEffect(int effectId) { internalTriggerEffect(effectId, false, true); } static int getHairColorsNr(void); @@ -379,6 +388,16 @@ class Being : public Sprite virtual Map::BlockType getBlockType() const { return Map::BLOCKTYPE_NONE; } + /** + * Trigger visual effect, with components + * + * \param effectId ID of the effect to trigger + * \param sfx Whether to trigger sound effects + * \param gfx Whether to trigger graphical effects + */ + void + internalTriggerEffect(int effectId, bool sfx, bool gfx); + Uint16 mId; /**< Unique being id */ Uint8 mSpriteDirection; /**< Facing direction */ Uint8 mDirection; /**< Walking direction */ diff --git a/src/engine.cpp b/src/engine.cpp index db1ac3bd..f191280e 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -119,6 +119,7 @@ void Engine::changeMap(const std::string &mapPath) } mCurrentMap = newMap; + mMapName = mapPath; } void Engine::logic() diff --git a/src/engine.h b/src/engine.h index dbee1258..f676a271 100644 --- a/src/engine.h +++ b/src/engine.h @@ -23,6 +23,7 @@ #define _ENGINE_H #include +#include class Map; @@ -48,6 +49,9 @@ class Engine */ Map *getCurrentMap() { return mCurrentMap; } + const std::string &getCurrentMapName() { return mMapName; } + + /** * Sets the currently active map. */ @@ -60,6 +64,7 @@ class Engine private: Map *mCurrentMap; + std::string mMapName; }; extern Engine *engine; diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 72371da5..f96cdcd5 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -32,6 +32,7 @@ #include "../localplayer.h" #include "../log.h" #include "../main.h" +#include "../npc.h" #include "../particle.h" #include "../sound.h" @@ -268,7 +269,7 @@ void BeingHandler::handleBeingAttackMessage(MessageIn &msg) int attackType = msg.readInt8(); if (!being) return; - + switch (direction) { case DIRECTION_UP: being->setDirection(Being::UP); break; @@ -347,3 +348,4 @@ void BeingHandler::handleBeingDirChangeMessage(MessageIn &msg) case DIRECTION_RIGHT: being->setDirection(Being::RIGHT); break; } } + diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index ad271f15..beb59250 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -50,6 +50,11 @@ extern BuyDialog *buyDialog; extern SellDialog *sellDialog; extern Window *buySellDialog; +/* Max. distance we are willing to scroll after a teleport; + * everything beyond will reset the port hard. + */ +static const int MAP_TELEPORT_SCROLL_DISTANCE = 8 * 32; + /** * Listener used for handling the overweigth message. */ @@ -292,6 +297,7 @@ PlayerHandler::handleMapChangeMessage(MessageIn &msg) const std::string mapName = msg.readString(); const unsigned short x = msg.readInt16(); const unsigned short y = msg.readInt16(); + const bool nearby = (engine->getCurrentMapName() == mapName); logger->log("Changing map to %s (%d, %d)", mapName.c_str(), x, y); @@ -301,8 +307,16 @@ PlayerHandler::handleMapChangeMessage(MessageIn &msg) current_npc = 0; const Vector &playerPos = player_node->getPosition(); - const float scrollOffsetX = x - (int) playerPos.x; - const float scrollOffsetY = y - (int) playerPos.y; + float scrollOffsetX = 0.0f; + float scrollOffsetY = 0.0f; + + /* Scroll if neccessary */ + if (!nearby + || (abs(x - (int) playerPos.x) > MAP_TELEPORT_SCROLL_DISTANCE) + || (abs(y - (int) playerPos.y) > MAP_TELEPORT_SCROLL_DISTANCE)) { + scrollOffsetX = x - (int) playerPos.x; + scrollOffsetY = y - (int) playerPos.y; + } player_node->setAction(Being::STAND); player_node->setPosition(x, y); diff --git a/src/particle.h b/src/particle.h index 4a11c4cb..d98f2c39 100644 --- a/src/particle.h +++ b/src/particle.h @@ -160,6 +160,9 @@ class Particle : public Sprite moveBy(float x, float y, float z) { mPos.x += x; mPos.y += y; mPos.z += z; } + void + moveChildren(Vector change); + void moveBy (Vector change) { mPos += change; } @@ -270,6 +273,12 @@ class Particle : public Sprite bool isAlive() { return mAlive; } + /** + * Determines whether the particle and its children are all dead + */ + bool isExtinct() + { return !isAlive() && mChildParticles.empty(); } + /** * Manually marks the particle for deletion. */ diff --git a/src/player.h b/src/player.h index 12f9d268..6880ca20 100644 --- a/src/player.h +++ b/src/player.h @@ -116,6 +116,14 @@ class Player : public Being // Character guild information std::map mGuilds; + /** + * Triggers a visual/audio effect, such as `level up' + * + * \param effect_id ID of the effect to trigger + */ + virtual void + triggerEffect(int effectId) { internalTriggerEffect(effectId, true, true); } + private: bool mInParty; }; -- cgit v1.2.3-60-g2f50 From 18f418c5cbd169be1b8e65c823e0b07d2d8db197 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 14 Dec 2008 18:03:19 +0100 Subject: Code reformatting I wish I had never fallen for this weird style, and I hope removing it will prevent others from introducing new code like this. :-) (cherry picked from eAthena branch, commit 68760426532b9ca4c6939d7a7b8faa1586ee82e0) Conflicts: src/being.cpp src/being.h src/gui/tabbedcontainer.cpp src/particle.cpp src/particle.h --- src/being.cpp | 1 + src/being.h | 38 +++++++----------- src/imageparticle.h | 3 +- src/particle.cpp | 75 +++++++++++++++------------------- src/particle.h | 84 ++++++++++++++------------------------- src/resources/action.cpp | 11 ++--- src/resources/mapreader.cpp | 29 +++++--------- src/resources/mapreader.h | 19 ++++----- src/resources/monsterdb.cpp | 11 ++--- src/resources/resourcemanager.cpp | 53 ++++++++++-------------- src/resources/resourcemanager.h | 54 +++++++++---------------- src/textparticle.h | 4 +- 12 files changed, 144 insertions(+), 238 deletions(-) (limited to 'src/particle.h') diff --git a/src/being.cpp b/src/being.cpp index 3a84ccd0..7c37d8e3 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -18,6 +18,7 @@ * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "being.h" #include diff --git a/src/being.h b/src/being.h index 9bf88d82..f9e6c58f 100644 --- a/src/being.h +++ b/src/being.h @@ -153,28 +153,25 @@ class Being : public Sprite * * @param amount The amount of damage. */ - virtual void - takeDamage(int amount); + virtual void takeDamage(int amount); /** * Handles an attack of another being by this being. */ - virtual void - handleAttack(); + virtual void handleAttack(); /** * Returns the name of the being. */ - const std::string& - getName() const { return mName; } + const std::string &getName() const + { return mName; } /** * Sets the name for the being. * * @param name The name that should appear. */ - void - setName(const std::string &name) { mName = name; } + void setName(const std::string &name) { mName = name; } /** * Sets the gender for this being. @@ -206,32 +203,28 @@ class Being : public Sprite /** * Sets visible equipments for this being. */ - virtual void - setSprite(int slot, int id, const std::string &color = ""); + virtual void setSprite(int slot, int id, + const std::string &color = ""); /** * Performs being logic. */ - virtual void - logic(); + virtual void logic(); /** * Draws the speech text above the being. */ - void - drawSpeech(Graphics* graphics, int offsetX, int offsetY); + void drawSpeech(Graphics* graphics, int offsetX, int offsetY); /** * Draws the emotion picture above the being. */ - void - drawEmotion(Graphics *graphics, int offsetX, int offsetY); + void drawEmotion(Graphics *graphics, int offsetX, int offsetY); /** * Draws the name text below the being. */ - virtual void - drawName(Graphics *, int, int) {}; + virtual void drawName(Graphics *, int, int) {}; /** * Returns the type of the being. @@ -252,14 +245,12 @@ class Being : public Sprite /** * Gets the being id. */ - Uint16 - getId() const { return mId; } + Uint16 getId() const { return mId; } /** * Sets the sprite id. */ - void - setId(Uint16 id) { mId = id; } + void setId(Uint16 id) { mId = id; } /** * Sets the map the being is on @@ -269,8 +260,7 @@ class Being : public Sprite /** * Sets the current action. */ - virtual void - setAction(Action action, int attackType = 0); + virtual void setAction(Action action, int attackType = 0); /** * Gets the current action. diff --git a/src/imageparticle.h b/src/imageparticle.h index 91c5426c..c18b30b8 100644 --- a/src/imageparticle.h +++ b/src/imageparticle.h @@ -49,8 +49,7 @@ class ImageParticle : public Particle /** * Draws the particle image */ - virtual void - draw(Graphics *graphics, int offsetX, int offsetY) const; + virtual void draw(Graphics *graphics, int offsetX, int offsetY) const; protected: Image *mImage; /**< The image used for this particle. */ diff --git a/src/particle.cpp b/src/particle.cpp index 8a15a132..c6e242bd 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -68,12 +68,21 @@ Particle::Particle(Map *map): mMomentum(1.0f) { Particle::particleCount++; - if (mMap) setSpriteIterator(mMap->addSprite(this)); + if (mMap) + setSpriteIterator(mMap->addSprite(this)); } +Particle::~Particle() +{ + // Remove from map sprite list + if (mMap) + mMap->removeSprite(mSpriteIterator); + // Delete child emitters and child particles + clear(); + Particle::particleCount--; +} -void -Particle::setupEngine() +void Particle::setupEngine() { Particle::maxCount = (int)config.getValue("particleMaxCount", 3000); Particle::fastPhysics = (int)config.getValue("particleFastPhysics", 0); @@ -82,17 +91,17 @@ Particle::setupEngine() logger->log("Particle engine set up"); } -void Particle::draw(Graphics *, int, int) const {} +void Particle::draw(Graphics *, int, int) const +{ +} -bool -Particle::update() +bool Particle::update() { - if (!mMap) return false; + if (!mMap) + return false; if (mLifetimeLeft == 0) - { mAlive = false; - } Vector oldPos = mPos; @@ -222,9 +231,8 @@ Particle::update() return true; } -Particle* -Particle::addEffect(const std::string &particleEffectFile, - int pixelX, int pixelY, int rotation) +Particle *Particle::addEffect(const std::string &particleEffectFile, + int pixelX, int pixelY, int rotation) { Particle *newParticle = NULL; @@ -298,11 +306,9 @@ Particle::addEffect(const std::string &particleEffectFile, return newParticle; } - -Particle* -Particle::addTextSplashEffect(const std::string &text, - int colorR, int colorG, int colorB, - gcn::Font *font, int x, int y) +Particle *Particle::addTextSplashEffect(const std::string &text, + int colorR, int colorG, int colorB, + gcn::Font *font, int x, int y) { Particle *newParticle = new TextParticle(mMap, text, colorR, colorG, colorB, font); @@ -320,11 +326,10 @@ Particle::addTextSplashEffect(const std::string &text, return newParticle; } -Particle* -Particle::addTextRiseFadeOutEffect(const std::string &text, - int colorR, int colorG, int colorB, - gcn::Font *font, - int x, int y) +Particle *Particle::addTextRiseFadeOutEffect(const std::string &text, + int colorR, int colorG, int colorB, + gcn::Font *font, + int x, int y) { Particle *newParticle = new TextParticle(mMap, text, colorR, colorG, colorB, font); newParticle->setPosition(x, y, 0); @@ -339,32 +344,18 @@ Particle::addTextRiseFadeOutEffect(const std::string &text, return newParticle; } -void -Particle::setMap(Map *map) +void Particle::setMap(Map *map) { mMap = map; - if (mMap) setSpriteIterator(mMap->addSprite(this)); + if (mMap) + setSpriteIterator(mMap->addSprite(this)); } - -Particle::~Particle() -{ - // Remove from map sprite list - if (mMap) mMap->removeSprite(mSpriteIterator); - // Delete child emitters and child particles - clear(); - Particle::particleCount--; -} - - -void -Particle::clear() +void Particle::clear() { - std::for_each(mChildEmitters.begin(), mChildEmitters.end(), - make_dtor(mChildEmitters)); + delete_all(mChildEmitters); mChildEmitters.clear(); - std::for_each(mChildParticles.begin(), mChildParticles.end(), - make_dtor(mChildParticles)); + delete_all(mChildParticles); mChildParticles.clear(); } diff --git a/src/particle.h b/src/particle.h index d98f2c39..af0caf21 100644 --- a/src/particle.h +++ b/src/particle.h @@ -67,22 +67,19 @@ class Particle : public Sprite /** * Deletes all child particles and emitters. */ - void - clear(); + void clear(); /** * Gives a particle the properties of an engine root particle and loads * the particle-related config settings. */ - void - setupEngine(); + void setupEngine(); /** * Updates particle position, returns false when the particle should * be deleted. */ - virtual bool - update(); + virtual bool update(); /** * Draws the particle image. @@ -92,8 +89,7 @@ class Particle : public Sprite /** * Necessary for sorting with the other sprites. */ - virtual int - getPixelY() const + virtual int getPixelY() const { return (int) (mPos.y + mPos.z) - 64; } /** @@ -105,46 +101,40 @@ class Particle : public Sprite * Creates a child particle that hosts some emitters described in the * particleEffectFile. */ - Particle* - addEffect(const std::string &particleEffectFile, - int pixelX, int pixelY, int rotation = 0); + Particle *addEffect(const std::string &particleEffectFile, + int pixelX, int pixelY, int rotation = 0); /** * Creates a standalone text particle. */ - Particle* - addTextSplashEffect(const std::string &text, - int colorR, int colorG, int colorB, - gcn::Font *font, int x, int y); + Particle *addTextSplashEffect(const std::string &text, + int colorR, int colorG, int colorB, + gcn::Font *font, int x, int y); /** * Creates a standalone text particle. */ - Particle* - addTextRiseFadeOutEffect(const std::string &text, - int colorR, int colorG, int colorB, - gcn::Font *font, - int x, int y); + Particle *addTextRiseFadeOutEffect(const std::string &text, + int colorR, int colorG, int colorB, + gcn::Font *font, + int x, int y); /** * Adds an emitter to the particle. */ - void - addEmitter (ParticleEmitter* emitter) + void addEmitter (ParticleEmitter* emitter) { mChildEmitters.push_back(emitter); } /** * Sets the position in 3 dimensional space in pixels relative to map. */ - void - setPosition(float x, float y, float z) + void setPosition(float x, float y, float z) { mPos.x = x; mPos.y = y; mPos.z = z; } /** * Sets the position in 2 dimensional space in pixels relative to map. */ - void - setPosition(float x, float y) + void setPosition(float x, float y) { mPos.x = x; mPos.y = y; } /** @@ -156,53 +146,45 @@ class Particle : public Sprite /** * Changes the particle position relative */ - void - moveBy(float x, float y, float z) + void moveBy(float x, float y, float z) { mPos.x += x; mPos.y += y; mPos.z += z; } - void - moveChildren(Vector change); + void moveChildren(Vector change); - void - moveBy (Vector change) + void moveBy (Vector change) { mPos += change; } /** * Sets the time in game ticks until the particle is destroyed. */ - void - setLifetime(int lifetime) + void setLifetime(int lifetime) { mLifetimeLeft = lifetime; mLifetimePast = 0; } /** * Sets the age of the pixel in game ticks where the particle has * faded in completely. */ - void - setFadeOut(int fadeOut) + void setFadeOut(int fadeOut) { mFadeOut = fadeOut; } /** * Sets the remaining particle lifetime where the particle starts to * fade out. */ - void - setFadeIn(int fadeIn) + void setFadeIn(int fadeIn) { mFadeIn = fadeIn; } /** * Sets the alpha value of the particle */ - void - setAlpha(float alpha) + void setAlpha(float alpha) { mAlpha = alpha; } /** * Sets the sprite iterator of the particle on the current map to make * it easier to remove the particle from the map when it is destroyed. */ - void - setSpriteIterator(std::list::iterator spriteIterator) + void setSpriteIterator(std::list::iterator spriteIterator) { mSpriteIterator = spriteIterator; } /** @@ -215,44 +197,38 @@ class Particle : public Sprite /** * Sets the current velocity in 3 dimensional space. */ - void - setVelocity(float x, float y, float z) + void setVelocity(float x, float y, float z) { mVelocity.x = x; mVelocity.y = y; mVelocity.z = z; } /** * Sets the downward acceleration. */ - void - setGravity(float gravity) + void setGravity(float gravity) { mGravity = gravity; } /** * Sets the ammount of random vector changes */ - void - setRandomness(int r) + void setRandomness(int r) { mRandomness = r; } /** * Sets the ammount of velocity particles retain after * hitting the ground. */ - void - setBounce(float bouncieness) + void setBounce(float bouncieness) { mBounce = bouncieness; } /** * Sets the flag if the particle is supposed to be moved by its parent */ - void - setFollow(bool follow) + void setFollow(bool follow) { mFollow = follow; } /** * Gets the flag if the particle is supposed to be moved by its parent */ - bool - doesFollow() + bool doesFollow() { return mFollow; } /** diff --git a/src/resources/action.cpp b/src/resources/action.cpp index ffbbffb2..bbea45c9 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -21,8 +21,6 @@ #include "action.h" -#include - #include "animation.h" #include "../utils/dtor.h" @@ -34,12 +32,10 @@ Action::Action() Action::~Action() { - std::for_each(mAnimations.begin(), mAnimations.end(), - make_dtor(mAnimations)); + delete_all(mAnimations); } -Animation* -Action::getAnimation(int direction) const +Animation *Action::getAnimation(int direction) const { Animations::const_iterator i = mAnimations.find(direction); @@ -53,8 +49,7 @@ Action::getAnimation(int direction) const return (i == mAnimations.end()) ? NULL : i->second; } -void -Action::setAnimation(int direction, Animation *animation) +void Action::setAnimation(int direction, Animation *animation) { mAnimations[direction] = animation; } diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 34018022..949d7913 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -43,9 +43,8 @@ const unsigned int DEFAULT_TILE_HEIGHT = 32; * Inflates either zlib or gzip deflated memory. The inflated memory is * expected to be freed by the caller. */ -int -inflateMemory(unsigned char *in, unsigned int inLength, - unsigned char *&out, unsigned int &outLength) +int inflateMemory(unsigned char *in, unsigned int inLength, + unsigned char *&out, unsigned int &outLength) { int bufferSize = 256 * 1024; int ret; @@ -109,9 +108,8 @@ inflateMemory(unsigned char *in, unsigned int inLength, return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR; } -int -inflateMemory(unsigned char *in, unsigned int inLength, - unsigned char *&out) +int inflateMemory(unsigned char *in, unsigned int inLength, + unsigned char *&out) { unsigned int outLength = 0; int ret = inflateMemory(in, inLength, out, outLength); @@ -143,8 +141,7 @@ inflateMemory(unsigned char *in, unsigned int inLength, return outLength; } -Map* -MapReader::readMap(const std::string &filename) +Map *MapReader::readMap(const std::string &filename) { // Load the file through resource manager ResourceManager *resman = ResourceManager::getInstance(); @@ -201,8 +198,7 @@ MapReader::readMap(const std::string &filename) return map; } -Map* -MapReader::readMap(xmlNodePtr node, const std::string &path) +Map *MapReader::readMap(xmlNodePtr node, const std::string &path) { // Take the filename off the path const std::string pathDir = path.substr(0, path.rfind("/") + 1); @@ -280,8 +276,7 @@ MapReader::readMap(xmlNodePtr node, const std::string &path) return map; } -void -MapReader::readProperties(xmlNodePtr node, Properties* props) +void MapReader::readProperties(xmlNodePtr node, Properties *props) { for_each_xml_child_node(childNode, node) { @@ -311,8 +306,7 @@ static void setTile(Map *map, MapLayer *layer, int x, int y, int gid) } } -void -MapReader::readLayer(xmlNodePtr node, Map *map) +void MapReader::readLayer(xmlNodePtr node, Map *map) { // Layers are not necessarily the same size as the map const int w = XML::getProperty(node, "width", map->getWidth()); @@ -446,10 +440,9 @@ MapReader::readLayer(xmlNodePtr node, Map *map) } } -Tileset* -MapReader::readTileset(xmlNodePtr node, - const std::string &path, - Map *map) +Tileset *MapReader::readTileset(xmlNodePtr node, + const std::string &path, + Map *map) { if (xmlHasProp(node, BAD_CAST "source")) { diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h index 0142eb45..04e83b99 100644 --- a/src/resources/mapreader.h +++ b/src/resources/mapreader.h @@ -39,15 +39,13 @@ class MapReader /** * Read an XML map from a file. */ - static Map* - readMap(const std::string &filename); + static Map *readMap(const std::string &filename); /** * Read an XML map from a parsed XML tree. The path is used to find the * location of referenced tileset images. */ - static Map* - readMap(xmlNodePtr node, const std::string &path); + static Map *readMap(xmlNodePtr node, const std::string &path); private: /** @@ -57,26 +55,23 @@ class MapReader * @param props The Properties instance to which the properties will * be assigned. */ - static void - readProperties(xmlNodePtr node, Properties* props); + static void readProperties(xmlNodePtr node, Properties* props); /** * Reads a map layer and adds it to the given map. */ - static void - readLayer(xmlNodePtr node, Map *map); + static void readLayer(xmlNodePtr node, Map *map); /** * Reads a tile set. */ - static Tileset* - readTileset(xmlNodePtr node, const std::string &path, Map *map); + static Tileset *readTileset(xmlNodePtr node, const std::string &path, + Map *map); /** * Gets an integer property from an xmlNodePtr. */ - static int - getProperty(xmlNodePtr node, const char* name, int def); + static int getProperty(xmlNodePtr node, const char* name, int def); }; #endif diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index e0c47db8..ed4acd38 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -19,8 +19,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include - #include "monsterdb.h" #include "resourcemanager.h" @@ -147,19 +145,16 @@ MonsterDB::load() mLoaded = true; } -void -MonsterDB::unload() +void MonsterDB::unload() { - for_each(mMonsterInfos.begin(), mMonsterInfos.end(), - make_dtor(mMonsterInfos)); + delete_all(mMonsterInfos); mMonsterInfos.clear(); mLoaded = false; } -const MonsterInfo& -MonsterDB::get(int id) +const MonsterInfo &MonsterDB::get(int id) { MonsterInfoIterator i = mMonsterInfos.find(id); diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 08a4eec9..8c6d1376 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -93,8 +93,7 @@ ResourceManager::~ResourceManager() } } -void -ResourceManager::cleanUp(Resource *res) +void ResourceManager::cleanUp(Resource *res) { logger->log("ResourceManager::~ResourceManager() cleaning up %d " "reference%s to %s", @@ -136,14 +135,12 @@ void ResourceManager::cleanOrphans() mOldestOrphan = oldest; } -bool -ResourceManager::setWriteDir(const std::string &path) +bool ResourceManager::setWriteDir(const std::string &path) { return (bool) PHYSFS_setWriteDir(path.c_str()); } -bool -ResourceManager::addToSearchPath(const std::string &path, bool append) +bool ResourceManager::addToSearchPath(const std::string &path, bool append) { logger->log("Adding to PhysicsFS: %s", path.c_str()); if (!PHYSFS_addToSearchPath(path.c_str(), append ? 1 : 0)) { @@ -153,8 +150,7 @@ ResourceManager::addToSearchPath(const std::string &path, bool append) return true; } -void -ResourceManager::searchAndAddArchives(const std::string &path, +void ResourceManager::searchAndAddArchives(const std::string &path, const std::string &ext, bool append) { @@ -180,31 +176,27 @@ ResourceManager::searchAndAddArchives(const std::string &path, PHYSFS_freeList(list); } -bool -ResourceManager::mkdir(const std::string &path) +bool ResourceManager::mkdir(const std::string &path) { return (bool) PHYSFS_mkdir(path.c_str()); } -bool -ResourceManager::exists(const std::string &path) +bool ResourceManager::exists(const std::string &path) { return PHYSFS_exists(path.c_str()); } -bool -ResourceManager::isDirectory(const std::string &path) +bool ResourceManager::isDirectory(const std::string &path) { return PHYSFS_isDirectory(path.c_str()); } -std::string -ResourceManager::getPath(const std::string &file) +std::string ResourceManager::getPath(const std::string &file) { // get the real path to the file const char* tmp = PHYSFS_getRealDir(file.c_str()); std::string path; - + // if the file is not in the search path, then its NULL if (tmp) { @@ -215,11 +207,12 @@ ResourceManager::getPath(const std::string &file) // if not found in search path return the default path path = std::string(TMW_DATADIR) + std::string("data") + "/" + file; } - + return path; } -Resource *ResourceManager::get(std::string const &idPath, generator fun, void *data) +Resource *ResourceManager::get(std::string const &idPath, generator fun, + void *data) { // Check if the id exists, and return the value if it does. ResourceIterator resIter = mResources.find(idPath); @@ -276,14 +269,12 @@ Resource *ResourceManager::load(std::string const &path, loader fun) return get(path, ResourceLoader::load, &l); } -Music* -ResourceManager::getMusic(const std::string &idPath) +Music *ResourceManager::getMusic(const std::string &idPath) { return static_cast(load(idPath, Music::load)); } -SoundEffect* -ResourceManager::getSoundEffect(const std::string &idPath) +SoundEffect *ResourceManager::getSoundEffect(const std::string &idPath) { return static_cast(load(idPath, SoundEffect::load)); } @@ -336,8 +327,8 @@ struct ImageSetLoader } }; -ImageSet* -ResourceManager::getImageSet(const std::string &imagePath, int w, int h) +ImageSet *ResourceManager::getImageSet(const std::string &imagePath, + int w, int h) { ImageSetLoader l = { this, imagePath, w, h }; std::stringstream ss; @@ -383,23 +374,20 @@ void ResourceManager::release(Resource *res) mResources.erase(resIter); } -ResourceManager* -ResourceManager::getInstance() +ResourceManager *ResourceManager::getInstance() { // Create a new instance if necessary. if (instance == NULL) instance = new ResourceManager(); return instance; } -void -ResourceManager::deleteInstance() +void ResourceManager::deleteInstance() { delete instance; instance = NULL; } -void* -ResourceManager::loadFile(const std::string &fileName, int &fileSize) +void *ResourceManager::loadFile(const std::string &fileName, int &fileSize) { // Attempt to open the specified file using PhysicsFS PHYSFS_file *file = PHYSFS_openRead(fileName.c_str()); @@ -451,8 +439,7 @@ ResourceManager::loadTextFile(const std::string &fileName) return lines; } -SDL_Surface* -ResourceManager::loadSDLSurface(const std::string& filename) +SDL_Surface *ResourceManager::loadSDLSurface(const std::string& filename) { int fileSize; void *buffer = loadFile(filename, fileSize); diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 66813a9c..c1007f4a 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -64,8 +64,7 @@ class ResourceManager * @param path The path of the directory to be added. * @return true on success, false otherwise. */ - bool - setWriteDir(const std::string &path); + bool setWriteDir(const std::string &path); /** * Adds a directory or archive to the search path. If append is true @@ -74,35 +73,30 @@ class ResourceManager * * @return true on success, false otherwise. */ - bool - addToSearchPath(const std::string &path, bool append); + bool addToSearchPath(const std::string &path, bool append); /** * Searches for zip files and adds them to the search path. */ - void - searchAndAddArchives(const std::string &path, - const std::string &ext, - bool append); + void searchAndAddArchives(const std::string &path, + const std::string &ext, + bool append); /** * Creates a directory in the write path */ - bool - mkdir(const std::string &path); + bool mkdir(const std::string &path); /** * Checks whether the given file or directory exists in the search path */ - bool - exists(const std::string &path); + bool exists(const std::string &path); /** * Checks whether the given path is a directory. */ - bool - isDirectory(const std::string &path); - + bool isDirectory(const std::string &path); + /** * Returns the real path to a file * @@ -136,29 +130,25 @@ class ResourceManager * Convenience wrapper around ResourceManager::get for loading * images. */ - Image* - getImage(const std::string &idPath); + Image *getImage(const std::string &idPath); /** * Convenience wrapper around ResourceManager::get for loading * songs. */ - Music* - getMusic(const std::string &idPath); + Music *getMusic(const std::string &idPath); /** * Convenience wrapper around ResourceManager::get for loading * samples. */ - SoundEffect* - getSoundEffect(const std::string &idPath); + SoundEffect *getSoundEffect(const std::string &idPath); /** * Creates a image set based on the image referenced by the given * path and the supplied sprite sizes */ - ImageSet* - getImageSet(const std::string &imagePath, int w, int h); + ImageSet *getImageSet(const std::string &imagePath, int w, int h); /** * Creates a sprite definition based on a given path and the supplied @@ -181,41 +171,35 @@ class ResourceManager * @return An allocated byte array containing the data that was loaded, * or NULL on fail. */ - void* - loadFile(const std::string &fileName, int &fileSize); + void *loadFile(const std::string &fileName, int &fileSize); /** * Retrieves the contents of a text file. */ - std::vector - loadTextFile(const std::string &fileName); + std::vector loadTextFile(const std::string &fileName); /** * Loads the given filename as an SDL surface. The returned surface is * expected to be freed by the caller using SDL_FreeSurface. */ - SDL_Surface* - loadSDLSurface(const std::string& filename); + SDL_Surface *loadSDLSurface(const std::string& filename); /** * Returns an instance of the class, creating one if it does not * already exist. */ - static ResourceManager* - getInstance(); + static ResourceManager *getInstance(); /** * Deletes the class instance if it exists. */ - static void - deleteInstance(); + static void deleteInstance(); private: /** * Deletes the resource after logging a cleanup message. */ - static void - cleanUp(Resource *resource); + static void cleanUp(Resource *resource); void cleanOrphans(); diff --git a/src/textparticle.h b/src/textparticle.h index 3a0ba674..d56dbf84 100644 --- a/src/textparticle.h +++ b/src/textparticle.h @@ -37,11 +37,11 @@ class TextParticle : public Particle TextParticle(Map *map, const std::string &text, int colorR, int colorG, int colorB, gcn::Font *font); + /** * Draws the particle image. */ - virtual void - draw(Graphics *graphics, int offsetX, int offsetY) const; + virtual void draw(Graphics *graphics, int offsetX, int offsetY) const; // hack to improve text visibility virtual int getPixelY() const -- cgit v1.2.3-60-g2f50