diff options
author | Paul Gilbert | 2012-06-13 21:06:57 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-06-13 21:06:57 +1000 |
commit | 746dcf33da340702157dc7aca0f01265648189be (patch) | |
tree | 354464dccc9d107e41192fb7e335db8d86666e1b /engines/tony/game.h | |
parent | 5bafab9ad629595a1d270b60b2a91bd04dc1b7b9 (diff) | |
download | scummvm-rg350-746dcf33da340702157dc7aca0f01265648189be.tar.gz scummvm-rg350-746dcf33da340702157dc7aca0f01265648189be.tar.bz2 scummvm-rg350-746dcf33da340702157dc7aca0f01265648189be.zip |
TONY: Refactor RMPointer class to use the ScummVM CursorMan
Diffstat (limited to 'engines/tony/game.h')
-rw-r--r-- | engines/tony/game.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/engines/tony/game.h b/engines/tony/game.h index db182dfa23..9ac8f76bcc 100644 --- a/engines/tony/game.h +++ b/engines/tony/game.h @@ -54,11 +54,11 @@ namespace Tony { delete raw; -class RMPointer : public RMGfxTask { +class RMPointer { private: RMGfxSourceBuffer8 *_pointer[16]; RMPoint _hotspot[16]; - RMPoint _pos; + RMPoint _cursorHotspot; RMItem *_specialPointer[16]; @@ -67,6 +67,8 @@ private: RMGfxSourceBuffer8 *_nCurCustomPointer; + void updateCursor(); + public: enum POINTER { PTR_NONE = 0, @@ -95,20 +97,13 @@ public: // Overloading of priorities int priority(); - // Overloading draw method - virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); - - // Sets the current co-ordinates - void setCoord(const RMPoint &pt) { - _pos = pt; - } - - // Overloading of the method to see if rising from the list - virtual void removeThis(CORO_PARAM, bool &result); + // draw method + void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Sets a new action as current void setAction(RMTonyAction action) { _nCurPointer = action; + updateCursor(); } // Sets a new pointer @@ -116,6 +111,8 @@ public: _nCurSpecialPointer = ptr; if (_nCurSpecialPointer && _nCurSpecialPointer != PTR_CUSTOM) _specialPointer[ptr - 1]->setPattern(1); + + updateCursor(); } POINTER getSpecialPointer(void) { return (POINTER)_nCurSpecialPointer; @@ -124,10 +121,17 @@ public: // Set the new custom pointer void setCustomPointer(RMGfxSourceBuffer8 *ptr) { _nCurCustomPointer = ptr; + updateCursor(); } // Return the current action to be applied according to the pointer int curAction(void); + + /** Show the cursor */ + void showCursor(); + + /** Hide the cursor */ + void hideCursor(); }; class RMOptionButton: public RMGfxTaskSetPrior { |