aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorFilippos Karapetis2014-12-15 03:15:30 +0200
committerFilippos Karapetis2014-12-16 01:58:54 +0200
commit3d1a9e34422f3bb9d86149c18695cc5a9e4ebac8 (patch)
tree86b62320e6f3af3e49c731db95ba0972c107d23e /engines/zvision
parent3315522ba1607d68c3402f3d1c8b51b7dc38a7dd (diff)
downloadscummvm-rg350-3d1a9e34422f3bb9d86149c18695cc5a9e4ebac8.tar.gz
scummvm-rg350-3d1a9e34422f3bb9d86149c18695cc5a9e4ebac8.tar.bz2
scummvm-rg350-3d1a9e34422f3bb9d86149c18695cc5a9e4ebac8.zip
ZVISION: Simplify the working window code
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/zvision.cpp12
-rw-r--r--engines/zvision/zvision.h13
2 files changed, 14 insertions, 11 deletions
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 8a44ccebea..ec1fb9413b 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -81,9 +81,6 @@ struct zvisionIniSettings {
ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc)
: Engine(syst),
_gameDescription(gameDesc),
- _workingWindow_ZGI((WINDOW_WIDTH - WORKING_WINDOW_WIDTH) / 2, (WINDOW_HEIGHT - WORKING_WINDOW_HEIGHT) / 2, ((WINDOW_WIDTH - WORKING_WINDOW_WIDTH) / 2) + WORKING_WINDOW_WIDTH, ((WINDOW_HEIGHT - WORKING_WINDOW_HEIGHT) / 2) + WORKING_WINDOW_HEIGHT),
- _workingWindow_ZNM((WINDOW_WIDTH - ZNM_WORKING_WINDOW_WIDTH) / 2, (WINDOW_HEIGHT - ZNM_WORKING_WINDOW_HEIGHT) / 2, ((WINDOW_WIDTH - ZNM_WORKING_WINDOW_WIDTH) / 2) + ZNM_WORKING_WINDOW_WIDTH, ((WINDOW_HEIGHT - ZNM_WORKING_WINDOW_HEIGHT) / 2) + ZNM_WORKING_WINDOW_HEIGHT),
- _workingWindow(gameDesc->gameId == GID_NEMESIS ? _workingWindow_ZNM : _workingWindow_ZGI),
_pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), /*RGB 565*/
_desiredFrameTime(33), /* ~30 fps */
_clock(_system),
@@ -101,6 +98,15 @@ ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc)
debug(1, "ZVision::ZVision");
+ uint16 workingWindowWidth = (gameDesc->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_WIDTH : ZGI_WORKING_WINDOW_WIDTH;
+ uint16 workingWindowHeight = (gameDesc->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_HEIGHT : ZGI_WORKING_WINDOW_HEIGHT;
+ _workingWindow = Common::Rect(
+ (WINDOW_WIDTH - workingWindowWidth) / 2,
+ (WINDOW_HEIGHT - workingWindowHeight) / 2,
+ ((WINDOW_WIDTH - workingWindowWidth) / 2) + workingWindowWidth,
+ ((WINDOW_HEIGHT - workingWindowHeight) / 2) + workingWindowHeight
+ );
+
memset(_cheatBuff, 0, sizeof(_cheatBuff));
}
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 891f9a9a0f..f8763f94ee 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -67,7 +67,7 @@ public:
* are given in this coordinate space. Also, all images are clipped to the
* edges of this Rectangle
*/
- const Common::Rect &_workingWindow;
+ Common::Rect _workingWindow;
const Graphics::PixelFormat _pixelFormat;
private:
@@ -75,13 +75,13 @@ private:
WINDOW_WIDTH = 640,
WINDOW_HEIGHT = 480,
- //Zork nemesis working window sizes
+ // Zork nemesis working window sizes
ZNM_WORKING_WINDOW_WIDTH = 512,
ZNM_WORKING_WINDOW_HEIGHT = 320,
- //ZGI(and default) working window sizes
- WORKING_WINDOW_WIDTH = 640,
- WORKING_WINDOW_HEIGHT = 344,
+ // ZGI working window sizes
+ ZGI_WORKING_WINDOW_WIDTH = 640,
+ ZGI_WORKING_WINDOW_HEIGHT = 344,
ROTATION_SCREEN_EDGE_OFFSET = 60,
MAX_ROTATION_SPEED = 400, // Pixels per second
@@ -117,9 +117,6 @@ private:
// To prevent allocation every time we process events
Common::Event _event;
- const Common::Rect _workingWindow_ZGI;
- const Common::Rect _workingWindow_ZNM;
-
int _rendDelay;
int16 _mouseVelocity;
int16 _kbdVelocity;