diff options
author | Filippos Karapetis | 2014-12-24 22:29:52 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-24 22:56:55 +0200 |
commit | 84341a889cfafc4c7ecef6cf7d6841df8353fe4b (patch) | |
tree | bc0ef27bdfd8ad440aafd4ed82be924e719e9154 /engines/zvision | |
parent | 1bc9b13357e36f6f52e3dd6f8223ab569e5b5362 (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/zvision/graphics/cursors/cursor.cpp | 5 | ||||
-rw-r--r-- | engines/zvision/graphics/cursors/cursor_manager.cpp | 2 | ||||
-rw-r--r-- | engines/zvision/graphics/cursors/cursor_manager.h | 4 | ||||
-rw-r--r-- | engines/zvision/zvision.cpp | 2 |
4 files changed, 5 insertions, 8 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; diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp index 145b2ebeac..5978316451 100644 --- a/engines/zvision/zvision.cpp +++ b/engines/zvision/zvision.cpp @@ -194,7 +194,7 @@ void ZVision::initialize() { _renderManager = new RenderManager(this, WINDOW_WIDTH, WINDOW_HEIGHT, _workingWindow, _screenPixelFormat); _saveManager = new SaveManager(this); _stringManager = new StringManager(this); - _cursorManager = new CursorManager(this, &_screenPixelFormat); + _cursorManager = new CursorManager(this, _resourcePixelFormat); _textRenderer = new TextRenderer(this); _midiManager = new MidiManager(); |