Skip to content

Commit

Permalink
DREAMWEB: Accessor for kQuitrequested
Browse files Browse the repository at this point in the history
  • Loading branch information
tramboi committed Nov 20, 2011
1 parent 57fc322 commit 6cab17c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions engines/dreamweb/monitor.cpp
Expand Up @@ -81,7 +81,7 @@ void DreamGenContext::usemon() {
data.word(kMonadx) = di;
data.word(kMonady) = bx;
execcommand();
if (data.byte(kQuitrequested)) //TODO : Check why it crashes when put before the execcommand
if (quitRequested()) //TODO : Check why it crashes when put before the execcommand
break;
} while (al == 0);
getridoftemp();
Expand Down Expand Up @@ -117,7 +117,7 @@ void DreamGenContext::input() {
vsync();
delcurs();
readkey();
if (data.byte(kQuitrequested))
if (quitRequested())
return;
uint8 currentKey = data.byte(kCurrentkey);
if (currentKey == 0)
Expand Down
20 changes: 12 additions & 8 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -100,7 +100,7 @@ void DreamGenContext::dreamweb() {
cls();
setmode();
decide();
if (data.byte(kQuitrequested))
if (quitRequested())
return; // exit game

if (data.byte(kGetback) == 4)
Expand All @@ -114,11 +114,11 @@ void DreamGenContext::dreamweb() {
// "playgame"

titles();
if (data.byte(kQuitrequested))
if (quitRequested())
return; // exit game
credits();

if (data.byte(kQuitrequested))
if (quitRequested())
return; // exit game

clearchanges();
Expand Down Expand Up @@ -146,12 +146,12 @@ void DreamGenContext::dreamweb() {
// main loop
while (true) {

if (data.byte(kQuitrequested))
if (quitRequested())
return; // exit game

screenupdate();

if (data.byte(kQuitrequested))
if (quitRequested())
return; // exit game

if (data.byte(kWongame) != 0) {
Expand Down Expand Up @@ -203,10 +203,14 @@ void DreamGenContext::dreamweb() {
}
}

bool DreamGenContext::quitRequested() {
return data.byte(kQuitrequested);
}

void DreamGenContext::screenupdate() {
newplace();
mainscreen();
if (data.byte(kQuitrequested))
if (quitRequested())
return;
animpointer();
showpointer();
Expand Down Expand Up @@ -1949,7 +1953,7 @@ void DreamGenContext::hangon(uint16 frameCount) {
while (frameCount) {
vsync();
--frameCount;
if (data.byte(kQuitrequested))
if (quitRequested())
break;
}
}
Expand Down Expand Up @@ -1979,7 +1983,7 @@ void DreamGenContext::hangonp(uint16 count) {
showpointer();
vsync();
dumppointer();
if (data.byte(kQuitrequested))
if (quitRequested())
break;
if (data.word(kMousebutton) != 0 && data.word(kMousebutton) != data.word(kOldbutton))
break;
Expand Down
3 changes: 2 additions & 1 deletion engines/dreamweb/stubs.h
Expand Up @@ -19,7 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
void screenupdate();
void screenupdate();
bool quitRequested();
void startup();
void startup1();
void switchryanon();
Expand Down

0 comments on commit 6cab17c

Please sign in to comment.