summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-14 22:33:12 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-14 22:33:12 +0200
commitc0f674098878b171ace1b0cf884507a611b21de2 (patch)
tree2a30487f384c3358e5e2f7e623def94b1d031a94 /src
parentff5dcb946d1efc9248a2f1b88015119d2f267b35 (diff)
downloadmana-c0f674098878b171ace1b0cf884507a611b21de2.tar.gz
mana-c0f674098878b171ace1b0cf884507a611b21de2.tar.bz2
mana-c0f674098878b171ace1b0cf884507a611b21de2.tar.xz
mana-c0f674098878b171ace1b0cf884507a611b21de2.zip
Put the remaining unnamespaced handlers in a namespace
Also fixed some initialization order warnings when compiling with tmwserv support and made two getters const.
Diffstat (limited to 'src')
-rw-r--r--src/graphics.cpp4
-rw-r--r--src/graphics.h10
-rw-r--r--src/gui/widgets/popup.h1
-rw-r--r--src/localplayer.cpp20
-rw-r--r--src/net/ea/beinghandler.cpp4
-rw-r--r--src/net/ea/beinghandler.h4
-rw-r--r--src/net/ea/buysellhandler.cpp4
-rw-r--r--src/net/ea/buysellhandler.h4
-rw-r--r--src/net/ea/equipmenthandler.cpp4
-rw-r--r--src/net/ea/equipmenthandler.h4
-rw-r--r--src/net/ea/itemhandler.cpp4
-rw-r--r--src/net/ea/itemhandler.h4
-rw-r--r--src/net/ea/partyhandler.cpp6
-rw-r--r--src/net/ea/partyhandler.h4
-rw-r--r--src/net/tmwserv/beinghandler.cpp4
-rw-r--r--src/net/tmwserv/beinghandler.h4
-rw-r--r--src/net/tmwserv/buysellhandler.cpp4
-rw-r--r--src/net/tmwserv/buysellhandler.h4
-rw-r--r--src/net/tmwserv/effecthandler.cpp3
-rw-r--r--src/net/tmwserv/effecthandler.h4
-rw-r--r--src/net/tmwserv/guildhandler.cpp4
-rw-r--r--src/net/tmwserv/guildhandler.h4
-rw-r--r--src/net/tmwserv/itemhandler.cpp4
-rw-r--r--src/net/tmwserv/itemhandler.h4
24 files changed, 98 insertions, 18 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 2fbf5e20..58f643e9 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -105,12 +105,12 @@ bool Graphics::setFullscreen(bool fs)
mScreen->format->BitsPerPixel, fs, mHWAccel);
}
-int Graphics::getWidth()
+int Graphics::getWidth() const
{
return mScreen->w;
}
-int Graphics::getHeight()
+int Graphics::getHeight() const
{
return mScreen->h;
}
diff --git a/src/graphics.h b/src/graphics.h
index 2b6ca60e..d0e70c24 100644
--- a/src/graphics.h
+++ b/src/graphics.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _GRAPHICS_H
-#define _GRAPHICS_H
+#ifndef GRAPHICS_H
+#define GRAPHICS_H
#include <guichan/sdl/sdlgraphics.hpp>
@@ -149,17 +149,17 @@ class Graphics : public gcn::SDLGraphics
/**
* Returns the width of the screen.
*/
- int getWidth();
+ int getWidth() const;
/**
* Returns the height of the screen.
*/
- int getHeight();
+ int getHeight() const;
/**
* Takes a screenshot and returns it as SDL surface.
*/
- virtual SDL_Surface* getScreenshot();
+ virtual SDL_Surface *getScreenshot();
protected:
SDL_Surface *mScreen;
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index 928c8d32..1e7f103e 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -28,7 +28,6 @@
#include "guichanfwd.h"
class Skin;
-class SkinLoader;
class WindowContainer;
/**
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 7323008b..ecc6b25d 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -80,13 +80,6 @@ LocalPlayer *player_node = NULL;
LocalPlayer::LocalPlayer():
Player(65535, 0, NULL),
mEquipment(new Equipment),
- mAttributeBase(NB_CHARACTER_ATTRIBUTES, -1),
- mAttributeEffective(NB_CHARACTER_ATTRIBUTES, -1),
- mExpCurrent(CHAR_SKILL_NB, -1),
- mExpNext(CHAR_SKILL_NB, -1),
- mCharacterPoints(-1),
- mCorrectionPoints(-1),
- mLevelProgress(0),
#else
LocalPlayer::LocalPlayer(int id, int job, Map *map):
Player(id, job, map),
@@ -108,6 +101,15 @@ LocalPlayer::LocalPlayer(int id, int job, Map *map):
mTargetTime(-1),
#endif
mLastTarget(-1),
+#ifdef TMWSERV_SUPPORT
+ mAttributeBase(NB_CHARACTER_ATTRIBUTES, -1),
+ mAttributeEffective(NB_CHARACTER_ATTRIBUTES, -1),
+ mExpCurrent(CHAR_SKILL_NB, -1),
+ mExpNext(CHAR_SKILL_NB, -1),
+ mCharacterPoints(-1),
+ mCorrectionPoints(-1),
+ mLevelProgress(0),
+#endif
mLevel(1),
mMoney(0),
mTotalWeight(1), mMaxWeight(1),
@@ -120,9 +122,11 @@ LocalPlayer::LocalPlayer(int id, int job, Map *map):
mInventory(new Inventory(INVENTORY_SIZE)),
#ifdef TMWSERV_SUPPORT
mLocalWalkTime(-1),
- mExpMessageTime(0),
#endif
mStorage(new Inventory(STORAGE_SIZE))
+#ifdef TMWSERV_SUPPORT
+ , mExpMessageTime(0)
+#endif
{
// Variable to keep the local player from doing certain actions before a map
// is initialized. e.g. drawing a player's name using the TextManager, since
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 2fe5bedc..6ab73b4c 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -41,6 +41,8 @@
extern NpcTextDialog *npcTextDialog;
+namespace EAthena {
+
const int EMOTION_TIME = 150; /**< Duration of emotion icon */
BeingHandler::BeingHandler(bool enableSync):
@@ -600,3 +602,5 @@ void BeingHandler::handleMessage(MessageIn &msg)
break;
}
}
+
+} // namespace EAthena
diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h
index 83ac9fb4..97001579 100644
--- a/src/net/ea/beinghandler.h
+++ b/src/net/ea/beinghandler.h
@@ -24,6 +24,8 @@
#include "net/messagehandler.h"
+namespace EAthena {
+
class BeingHandler : public MessageHandler
{
public:
@@ -36,4 +38,6 @@ class BeingHandler : public MessageHandler
bool mSync;
};
+} // namespace EAthena
+
#endif // NET_EA_BEINGHANDLER_H
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp
index 69726384..ca155228 100644
--- a/src/net/ea/buysellhandler.cpp
+++ b/src/net/ea/buysellhandler.cpp
@@ -39,6 +39,8 @@
#include "utils/gettext.h"
+namespace EAthena {
+
BuySellHandler::BuySellHandler()
{
static const Uint16 _messages[] = {
@@ -134,3 +136,5 @@ void BuySellHandler::handleMessage(MessageIn &msg)
break;
}
}
+
+} // namespace EAthena
diff --git a/src/net/ea/buysellhandler.h b/src/net/ea/buysellhandler.h
index 983fd67a..cddace55 100644
--- a/src/net/ea/buysellhandler.h
+++ b/src/net/ea/buysellhandler.h
@@ -24,6 +24,8 @@
#include "net/messagehandler.h"
+namespace EAthena {
+
class BuySellHandler : public MessageHandler
{
public:
@@ -32,4 +34,6 @@ class BuySellHandler : public MessageHandler
virtual void handleMessage(MessageIn &msg);
};
+} // namespace EAthena
+
#endif // NET_EA_BUYSELLHANDLER_H
diff --git a/src/net/ea/equipmenthandler.cpp b/src/net/ea/equipmenthandler.cpp
index d30b2681..0df0b31e 100644
--- a/src/net/ea/equipmenthandler.cpp
+++ b/src/net/ea/equipmenthandler.cpp
@@ -35,6 +35,8 @@
#include "utils/gettext.h"
+namespace EAthena {
+
enum { debugEquipment = 1 };
EquipmentHandler::EquipmentHandler()
@@ -205,3 +207,5 @@ void EquipmentHandler::handleMessage(MessageIn &msg)
break;
}
}
+
+} // namespace EAthena
diff --git a/src/net/ea/equipmenthandler.h b/src/net/ea/equipmenthandler.h
index afac0c30..852be3c9 100644
--- a/src/net/ea/equipmenthandler.h
+++ b/src/net/ea/equipmenthandler.h
@@ -24,6 +24,8 @@
#include "net/messagehandler.h"
+namespace EAthena {
+
class EquipmentHandler : public MessageHandler
{
public:
@@ -32,4 +34,6 @@ class EquipmentHandler : public MessageHandler
virtual void handleMessage(MessageIn &msg);
};
+} // namespace EAthena
+
#endif // NET_EA_EQUIPMENTHANDLER_H
diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp
index 427b29bd..95d480f9 100644
--- a/src/net/ea/itemhandler.cpp
+++ b/src/net/ea/itemhandler.cpp
@@ -28,6 +28,8 @@
#include "engine.h"
#include "flooritemmanager.h"
+namespace EAthena {
+
ItemHandler::ItemHandler()
{
static const Uint16 _messages[] = {
@@ -67,3 +69,5 @@ void ItemHandler::handleMessage(MessageIn &msg)
break;
}
}
+
+} // namespace EAthena
diff --git a/src/net/ea/itemhandler.h b/src/net/ea/itemhandler.h
index 412d8783..f72e4779 100644
--- a/src/net/ea/itemhandler.h
+++ b/src/net/ea/itemhandler.h
@@ -24,6 +24,8 @@
#include "net/messagehandler.h"
+namespace EAthena {
+
class ItemHandler : public MessageHandler
{
public:
@@ -32,4 +34,6 @@ class ItemHandler : public MessageHandler
virtual void handleMessage(MessageIn &msg);
};
+} // namespace EAthena
+
#endif // NET_EA_ITEMHANDLER_H
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index c1d625f5..625f233a 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -37,7 +37,9 @@
#include "utils/strprintf.h"
PartyTab *partyTab = 0;
-PartyHandler *partyHandler = 0;
+Net::PartyHandler *partyHandler = 0;
+
+namespace EAthena {
PartyHandler::PartyHandler()
{
@@ -261,3 +263,5 @@ void PartyHandler::requestPartyMembers()
{
// Our eAthena doesn't have this message
}
+
+} // namespace EAthena
diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h
index 41338c96..aaebe353 100644
--- a/src/net/ea/partyhandler.h
+++ b/src/net/ea/partyhandler.h
@@ -26,6 +26,8 @@
#include "net/net.h"
#include "net/partyhandler.h"
+namespace EAthena {
+
class PartyHandler : public MessageHandler, public Net::PartyHandler
{
public:
@@ -54,6 +56,6 @@ class PartyHandler : public MessageHandler, public Net::PartyHandler
void requestPartyMembers();
};
-extern PartyHandler *partyHandler;
+} // namespace EAthena
#endif // NET_EA_PARTYHANDLER_H
diff --git a/src/net/tmwserv/beinghandler.cpp b/src/net/tmwserv/beinghandler.cpp
index 292a3e3f..581640db 100644
--- a/src/net/tmwserv/beinghandler.cpp
+++ b/src/net/tmwserv/beinghandler.cpp
@@ -41,6 +41,8 @@
#include "net/tmwserv/gameserver/player.h"
+namespace TmwServ {
+
BeingHandler::BeingHandler()
{
static const Uint16 _messages[] = {
@@ -359,3 +361,5 @@ void BeingHandler::handleBeingDirChangeMessage(MessageIn &msg)
case DIRECTION_RIGHT: being->setDirection(Being::RIGHT); break;
}
}
+
+} // namespace TmwServ
diff --git a/src/net/tmwserv/beinghandler.h b/src/net/tmwserv/beinghandler.h
index 0ca186f0..77a329a2 100644
--- a/src/net/tmwserv/beinghandler.h
+++ b/src/net/tmwserv/beinghandler.h
@@ -24,6 +24,8 @@
#include "net/messagehandler.h"
+namespace TmwServ {
+
class BeingHandler : public MessageHandler
{
public:
@@ -42,4 +44,6 @@ class BeingHandler : public MessageHandler
void handleBeingDirChangeMessage(MessageIn &msg);
};
+} // namespace TmwServ
+
#endif
diff --git a/src/net/tmwserv/buysellhandler.cpp b/src/net/tmwserv/buysellhandler.cpp
index e6943ee0..87a583ec 100644
--- a/src/net/tmwserv/buysellhandler.cpp
+++ b/src/net/tmwserv/buysellhandler.cpp
@@ -38,6 +38,8 @@ extern BuyDialog *buyDialog;
extern SellDialog *sellDialog;
extern Window *buySellDialog;
+namespace TmwServ {
+
BuySellHandler::BuySellHandler()
{
static const Uint16 _messages[] = {
@@ -89,3 +91,5 @@ void BuySellHandler::handleMessage(MessageIn &msg)
break;
}
}
+
+} // namespace TmwServ
diff --git a/src/net/tmwserv/buysellhandler.h b/src/net/tmwserv/buysellhandler.h
index 32f273f1..08f89015 100644
--- a/src/net/tmwserv/buysellhandler.h
+++ b/src/net/tmwserv/buysellhandler.h
@@ -24,6 +24,8 @@
#include "net/messagehandler.h"
+namespace TmwServ {
+
class BuySellHandler : public MessageHandler
{
public:
@@ -32,4 +34,6 @@ class BuySellHandler : public MessageHandler
void handleMessage(MessageIn &msg);
};
+} // namespace TmwServ
+
#endif
diff --git a/src/net/tmwserv/effecthandler.cpp b/src/net/tmwserv/effecthandler.cpp
index 787a7a68..34da9c7d 100644
--- a/src/net/tmwserv/effecthandler.cpp
+++ b/src/net/tmwserv/effecthandler.cpp
@@ -27,6 +27,7 @@
#include "effectmanager.h"
+namespace TmwServ {
EffectHandler::EffectHandler()
{
@@ -56,3 +57,5 @@ void EffectHandler::handleCreateEffects(MessageIn &msg)
Uint16 y = msg.readInt16();
effectManager->trigger(id, x, y);
}
+
+} // namespace TmwServ
diff --git a/src/net/tmwserv/effecthandler.h b/src/net/tmwserv/effecthandler.h
index 894ad1c8..05638cad 100644
--- a/src/net/tmwserv/effecthandler.h
+++ b/src/net/tmwserv/effecthandler.h
@@ -24,6 +24,8 @@
#include "net/messagehandler.h"
+namespace TmwServ {
+
class EffectHandler : public MessageHandler
{
public:
@@ -35,4 +37,6 @@ class EffectHandler : public MessageHandler
void handleCreateEffects(MessageIn &msg);
};
+} // namespace TmwServ
+
#endif
diff --git a/src/net/tmwserv/guildhandler.cpp b/src/net/tmwserv/guildhandler.cpp
index 21b43063..92057e6e 100644
--- a/src/net/tmwserv/guildhandler.cpp
+++ b/src/net/tmwserv/guildhandler.cpp
@@ -39,6 +39,8 @@
#include <iostream>
+namespace TmwServ {
+
GuildHandler::GuildHandler()
{
static const Uint16 _messages[] = {
@@ -241,3 +243,5 @@ void GuildHandler::joinedGuild(MessageIn &msg)
channelManager->addChannel(channel);
channel->getTab()->chatLog("Topic: " + announcement, BY_CHANNEL);
}
+
+} // namespace TmwServ
diff --git a/src/net/tmwserv/guildhandler.h b/src/net/tmwserv/guildhandler.h
index 9b900d9f..2178a19e 100644
--- a/src/net/tmwserv/guildhandler.h
+++ b/src/net/tmwserv/guildhandler.h
@@ -26,6 +26,8 @@
#include <string>
+namespace TmwServ {
+
class GuildHandler : public MessageHandler
{
public:
@@ -37,4 +39,6 @@ protected:
void joinedGuild(MessageIn &msg);
};
+} // namespace TmwServ
+
#endif
diff --git a/src/net/tmwserv/itemhandler.cpp b/src/net/tmwserv/itemhandler.cpp
index 4ed61266..423ce192 100644
--- a/src/net/tmwserv/itemhandler.cpp
+++ b/src/net/tmwserv/itemhandler.cpp
@@ -28,6 +28,8 @@
#include "engine.h"
#include "flooritemmanager.h"
+namespace TmwServ {
+
ItemHandler::ItemHandler()
{
static const Uint16 _messages[] = {
@@ -64,3 +66,5 @@ void ItemHandler::handleMessage(MessageIn &msg)
} break;
}
}
+
+} // namespace TmwServ
diff --git a/src/net/tmwserv/itemhandler.h b/src/net/tmwserv/itemhandler.h
index 6a2a96c8..d1d24d43 100644
--- a/src/net/tmwserv/itemhandler.h
+++ b/src/net/tmwserv/itemhandler.h
@@ -24,6 +24,8 @@
#include "net/messagehandler.h"
+namespace TmwServ {
+
class ItemHandler : public MessageHandler
{
public:
@@ -32,4 +34,6 @@ class ItemHandler : public MessageHandler
void handleMessage(MessageIn &msg);
};
+} // namespace TmwServ
+
#endif