aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrichiesams2013-07-08 16:04:18 -0500
committerrichiesams2013-08-04 13:32:08 -0500
commitafbcca2187c7a07e6e0853bd0befdc1e9a67dce2 (patch)
treea22af9512ccb7f476a7b961973813538ead1dc75
parent4c7db7f5de574833b360653e423d8240d7af8fa9 (diff)
downloadscummvm-rg350-afbcca2187c7a07e6e0853bd0befdc1e9a67dce2.tar.gz
scummvm-rg350-afbcca2187c7a07e6e0853bd0befdc1e9a67dce2.tar.bz2
scummvm-rg350-afbcca2187c7a07e6e0853bd0befdc1e9a67dce2.zip
ZVISION: Move engine width, height, and pixelFormat to const member variables
-rw-r--r--engines/zvision/image.cpp4
-rw-r--r--engines/zvision/zvision.cpp12
-rw-r--r--engines/zvision/zvision.h6
3 files changed, 12 insertions, 10 deletions
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;