[Scummvm-cvs-logs] SF.net SVN: scummvm:[46324] scummvm/trunk/graphics
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Thu Dec 10 00:04:55 CET 2009
Revision: 46324
http://scummvm.svn.sourceforge.net/scummvm/?rev=46324&view=rev
Author: lordhoto
Date: 2009-12-09 23:04:54 +0000 (Wed, 09 Dec 2009)
Log Message:
-----------
Cleanup: Move constructor/destructor definition of CursorManager::Cursor and CursorManager::Palette to cursorman.cpp.
Modified Paths:
--------------
scummvm/trunk/graphics/cursorman.cpp
scummvm/trunk/graphics/cursorman.h
Modified: scummvm/trunk/graphics/cursorman.cpp
===================================================================
--- scummvm/trunk/graphics/cursorman.cpp 2009-12-09 22:50:12 UTC (rev 46323)
+++ scummvm/trunk/graphics/cursorman.cpp 2009-12-09 23:04:54 UTC (rev 46324)
@@ -217,4 +217,50 @@
}
}
+CursorManager::Cursor::Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int targetScale, const Graphics::PixelFormat *format) {
+#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;
+}
+
+CursorManager::Cursor::~Cursor() {
+ delete[] _data;
+}
+
+CursorManager::Palette::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;
+}
+
+CursorManager::Palette::~Palette() {
+ delete[] _data;
+}
+
} // End of namespace Graphics
Modified: scummvm/trunk/graphics/cursorman.h
===================================================================
--- scummvm/trunk/graphics/cursorman.h 2009-12-09 22:50:12 UTC (rev 46323)
+++ scummvm/trunk/graphics/cursorman.h 2009-12-09 23:04:54 UTC (rev 46324)
@@ -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 @@
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 @@
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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list