ZVISION: Move the screen initialization code into a separate function

This commit is contained in:
Filippos Karapetis 2015-01-07 11:22:26 +02:00
parent fb135b38ed
commit 2d0e9fc74a
2 changed files with 16 additions and 10 deletions

View File

@ -105,15 +105,6 @@ 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(_cheatBuffer, 0, sizeof(_cheatBuffer));
}
@ -211,7 +202,7 @@ void ZVision::initialize() {
} else if (_gameDescription->gameId == GID_NEMESIS)
_searchManager->loadZix("NEMESIS.ZIX");
initGraphics(WINDOW_WIDTH, WINDOW_HEIGHT, true, &_screenPixelFormat);
initScreen();
// Register random source
_rnd = new Common::RandomSource("zvision");
@ -358,4 +349,17 @@ void ZVision::fpsTimer() {
_renderedFrameCount = 0;
}
void ZVision::initScreen() {
uint16 workingWindowWidth = (_gameDescription->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_WIDTH : ZGI_WORKING_WINDOW_WIDTH;
uint16 workingWindowHeight = (_gameDescription->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
);
initGraphics(WINDOW_WIDTH, WINDOW_HEIGHT, true, &_screenPixelFormat);
}
} // End of namespace ZVision

View File

@ -194,6 +194,8 @@ public:
_clock.stop();
}
void initScreen();
/**
* Play a video until it is finished. This is a blocking call. It will call
* _clock.stop() when the video starts and _clock.start() when the video finishes.