From b7103fbcef86554476871ad363e2a6b3bad0b77e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 Nov 2011 19:58:04 +0300 Subject: Change chat logs dirs format to yyyy-mm/dd/file.log. --- src/net/ea/partyhandler.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/net/ea') diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 5fa0df29b..8373cb1c4 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -225,6 +225,7 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg) return; Ea::partyTab = new PartyTab(); + Ea::partyTab->loadFromLogFile("#Party"); } // These seem to indicate the sharing mode for exp and items -- cgit v1.2.3-60-g2f50 From 10cf52b5ab6a9e1bb8328d9859b11d885fd5eef9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 19 Nov 2011 21:49:38 +0300 Subject: Add limits for creating chars (hair color, hair style, stats). --- configure.ac | 2 + data/CMakeLists.txt | 1 + data/Makefile.am | 2 +- data/perserver/CMakeLists.txt | 1 + data/perserver/Makefile.am | 3 + data/perserver/default/CMakeLists.txt | 5 ++ data/perserver/default/Makefile.am | 8 ++ data/perserver/default/charcreation.xml | 9 +++ manaplus.cbp | 2 + packaging/windows/setup.nsi | 4 + src/CMakeLists.txt | 2 + src/Makefile.am | 2 + src/client.cpp | 5 ++ src/gui/charcreatedialog.cpp | 19 ++++- src/gui/charcreatedialog.h | 5 ++ src/net/ea/charserverhandler.cpp | 14 +++- src/resources/chardb.cpp | 129 ++++++++++++++++++++++++++++++++ src/resources/chardb.h | 62 +++++++++++++++ 18 files changed, 270 insertions(+), 5 deletions(-) create mode 100644 data/perserver/CMakeLists.txt create mode 100644 data/perserver/Makefile.am create mode 100644 data/perserver/default/CMakeLists.txt create mode 100644 data/perserver/default/Makefile.am create mode 100644 data/perserver/default/charcreation.xml create mode 100644 src/resources/chardb.cpp create mode 100644 src/resources/chardb.h (limited to 'src/net/ea') diff --git a/configure.ac b/configure.ac index 9f68bf2cb..26f448c8a 100755 --- a/configure.ac +++ b/configure.ac @@ -266,6 +266,8 @@ data/help/ru/Makefile data/help/ru/tips/Makefile data/help/tips/Makefile data/icons/Makefile +data/perserver/Makefile +data/perserver/default/Makefile docs/Makefile po/Makefile.in ]) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 968d926b3..0435f6e35 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -4,6 +4,7 @@ ADD_SUBDIRECTORY(fonts) ADD_SUBDIRECTORY(graphics) ADD_SUBDIRECTORY(help) ADD_SUBDIRECTORY(icons) +ADD_SUBDIRECTORY(perserver) ADD_SUBDIRECTORY(sfx) ADD_SUBDIRECTORY(themes) diff --git a/data/Makefile.am b/data/Makefile.am index 5531c610f..302f0feae 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,5 +1,5 @@ -SUBDIRS = fonts graphics help icons sfx themes +SUBDIRS = fonts graphics help icons perserver sfx themes EXTRA_DIST = CMakeLists.txt items.xsd diff --git a/data/perserver/CMakeLists.txt b/data/perserver/CMakeLists.txt new file mode 100644 index 000000000..8b86a84b0 --- /dev/null +++ b/data/perserver/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY(default) diff --git a/data/perserver/Makefile.am b/data/perserver/Makefile.am new file mode 100644 index 000000000..b754c27f8 --- /dev/null +++ b/data/perserver/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = default + +EXTRA_DIST = CMakeLists.txt diff --git a/data/perserver/default/CMakeLists.txt b/data/perserver/default/CMakeLists.txt new file mode 100644 index 000000000..61bd98df1 --- /dev/null +++ b/data/perserver/default/CMakeLists.txt @@ -0,0 +1,5 @@ +SET (FILES + charcreation.xml + ) + +INSTALL(FILES ${FILES} DESTINATION ${DATA_DIR}/perserver/default) diff --git a/data/perserver/default/Makefile.am b/data/perserver/default/Makefile.am new file mode 100644 index 000000000..7ab87da67 --- /dev/null +++ b/data/perserver/default/Makefile.am @@ -0,0 +1,8 @@ +defaultdir = $(pkgdatadir)/data/perserver/default + +default_DATA = \ + charcreation.xml + +EXTRA_DIST = \ + $(default_DATA) \ + CMakeLists.txt diff --git a/data/perserver/default/charcreation.xml b/data/perserver/default/charcreation.xml new file mode 100644 index 000000000..a7cb1a091 --- /dev/null +++ b/data/perserver/default/charcreation.xml @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/manaplus.cbp b/manaplus.cbp index 3c39ed68b..26f3b7c5e 100644 --- a/manaplus.cbp +++ b/manaplus.cbp @@ -589,6 +589,8 @@ + + diff --git a/packaging/windows/setup.nsi b/packaging/windows/setup.nsi index baa7930a4..eb0e5ffe9 100644 --- a/packaging/windows/setup.nsi +++ b/packaging/windows/setup.nsi @@ -226,6 +226,8 @@ Section "Core files (required)" SecCore CreateDirectory "$INSTDIR\data\help\ru\tips" CreateDirectory "$INSTDIR\data\help\tips" CreateDirectory "$INSTDIR\data\icons" + CreateDirectory "$INSTDIR\data\perserver" + CreateDirectory "$INSTDIR\data\perserver\default" CreateDirectory "$INSTDIR\data\graphics\gui" CreateDirectory "$INSTDIR\data\graphics\images" CreateDirectory "$INSTDIR\data\graphics\sprites" @@ -317,6 +319,8 @@ Section "Core files (required)" SecCore File "${SRCDIR}\data\help\tips\*.jpg" SetOutPath "$INSTDIR\data\icons\" File "${SRCDIR}\data\icons\manaplus.ico" + SetOutPath "$INSTDIR\data\perserver\default\" + File "${SRCDIR}\data\perserver\default\*.xml" SetOutPath "$INSTDIR\docs" File "${SRCDIR}\docs\FAQ.txt" SectionEnd diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aa568fa1d..d281151e2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -399,6 +399,8 @@ SET(SRCS resources/animation.h resources/beinginfo.cpp resources/beinginfo.h + resources/chardb.cpp + resources/chardb.h resources/colordb.cpp resources/colordb.h resources/dye.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 9823ff934..fce320166 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -404,6 +404,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ resources/animation.h \ resources/beinginfo.cpp \ resources/beinginfo.h \ + resources/chardb.cpp \ + resources/chardb.h \ resources/colordb.cpp \ resources/colordb.h \ resources/dye.cpp \ diff --git a/src/client.cpp b/src/client.cpp index 7de58368c..d8bb747fb 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -85,6 +85,7 @@ #include "net/worldinfo.h" #include "resources/beinginfo.h" +#include "resources/chardb.h" #include "resources/colordb.h" #include "resources/emotedb.h" #include "resources/image.h" @@ -368,6 +369,8 @@ Client::Client(const Options &options): Image::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f); #endif + resman->addToSearchPath(PKG_DATADIR "data/perserver/default", false); + #if defined __APPLE__ CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle); @@ -649,6 +652,7 @@ Client::~Client() SDL_RemoveTimer(mSecondsCounterId); // Unload XML databases + CharDB::unload(); ColorDB::unload(); EmoteDB::unload(); ItemDB::unload(); @@ -1111,6 +1115,7 @@ int Client::exec() Mana::Event::trigger(CHANNEL_CLIENT, evt2); // Load XML databases + CharDB::load(); ColorDB::load(); MapDB::load(); ItemDB::load(); diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp index 42435f036..c20cfab95 100644 --- a/src/gui/charcreatedialog.cpp +++ b/src/gui/charcreatedialog.cpp @@ -44,6 +44,7 @@ #include "net/messageout.h" #include "net/net.h" +#include "resources/chardb.h" #include "resources/colordb.h" #include "resources/itemdb.h" @@ -66,10 +67,18 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *parent, int slot): mPlayer = new Being(0, ActorSprite::PLAYER, mRace, nullptr); mPlayer->setGender(GENDER_MALE); - int numberOfHairColors = ColorDB::getHairSize(); + maxHairColor = CharDB::getMaxHairColor(); + minHairColor = CharDB::getMinHairColor(); + if (!maxHairColor) + maxHairColor = ColorDB::getHairSize(); - mHairStyle = rand() % mPlayer->getNumOfHairstyles(); - mHairColor = rand() % numberOfHairColors; + maxHairStyle = CharDB::getMaxHairStyle(); + minHairStyle = CharDB::getMinHairStyle(); + if (!maxHairStyle) + maxHairStyle = mPlayer->getNumOfHairstyles(); + + mHairStyle = (rand() % maxHairStyle) + minHairStyle; + mHairColor = (rand() % maxHairColor) + minHairColor; updateHair(); mNameField = new TextField(""); @@ -408,10 +417,14 @@ void CharCreateDialog::updateHair() mHairStyle %= Being::getNumOfHairstyles(); if (mHairStyle < 0) mHairStyle += Being::getNumOfHairstyles(); + if (mHairStyle < minHairStyle || mHairStyle > maxHairStyle) + mHairStyle = minHairStyle; mHairColor %= ColorDB::getHairSize(); if (mHairColor < 0) mHairColor += ColorDB::getHairSize(); + if (mHairColor < minHairColor || mHairColor > maxHairColor) + mHairColor = minHairColor; mPlayer->setSprite(Net::getCharHandler()->hairSprite(), mHairStyle * -1, ColorDB::getHairColor(mHairColor)); diff --git a/src/gui/charcreatedialog.h b/src/gui/charcreatedialog.h index 2f0f83513..c7010d6b1 100644 --- a/src/gui/charcreatedialog.h +++ b/src/gui/charcreatedialog.h @@ -124,6 +124,11 @@ class CharCreateDialog : public Window, public gcn::ActionListener int mRace; int mSlot; + + unsigned maxHairColor; + unsigned minHairColor; + unsigned maxHairStyle; + unsigned minHairStyle; }; #endif // CHAR_CREATE_DIALOG_H diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index 0c01959f2..d71236496 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -35,6 +35,8 @@ #include "utils/gettext.h" +#include "resources/chardb.h" + #include "debug.h" extern Net::CharHandler *charHandler; @@ -70,7 +72,17 @@ void CharServerHandler::setCharCreateDialog(CharCreateDialog *window) const Token &token = static_cast(Net::getLoginHandler())->getToken(); - mCharCreateDialog->setAttributes(attributes, 30, 1, 9); + int minStat = CharDB::getMinStat(); + if (!minStat) + minStat = 1; + int maxStat = CharDB::getMaxStat(); + if (!maxStat) + maxStat = 9; + int sumStat = CharDB::getSumStat(); + if (!sumStat) + sumStat = 30; + + mCharCreateDialog->setAttributes(attributes, sumStat, minStat, maxStat); mCharCreateDialog->setFixedGender(true, token.sex); } diff --git a/src/resources/chardb.cpp b/src/resources/chardb.cpp new file mode 100644 index 000000000..d944f280e --- /dev/null +++ b/src/resources/chardb.cpp @@ -0,0 +1,129 @@ +/* + * Color database + * Copyright (C) 2008 Aethyra Development Team + * Copyright (C) 2011 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program 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. + * + * This program 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 this program. If not, see . + */ + +#include "resources/chardb.h" + +#include "client.h" +#include "logger.h" + +#include "utils/xml.h" + +#include + +#include "debug.h" + +namespace +{ + bool mLoaded = false; + unsigned mMinHairColor = 0; + unsigned mMaxHairColor = 0; + unsigned mMinHairStyle = 0; + unsigned mMaxHairStyle = 0; + unsigned mMinStat = 0; + unsigned mMaxStat = 0; + unsigned mSumStat = 0; +} + +void CharDB::load() +{ + if (mLoaded) + unload(); + + XML::Document *doc = new XML::Document("charcreation.xml"); + xmlNodePtr root = doc->rootNode(); + + if (!root || !xmlStrEqual(root->name, BAD_CAST "chars")) + { + logger->log1("CharDB: Failed to parse charcreation.xml."); + + delete doc; + return; + } + + for_each_xml_child_node(node, root) + { + if (xmlStrEqual(node->name, BAD_CAST "haircolor")) + { + loadMinMax(node, &mMinHairColor, &mMaxHairColor); + } + else if (xmlStrEqual(node->name, BAD_CAST "hairstyle")) + { + loadMinMax(node, &mMinHairStyle, &mMaxHairStyle); + } + else if (xmlStrEqual(node->name, BAD_CAST "stat")) + { + loadMinMax(node, &mMinStat, &mMaxStat); + mSumStat = XML::getProperty(node, "sum", 0); + } + } + + delete doc; + + mLoaded = true; +} + +void CharDB::loadMinMax(xmlNodePtr node, unsigned *min, unsigned *max) +{ + *min = XML::getProperty(node, "min", 1); + *max = XML::getProperty(node, "max", 10); +} + +void CharDB::unload() +{ + logger->log1("Unloading chars database..."); + + mLoaded = false; +} + +unsigned CharDB::getMinHairColor() +{ + return mMinHairColor; +} + +unsigned CharDB::getMaxHairColor() +{ + return mMaxHairColor; +} + +unsigned CharDB::getMinHairStyle() +{ + return mMinHairStyle; +} + +unsigned CharDB::getMaxHairStyle() +{ + return mMaxHairStyle; +} + +unsigned CharDB::getMinStat() +{ + return mMinStat; +} + +unsigned CharDB::getMaxStat() +{ + return mMaxStat; +} + +unsigned CharDB::getSumStat() +{ + return mSumStat; +} diff --git a/src/resources/chardb.h b/src/resources/chardb.h new file mode 100644 index 000000000..769dedb56 --- /dev/null +++ b/src/resources/chardb.h @@ -0,0 +1,62 @@ +/* + * Color database + * Copyright (C) 2008 Aethyra Development Team + * Copyright (C) 2011 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program 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. + * + * This program 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 this program. If not, see . + */ + +#ifndef CHARDB_MANAGER_H +#define CHARDB_MANAGER_H + +#include +#include + +#include + +/** + * Char information database. + */ +namespace CharDB +{ + /** + * Loads the chars data. + */ + void load(); + + /** + * Clear the chars data + */ + void unload(); + + void loadMinMax(xmlNodePtr node, unsigned *min, unsigned *max); + + unsigned getMinHairColor(); + + unsigned getMaxHairColor(); + + unsigned getMinHairStyle(); + + unsigned getMaxHairStyle(); + + unsigned getMinStat(); + + unsigned getMaxStat(); + + unsigned getSumStat(); +} + +#endif -- cgit v1.2.3-60-g2f50 From ed0f26678c9aa154d3af441762b9a3ad5345747c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Nov 2011 05:26:02 +0300 Subject: Fix memory leak in char selection dialog. --- src/gui/charselectdialog.cpp | 1 + src/net/charhandler.h | 2 ++ src/net/ea/charserverhandler.cpp | 7 +++++++ src/net/ea/charserverhandler.h | 2 ++ 4 files changed, 12 insertions(+) (limited to 'src/net/ea') diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index 93302e0ff..15d1e6e0e 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -186,6 +186,7 @@ CharSelectDialog::CharSelectDialog(LoginData *data): CharSelectDialog::~CharSelectDialog() { + Net::getCharHandler()->clear(); } void CharSelectDialog::action(const gcn::ActionEvent &event) diff --git a/src/net/charhandler.h b/src/net/charhandler.h index 72a81684c..848354e96 100644 --- a/src/net/charhandler.h +++ b/src/net/charhandler.h @@ -90,6 +90,8 @@ class CharHandler virtual unsigned int maxSprite() const = 0; + virtual void clear() = 0; + protected: CharHandler() : mSelectedCharacter(0), diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index d71236496..63e267584 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -33,6 +33,7 @@ #include "net/ea/loginhandler.h" #include "net/ea/eaprotocol.h" +#include "utils/dtor.h" #include "utils/gettext.h" #include "resources/chardb.h" @@ -184,4 +185,10 @@ void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg A_UNUSED) new OkDialog(_("Error"), _("Failed to delete character.")); } +void CharServerHandler::clear() +{ + delete_all(mCharacters); + mCharacters.clear(); +} + } // namespace Ea diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h index bd39781cd..bab941503 100644 --- a/src/net/ea/charserverhandler.h +++ b/src/net/ea/charserverhandler.h @@ -78,6 +78,8 @@ class CharServerHandler : public Net::CharHandler virtual void processCharDeleteFailed(Net::MessageIn &msg); + virtual void clear(); + protected: virtual void readPlayerData(Net::MessageIn &msg, Net::Character *character, -- cgit v1.2.3-60-g2f50 From 8e5861c3cfd41574351547a1a518efcf9007666a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 23 Nov 2011 04:40:34 +0300 Subject: Add ability to play different animation depend on monster hp. Disabled for legacy servers because monster hp unknown and compilated hp can be wrong (version <= 0). For usage need add to action tag attribute hp="xx" Example: ... Here 50 mean 50% of health or less. Default action tag mean hp=100 --- src/animatedsprite.cpp | 23 +++++++++++-- src/animatedsprite.h | 4 +++ src/being.cpp | 27 +++++++++++++++- src/being.h | 3 ++ src/compoundsprite.cpp | 15 +++++++++ src/compoundsprite.h | 2 ++ src/imagesprite.h | 3 ++ src/net/ea/beinghandler.cpp | 2 +- src/resources/action.cpp | 3 +- src/resources/action.h | 7 ++++ src/resources/spritedef.cpp | 78 +++++++++++++++++++++++++++++++++++---------- src/resources/spritedef.h | 12 +++++-- src/sprite.h | 2 ++ 13 files changed, 157 insertions(+), 24 deletions(-) (limited to 'src/net/ea') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index c1f1cac85..4143cb47a 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -42,7 +42,9 @@ AnimatedSprite::AnimatedSprite(SpriteDef *sprite): mSprite(sprite), mAction(nullptr), mAnimation(nullptr), - mFrame(nullptr) + mFrame(nullptr), + mNumber(100), + mNumber1(100) { mAlpha = 1.0f; @@ -51,6 +53,7 @@ AnimatedSprite::AnimatedSprite(SpriteDef *sprite): mSprite->incRef(); // Play the stand animation by default + //+++ need get num? play(SpriteAction::STAND); } @@ -90,7 +93,7 @@ bool AnimatedSprite::play(std::string spriteAction) if (!mSprite) return false; - Action *action = mSprite->getAction(spriteAction); + Action *action = mSprite->getAction(spriteAction, mNumber); if (!action) return false; @@ -313,3 +316,19 @@ void *AnimatedSprite::getHash() // return mAnimation; return this; } + +bool AnimatedSprite::updateNumber(unsigned num) +{ + if (mNumber1 != num) + { + mNumber1 = num; + mNumber = mSprite->findNumber(num); + if (!mNumber) + { + mNumber = 100; + return false; + } + return true; + } + return false; +} diff --git a/src/animatedsprite.h b/src/animatedsprite.h index 2a2cfb8d8..16bcdf2da 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -84,6 +84,8 @@ class AnimatedSprite : public Sprite virtual void *getHash(); + bool updateNumber(unsigned num); + private: bool updateCurrentAnimation(unsigned int dt); @@ -97,6 +99,8 @@ class AnimatedSprite : public Sprite Action *mAction; /**< The currently active action. */ Animation *mAnimation; /**< The currently active animation. */ Frame *mFrame; /**< The currently active frame. */ + unsigned mNumber; + unsigned mNumber1; }; #endif diff --git a/src/being.cpp b/src/being.cpp index 9d731d2c9..3ed7ba587 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -253,7 +253,8 @@ Being::Being(int id, Type type, Uint16 subtype, Map *map): mAdvanced(false), mShop(false), mAway(false), - mInactive(false) + mInactive(false), + mNumber(100) { mSpriteRemap = new int[20]; mSpriteHide = new int[20]; @@ -287,6 +288,7 @@ Being::Being(int id, Type type, Uint16 subtype, Map *map): updateColors(); resetCounters(); + updatePercentHP(); } Being::~Being() @@ -660,7 +662,10 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) } if (mType == MONSTER) + { + updatePercentHP(); updateName(); + } else if (mType == PLAYER && socialWindow && getName() != "") socialWindow->updateAvatar(getName()); @@ -1036,6 +1041,7 @@ void Being::setAction(Action action, int attackType A_UNUSED) if (currentAction != SpriteAction::INVALID) { + //set mNumber play(currentAction); mAction = action; } @@ -2102,6 +2108,8 @@ void Being::setHP(int hp) mHP = hp; if (mMaxHP < mHP) mMaxHP = mHP; + if (mType == MONSTER) + updatePercentHP(); } void Being::setMaxHP(int hp) @@ -2521,6 +2529,23 @@ void Being::setEmote(Uint8 emotion, int emote_time) } } +void Being::updatePercentHP() +{ + if (!mMaxHP || !serverVersion) + return; + unsigned num = 0; + if (mHP) + { + num = mHP * 100 / mMaxHP; + if (num != mNumber) + { + mNumber = num; + if (updateNumber(mNumber)) + setAction(mAction); + } + } +} + BeingEquipBackend::BeingEquipBackend(Being *being): mBeing(being) { diff --git a/src/being.h b/src/being.h index 9ee60fcdf..1a5644929 100644 --- a/src/being.h +++ b/src/being.h @@ -767,6 +767,8 @@ class Being : public ActorSprite, public ConfigListener void attack2(Being *target = nullptr, bool keep = false, bool dontChangeEquipment = false); + void updatePercentHP(); + protected: /** * Sets the new path for this being. @@ -909,6 +911,7 @@ class Being : public ActorSprite, public ConfigListener bool mShop; bool mAway; bool mInactive; + unsigned mNumber; }; extern std::list beingInfoCache; diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index 3ee988cec..912c51404 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -544,6 +544,21 @@ void CompoundSprite::initCurrentCacheItem() const } } +bool CompoundSprite::updateNumber(unsigned num) +{ + SpriteConstIterator it, it_end; + bool res(false); + for (it = begin(), it_end = end(); it != it_end; ++ it) + { + if (*it) + { + if ((*it)->updateNumber(num)) + res = true; + } + } + return res; +} + CompoundItem::CompoundItem() : // alpha(1.0f), image(nullptr), diff --git a/src/compoundsprite.h b/src/compoundsprite.h index d1b019057..f29bece7f 100644 --- a/src/compoundsprite.h +++ b/src/compoundsprite.h @@ -119,6 +119,8 @@ public: virtual void setAlpha(float alpha); + bool updateNumber(unsigned num); + private: void redraw() const; diff --git a/src/imagesprite.h b/src/imagesprite.h index 21705c812..c59dd8eec 100644 --- a/src/imagesprite.h +++ b/src/imagesprite.h @@ -73,6 +73,9 @@ public: unsigned int getFrameCount() const { return 1; } + bool updateNumber(unsigned num A_UNUSED) + { return false; } + private: Image *mImage; }; diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index 5c3c694b3..1c2983137 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -215,10 +215,10 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, bool visible) int maxHP = msg.readInt32(); if (hp && maxHP) { + dstBeing->setMaxHP(maxHP); int oldHP = dstBeing->getHP(); if (!oldHP || oldHP > hp) dstBeing->setHP(hp); - dstBeing->setMaxHP(maxHP); } } else diff --git a/src/resources/action.cpp b/src/resources/action.cpp index c2af3ff9b..f940bffcb 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -29,7 +29,8 @@ #include "debug.h" -Action::Action() +Action::Action() : + mNumber(100) { } diff --git a/src/resources/action.h b/src/resources/action.h index 05b326d8f..9ab6f98d5 100644 --- a/src/resources/action.h +++ b/src/resources/action.h @@ -43,10 +43,17 @@ class Action Animation *getAnimation(int direction) const; + unsigned getNumber() + { return mNumber; } + + void setNumber(unsigned n) + { mNumber = n; } + protected: typedef std::map Animations; typedef Animations::iterator AnimationIterator; Animations mAnimations; + unsigned mNumber; }; #endif diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 3e2aac785..6b856c5d3 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -41,17 +41,41 @@ SpriteReference *SpriteReference::Empty = nullptr; -Action *SpriteDef::getAction(std::string action) const +Action *SpriteDef::getAction(std::string action, unsigned num) const { - Actions::const_iterator i = mActions.find(action); + Actions::const_iterator i = mActions.find(num); + if (i == mActions.end() && num != 100) + i = mActions.find(100); if (i == mActions.end()) + return nullptr; + + std::map::const_iterator it + = ((*i).second)->find(action); + + if (it == ((*i).second)->end()) { logger->log("Warning: no action \"%s\" defined!", action.c_str()); return nullptr; } - return i->second; + return (*it).second; +} + +unsigned SpriteDef::findNumber(unsigned num) const +{ + unsigned min = 101; + Actions::const_iterator it = mActions.begin(); + Actions::const_iterator it_end = mActions.end(); + for (; it != it_end; ++ it) + { + unsigned n = (*it).first; + if (n >= num && n < min) + min = n; + } + if (min == 101) + return 0; + return min; } SpriteDef *SpriteDef::load(const std::string &animationFile, int variant) @@ -84,11 +108,17 @@ SpriteDef *SpriteDef::load(const std::string &animationFile, int variant) void SpriteDef::substituteAction(std::string complete, std::string with) { - if (mActions.find(complete) == mActions.end()) + Actions::const_iterator it = mActions.begin(); + Actions::const_iterator it_end = mActions.end(); + for (; it != it_end; ++ it) { - Actions::const_iterator i = mActions.find(with); - if (i != mActions.end()) - mActions[complete] = i->second; + std::map *d = (*it).second; + if (d->find(complete) == d->end()) + { + std::map::iterator i = d->find(with); + if (i != d->end()) + (*d)[complete] = i->second; + } } } @@ -162,6 +192,7 @@ void SpriteDef::loadAction(xmlNodePtr node, int variant_offset) { const std::string actionName = XML::getProperty(node, "name", ""); const std::string imageSetName = XML::getProperty(node, "imageset", ""); + const unsigned hp = XML::getProperty(node, "hp", 100); ImageSetIterator si = mImageSets.find(imageSetName); if (si == mImageSets.end()) @@ -179,15 +210,17 @@ void SpriteDef::loadAction(xmlNodePtr node, int variant_offset) return; } Action *action = new Action; - mActions[actionName] = action; + action->setNumber(hp); + addAction(hp, actionName, action); // dirty hack to fix bad resources in tmw server if (actionName == "attack_stab") - mActions["attack"] = action; + addAction(hp, "attack", action); // When first action set it as default direction - if (mActions.size() == 1) - mActions[SpriteAction::DEFAULT] = action; + Actions::const_iterator i = mActions.find(hp); + if ((*i).second->size() == 1) + addAction(hp, SpriteAction::DEFAULT, action); // Load animations for_each_xml_child_node(animationNode, node) @@ -339,14 +372,18 @@ void SpriteDef::includeSprite(xmlNodePtr includeNode) SpriteDef::~SpriteDef() { // Actions are shared, so ensure they are deleted only once. - std::set< Action * > actions; - for (Actions::const_iterator i = mActions.begin(), + std::set actions; + for (Actions::iterator i = mActions.begin(), i_end = mActions.end(); i != i_end; ++i) { - actions.insert(i->second); + std::map::iterator it = (*i).second->begin(); + std::map::iterator it_end = (*i).second->end(); + for (; it != it_end; ++ it) + actions.insert(it->second); + delete (*i).second; } - for (std::set< Action * >::const_iterator i = actions.begin(), + for (std::set::const_iterator i = actions.begin(), i_end = actions.end(); i != i_end; ++i) { delete *i; @@ -355,7 +392,7 @@ SpriteDef::~SpriteDef() mActions.clear(); for (ImageSetIterator i = mImageSets.begin(); - i != mImageSets.end(); ++i) + i != mImageSets.end(); ++i) { if (i->second) { @@ -388,3 +425,12 @@ SpriteDirection SpriteDef::makeSpriteDirection(const std::string &direction) else return DIRECTION_INVALID; } + +void SpriteDef::addAction(unsigned hp, std::string name, Action *action) +{ + Actions::const_iterator i = mActions.find(hp); + if (i == mActions.end()) + mActions[hp] = new std::map(); + + (*mActions[hp])[name] = action; +} diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index b2939fca1..642962c0b 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -117,7 +117,9 @@ class SpriteDef : public Resource /** * Returns the specified action. */ - Action *getAction(std::string action) const; + Action *getAction(std::string action, unsigned num) const; + + unsigned findNumber(unsigned num) const; /** * Converts a string into a SpriteDirection enum. @@ -125,11 +127,14 @@ class SpriteDef : public Resource static SpriteDirection makeSpriteDirection(const std::string &direction); + void addAction(unsigned hp, std::string name, Action *action); + private: /** * Constructor. */ - SpriteDef() {} + SpriteDef() + { } /** * Destructor. @@ -178,7 +183,8 @@ class SpriteDef : public Resource typedef std::map ImageSets; typedef ImageSets::iterator ImageSetIterator; - typedef std::map Actions; +// typedef std::map*> Actions; + typedef std::map*> Actions; ImageSets mImageSets; Actions mActions; diff --git a/src/sprite.h b/src/sprite.h index 52752619b..64721b740 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -112,6 +112,8 @@ class Sprite virtual void *getHash2() { return this; } + virtual bool updateNumber(unsigned num) = 0; + protected: float mAlpha; /**< The alpha opacity used to draw */ }; -- cgit v1.2.3-60-g2f50 From 34a492ac70b3217937eafeb6db3cb9bfdc18fba9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 25 Nov 2011 01:11:42 +0300 Subject: Move A_UNUSED define to include file. --- src/actorspritemanager.h | 6 ----- src/being.h | 6 ----- src/client.h | 6 ----- src/commandhandler.h | 41 +++++++++++--------------------- src/graphics.h | 8 ------- src/gui/botcheckerwindow.h | 6 ----- src/gui/buydialog.h | 6 ----- src/gui/chatwindow.h | 6 ----- src/gui/didyouknowwindow.h | 9 +------ src/gui/equipmentwindow.h | 6 ----- src/gui/helpwindow.h | 6 +---- src/gui/inventorywindow.h | 7 ------ src/gui/itemamountwindow.h | 6 ----- src/gui/ministatuswindow.h | 6 ----- src/gui/popupmenu.h | 6 +---- src/gui/register.h | 6 ----- src/gui/selldialog.h | 6 ----- src/gui/setup_colors.h | 6 ----- src/gui/setup_relations.h | 6 ----- src/gui/shopwindow.h | 6 ----- src/gui/skilldialog.h | 6 ----- src/gui/socialwindow.h | 6 ----- src/gui/specialswindow.h | 6 ----- src/gui/statuswindow.h | 6 ----- src/gui/viewport.h | 6 ----- src/gui/widgets/chattab.h | 10 ++++---- src/gui/widgets/checkbox.h | 6 ----- src/gui/widgets/desktop.h | 6 ----- src/gui/widgets/dropshortcutcontainer.h | 6 ----- src/gui/widgets/emoteshortcutcontainer.h | 6 ----- src/gui/widgets/flowcontainer.h | 6 ----- src/gui/widgets/guitable.h | 6 ----- src/gui/widgets/horizontcontainer.h | 6 ----- src/gui/widgets/inventoryfilter.h | 6 ----- src/gui/widgets/itemcontainer.h | 6 ----- src/gui/widgets/itemlinkhandler.h | 11 +++------ src/gui/widgets/itemshortcutcontainer.h | 6 ----- src/gui/widgets/layouthelper.h | 6 ----- src/gui/widgets/listbox.h | 6 ----- src/gui/widgets/popup.h | 6 ----- src/gui/widgets/radiobutton.h | 6 ----- src/gui/widgets/scrollarea.h | 6 ----- src/gui/widgets/setupitem.h | 6 ----- src/gui/widgets/setuptabscroll.h | 6 +---- src/gui/widgets/shoplistbox.h | 8 +------ src/gui/widgets/shortcutcontainer.h | 9 ++----- src/gui/widgets/slider.h | 6 ----- src/gui/widgets/spellshortcutcontainer.h | 7 ------ src/gui/widgets/tabbedarea.h | 6 ----- src/gui/widgets/vertcontainer.h | 6 ----- src/gui/widgets/window.h | 6 ----- src/gui/windowmenu.h | 8 ++----- src/imagesprite.h | 6 ----- src/localconsts.h | 6 +++++ src/localplayer.h | 6 ----- src/main.h | 6 ----- src/map.h | 6 ----- src/net/download.h | 6 ----- src/net/ea/adminhandler.h | 6 ----- src/net/ea/beinghandler.h | 6 ----- src/net/ea/charserverhandler.h | 6 ----- src/net/ea/chathandler.h | 6 ----- src/net/ea/gamehandler.h | 6 ----- src/net/ea/guildhandler.h | 6 ----- src/net/ea/inventoryhandler.h | 6 ----- src/net/ea/loginhandler.h | 6 ----- src/net/ea/npchandler.h | 6 ----- src/net/ea/partyhandler.h | 6 ----- src/net/ea/playerhandler.h | 6 ----- src/net/ea/specialhandler.h | 6 ----- src/net/ea/tradehandler.h | 6 ----- src/net/manaserv/adminhandler.h | 6 ----- src/net/manaserv/beinghandler.h | 6 ----- src/net/manaserv/buysellhandler.h | 6 ----- src/net/manaserv/chathandler.h | 6 ----- src/net/manaserv/gamehandler.h | 6 ----- src/net/manaserv/generalhandler.h | 6 ----- src/net/manaserv/guildhandler.h | 8 +------ src/net/manaserv/inventoryhandler.h | 6 ----- src/net/manaserv/loginhandler.h | 6 ----- src/net/manaserv/npchandler.h | 6 ----- src/net/manaserv/partyhandler.h | 7 +----- src/net/manaserv/playerhandler.h | 6 ----- src/net/manaserv/specialhandler.h | 6 ----- src/net/manaserv/tradehandler.h | 6 ----- src/net/messageout.h | 6 ----- src/net/tmwa/adminhandler.h | 6 ----- src/net/tmwa/charserverhandler.h | 6 ----- src/net/tmwa/chathandler.h | 6 ----- src/net/tmwa/gamehandler.h | 6 ----- src/net/tmwa/generalhandler.h | 6 ----- src/net/tmwa/guildhandler.h | 8 +------ src/net/tmwa/inventoryhandler.h | 6 ----- src/net/tmwa/loginhandler.h | 6 ----- src/net/tmwa/npchandler.h | 6 ----- src/net/tmwa/partyhandler.h | 6 ----- src/net/tmwa/playerhandler.h | 6 ----- src/net/tmwa/specialhandler.h | 6 ----- src/net/tmwa/tradehandler.h | 6 ----- src/net/tradehandler.h | 7 +----- src/opengl1graphics.h | 6 ----- src/openglgraphics.h | 6 ----- src/particle.h | 10 +++----- src/playerrelations.h | 6 ----- src/resources/itemdb.h | 6 ----- src/resources/mapreader.h | 6 ----- src/textmanager.h | 6 ----- 107 files changed, 43 insertions(+), 667 deletions(-) (limited to 'src/net/ea') diff --git a/src/actorspritemanager.h b/src/actorspritemanager.h index d2d9af108..f1f83634d 100644 --- a/src/actorspritemanager.h +++ b/src/actorspritemanager.h @@ -30,12 +30,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class LocalPlayer; class Map; diff --git a/src/being.h b/src/being.h index 1a5644929..f1cae8df7 100644 --- a/src/being.h +++ b/src/being.h @@ -23,12 +23,6 @@ #ifndef BEING_H #define BEING_H -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - #include "actorsprite.h" #include "configlistener.h" #include "equipment.h" diff --git a/src/client.h b/src/client.h index 776e9aa3d..b3fc0d676 100644 --- a/src/client.h +++ b/src/client.h @@ -36,12 +36,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Button; class Desktop; class LoginData; diff --git a/src/commandhandler.h b/src/commandhandler.h index 809e9e517..f8b44e04f 100644 --- a/src/commandhandler.h +++ b/src/commandhandler.h @@ -31,12 +31,6 @@ class ChatTab; extern ChatTab *localChatTab; -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - #define BOOLEAN_OPTIONS _("Options to /%s are \"yes\", \"no\", \"true\", "\ "\"false\", \"1\", \"0\".") @@ -263,23 +257,21 @@ class CommandHandler */ void handleNavigate(const std::string &args, ChatTab *tab); - void handleMail(const std::string &args, ChatTab *tab A_UNUSED); + void handleMail(const std::string &args, ChatTab *tab); void handleHack(const std::string &args, ChatTab *tab); - void handlePriceLoad(const std::string &args A_UNUSED, - ChatTab *tab A_UNUSED); + void handlePriceLoad(const std::string &args, ChatTab *tab); - void handlePriceSave(const std::string &args A_UNUSED, - ChatTab *tab A_UNUSED); + void handlePriceSave(const std::string &args, ChatTab *tab); - void handleTrade(const std::string &args, ChatTab *tab A_UNUSED); + void handleTrade(const std::string &args, ChatTab *tab); - void handleDisconnect(const std::string &args, ChatTab *tab A_UNUSED); + void handleDisconnect(const std::string &args, ChatTab *tab); - void handleUndress(const std::string &args, ChatTab *tab A_UNUSED); + void handleUndress(const std::string &args, ChatTab *tab); - void handleAttack(const std::string &args, ChatTab *tab A_UNUSED); + void handleAttack(const std::string &args, ChatTab *tab); void handleDirs(const std::string &args, ChatTab *tab); @@ -289,22 +281,17 @@ class CommandHandler void handleUptime(const std::string &args, ChatTab *tab); - void handleAddAttack(const std::string &args, ChatTab *tab A_UNUSED); + void handleAddAttack(const std::string &args, ChatTab *tab); - void handleAddPriorityAttack(const std::string &args, - ChatTab *tab A_UNUSED); + void handleAddPriorityAttack(const std::string &args, ChatTab *tab); - void handleRemoveAttack(const std::string &args, - ChatTab *tab A_UNUSED); + void handleRemoveAttack(const std::string &args, ChatTab *tab); - void handleAddIgnoreAttack(const std::string &args, - ChatTab *tab A_UNUSED); + void handleAddIgnoreAttack(const std::string &args, ChatTab *tab); - void handleServerIgnoreAll(const std::string &args, - ChatTab *tab A_UNUSED); + void handleServerIgnoreAll(const std::string &args, ChatTab *tab); - void handleServerUnIgnoreAll(const std::string &args, - ChatTab *tab A_UNUSED); + void handleServerUnIgnoreAll(const std::string &args, ChatTab *tab); void handleDump(const std::string &args, ChatTab *tab); @@ -313,7 +300,7 @@ class CommandHandler void outString(ChatTab *tab, const std::string &str, const std::string &def); - void handleCacheInfo(const std::string &args, ChatTab *tab A_UNUSED); + void handleCacheInfo(const std::string &args, ChatTab *tab); bool parse2Int(const std::string &args, int *x, int *y); }; diff --git a/src/graphics.h b/src/graphics.h index 4a4676b26..2502c0418 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -25,14 +25,6 @@ #include -//include "graphicsvertexes.h" - -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class GraphicsVertexes; class Image; class ImageVertexes; diff --git a/src/gui/botcheckerwindow.h b/src/gui/botcheckerwindow.h index 6af9c91d6..86d5ef290 100644 --- a/src/gui/botcheckerwindow.h +++ b/src/gui/botcheckerwindow.h @@ -32,12 +32,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - struct BOTCHK { short id; /**< Index into "botchecker_db" array */ diff --git a/src/gui/buydialog.h b/src/gui/buydialog.h index 53d20e1e5..6bc10a103 100644 --- a/src/gui/buydialog.h +++ b/src/gui/buydialog.h @@ -30,12 +30,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ShopItems; class ShopListBox; class IntTextField; diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index 1ad468a3b..ad5229ffe 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -38,12 +38,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class BrowserBox; class ChatTab; class Channel; diff --git a/src/gui/didyouknowwindow.h b/src/gui/didyouknowwindow.h index b135103e8..d9734e8fe 100644 --- a/src/gui/didyouknowwindow.h +++ b/src/gui/didyouknowwindow.h @@ -28,12 +28,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Button; class BrowserBox; class CheckBox; @@ -59,8 +53,7 @@ class DidYouKnowWindow : public Window, public LinkHandler, /** * Handles link action. */ - void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED); + void handleLink(const std::string &link, gcn::MouseEvent *event); void loadData(int num = 0); diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h index b7d71d49f..0a3c2da20 100644 --- a/src/gui/equipmentwindow.h +++ b/src/gui/equipmentwindow.h @@ -37,12 +37,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Being; class Inventory; class Image; diff --git a/src/gui/helpwindow.h b/src/gui/helpwindow.h index d59289db0..178ae1e16 100644 --- a/src/gui/helpwindow.h +++ b/src/gui/helpwindow.h @@ -28,11 +28,7 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif +#include "localconsts.h" class BrowserBox; class LinkHandler; diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 9dadeb5a8..aa78705b8 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -35,12 +35,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class DropDown; class Item; class ItemContainer; @@ -48,7 +42,6 @@ class InventoryFilter; class LayoutCell; class ProgressBar; class SortListModel; -//class TextBox; class TextField; /** diff --git a/src/gui/itemamountwindow.h b/src/gui/itemamountwindow.h index 2dffdc286..bacd4cfd0 100644 --- a/src/gui/itemamountwindow.h +++ b/src/gui/itemamountwindow.h @@ -28,12 +28,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Icon; class IntTextField; class Item; diff --git a/src/gui/ministatuswindow.h b/src/gui/ministatuswindow.h index 5e1b442dc..6fb8f7652 100644 --- a/src/gui/ministatuswindow.h +++ b/src/gui/ministatuswindow.h @@ -31,12 +31,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class AnimatedSprite; class Graphics; class ProgressBar; diff --git a/src/gui/popupmenu.h b/src/gui/popupmenu.h index 3a7f27d4b..4bbe2c46c 100644 --- a/src/gui/popupmenu.h +++ b/src/gui/popupmenu.h @@ -28,11 +28,7 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif +#include "localconsts.h" class Being; class BrowserBox; diff --git a/src/gui/register.h b/src/gui/register.h index 34bcadd6d..b0137f141 100644 --- a/src/gui/register.h +++ b/src/gui/register.h @@ -30,12 +30,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class LoginData; class OkDialog; diff --git a/src/gui/selldialog.h b/src/gui/selldialog.h index 46cb077e1..a775cf0e0 100644 --- a/src/gui/selldialog.h +++ b/src/gui/selldialog.h @@ -30,12 +30,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Item; class ShopItems; class ShopListBox; diff --git a/src/gui/setup_colors.h b/src/gui/setup_colors.h index 850f23897..b6d5209e2 100644 --- a/src/gui/setup_colors.h +++ b/src/gui/setup_colors.h @@ -31,12 +31,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class BrowserBox; class TextField; class TextPreview; diff --git a/src/gui/setup_relations.h b/src/gui/setup_relations.h index a6627a06d..2c23d4dba 100644 --- a/src/gui/setup_relations.h +++ b/src/gui/setup_relations.h @@ -30,12 +30,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class EditDialog; class GuiTable; class PlayerTableModel; diff --git a/src/gui/shopwindow.h b/src/gui/shopwindow.h index 8b170f31e..e1fd8a2a0 100644 --- a/src/gui/shopwindow.h +++ b/src/gui/shopwindow.h @@ -30,12 +30,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class CheckBox; class Item; class ListBox; diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index 21ee56f5e..63f7d1790 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -42,12 +42,6 @@ class TabbedArea; struct SkillInfo; -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * The skill dialog. * diff --git a/src/gui/socialwindow.h b/src/gui/socialwindow.h index 7dc962316..dec8a6c26 100644 --- a/src/gui/socialwindow.h +++ b/src/gui/socialwindow.h @@ -30,12 +30,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class AttackTab; class Button; class ConfirmDialog; diff --git a/src/gui/specialswindow.h b/src/gui/specialswindow.h index 030c1343b..4350a656b 100644 --- a/src/gui/specialswindow.h +++ b/src/gui/specialswindow.h @@ -34,12 +34,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Label; class ScrollArea; class Tab; diff --git a/src/gui/statuswindow.h b/src/gui/statuswindow.h index 0af8d4276..d3a619bcb 100644 --- a/src/gui/statuswindow.h +++ b/src/gui/statuswindow.h @@ -37,12 +37,6 @@ class ProgressBar; class ScrollArea; class VertContainer; -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * The player status dialog. * diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 8823928a3..938988198 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -31,12 +31,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ActorSprite; class Button; class Being; diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index 4e077fafb..962c0b363 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -28,11 +28,7 @@ #include "gui/widgets/browserbox.h" #include "gui/widgets/tab.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif +#include "localconsts.h" class ScrollArea; @@ -58,6 +54,7 @@ class ChatTab : public Tab * Constructor. */ ChatTab(const std::string &name); + ~ChatTab(); /** @@ -106,7 +103,8 @@ class ChatTab : public Tab * Add any extra help text to the output. Allows tabs to define help * for commands defined by the tab itself. */ - virtual void showHelp() {} + virtual void showHelp() + { } /** * Handle special commands. Allows a tab to handle commands it diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 4e293aad6..af38065f5 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -27,12 +27,6 @@ #include "localconsts.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index 6364ecfe9..b1f059ffe 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -27,12 +27,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 348f48567..1f03fd53b 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -28,12 +28,6 @@ #include "gui/widgets/shortcutcontainer.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; class Item; class ItemPopup; diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index 06c009f0b..743ca4e87 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -27,12 +27,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class AnimatedSprite; class Image; class TextPopup; diff --git a/src/gui/widgets/flowcontainer.h b/src/gui/widgets/flowcontainer.h index 2ef6035f0..d1f276b3c 100644 --- a/src/gui/widgets/flowcontainer.h +++ b/src/gui/widgets/flowcontainer.h @@ -26,12 +26,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * A container that arranges its contents like words on a page. * diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index cf3cb8ad8..17f517644 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -33,12 +33,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class GuiTableActionListener; /** diff --git a/src/gui/widgets/horizontcontainer.h b/src/gui/widgets/horizontcontainer.h index 80014c171..2a3f77d2b 100644 --- a/src/gui/widgets/horizontcontainer.h +++ b/src/gui/widgets/horizontcontainer.h @@ -26,12 +26,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * A widget container. * diff --git a/src/gui/widgets/inventoryfilter.h b/src/gui/widgets/inventoryfilter.h index be69489a8..c3762189e 100644 --- a/src/gui/widgets/inventoryfilter.h +++ b/src/gui/widgets/inventoryfilter.h @@ -27,12 +27,6 @@ #include "gui/widgets/horizontcontainer.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class InventoryFilter : public HorizontContainer, public gcn::ActionListener { public: diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index e4188f54b..2c465fdee 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -31,12 +31,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; class Inventory; class Item; diff --git a/src/gui/widgets/itemlinkhandler.h b/src/gui/widgets/itemlinkhandler.h index 8dd2f62f5..bc3bdc51c 100644 --- a/src/gui/widgets/itemlinkhandler.h +++ b/src/gui/widgets/itemlinkhandler.h @@ -25,21 +25,16 @@ #include "gui/widgets/linkhandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ItemPopup; class ItemLinkHandler : public LinkHandler { public: ItemLinkHandler(); + ~ItemLinkHandler(); - void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED); + + void handleLink(const std::string &link, gcn::MouseEvent *event); private: ItemPopup *mItemPopup; diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 473cef350..587723279 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -29,12 +29,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; class Item; class ItemPopup; diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h index c38356c07..a01051595 100644 --- a/src/gui/widgets/layouthelper.h +++ b/src/gui/widgets/layouthelper.h @@ -27,12 +27,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * A helper class for adding a layout to a Guichan container widget. The layout * will register itself as a widget listener and relayout the widgets in the diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 418b83f58..8ac0bbc3b 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -25,12 +25,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class SelectionListener; /** diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 9d4343ba3..64e4b52ac 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -32,12 +32,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class GraphicsVertexes; class Skin; class WindowContainer; diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index 677195bd6..d1c347acb 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -25,12 +25,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 56e21c58c..105791080 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -26,12 +26,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class GraphicsVertexes; class Image; class ImageRect; diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index 15d2d41ea..5b8a9df87 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -33,12 +33,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class CheckBox; class Configuration; class ContainerPlacer; diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h index d2aa7002f..2b0c6f65e 100644 --- a/src/gui/widgets/setuptabscroll.h +++ b/src/gui/widgets/setuptabscroll.h @@ -26,11 +26,7 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif +#include "localconsts.h" class SetupItem; class ScrollArea; diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index 38e238f20..c5acbbefc 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -25,12 +25,6 @@ #include "gui/widgets/listbox.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ShopItems; class ItemPopup; @@ -82,7 +76,7 @@ class ShopListBox : public ListBox void mouseMoved(gcn::MouseEvent &event); - void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED); + void mouseExited(gcn::MouseEvent& mouseEvent); private: void init(); diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index df8529bd5..8587950c6 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -29,12 +29,6 @@ #include "gui/widgets/tab.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** @@ -55,7 +49,8 @@ class ShortcutContainer : public gcn::Widget, /** * Destructor. */ - ~ShortcutContainer() {} + ~ShortcutContainer() + { } /** * Draws the shortcuts diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 619c0c795..9ac45d0a0 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -25,12 +25,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Image; /** diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index 88b00338a..4191f9921 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -27,13 +27,6 @@ #include #include "gui/widgets/shortcutcontainer.h" -//#include "textcommand.h" - -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif class Image; class SpellPopup; diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index af241d7c5..d71109dd3 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -32,12 +32,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Tab; /** diff --git a/src/gui/widgets/vertcontainer.h b/src/gui/widgets/vertcontainer.h index 3b0ceeca7..08546aa47 100644 --- a/src/gui/widgets/vertcontainer.h +++ b/src/gui/widgets/vertcontainer.h @@ -28,12 +28,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - /** * A widget container. * diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 5ace2328e..6249626d3 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -31,12 +31,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ContainerPlacer; class GraphicsVertexes; class Layout; diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index 739a302ba..3f02ea851 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -29,15 +29,11 @@ #include #include +#include "localconsts.h" + #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class EmotePopup; class TextPopup; diff --git a/src/imagesprite.h b/src/imagesprite.h index c59dd8eec..9dad0f743 100644 --- a/src/imagesprite.h +++ b/src/imagesprite.h @@ -22,12 +22,6 @@ #ifndef IMAGESPRITE_H #define IMAGESPRITE_H -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - #include "sprite.h" #include "resources/image.h" diff --git a/src/localconsts.h b/src/localconsts.h index cd7fcd955..e135a4108 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -22,3 +22,9 @@ #undef nullptr #define nullptr 0 #endif + +#ifdef __GNUC__ +#define A_UNUSED __attribute__ ((unused)) +#else +#define A_UNUSED +#endif \ No newline at end of file diff --git a/src/localplayer.h b/src/localplayer.h index 56867a0b8..5b755e4f6 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -37,12 +37,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ChatTab; class FloorItem; class ImageSet; diff --git a/src/main.h b/src/main.h index f0f3b8c2c..36173a1c8 100644 --- a/src/main.h +++ b/src/main.h @@ -98,10 +98,4 @@ #define PKG_DATADIR "" #endif -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - #endif diff --git a/src/map.h b/src/map.h index 3fa607116..79dd01c41 100644 --- a/src/map.h +++ b/src/map.h @@ -32,12 +32,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Animation; class AmbientLayer; class Graphics; diff --git a/src/net/download.h b/src/net/download.h index 12c0c07d7..8339dee30 100644 --- a/src/net/download.h +++ b/src/net/download.h @@ -28,12 +28,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - enum DownloadStatus { DOWNLOAD_STATUS_CANCELLED = -3, diff --git a/src/net/ea/adminhandler.h b/src/net/ea/adminhandler.h index 2e311881f..5d1b7aa14 100644 --- a/src/net/ea/adminhandler.h +++ b/src/net/ea/adminhandler.h @@ -26,12 +26,6 @@ #include "net/adminhandler.h" #include "net/net.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h index f3769943d..f47385a61 100644 --- a/src/net/ea/beinghandler.h +++ b/src/net/ea/beinghandler.h @@ -26,12 +26,6 @@ #include "net/beinghandler.h" #include "net/net.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h index bab941503..bacde67b6 100644 --- a/src/net/ea/charserverhandler.h +++ b/src/net/ea/charserverhandler.h @@ -28,12 +28,6 @@ #include "net/net.h" #include "net/serverinfo.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class LoginData; namespace Ea diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index cff9bf589..d39e6788a 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -30,12 +30,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h index 6d8b88bd4..511efe357 100644 --- a/src/net/ea/gamehandler.h +++ b/src/net/ea/gamehandler.h @@ -29,12 +29,6 @@ #include "net/messagein.h" #include "net/net.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/guildhandler.h b/src/net/ea/guildhandler.h index 06edb2e89..5b090ec41 100644 --- a/src/net/ea/guildhandler.h +++ b/src/net/ea/guildhandler.h @@ -27,12 +27,6 @@ #include "net/ea/gui/guildtab.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index d99e34fc6..6db6b18ed 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -38,12 +38,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h index 06c47ad5d..62ace31c8 100644 --- a/src/net/ea/loginhandler.h +++ b/src/net/ea/loginhandler.h @@ -31,12 +31,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class LoginData; namespace Ea diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h index 44c1c5fb3..3e68c2321 100644 --- a/src/net/ea/npchandler.h +++ b/src/net/ea/npchandler.h @@ -29,12 +29,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class NpcDialog; namespace Ea diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h index 6ba0d0b82..596fda4f7 100644 --- a/src/net/ea/partyhandler.h +++ b/src/net/ea/partyhandler.h @@ -29,12 +29,6 @@ #include "party.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index 57bcbdcd5..ceb4aba0b 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -27,12 +27,6 @@ #include "net/net.h" #include "net/playerhandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/specialhandler.h b/src/net/ea/specialhandler.h index 06e8f8893..47b412f3e 100644 --- a/src/net/ea/specialhandler.h +++ b/src/net/ea/specialhandler.h @@ -27,12 +27,6 @@ #include "net/net.h" #include "net/specialhandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h index 2a27f8c31..6d623f60d 100644 --- a/src/net/ea/tradehandler.h +++ b/src/net/ea/tradehandler.h @@ -27,12 +27,6 @@ #include "net/net.h" #include "net/tradehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Ea { diff --git a/src/net/manaserv/adminhandler.h b/src/net/manaserv/adminhandler.h index 17d296bd6..5a71db35e 100644 --- a/src/net/manaserv/adminhandler.h +++ b/src/net/manaserv/adminhandler.h @@ -26,12 +26,6 @@ #include "net/adminhandler.h" #include "string" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/beinghandler.h b/src/net/manaserv/beinghandler.h index 512d3e58f..59797f8f5 100644 --- a/src/net/manaserv/beinghandler.h +++ b/src/net/manaserv/beinghandler.h @@ -30,12 +30,6 @@ #include "vector.h" #include "map.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/buysellhandler.h b/src/net/manaserv/buysellhandler.h index b38fdd9e7..e1a9c91e5 100644 --- a/src/net/manaserv/buysellhandler.h +++ b/src/net/manaserv/buysellhandler.h @@ -27,12 +27,6 @@ #include "net/buysellhandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/chathandler.h b/src/net/manaserv/chathandler.h index 3ed7717ad..e93c2dd87 100644 --- a/src/net/manaserv/chathandler.h +++ b/src/net/manaserv/chathandler.h @@ -28,12 +28,6 @@ #include "net/manaserv/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/gamehandler.h b/src/net/manaserv/gamehandler.h index a38052205..323b2566a 100644 --- a/src/net/manaserv/gamehandler.h +++ b/src/net/manaserv/gamehandler.h @@ -28,12 +28,6 @@ #include "net/manaserv/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/generalhandler.h b/src/net/manaserv/generalhandler.h index ccdddbbe6..c6614707f 100644 --- a/src/net/manaserv/generalhandler.h +++ b/src/net/manaserv/generalhandler.h @@ -30,12 +30,6 @@ #include "net/manaserv/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/guildhandler.h b/src/net/manaserv/guildhandler.h index 023e60b08..6a8db27c8 100644 --- a/src/net/manaserv/guildhandler.h +++ b/src/net/manaserv/guildhandler.h @@ -27,12 +27,6 @@ #include "net/manaserv/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { @@ -62,7 +56,7 @@ public: void memberList(int guildId); - void info(int guildId A_UNUSED); + void info(int guildId); void changeMemberPostion(GuildMember *member, int level); diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h index fbe53d735..ba4535d79 100644 --- a/src/net/manaserv/inventoryhandler.h +++ b/src/net/manaserv/inventoryhandler.h @@ -29,12 +29,6 @@ #include "net/manaserv/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/loginhandler.h b/src/net/manaserv/loginhandler.h index e60f00d92..0e8f2a4e6 100644 --- a/src/net/manaserv/loginhandler.h +++ b/src/net/manaserv/loginhandler.h @@ -28,12 +28,6 @@ #include "net/manaserv/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class LoginData; namespace ManaServ diff --git a/src/net/manaserv/npchandler.h b/src/net/manaserv/npchandler.h index f48e92ecb..f91858614 100644 --- a/src/net/manaserv/npchandler.h +++ b/src/net/manaserv/npchandler.h @@ -29,12 +29,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class NpcDialog; namespace ManaServ diff --git a/src/net/manaserv/partyhandler.h b/src/net/manaserv/partyhandler.h index 89924c962..087936d72 100644 --- a/src/net/manaserv/partyhandler.h +++ b/src/net/manaserv/partyhandler.h @@ -27,16 +27,11 @@ #include "net/manaserv/messagehandler.h" +#include "localconsts.h" #include "party.h" #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/playerhandler.h b/src/net/manaserv/playerhandler.h index f00fea42a..21bbac516 100644 --- a/src/net/manaserv/playerhandler.h +++ b/src/net/manaserv/playerhandler.h @@ -29,12 +29,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/specialhandler.h b/src/net/manaserv/specialhandler.h index e7931f8ea..ccbe59fd9 100644 --- a/src/net/manaserv/specialhandler.h +++ b/src/net/manaserv/specialhandler.h @@ -27,12 +27,6 @@ #include "net/manaserv/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/manaserv/tradehandler.h b/src/net/manaserv/tradehandler.h index 35c260a8e..b5fcb3d3f 100644 --- a/src/net/manaserv/tradehandler.h +++ b/src/net/manaserv/tradehandler.h @@ -27,12 +27,6 @@ #include "net/manaserv/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace ManaServ { diff --git a/src/net/messageout.h b/src/net/messageout.h index 4445bbbe8..a169bfe2d 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -27,12 +27,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace Net { diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h index 53fd4831f..d81e2421a 100644 --- a/src/net/tmwa/adminhandler.h +++ b/src/net/tmwa/adminhandler.h @@ -30,12 +30,6 @@ #include "net/tmwa/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h index 4bd3153e8..f1256e409 100644 --- a/src/net/tmwa/charserverhandler.h +++ b/src/net/tmwa/charserverhandler.h @@ -33,12 +33,6 @@ #include "net/ea/token.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class LoginData; namespace TmwAthena diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index 197ba12b3..9a88b7478 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -30,12 +30,6 @@ #include "net/tmwa/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index 6824ee672..ddb381058 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -31,12 +31,6 @@ #include "net/ea/gamehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 9ab8d64b4..e0f29fd1d 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -30,12 +30,6 @@ #include "net/tmwa/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tmwa/guildhandler.h b/src/net/tmwa/guildhandler.h index d8a1cc9e7..d8d291bdd 100644 --- a/src/net/tmwa/guildhandler.h +++ b/src/net/tmwa/guildhandler.h @@ -30,12 +30,6 @@ #include "net/tmwa/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { @@ -64,7 +58,7 @@ class GuildHandler : public Ea::GuildHandler, public MessageHandler void memberList(int guildId); - void info(int guildId A_UNUSED); + void info(int guildId); void changeMemberPostion(GuildMember *member, int level); diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index 989ced27a..d924e8713 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -31,12 +31,6 @@ #include "net/tmwa/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h index 1e73d3c99..c13c882a7 100644 --- a/src/net/tmwa/loginhandler.h +++ b/src/net/tmwa/loginhandler.h @@ -33,12 +33,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class LoginData; namespace TmwAthena diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h index 624f64cbc..548346205 100644 --- a/src/net/tmwa/npchandler.h +++ b/src/net/tmwa/npchandler.h @@ -32,12 +32,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class NpcDialog; namespace TmwAthena diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h index 209ea5047..4d727a986 100644 --- a/src/net/tmwa/partyhandler.h +++ b/src/net/tmwa/partyhandler.h @@ -30,12 +30,6 @@ #include "party.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h index 4fd108e94..bf8e861ff 100644 --- a/src/net/tmwa/playerhandler.h +++ b/src/net/tmwa/playerhandler.h @@ -30,12 +30,6 @@ #include "net/tmwa/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tmwa/specialhandler.h b/src/net/tmwa/specialhandler.h index 21c1b9026..50bf31c0b 100644 --- a/src/net/tmwa/specialhandler.h +++ b/src/net/tmwa/specialhandler.h @@ -30,12 +30,6 @@ #include "net/tmwa/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h index 85c153743..3a4c8c1fc 100644 --- a/src/net/tmwa/tradehandler.h +++ b/src/net/tmwa/tradehandler.h @@ -30,12 +30,6 @@ #include "net/tmwa/messagehandler.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - namespace TmwAthena { diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h index f099efe53..57219e675 100644 --- a/src/net/tradehandler.h +++ b/src/net/tradehandler.h @@ -27,11 +27,7 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif +#include "localconsts.h" namespace Net { @@ -43,7 +39,6 @@ class TradeHandler virtual void request(Being *being A_UNUSED) { } -// virtual ~TradeHandler() {} virtual void respond(bool accept A_UNUSED) { } diff --git a/src/opengl1graphics.h b/src/opengl1graphics.h index 3943a82fb..11df607f8 100644 --- a/src/opengl1graphics.h +++ b/src/opengl1graphics.h @@ -33,12 +33,6 @@ #include #endif -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class OpenGL1Graphics : public Graphics { public: diff --git a/src/openglgraphics.h b/src/openglgraphics.h index 12eb2d9f8..d12810203 100644 --- a/src/openglgraphics.h +++ b/src/openglgraphics.h @@ -33,12 +33,6 @@ #include #endif -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class OpenGLGraphics : public Graphics { public: diff --git a/src/particle.h b/src/particle.h index 2e3aa8740..ad448a054 100644 --- a/src/particle.h +++ b/src/particle.h @@ -25,17 +25,12 @@ #include "actor.h" #include "guichanfwd.h" +#include "localconsts.h" #include "vector.h" #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Map; class Particle; class ParticleEmitter; @@ -280,7 +275,8 @@ class Particle : public Actor virtual float getAlpha() const { return 1.0f; } - virtual void setAlpha(float alpha A_UNUSED) {} + virtual void setAlpha(float alpha A_UNUSED) + { } virtual void setDeathEffect(const std::string &effectFile, char conditions) diff --git a/src/playerrelations.h b/src/playerrelations.h index 5fabb3d0e..5eb1b3c64 100644 --- a/src/playerrelations.h +++ b/src/playerrelations.h @@ -28,12 +28,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Being; struct PlayerRelation diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h index c20961eff..71f0a490e 100644 --- a/src/resources/itemdb.h +++ b/src/resources/itemdb.h @@ -28,12 +28,6 @@ #include #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class ItemInfo; /** diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h index b10f35d89..c15a83b6f 100644 --- a/src/resources/mapreader.h +++ b/src/resources/mapreader.h @@ -27,12 +27,6 @@ #include -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Map; class Properties; class Tileset; diff --git a/src/textmanager.h b/src/textmanager.h index 019214bb6..1ed88883a 100644 --- a/src/textmanager.h +++ b/src/textmanager.h @@ -25,12 +25,6 @@ #include "guichanfwd.h" -#ifdef __GNUC__ -#define A_UNUSED __attribute__ ((unused)) -#else -#define A_UNUSED -#endif - class Text; class TextManager -- cgit v1.2.3-60-g2f50