aboutsummaryrefslogtreecommitdiff
path: root/graphics/cursorman.h
diff options
context:
space:
mode:
authorJohannes Schickel2009-12-09 23:04:54 +0000
committerJohannes Schickel2009-12-09 23:04:54 +0000
commit7605a35fd7695c292c8176b3ea885d2be03e35cf (patch)
tree73ae1249312bdef26cfe3a0c0ff76ced89970381 /graphics/cursorman.h
parent2f372d79d5b792b624dc585840131f8e5ad9be5e (diff)
downloadscummvm-rg350-7605a35fd7695c292c8176b3ea885d2be03e35cf.tar.gz
scummvm-rg350-7605a35fd7695c292c8176b3ea885d2be03e35cf.tar.bz2
scummvm-rg350-7605a35fd7695c292c8176b3ea885d2be03e35cf.zip
Cleanup: Move constructor/destructor definition of CursorManager::Cursor and CursorManager::Palette to cursorman.cpp.
svn-id: r46324
Diffstat (limited to 'graphics/cursorman.h')
-rw-r--r--graphics/cursorman.h52
1 files changed, 5 insertions, 47 deletions
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 9eaca57a09..1a5c116232 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -29,9 +29,6 @@
#include "common/stack.h"
#include "common/singleton.h"
#include "graphics/pixelformat.h"
-#ifdef USE_RGB_COLOR
-#include "common/system.h"
-#endif
namespace Graphics {
@@ -181,32 +178,9 @@ private:
int _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 USE_RGB_COLOR
- if (!format)
- _format = Graphics::PixelFormat::createFormatCLUT8();
- else
- _format = *format;
- _size = w * h * _format.bytesPerPixel;
- _keycolor = keycolor & ((1 << (_format.bytesPerPixel << 3)) - 1);
-#else
- _format = Graphics::PixelFormat::createFormatCLUT8();
- _size = w * h;
- _keycolor = keycolor & 0xFF;
-#endif
- _data = new byte[_size];
- if (data && _data)
- memcpy(_data, data, _size);
- _width = w;
- _height = h;
- _hotspotX = hotspotX;
- _hotspotY = hotspotY;
- _targetScale = targetScale;
- }
-
- ~Cursor() {
- delete[] _data;
- }
+
+ Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL);
+ ~Cursor();
};
struct Palette {
@@ -217,24 +191,8 @@ private:
bool _disabled;
- Palette(const byte *colors, uint start, uint num) {
- _start = start;
- _num = num;
- _size = 4 * num;
-
- if (num) {
- _data = new byte[_size];
- memcpy(_data, colors, _size);
- } else {
- _data = NULL;
- }
-
- _disabled = false;
- }
-
- ~Palette() {
- delete[] _data;
- }
+ Palette(const byte *colors, uint start, uint num);
+ ~Palette();
};
Common::Stack<Cursor *> _cursorStack;
Common::Stack<Palette *> _cursorPaletteStack;