DREAMWEB: Move kQuitRequested out of data blob.

This commit is contained in:
D G Turner 2011-12-27 03:08:43 +00:00
parent 5511779085
commit 5cfa1899bd
14 changed files with 38 additions and 42 deletions

View File

@ -59,6 +59,7 @@ p = parser(skip_binary_data = [
'id',
'place',
'blinktab',
'quitrequested',
# keypad.asm
'keypadlist',
'symbollist',

View File

@ -114,7 +114,8 @@ protected:
public:
DreamBase(DreamWeb::DreamWebEngine *en);
public:
bool _quitRequested;
// from backdrop.cpp
void doBlocks();
uint8 getXAd(const uint8 *setData, uint8 *result);
@ -446,7 +447,6 @@ public:
void readMouse();
uint16 readMouseState();
void hangOn(uint16 frameCount);
bool quitRequested();
void lockMon();
uint8 *textUnder();
void readKey();

View File

@ -75,7 +75,7 @@ void DreamGenContext::__start() {
//0x0150: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0160: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, };
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, };
ds.assign(src, src + sizeof(src));
dreamweb();
}

View File

@ -307,9 +307,8 @@ static const uint16 kCh1playing = 374;
static const uint16 kCh1blockstocopy = 375;
static const uint16 kCurrentsample = 377;
static const uint16 kRoomssample = 378;
static const uint16 kQuitrequested = 379;
static const uint16 kSubtitles = 380;
static const uint16 kForeignrelease = 381;
static const uint16 kSubtitles = 379;
static const uint16 kForeignrelease = 380;
static const uint16 kBlocktextdat = (0);
static const uint16 kPersonframes = (0);
static const uint16 kDebuglevel1 = (0);

View File

@ -102,7 +102,7 @@ void DreamWebEngine::waitForVSync() {
}
void DreamWebEngine::quit() {
_base.data.byte(DreamGen::kQuitrequested) = 1;
_base._quitRequested = true;
_base.data.byte(DreamGen::kLasthardkey) = 1;
}
@ -213,7 +213,7 @@ Common::Error DreamWebEngine::run() {
_timer->installTimerProc(vSyncInterrupt, 1000000 / 70, this, "dreamwebVSync");
_context.__start();
_base.data.byte(DreamGen::kQuitrequested) = 0;
_base._quitRequested = false;
_timer->removeTimerProc(vSyncInterrupt);
@ -417,6 +417,7 @@ namespace DreamGen {
// FIXME/TODO: Move this to a better place.
DreamBase::DreamBase(DreamWeb::DreamWebEngine *en) : engine(en) {
_openChangeSize = kInventx+(4*kItempicsize);
_quitRequested = false;
}
} // End of namespace DreamGen

View File

@ -139,7 +139,7 @@ void DreamBase::enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3
dumpKeypad();
dumpTextLine();
checkCoords(keypadList);
if (quitRequested() || (data.byte(kGetback) == 1))
if (_quitRequested || (data.byte(kGetback) == 1))
break;
if (data.byte(kLightcount) == 1) {
if (data.byte(kLockstatus) == 0)

View File

@ -86,7 +86,7 @@ void DreamBase::useMon() {
data.word(kMonadx) = oldMonadx;
data.word(kMonady) = oldMonady;
stop = execCommand();
if (quitRequested()) //TODO : Check why it crashes when put before the execcommand
if (_quitRequested) //TODO : Check why it crashes when put before the execcommand
break;
} while (!stop);
getRidOfTemp();
@ -203,7 +203,7 @@ void DreamBase::input() {
vSync();
delCurs();
readKey();
if (quitRequested())
if (_quitRequested)
return;
uint8 currentKey = data.byte(kCurrentkey);
if (currentKey == 0)

View File

@ -59,7 +59,7 @@ void DreamBase::selectLocation() {
data.byte(kNewlocation) = 255;
while (data.byte(kNewlocation) == 255) {
if (quitRequested())
if (_quitRequested)
break;
delPointer();
@ -84,7 +84,7 @@ void DreamBase::selectLocation() {
checkCoords(destList);
}
if (quitRequested() || data.byte(kGetback) == 1 || data.byte(kNewlocation) == data.byte(kLocation)) {
if (_quitRequested || data.byte(kGetback) == 1 || data.byte(kNewlocation) == data.byte(kLocation)) {
data.byte(kNewlocation) = data.byte(kReallocation);
data.byte(kGetback) = 0;
}

View File

@ -195,7 +195,7 @@ void DreamBase::examineOb(bool examineAgain) {
}
}
if (data.byte(kQuitrequested) != 0)
if (_quitRequested)
break;
if (data.byte(kExamagain) != 0)
examineAgain = true;

View File

@ -103,7 +103,7 @@ uint8 DreamBase::printSlow(const uint8 *string, uint16 x, uint16 y, uint8 maxWid
data.word(kCharshift) = 0;
for (int i=0; i<2; ++i) {
uint16 mouseState = waitFrames();
if (data.byte(kQuitrequested))
if (_quitRequested)
return 0;
if (mouseState == 0)
continue;

View File

@ -72,7 +72,7 @@ void DreamBase::doLoad(int savegameId) {
data.byte(kGetback) = 0;
while (data.byte(kGetback) == 0) {
if (quitRequested())
if (_quitRequested)
return;
delPointer();
readMouse();
@ -166,7 +166,7 @@ void DreamBase::saveGame() {
data.byte(kGetback) = 0;
while (data.byte(kGetback) == 0) {
if (quitRequested())
if (_quitRequested)
return;
delPointer();
checkInput();
@ -288,7 +288,7 @@ void DreamBase::doSaveLoad() {
data.byte(kGetback) = 0;
do { // wait ops
if (data.byte(kQuitrequested)) {
if (_quitRequested) {
data.byte(kManisoffscreen) = 0;
return;
}
@ -376,7 +376,7 @@ void DreamBase::discOps() {
};
do {
if (data.byte(kQuitrequested) != 0)
if (_quitRequested)
return; // quitdiscops
delPointer();
@ -637,7 +637,7 @@ void DreamBase::loadOld() {
doLoad(-1);
if (data.byte(kGetback) == 4 || quitRequested())
if (data.byte(kGetback) == 4 || _quitRequested)
return;
showDecisions();

View File

@ -527,7 +527,7 @@ void DreamBase::dreamweb() {
cls();
setMode();
decide();
if (quitRequested())
if (_quitRequested)
goto done;
if (data.byte(kGetback) == 4)
@ -544,17 +544,17 @@ void DreamBase::dreamweb() {
// TODO: In the demo version, titles() did nothing
clearPalette();
bibleQuote();
if (!quitRequested()) // "titlesearly"
if (!_quitRequested) // "titlesearly"
intro();
if (quitRequested())
if (_quitRequested)
goto done;
// "credits"
clearPalette();
realCredits();
if (quitRequested())
if (_quitRequested)
goto done;
clearChanges();
@ -581,13 +581,12 @@ void DreamBase::dreamweb() {
// main loop
while (true) {
if (quitRequested())
if (_quitRequested)
goto done;
screenUpdate();
if (quitRequested())
if (_quitRequested)
goto done;
if (data.byte(kWongame) != 0) {
@ -645,14 +644,10 @@ done: // The engine will need some cleaner finalization, let's put it here for n
engine->freeIcons2();
}
bool DreamBase::quitRequested() {
return data.byte(kQuitrequested);
}
void DreamBase::screenUpdate() {
newPlace();
mainScreen();
if (quitRequested())
if (_quitRequested)
return;
animPointer();
@ -1742,7 +1737,7 @@ void DreamBase::hangOn(uint16 frameCount) {
while (frameCount) {
vSync();
--frameCount;
if (quitRequested())
if (_quitRequested)
break;
}
}
@ -1756,7 +1751,7 @@ void DreamBase::hangOnW(uint16 frameCount) {
vSync();
dumpPointer();
--frameCount;
if (quitRequested())
if (_quitRequested)
break;
}
}
@ -1782,7 +1777,7 @@ void DreamBase::hangOnP(uint16 count) {
showPointer();
vSync();
dumpPointer();
if (quitRequested())
if (_quitRequested)
break;
if (data.word(kMousebutton) != 0 && data.word(kMousebutton) != data.word(kOldbutton))
break;
@ -1837,7 +1832,7 @@ void DreamBase::enterSymbol() {
{ 0xFFFF,0,0,0,0 }
};
checkCoords(symbolList);
} while ((data.byte(kGetback) == 0) && !quitRequested());
} while ((data.byte(kGetback) == 0) && !_quitRequested);
if ((data.byte(kSymbolbotnum) == 3) && (data.byte(kSymboltopnum) == 5)) {
removeSetObject(43);
placeSetObject(46);
@ -2529,7 +2524,7 @@ void DreamBase::useMenu() {
{ 0xFFFF,0,0,0,0 }
};
checkCoords(menuList);
} while ((data.byte(kGetback) != 1) && !quitRequested());
} while ((data.byte(kGetback) != 1) && !_quitRequested);
data.byte(kManisoffscreen) = 0;
redrawMainScrn();
getRidOfTemp();
@ -3125,7 +3120,7 @@ void DreamBase::decide() {
};
do {
if (data.byte(kQuitrequested) != 0)
if (_quitRequested)
return;
readMouse();

View File

@ -57,7 +57,7 @@ void DreamBase::talk() {
dumpTextLine();
data.byte(kGetback) = 0;
checkCoords(talkList);
if (data.byte(kQuitrequested))
if (_quitRequested)
break;
} while (!data.byte(kGetback));
@ -216,7 +216,7 @@ bool DreamBase::hangOnPQ() {
dumpTextLine();
checkCoords(quitList);
if (data.byte(kGetback) == 1 || data.byte(kQuitrequested)) {
if (data.byte(kGetback) == 1 || _quitRequested) {
// Quit conversation
delPointer();
data.byte(kPointermode) = 0;

View File

@ -199,7 +199,7 @@ void DreamBase::viewFolder() {
workToScreenM();
data.byte(kGetback) = 0;
do {
if (quitRequested())
if (_quitRequested)
break;
delPointer();
readMouse();
@ -1288,7 +1288,7 @@ void DreamBase::useDiary() {
dumpDiaryKeys();
dumpTextLine();
checkCoords(diaryList);
} while (!data.byte(kGetback) && !quitRequested());
} while (!data.byte(kGetback) && !_quitRequested);
getRidOfTemp();