aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision/graphics
diff options
context:
space:
mode:
authorFilippos Karapetis2014-12-24 22:29:52 +0200
committerFilippos Karapetis2014-12-24 22:56:55 +0200
commit84341a889cfafc4c7ecef6cf7d6841df8353fe4b (patch)
treebc0ef27bdfd8ad440aafd4ed82be924e719e9154 /engines/zvision/graphics
parent1bc9b13357e36f6f52e3dd6f8223ab569e5b5362 (diff)
downloadscummvm-rg350-84341a889cfafc4c7ecef6cf7d6841df8353fe4b.tar.gz
scummvm-rg350-84341a889cfafc4c7ecef6cf7d6841df8353fe4b.tar.bz2
scummvm-rg350-84341a889cfafc4c7ecef6cf7d6841df8353fe4b.zip
ZVISION: Let the cursor manager do pixel format conversion for cursors
Diffstat (limited to 'engines/zvision/graphics')
-rw-r--r--engines/zvision/graphics/cursors/cursor.cpp5
-rw-r--r--engines/zvision/graphics/cursors/cursor_manager.cpp2
-rw-r--r--engines/zvision/graphics/cursors/cursor_manager.h4
3 files changed, 4 insertions, 7 deletions
diff --git a/engines/zvision/graphics/cursors/cursor.cpp b/engines/zvision/graphics/cursors/cursor.cpp
index 515358fe59..eb25e92860 100644
--- a/engines/zvision/graphics/cursors/cursor.cpp
+++ b/engines/zvision/graphics/cursors/cursor.cpp
@@ -57,12 +57,9 @@ ZorkCursor::ZorkCursor(ZVision *engine, const Common::String &fileName)
_height = file.readUint16LE();
uint dataSize = _width * _height * sizeof(uint16);
- _surface.create(_width, _height, Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
+ _surface.create(_width, _height, engine->_resourcePixelFormat);
uint32 bytesRead = file.read(_surface.getPixels(), dataSize);
assert(bytesRead == dataSize);
-
- // Convert to RGB 565
- _surface.convertToInPlace(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
}
ZorkCursor::ZorkCursor(const ZorkCursor &other) {
diff --git a/engines/zvision/graphics/cursors/cursor_manager.cpp b/engines/zvision/graphics/cursors/cursor_manager.cpp
index 92fd461c72..a197c7ed87 100644
--- a/engines/zvision/graphics/cursors/cursor_manager.cpp
+++ b/engines/zvision/graphics/cursors/cursor_manager.cpp
@@ -45,7 +45,7 @@ const char *CursorManager::_zNemCursorFileNames[NUM_CURSORS] = { "00act", "arrow
"hright", "hup", "00idle", "left", "right", "ssurr", "stilt", "turn", "up"
};
-CursorManager::CursorManager(ZVision *engine, const Graphics::PixelFormat *pixelFormat)
+CursorManager::CursorManager(ZVision *engine, const Graphics::PixelFormat pixelFormat)
: _engine(engine),
_pixelFormat(pixelFormat),
_cursorIsPushed(false),
diff --git a/engines/zvision/graphics/cursors/cursor_manager.h b/engines/zvision/graphics/cursors/cursor_manager.h
index bbfa085c23..35c605baf8 100644
--- a/engines/zvision/graphics/cursors/cursor_manager.h
+++ b/engines/zvision/graphics/cursors/cursor_manager.h
@@ -58,7 +58,7 @@ enum CursorIndex {
*/
class CursorManager {
public:
- CursorManager(ZVision *engine, const Graphics::PixelFormat *pixelFormat);
+ CursorManager(ZVision *engine, const Graphics::PixelFormat pixelFormat);
private:
static const int NUM_CURSORS = 18;
@@ -67,7 +67,7 @@ private:
ZorkCursor _cursors[NUM_CURSORS + 2][2];
ZVision *_engine;
- const Graphics::PixelFormat *_pixelFormat;
+ const Graphics::PixelFormat _pixelFormat;
bool _cursorIsPushed;
int _item;
int _lastitem;