From 768cf33e1b66994379ac757aae0589bee83a2e7f Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Sun, 31 Dec 2006 17:42:24 +0000 Subject: Enumerations do not need out-of-class definitions. --- src/being.cpp | 5 ----- src/being.h | 5 +---- src/gui/viewport.cpp | 2 -- src/joystick.h | 7 ++----- 4 files changed, 3 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index abf64c18..1018b8e1 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -47,11 +47,6 @@ PATH_NODE::PATH_NODE(Uint16 iX, Uint16 iY): { } -const char Being::DOWN; -const char Being::LEFT; -const char Being::UP; -const char Being::RIGHT; - Being::Being(Uint16 id, Uint16 job, Map *map): mJob(job), mX(0), mY(0), diff --git a/src/being.h b/src/being.h index 8bb382ee..6eca252c 100644 --- a/src/being.h +++ b/src/being.h @@ -91,10 +91,7 @@ class Being : public Sprite /** * Directions, to be used as bitmask values */ - static const char DOWN = 1; - static const char LEFT = 2; - static const char UP = 4; - static const char RIGHT = 8; + enum { DOWN = 1, LEFT = 2, UP = 4, RIGHT = 8 }; std::string mName; /**< Name of character */ Uint16 mJob; /**< Job (player job, npc, monster, ) */ diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index f26d8d70..3346c07a 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -288,10 +288,8 @@ Viewport::mousePress(int mx, int my, int button) // Left click can cause different actions if (button == gcn::MouseInput::LEFT) { - Being *being; FloorItem *item; - // Pick up some item if ((item = floorItemManager->findByCoordinates(tilex, tiley))) { diff --git a/src/joystick.h b/src/joystick.h index f0759add..321e3e7d 100644 --- a/src/joystick.h +++ b/src/joystick.h @@ -32,15 +32,12 @@ class Joystick /** * Number of buttons we can handle. */ - static const unsigned char MAX_BUTTONS = 6; + enum { MAX_BUTTONS = 6 }; /** * Directions, to be used as bitmask values. */ - static const char UP = 1; - static const char DOWN = 2; - static const char LEFT = 4; - static const char RIGHT = 8; + enum { UP = 1, DOWN = 2, LEFT = 4, RIGHT = 8 }; /** * Initializes the joystick subsystem. -- cgit v1.2.3-60-g2f50