aboutsummaryrefslogtreecommitdiff
path: root/graphics/cursorman.h
diff options
context:
space:
mode:
authorJody Northup2009-06-30 07:30:57 +0000
committerJody Northup2009-06-30 07:30:57 +0000
commit9e1916bcad3cc33a870bdbff5bd01b39e523492d (patch)
tree557ec11652f89b3323c1bcc117df2eedebfca817 /graphics/cursorman.h
parent6f644324863437dedecb254bf088b33c914c7241 (diff)
downloadscummvm-rg350-9e1916bcad3cc33a870bdbff5bd01b39e523492d.tar.gz
scummvm-rg350-9e1916bcad3cc33a870bdbff5bd01b39e523492d.tar.bz2
scummvm-rg350-9e1916bcad3cc33a870bdbff5bd01b39e523492d.zip
renamed kTransactionPixelFormatNotSupported to kTransactionFormatNotSupported, retyped all Graphics::PixelFormat * parameters to const Graphics::PixelFormat *, (hopefully) repaired all memory leaks on screen and cursor format changes, provided OSystem::getScreenFormat and OSystem::getSupportedFormats methods for when ENABLE_RGB_COLOR is not set, completely forgot the "commit early, commit often" mantra.
svn-id: r41972
Diffstat (limited to 'graphics/cursorman.h')
-rw-r--r--graphics/cursorman.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 2b2f34f952..044a787e71 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -61,7 +61,7 @@ public:
* useful to push a "dummy" cursor and modify it later. The
* cursor will be added to the stack, but not to the backend.
*/
- void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL);
+ void pushCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
/**
* Pop a cursor from the stack, and restore the previous one to the
@@ -83,7 +83,7 @@ public:
* @param targetScale the scale for which the cursor is designed
* @param format the pixel format which the cursor graphic uses
*/
- void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL);
+ void replaceCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
@@ -148,22 +148,27 @@ private:
int _hotspotX;
int _hotspotY;
uint32 _keycolor;
-#ifdef ENABLE_RGB_COLOR
- Graphics::PixelFormat _format;
-#endif
+ const Graphics::PixelFormat *_format;
byte _targetScale;
uint _size;
- Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, Graphics::PixelFormat *format = NULL) {
+ Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) {
#ifdef ENABLE_RGB_COLOR
if (!format)
- format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
- _size = w * h * format->bytesPerPixel;
- _keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
- _format = *format;
+ {
+ _size = w * h;
+ _keycolor &= 0xFF;
+ }
+ else
+ {
+ _size = w * h * format->bytesPerPixel;
+ _keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
+ }
+ _format = format;
#else
+ _format = NULL;
_size = w * h;
- _keycolor = keycolor & 0xFF;
+ _keycolor &= 0xFF;
#endif
_data = new byte[_size];
if (data && _data)