diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-12-31 17:42:24 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-12-31 17:42:24 +0000 |
commit | 768cf33e1b66994379ac757aae0589bee83a2e7f (patch) | |
tree | 73b4b157e6a389da21742f9005ffa507e5ace509 | |
parent | f131ed7e4341ef1b1845641a70eb70c5823afe47 (diff) | |
download | mana-client-768cf33e1b66994379ac757aae0589bee83a2e7f.tar.gz mana-client-768cf33e1b66994379ac757aae0589bee83a2e7f.tar.bz2 mana-client-768cf33e1b66994379ac757aae0589bee83a2e7f.tar.xz mana-client-768cf33e1b66994379ac757aae0589bee83a2e7f.zip |
Enumerations do not need out-of-class definitions.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/being.cpp | 5 | ||||
-rw-r--r-- | src/being.h | 5 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 2 | ||||
-rw-r--r-- | src/joystick.h | 7 |
5 files changed, 9 insertions, 16 deletions
@@ -1,3 +1,9 @@ +2006-12-31 Guillaume Melquiond <guillaume.melquiond@gmail.com> + + * src/being.h, src/being.cpp, src/joystick.h: Scrapped static const + integral members and replaced them with enumerations. + * src/gui/viewport.cpp: Removed unused variable. + 2006-12-31 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/being.cpp: Added some variable definitions since they were 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. |