Skip to content

Commit

Permalink
DREAMWEB: Simplify finalization call in dreamweb main function.
Browse files Browse the repository at this point in the history
Thanks to Fingolfin for the suggestion.
  • Loading branch information
digitall committed Dec 29, 2011
1 parent cb889a9 commit 59458c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
1 change: 1 addition & 0 deletions engines/dreamweb/dreamweb.cpp
Expand Up @@ -370,6 +370,7 @@ Common::Error DreamWebEngine::run() {

_timer->installTimerProc(vSyncInterrupt, 1000000 / 70, this, "dreamwebVSync");
dreamweb();
dreamwebFinalize();
_quitRequested = false;

_timer->removeTimerProc(vSyncInterrupt);
Expand Down
26 changes: 5 additions & 21 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -507,8 +507,6 @@ void DreamWebEngine::dreamweb() {
}

seeCommandTail();
// soundStartup used to be done here...
// setKeyboardInt used to be done here...
allocateBuffers();

// setMouse
Expand Down Expand Up @@ -563,10 +561,8 @@ void DreamWebEngine::dreamweb() {
cls();
setMode();
decide();
if (_quitRequested) {
dreamwebFinalize();
if (_quitRequested)
return;
}

if (_getBack == 4)
startNewGame = false; // savegame has been loaded
Expand All @@ -584,19 +580,15 @@ void DreamWebEngine::dreamweb() {
if (!_quitRequested) // "titlesearly"
intro();

if (_quitRequested) {
dreamwebFinalize();
if (_quitRequested)
return;
}

// "credits"
clearPalette();
realCredits();

if (_quitRequested) {
dreamwebFinalize();
if (_quitRequested)
return;
}

clearChanges();
setMode();
Expand All @@ -617,22 +609,17 @@ void DreamWebEngine::dreamweb() {
_volumeTo = 0;
_volumeDirection = -1;
_commandType = 255;

}

// main loop
while (true) {
if (_quitRequested) {
dreamwebFinalize();
if (_quitRequested)
return;
}

screenUpdate();

if (_quitRequested) {
dreamwebFinalize();
if (_quitRequested)
return;
}

if (_wonGame) {
// "endofgame"
Expand All @@ -641,7 +628,6 @@ void DreamWebEngine::dreamweb() {
hangOn(200);
endGame();
quickQuit2();

This comment has been minimized.

Copy link
@fingolfin

fingolfin Dec 29, 2011

Contributor

Much nicer. Another suggestion: The quickQuit2() call here (and indeed, the whole quickQuit2() method) is redundant, and could be removed.

This comment has been minimized.

Copy link
@wjp

wjp Dec 29, 2011

Contributor

Indeed. Thanks.

dreamwebFinalize();
return;
}

Expand Down Expand Up @@ -682,8 +668,6 @@ void DreamWebEngine::dreamweb() {
hangOn(100);

}

dreamwebFinalize();
}

void DreamWebEngine::loadTextFile(TextFile &file, const char *fileName)
Expand Down

0 comments on commit 59458c9

Please sign in to comment.