aboutsummaryrefslogtreecommitdiff
path: root/graphics/cursorman.h
diff options
context:
space:
mode:
authorJody Northup2009-07-04 04:13:10 +0000
committerJody Northup2009-07-04 04:13:10 +0000
commit6ef485f44896ad778d355bc1201f2f143cc9e770 (patch)
tree6e7ff7fc9d922c13f2c1f696656e1bc3a1944303 /graphics/cursorman.h
parent855a9587b94343a563f254998009fd3855ee8227 (diff)
downloadscummvm-rg350-6ef485f44896ad778d355bc1201f2f143cc9e770.tar.gz
scummvm-rg350-6ef485f44896ad778d355bc1201f2f143cc9e770.tar.bz2
scummvm-rg350-6ef485f44896ad778d355bc1201f2f143cc9e770.zip
Fixed cursor corruption in non-8bit graphics games when switching back from overlay.
svn-id: r42084
Diffstat (limited to 'graphics/cursorman.h')
-rw-r--r--graphics/cursorman.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index b744109b61..ab87c9b095 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -148,22 +148,20 @@ private:
int _hotspotX;
int _hotspotY;
uint32 _keycolor;
- const Graphics::PixelFormat *_format;
+ 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, const Graphics::PixelFormat *format = NULL) {
#ifdef ENABLE_RGB_COLOR
- if (!format) {
- _size = w * h;
- _keycolor &= 0xFF;
- } else {
- _size = w * h * format->bytesPerPixel;
- _keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
- }
- _format = format;
+ if (!format)
+ _format = Graphics::PixelFormat::createFormatCLUT8();
+ else
+ _format = *format;
+ _size = w * h * _format.bytesPerPixel;
+ _keycolor &= ((1 << (_format.bytesPerPixel << 3)) - 1);
#else
- _format = NULL;
+ _format = Graphics::PixelFormat::createFormatCLUT8();
_size = w * h;
_keycolor &= 0xFF;
#endif