aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorMatthew Hoops2011-08-16 00:30:12 -0400
committerMatthew Hoops2011-08-16 00:30:12 -0400
commitc75bf3290d841f61e9b321f2419537cdaa972f52 (patch)
tree0101629b7656516e2f8906330d8cb5a97b856696 /graphics
parent91ae23ebf2967433d17457fbfc41cfb6200a924e (diff)
downloadscummvm-rg350-c75bf3290d841f61e9b321f2419537cdaa972f52.tar.gz
scummvm-rg350-c75bf3290d841f61e9b321f2419537cdaa972f52.tar.bz2
scummvm-rg350-c75bf3290d841f61e9b321f2419537cdaa972f52.zip
GRAPHICS: Add a default Windows cursor
Based on the Mohawk one
Diffstat (limited to 'graphics')
-rw-r--r--graphics/wincursor.cpp57
-rw-r--r--graphics/wincursor.h7
2 files changed, 64 insertions, 0 deletions
diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp
index 6208f5f053..2db72a2874 100644
--- a/graphics/wincursor.cpp
+++ b/graphics/wincursor.cpp
@@ -308,4 +308,61 @@ WinCursorGroup *WinCursorGroup::createCursorGroup(Common::PEResources &exe, cons
return group;
}
+/**
+ * The default Windows cursor
+ */
+class DefaultWinCursor : public Cursor {
+public:
+ DefaultWinCursor() {}
+ ~DefaultWinCursor() {}
+
+ uint16 getWidth() const { return 12; }
+ uint16 getHeight() const { return 20; }
+ uint16 getHotspotX() const { return 0; }
+ uint16 getHotspotY() const { return 0; }
+ byte getKeyColor() const { return 0; }
+
+ const byte *getSurface() const {
+ static const byte defaultCursor[] = {
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0,
+ 1, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0,
+ 1, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0,
+ 1, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0,
+ 1, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0,
+ 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0,
+ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0,
+ 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
+ 1, 2, 2, 2, 1, 2, 2, 1, 0, 0, 0, 0,
+ 1, 2, 2, 1, 1, 2, 2, 1, 0, 0, 0, 0,
+ 1, 2, 1, 0, 1, 1, 2, 2, 1, 0, 0, 0,
+ 1, 1, 0, 0, 0, 1, 2, 2, 1, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 1, 2, 2, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0
+ };
+
+ return defaultCursor;
+ }
+
+ const byte *getPalette() const {
+ static const byte bwPalette[] = {
+ 0x00, 0x00, 0x00, // Black
+ 0xFF, 0xFF, 0xFF // White
+ };
+
+ return bwPalette;
+ }
+ byte getPaletteStartIndex() const { return 1; }
+ uint16 getPaletteCount() const { return 2; }
+};
+
+Cursor *makeDefaultWinCursor() {
+ return new DefaultWinCursor();
+}
+
} // End of namespace Graphics
diff --git a/graphics/wincursor.h b/graphics/wincursor.h
index 974341f196..e6b35dc80c 100644
--- a/graphics/wincursor.h
+++ b/graphics/wincursor.h
@@ -102,6 +102,13 @@ struct WinCursorGroup {
static WinCursorGroup *createCursorGroup(Common::PEResources &exe, const Common::WinResourceID &id);
};
+/**
+ * Create a Cursor for the default Windows cursor.
+ *
+ * @note The calling code is responsible for deleting the returned pointer.
+ */
+Cursor *makeDefaultWinCursor();
+
} // End of namespace Graphics
#endif