FREESCAPE: fixes for driller demo

This commit is contained in:
neuromancer 2023-06-04 14:48:59 +02:00
parent 2c40ad1b12
commit 51b9f6f705
2 changed files with 19 additions and 7 deletions

View File

@ -40,12 +40,19 @@ void FreescapeEngine::generateDemoInput() {
if (_currentDemoInputCode >= 0x16 && _currentDemoInputCode <= 0x1a) {
event = decodeDOSMouseEvent(_currentDemoInputCode, _currentDemoInputRepetition);
Common::Point resolution = _gfx->nativeResolution();
event.mouse.x = resolution.x * event.mouse.x / _screenW;
event.mouse.y = resolution.y * event.mouse.y / _screenH ;
_demoEvents.push_back(event);
g_system->delayMillis(10);
_currentDemoInputRepetition = 0;
} else if (_currentDemoInputCode == 0x7f) {
// NOP
_currentDemoInputRepetition--;
} else if (_currentDemoInputCode == 0x0) {
_forceEndGame = true;
} else {
event = Common::Event();
event.type = Common::EVENT_KEYDOWN;

View File

@ -756,7 +756,8 @@ void DrillerEngine::initGameState() {
bool DrillerEngine::checkIfGameEnded() {
if (isDemo() && _demoMode)
return (_demoData[_demoIndex + 1] == 0x5f);
if (_demoData[_demoIndex + 1] == 0x5f)
return true;
if (_countdown <= 0) {
insertTemporaryMessage(_messagesList[14], _countdown - 2);
@ -800,12 +801,16 @@ bool DrillerEngine::checkIfGameEnded() {
if (_forceEndGame) {
_forceEndGame = false;
insertTemporaryMessage(_messagesList[18], _countdown - 2);
drawFrame();
_gfx->flipBuffer();
g_system->updateScreen();
g_system->delayMillis(2000);
gotoArea(127, 0);
if (isDemo())
return true;
else {
insertTemporaryMessage(_messagesList[18], _countdown - 2);
drawFrame();
_gfx->flipBuffer();
g_system->updateScreen();
g_system->delayMillis(2000);
gotoArea(127, 0);
}
}
if (_currentArea->getAreaID() == 127) {