mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
ZVISION: Let the cursor manager do pixel format conversion for cursors
This commit is contained in:
parent
1bc9b13357
commit
84341a889c
@ -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) {
|
||||
|
@ -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),
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user