summaryrefslogtreecommitdiff
path: root/src/localplayer.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-10 12:26:57 -0700
committerIra Rice <irarice@gmail.com>2009-02-10 12:26:57 -0700
commit02e60b55b359002ae1f26f36b40f8fa78ea1a708 (patch)
tree0264392528cf174e2275bb79a84472b77c5245d2 /src/localplayer.h
parenta8a992ade40c9d68c9faec1cc3a54e7f064fb9d5 (diff)
downloadmana-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.gz
mana-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.bz2
mana-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.xz
mana-02e60b55b359002ae1f26f36b40f8fa78ea1a708.zip
Simplified target drawing so that it actually uses the SimpleAnimation
that it creates when initializing the target cursors in the first place. This behavior was carried over in the first place from the Viewport class. Also moved target drawing responsibility from the map to the being being targeted in the first place. This allows for assuring that targets are always drawn below the sprite being targeted (which the previous solution was designed to do, but didn't do correctly). Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/localplayer.h')
-rw-r--r--src/localplayer.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/localplayer.h b/src/localplayer.h
index d6d5ad2e..a4625f73 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -39,7 +39,6 @@ class Inventory;
class Item;
class Map;
class Network;
-class SimpleAnimation;
/**
* The local player character.
@@ -231,14 +230,6 @@ class LocalPlayer : public Player
float mLastAttackTime; /**< Used to synchronize the charge dialog */
- void drawTargetCursor(Graphics *graphics, int offsetX, int offsetY);
-
- /** Animated in range target cursor. */
- SimpleAnimation *mTargetCursorInRange[NUM_TC];
-
- /** Animated out of range target cursor. */
- SimpleAnimation *mTargetCursorOutRange[NUM_TC];
-
const std::auto_ptr<Equipment> mEquipment;
protected:
@@ -264,20 +255,20 @@ class LocalPlayer : public Player
Inventory *mInventory;
Inventory *mStorage;
+ // Load the target cursors into memory
+ void initTargetCursor();
+
/**
* Helper function for loading target cursors
*/
void loadTargetCursor(std::string filename, int width, int height,
bool outRange, Being::TargetCursorSize size);
- /** Images of in range target cursor. */
- ImageSet *mInRangeImages[NUM_TC];
-
- /** Images of out of range target cursor. */
- ImageSet *mOutRangeImages[NUM_TC];
+ /** Images of the target cursor. */
+ ImageSet *mTargetCursorImages[2][NUM_TC];
- // Load the target cursors into memory
- void initTargetCursor();
+ /** Animated target cursors. */
+ SimpleAnimation *mTargetCursor[2][NUM_TC];
};
extern LocalPlayer *player_node;