diff options
author | Matthew Hoops | 2012-05-14 00:59:50 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-05-14 09:56:56 -0400 |
commit | b253a05454cd4088a70ac1a90589ebf5db85ed5a (patch) | |
tree | ebf119cbc9dbe9c435967886f1885756ceabc31d | |
parent | d789df894552bf73709628f09a0282b462df797e (diff) | |
download | scummvm-rg350-b253a05454cd4088a70ac1a90589ebf5db85ed5a.tar.gz scummvm-rg350-b253a05454cd4088a70ac1a90589ebf5db85ed5a.tar.bz2 scummvm-rg350-b253a05454cd4088a70ac1a90589ebf5db85ed5a.zip |
GRAPHICS: Hide the WinCursor implementation
-rw-r--r-- | engines/mohawk/cursors.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/he/resource_he.cpp | 2 | ||||
-rw-r--r-- | graphics/wincursor.cpp | 40 | ||||
-rw-r--r-- | graphics/wincursor.h | 42 |
4 files changed, 44 insertions, 44 deletions
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index 8c72c9875e..3cf5ac740e 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -157,7 +157,7 @@ void NECursorManager::setCursor(uint16 id) { Graphics::WinCursorGroup *cursorGroup = Graphics::WinCursorGroup::createCursorGroup(*_exe, id); if (cursorGroup) { - Graphics::WinCursor *cursor = cursorGroup->cursors[0].cursor; + Graphics::Cursor *cursor = cursorGroup->cursors[0].cursor; CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(), cursor->getHotspotY(), cursor->getKeyColor()); CursorMan.replaceCursorPalette(cursor->getPalette(), 0, 256); return; @@ -257,7 +257,7 @@ void PECursorManager::setCursor(uint16 id) { Graphics::WinCursorGroup *cursorGroup = Graphics::WinCursorGroup::createCursorGroup(*_exe, id); if (cursorGroup) { - Graphics::WinCursor *cursor = cursorGroup->cursors[0].cursor; + Graphics::Cursor *cursor = cursorGroup->cursors[0].cursor; CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(), cursor->getHotspotY(), cursor->getKeyColor()); CursorMan.replaceCursorPalette(cursor->getPalette(), 0, 256); delete cursorGroup; diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index 42748d08ed..ce4b2239d2 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -129,7 +129,7 @@ bool Win32ResExtractor::extractResource(int id, CachedCursor *cc) { if (!group) return false; - Graphics::WinCursor *cursor = group->cursors[0].cursor; + Graphics::Cursor *cursor = group->cursors[0].cursor; cc->bitmap = new byte[cursor->getWidth() * cursor->getHeight()]; cc->width = cursor->getWidth(); diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp index 2db72a2874..1d599f7130 100644 --- a/graphics/wincursor.cpp +++ b/graphics/wincursor.cpp @@ -30,6 +30,46 @@ namespace Graphics { +/** A Windows cursor. */ +class WinCursor : public Cursor { +public: + WinCursor(); + ~WinCursor(); + + /** Return the cursor's width. */ + uint16 getWidth() const; + /** Return the cursor's height. */ + uint16 getHeight() const; + /** Return the cursor's hotspot's x coordinate. */ + uint16 getHotspotX() const; + /** Return the cursor's hotspot's y coordinate. */ + uint16 getHotspotY() const; + /** Return the cursor's transparent key. */ + byte getKeyColor() const; + + const byte *getSurface() const { return _surface; } + + const byte *getPalette() const { return _palette; } + byte getPaletteStartIndex() const { return 0; } + uint16 getPaletteCount() const { return 256; } + + /** Read the cursor's data out of a stream. */ + bool readFromStream(Common::SeekableReadStream &stream); + +private: + byte *_surface; + byte _palette[256 * 3]; + + uint16 _width; ///< The cursor's width. + uint16 _height; ///< The cursor's height. + uint16 _hotspotX; ///< The cursor's hotspot's x coordinate. + uint16 _hotspotY; ///< The cursor's hotspot's y coordinate. + byte _keyColor; ///< The cursor's transparent key + + /** Clear the cursor. */ + void clear(); +}; + WinCursor::WinCursor() { _width = 0; _height = 0; diff --git a/graphics/wincursor.h b/graphics/wincursor.h index e6b35dc80c..9e73e3a12f 100644 --- a/graphics/wincursor.h +++ b/graphics/wincursor.h @@ -36,46 +36,6 @@ class SeekableReadStream; namespace Graphics { -/** A Windows cursor. */ -class WinCursor : public Cursor { -public: - WinCursor(); - ~WinCursor(); - - /** Return the cursor's width. */ - uint16 getWidth() const; - /** Return the cursor's height. */ - uint16 getHeight() const; - /** Return the cursor's hotspot's x coordinate. */ - uint16 getHotspotX() const; - /** Return the cursor's hotspot's y coordinate. */ - uint16 getHotspotY() const; - /** Return the cursor's transparent key. */ - byte getKeyColor() const; - - const byte *getSurface() const { return _surface; } - - const byte *getPalette() const { return _palette; } - byte getPaletteStartIndex() const { return 0; } - uint16 getPaletteCount() const { return 256; } - - /** Read the cursor's data out of a stream. */ - bool readFromStream(Common::SeekableReadStream &stream); - -private: - byte *_surface; - byte _palette[256 * 3]; - - uint16 _width; ///< The cursor's width. - uint16 _height; ///< The cursor's height. - uint16 _hotspotX; ///< The cursor's hotspot's x coordinate. - uint16 _hotspotY; ///< The cursor's hotspot's y coordinate. - byte _keyColor; ///< The cursor's transparent key - - /** Clear the cursor. */ - void clear(); -}; - /** * A structure holding an array of cursors from a single Windows Executable cursor group. * @@ -91,7 +51,7 @@ struct WinCursorGroup { struct CursorItem { Common::WinResourceID id; - WinCursor *cursor; + Cursor *cursor; }; Common::Array<CursorItem> cursors; |