From afbcca2187c7a07e6e0853bd0befdc1e9a67dce2 Mon Sep 17 00:00:00 2001 From: richiesams Date: Mon, 8 Jul 2013 16:04:18 -0500 Subject: ZVISION: Move engine width, height, and pixelFormat to const member variables --- engines/zvision/image.cpp | 4 ---- engines/zvision/zvision.cpp | 12 ++++++++---- engines/zvision/zvision.h | 6 ++++-- 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'engines/zvision') diff --git a/engines/zvision/image.cpp b/engines/zvision/image.cpp index 35ec9b3e2f..981308fa31 100644 --- a/engines/zvision/image.cpp +++ b/engines/zvision/image.cpp @@ -56,9 +56,6 @@ void ZVision::renderImageToScreen(const Common::String &fileName, uint32 x, uint byte *buffer = new byte[stream.currentSize()]; stream.read(buffer, stream.currentSize()); - //Graphics::PixelFormat format(16, 5, 6, 5, 0, 11, 5, 0, 0); - // Graphics::PixelFormat format(16, 5, 5, 5, 1, 11, 6, 1, 0); - _system->copyRectToScreen(buffer, width * 2, x, y, width, height); } else { // Reset the cursor @@ -71,7 +68,6 @@ void ZVision::renderImageToScreen(const Common::String &fileName, uint32 x, uint file.close(); const Graphics::Surface *tgaSurface = tga.getSurface(); - _system->copyRectToScreen(tgaSurface->pixels, tgaSurface->pitch, x, y, tgaSurface->w, tgaSurface->h); tga.destroy(); diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp index 4653b30346..ac810d8d07 100644 --- a/engines/zvision/zvision.cpp +++ b/engines/zvision/zvision.cpp @@ -41,7 +41,13 @@ namespace ZVision { -ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { +ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc) + : Engine(syst), + _gameDescription(gameDesc), + _pixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555 + _currentVideo(0), + _width(640), + _height(480) { // Put your engine in a sane state, but do nothing big yet; // in particular, do not load data from files; rather, if you // need to do such things, do them from run(). @@ -94,9 +100,7 @@ void ZVision::initialize() { SearchMan.add(name, archive); } - //Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24); // ARGB8888 - Graphics::PixelFormat format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); // RGB555 - initGraphics(640, 480, true, &format); + initGraphics(_width, _height, true, &_pixelFormat); _scriptManager->initialize(); diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h index 31c65a82af..d18319a056 100644 --- a/engines/zvision/zvision.h +++ b/engines/zvision/zvision.h @@ -54,12 +54,14 @@ public: private: Console *_console; const ZVisionGameDescription *_gameDescription; + const Graphics::PixelFormat _pixelFormat; + const int _width; + const int _height; // We need random numbers Common::RandomSource *_rnd; - + // Managers ScriptManager *_scriptManager; - // To prevent allocation every time we process events Common::Event _event; -- cgit v1.2.3