aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-08-22 22:33:09 +0200
committerThierry Crozat2018-01-23 01:42:32 +0000
commita24af98b5e7a94fa1d4a91ca66f12b3cb2f0b250 (patch)
tree2e5560cd2e58411d78440d58cc3567998e07b0be /engines/supernova
parenta2f43c4eb6adb3e6c61cc4c1838707e8adb580c2 (diff)
downloadscummvm-rg350-a24af98b5e7a94fa1d4a91ca66f12b3cb2f0b250.tar.gz
scummvm-rg350-a24af98b5e7a94fa1d4a91ca66f12b3cb2f0b250.tar.bz2
scummvm-rg350-a24af98b5e7a94fa1d4a91ca66f12b3cb2f0b250.zip
SUPERNOVA: Corrects GameState variable names
According to the naming convention class member variables need to be prefixed with an underscore. Unfortunately, I already started converting time constants when making this change so ticksToMsec() and constant changes are sprinkled over this commit.
Diffstat (limited to 'engines/supernova')
-rw-r--r--engines/supernova/rooms.cpp259
-rw-r--r--engines/supernova/state.cpp204
-rw-r--r--engines/supernova/state.h54
3 files changed, 295 insertions, 222 deletions
diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp
index 2904ca1015..9e28c300e1 100644
--- a/engines/supernova/rooms.cpp
+++ b/engines/supernova/rooms.cpp
@@ -103,11 +103,11 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
_gm->_guiEnabled = false;
setSectionVisible(4, false);
g_system->fillScreen(kColorDarkBlue);
- if (_gm->_state.time == 0) {
+ if (_gm->_state._time == 0) {
// Destination reached
_vm->renderText("Flugziel erreicht", 60, 95, kColorWhite99);
_gm->getInput();
- } else if (_gm->_state.powerOff) {
+ } else if (_gm->_state._powerOff) {
// Energy depleted
_vm->renderText("Energie erschöpft", 60, 95, kColorWhite99);
// Artificial coma interrupted
@@ -116,7 +116,7 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
} else if (isSectionVisible(5)) {
// Sleep duration in days
_vm->renderText("Schlafdauer in Tagen:", 30, 85, kColorWhite99);
- _vm->renderText(Common::String::format("%d",_gm->_state.timeSleep).c_str(),
+ _vm->renderText(Common::String::format("%d",_gm->_state._timeSleep).c_str(),
150, 85, kColorWhite99);
_vm->renderText("Bitte legen Sie sich in die angezeigte Schlafkammer.",
30, 105, kColorWhite99);
@@ -149,7 +149,7 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
}
}
if (daysSleep != 0) {
- _gm->_state.timeSleep = daysSleep;
+ _gm->_state._timeSleep = daysSleep;
_vm->renderText("Bitte legen Sie sich in die angezeigte Schlafkammer.", 30, 105, kColorWhite99);
_gm->wait2(18);
setSectionVisible(5, true);
@@ -177,15 +177,15 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
_gm->drawImage(_gm->invertSection(4));
room = _gm->_rooms[GENERATOR];
if (room->isSectionVisible(9)) {
- energy = &_gm->_state.landingModuleEnergy;
+ energy = &_gm->_state._landingModuleEnergy;
} else {
- energy = &_gm->_state.shipEnergy;
+ energy = &_gm->_state._shipEnergy;
}
- if (_gm->_state.timeSleep > _gm->_state.time) {
- _gm->_state.timeSleep = _gm->_state.time;
+ if (_gm->_state._timeSleep > _gm->_state._time) {
+ _gm->_state._timeSleep = _gm->_state._time;
}
- if (_gm->_state.timeSleep >= *energy) {
- _gm->_state.timeSleep = *energy;
+ if (_gm->_state._timeSleep >= *energy) {
+ _gm->_state._timeSleep = *energy;
if (room->isSectionVisible(9)) {
room = _gm->_rooms[LANDINGMODULE]; // Monitors off
room->setSectionVisible(2, false);
@@ -195,7 +195,7 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
room->setSectionVisible(10, false);
}
}
- if (_gm->_state.timeSleep == _gm->_state.time) {
+ if (_gm->_state._timeSleep == _gm->_state._time) {
_gm->drawImage(3);
room = _gm->_rooms[COCKPIT];
room->setSectionVisible(23, true);
@@ -220,26 +220,26 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
room->setSectionVisible(11, true);
}
}
- _gm->_state.time -= _gm->_state.timeSleep;
- *energy -= _gm->_state.timeSleep;
- _gm->_state.timeStarting = _vm->getDOSTicks() - 786520; // 12pm
- _gm->_state.timeAlarmSystem = _gm->_state.timeAlarm + _gm->_state.timeStarting;
- _gm->_state.alarmOn = (_gm->_state.timeAlarmSystem > _vm->getDOSTicks());
+ _gm->_state._time -= _gm->_state._timeSleep;
+ *energy -= _gm->_state._timeSleep;
+ _gm->_state._timeStarting = _vm->_system->getMillis() - ticksToMsec(786520); // 12pm
+ _gm->_state._timeAlarmSystem = _gm->_state._timeAlarm + _gm->_state._timeStarting;
+ _gm->_state._alarmOn = (_gm->_state._timeAlarmSystem > _vm->_system->getMillis());
if (!*energy) {
_gm->turnOff();
room = _gm->_rooms[GENERATOR];
room->setSectionVisible(4, room->isSectionVisible(2));
}
- if (_gm->_state.time == 0) {
+ if (_gm->_state._time == 0) {
_gm->saveTime();
if (!_gm->saveGame(-2))
_gm->errorTemp();
- _gm->_state.dream = true;
+ _gm->_state._dream = true;
_gm->loadTime();
}
_gm->wait2(18);
_vm->paletteFadeIn();
- if (_gm->_state.time == 0) {
+ if (_gm->_state._time == 0) {
_vm->playSound(kAudioCrash);
_gm->screenShake();
_gm->wait2(18);
@@ -255,7 +255,7 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
void ShipSleepCabin::animation() {
static char color;
- if (_gm->_state.powerOff && _gm->_state.time) {
+ if (_gm->_state._powerOff && _gm->_state._time) {
if (_gm->_guiEnabled) {
if (isSectionVisible(1)) {
_gm->drawImage(2);
@@ -283,7 +283,7 @@ void ShipSleepCabin::animation() {
_gm->setAnimationTimer(6);
}
void ShipSleepCabin::onEntrance() {
- if (_gm->_state.dream && (_gm->_rooms[CAVE]->getObject(1)->_exitRoom == MEETUP3)) {
+ if (_gm->_state._dream && (_gm->_rooms[CAVE]->getObject(1)->_exitRoom == MEETUP3)) {
_vm->renderMessage("Du wachst mit brummendem Schädel auf|und merkst, daß du nur geträumt hast.");
_gm->mouseWait(_gm->_timer1);
_vm->removeMessage();
@@ -291,7 +291,7 @@ void ShipSleepCabin::onEntrance() {
_gm->mouseWait(_gm->_timer1);
_vm->removeMessage();
_vm->renderMessage("Was steht dir jetzt wohl wirklich bevor?");
- _gm->_state.dream = false;
+ _gm->_state._dream = false;
}
setRoomSeen(true);
}
@@ -304,21 +304,22 @@ bool ShipCockpit::interact(Action verb, Object &obj1, Object &obj2) {
_gm->_guiEnabled = false;
_vm->renderBox(0, 0, 320, 200, kColorBlack);
_vm->renderText("Geschwindigkeit: ", 50, 50, kColorLightYellow);
- if (_gm->_state.time)
+ if (_gm->_state._time)
_vm->renderText("8000 hpm");
else
_vm->renderText("0 hpm");
_vm->renderText("Ziel: Arsano 3", 50, 70, kColorLightYellow);
_vm->renderText("Entfernung: ", 50, 90, kColorLightYellow);
- _vm->renderText(Common::String::format("%d", _gm->_state.timeStarting / 7200000).c_str());
+ _vm->renderText(Common::String::format("%d", _gm->_state._time / ticksToMsec(400)).c_str());
_vm->renderText(",");
- c[0] = (_gm->_state.timeStarting / 720000) % 10 + '0';
+ c[0] = (_gm->_state._time / ticksToMsec(40)) % 10 + '0';
_vm->renderText(c);
- c[0] = (_gm->_state.timeStarting / 72000) % 10 + '0';
+ c[0] = (_gm->_state._time / ticksToMsec(4)) % 10 + '0';
_vm->renderText(c);
_vm->renderText(" Lichtjahre");
_vm->renderText("Dauer der Reise bei momentaner Geschwindigkeit:", 50, 110, kColorLightYellow);
- _vm->renderText(Common::String::format("%d", _gm->_state.timeStarting / 18000).c_str(), 50, 120, kColorLightYellow);
+ _vm->renderText(Common::String::format("%d", _gm->_state._time).c_str(),
+ 50, 120, kColorLightYellow);
_vm->renderText(" Tage");
_gm->getInput();
@@ -351,7 +352,7 @@ void ShipCockpit::animation() {
_gm->setAnimationTimer(10);
}
}
- if (_gm->_state.powerOff) {
+ if (_gm->_state._powerOff) {
if (!_gm->_guiEnabled) {
_vm->renderText("Energievorrat ersch”pft", 97, 165, color);
_vm->renderText("Notstromversorgung aktiv", 97, 175, color);
@@ -701,11 +702,11 @@ bool ShipHold::interact(Action verb, Object &obj1, Object &obj2) {
else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, TERMINALSTRIP, HOLD_WIRE)) {
getObject(0)->_name = "Leitung mit Lsterklemme";
_gm->_inventory.remove(*getObject(2));
- _gm->_state.terminalStripConnected = true;
- _gm->_state.terminalStripWire = true;
+ _gm->_state._terminalStripConnected = true;
+ _gm->_state._terminalStripWire = true;
_vm->renderMessage("Ok.");
} else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, HOLD_WIRE, SPOOL)) {
- if (!_gm->_state.terminalStripConnected)
+ if (!_gm->_state._terminalStripConnected)
_vm->renderMessage("Womit denn?");
else {
_gm->drawImage(5);
@@ -747,7 +748,7 @@ bool ShipLandingModule::interact(Action verb, Object &obj1, Object &obj2) {
if ((verb == ACTION_PRESS) && (obj1._id == LANDINGMOD_BUTTON))
_vm->renderMessage(obj1._description);
else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, PEN, LANDINGMOD_BUTTON)) {
- if (_gm->_state.landingModuleEnergy) {
+ if (_gm->_state._landingModuleEnergy) {
r = _gm->_rooms[GENERATOR];
if (isSectionVisible(7)) {
_gm->drawImage(_gm->invertSection(9));
@@ -756,13 +757,13 @@ bool ShipLandingModule::interact(Action verb, Object &obj1, Object &obj2) {
_gm->drawImage(_gm->invertSection(7));
_gm->drawImage(_gm->invertSection(10));
if (r->isSectionVisible(9))
- _gm->_state.powerOff = true;
+ _gm->_state._powerOff = true;
_gm->roomBrightness();
_vm->paletteBrightness();
} else {
_gm->drawImage(7);
if (r->isSectionVisible(9))
- _gm->_state.powerOff = false;
+ _gm->_state._powerOff = false;
// load("MSN_DATA.025");
_gm->roomBrightness();
_vm->paletteBrightness();
@@ -791,12 +792,12 @@ bool ShipLandingModule::interact(Action verb, Object &obj1, Object &obj2) {
_gm->_inventory.remove(*r->getObject(8));
getObject(4)->_name = r->getObject(8)->_name;
_gm->drawImage(4);
- if (_gm->_state.cableConnected) {
+ if (_gm->_state._cableConnected) {
_gm->drawImage(5);
getObject(4)->_click = 6;
} else {
getObject(4)->_click = 5;
- if (_gm->_state.terminalStripWire)
+ if (_gm->_state._terminalStripWire)
_gm->drawImage(11);
}
} else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, SPOOL, LANDINGMOD_SOCKET))
@@ -806,10 +807,10 @@ bool ShipLandingModule::interact(Action verb, Object &obj1, Object &obj2) {
getObject(4)->_name = "Leitung mit L\201sterklemme";
r = _gm->_rooms[HOLD];
_gm->_inventory.remove(*r->getObject(2));
- _gm->_state.terminalStripConnected = true;
- _gm->_state.terminalStripWire = true;
+ _gm->_state._terminalStripConnected = true;
+ _gm->_state._terminalStripWire = true;
} else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, LANDINGMOD_WIRE, SPOOL)) {
- if (!_gm->_state.terminalStripConnected)
+ if (!_gm->_state._terminalStripConnected)
_vm->renderMessage("Womit denn?");
else {
_gm->drawImage(5);
@@ -909,7 +910,7 @@ bool ShipGenerator::interact(Action verb, Object &obj1, Object &obj2) {
setSectionVisible(3, false);
setSectionVisible(4, false);
getObject(11)->_click = 10;
- if (_gm->_state.shipEnergy)
+ if (_gm->_state._shipEnergy)
_gm->turnOn();
else
_gm->drawImage(4);
@@ -918,7 +919,7 @@ bool ShipGenerator::interact(Action verb, Object &obj1, Object &obj2) {
_gm->drawImage(2);
if (getObject(11)->_click == 11)
_gm->drawImage(3);
- if (_gm->_state.powerOff)
+ if (_gm->_state._powerOff)
_gm->drawImage(4);
obj1.setProperty(OPENED);
obj1._click = 6;
@@ -941,7 +942,7 @@ bool ShipGenerator::interact(Action verb, Object &obj1, Object &obj2) {
_gm->drawImage(9);
getObject(0)->_click = 16;
r = _gm->_rooms[LANDINGMODULE];
- if (_gm->_state.landingModuleEnergy && r->isSectionVisible(7))
+ if (_gm->_state._landingModuleEnergy && r->isSectionVisible(7))
_gm->turnOn();
else
_gm->drawImage(4);
@@ -963,7 +964,7 @@ bool ShipGenerator::interact(Action verb, Object &obj1, Object &obj2) {
isSectionVisible(3)) {
_vm->renderMessage("Was n\201tzt dir der Anschlu\341|ohne eine Stromquelle?!");
} else if ((verb == ACTION_LOOK) && (obj1._id == VOLTMETER)) {
- if (_gm->_state.powerOff)
+ if (_gm->_state._powerOff)
_vm->renderMessage("Die Spannung ist auf Null abgesunken.");
else
_vm->renderMessage("Es zeigt volle Spannung an.");
@@ -1031,9 +1032,9 @@ void ArsanoMeetup::onEntrance() {
_gm->wait2(3);
_gm->drawImage(_gm->invertSection(6));
}
- if (!(_gm->_state.greatFlag & 0x8000)) {
+ if (!(_gm->_state._greatFlag & 0x8000)) {
_vm->playSound(kAudioGreat);
- _gm->_state.greatFlag |= 0x8000;
+ _gm->_state._greatFlag |= 0x8000;
}
}
@@ -1079,15 +1080,15 @@ bool ArsanoMeetup::interact(Action verb, Object &obj1, Object &obj2) {
_gm->wait2(3);
return false;
- } else if ((verb == ACTION_LOOK) && (obj1._id == MEETUP_SIGN) && _gm->_state.language) {
- if (_gm->_state.language == 2)
+ } else if ((verb == ACTION_LOOK) && (obj1._id == MEETUP_SIGN) && _gm->_state._language) {
+ if (_gm->_state._language == 2)
_vm->renderMessage("Komisch! Auf einmal kannst du|das Schild lesen! Darauf steht:|\"Treffpunkt Galactica\".");
obj1._description = "Darauf steht:|\"Treffpunkt Galactica\".";
- if (_gm->_state.language == 1)
+ if (_gm->_state._language == 1)
return false;
- _gm->_state.language = 1;
+ _gm->_state._language = 1;
} else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, KEYCARD_R, SPACESHIP)) {
getObject(5)->setProperty(OPENED);
_gm->changeRoom(GLIDER);
@@ -1144,12 +1145,12 @@ bool ArsanoEntrance::interact(Action verb, Object &obj1, Object &obj2) {
if (_gm->_rooms[AIRLOCK]->getObject(4)->hasProperty(WORN)) {
_vm->renderMessage("Durch deinen Helm kannst|du nicht sprechen.");
} else {
- if (_gm->_state.language) {
+ if (_gm->_state._language) {
do {
- if (_gm->_state.shoes == 1) {
+ if (_gm->_state._shoes == 1) {
_dialog2[2] = "Wo soll ich die Schuhe ablegen?";
_gm->addSentence(2, 2);
- } else if (_gm->_state.shoes > 1) {
+ } else if (_gm->_state._shoes > 1) {
_gm->removeSentence(2, 2);
}
switch (e = _gm->dialog(5, nullptr, nullptr, 2)) { // row2, dialog2
@@ -1164,12 +1165,12 @@ bool ArsanoEntrance::interact(Action verb, Object &obj1, Object &obj2) {
_gm->addSentence(1, 2);
break;
case 2:
- if (_gm->_state.shoes == 1) {
+ if (_gm->_state._shoes == 1) {
_gm->reply("In der Toilette gibt es|Schlieáf„cher fr Schuhe.", 1, _gm->invertSection(1));
- _gm->_state.shoes = 2;
+ _gm->_state._shoes = 2;
} else {
_gm->reply("Wenn Sie das Lokal betreten|wollen, mssen Sie erst|ihre Schuhe ausziehen.", 1, _gm->invertSection(1));
- _gm->_state.shoes = 1;
+ _gm->_state._shoes = 1;
}
break;
case 3:
@@ -1181,14 +1182,14 @@ bool ArsanoEntrance::interact(Action verb, Object &obj1, Object &obj2) {
_gm->reply("Hhius otgfh Dgfdrkjlh Fokj gf.", 1, _gm->invertSection(1));
}
}
- } else if ((verb == ACTION_WALK) && (obj1._id == STAIRCASE) && (_gm->_state.shoes != 3)) {
+ } else if ((verb == ACTION_WALK) && (obj1._id == STAIRCASE) && (_gm->_state._shoes != 3)) {
_gm->drawImage(3);
_gm->wait2(2);
_gm->drawImage(4);
setSectionVisible(3, false);
if (_gm->_rooms[AIRLOCK]->getObject(4)->hasProperty(WORN))
_gm->reply("|", 1, _gm->invertSection(1));
- else if (_gm->_state.language)
+ else if (_gm->_state._language)
_gm->reply("Halt!", 1, _gm->invertSection(1));
else
_gm->reply("Uhwdejkt!", 1, _gm->invertSection(1));
@@ -1197,8 +1198,8 @@ bool ArsanoEntrance::interact(Action verb, Object &obj1, Object &obj2) {
_gm->wait2(2);
_gm->drawImage(_gm->invertSection(3));
if (!_gm->_rooms[AIRLOCK]->getObject(4)->hasProperty(WORN)) {
- if (_gm->_state.language) {
- if (_gm->_state.shoes)
+ if (_gm->_state._language) {
+ if (_gm->_state._shoes)
_gm->reply("Sie mssen erst ihre Schuhe ausziehen, Sie Trottel!", 1, _gm->invertSection(1));
else
_gm->reply("Was f„llt ihnen ein!|Sie k”nnen doch ein Lokal|nicht mit Schuhen betreten!", 1, _gm->invertSection(1));
@@ -1216,7 +1217,7 @@ bool ArsanoEntrance::interact(Action verb, Object &obj1, Object &obj2) {
break;
case 2:
_gm->reply("In der Toilette gibt es|Schlieáf„cher fr Schuhe.", 1, 1 + 128);
- _gm->_state.shoes = 2;
+ _gm->_state._shoes = 2;
break;
case 3:
_gm->drawImage(3);
@@ -1254,15 +1255,15 @@ bool ArsanoEntrance::interact(Action verb, Object &obj1, Object &obj2) {
setSectionVisible(8, false);
getObject(11)->_click = 9;
} else if ((verb == ACTION_WALK) && (obj1._id == ARSANO_BATHROOM)) {
- if (_gm->_state.coins) {
- if (_gm->_state.shoes == 2) {
+ if (_gm->_state._coins) {
+ if (_gm->_state._shoes == 2) {
_vm->renderMessage("Du ziehst deine Schuhe|aus und legst sie in|eins der Schlieáf„cher.");
- _gm->_state.shoes = 3;
+ _gm->_state._shoes = 3;
_gm->removeSentence(2, 2);
_gm->removeSentence(3, 2);
- } else if (_gm->_state.shoes == 3) {
+ } else if (_gm->_state._shoes == 3) {
_vm->renderMessage("Du ziehst deine Schuhe wieder an.");
- _gm->_state.shoes = 2;
+ _gm->_state._shoes = 2;
} else
_vm->renderMessage("Du durchsuchst die Klos nach|anderen brauchbaren Sachen,|findest aber nichts.");
} else {
@@ -1274,39 +1275,39 @@ bool ArsanoEntrance::interact(Action verb, Object &obj1, Object &obj2) {
_vm->removeMessage();
_vm->renderMessage("In einem der Schlieáf„cher,|die sich auch im Raum befinden,|findest du einige Mnzen.");
_gm->takeObject(*getObject(16));
- _gm->_state.coins = 5;
+ _gm->_state._coins = 5;
}
}
_shown[kMaxSection - 5] = true;
} else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, COINS, CAR_SLOT)) {
- if ((_gm->_state.coins < 5) && (getObject(7 - _gm->_state.coins)->_click == 7))
+ if ((_gm->_state._coins < 5) && (getObject(7 - _gm->_state._coins)->_click == 7))
_vm->renderMessage("Mach doch zuerst das Fach leer!");
else {
- _gm->drawImage(15 - _gm->_state.coins);
- getObject(8 - _gm->_state.coins)->_click = 7;
- --_gm->_state.coins;
- if (_gm->_state.coins == 1) {
+ _gm->drawImage(15 - _gm->_state._coins);
+ getObject(8 - _gm->_state._coins)->_click = 7;
+ --_gm->_state._coins;
+ if (_gm->_state._coins == 1) {
getObject(16)->_name = "M\201nze";
}
- if (_gm->_state.coins == 0) {
+ if (_gm->_state._coins == 0) {
_gm->_inventory.remove(*getObject(16));
- _gm->_state.coins = 255;
+ _gm->_state._coins = 255;
}
}
- } else if ((verb == ACTION_LOOK) && (obj1._id == KITCHEN_SIGN) && _gm->_state.language) {
- if (_gm->_state.language == 2)
+ } else if ((verb == ACTION_LOOK) && (obj1._id == KITCHEN_SIGN) && _gm->_state._language) {
+ if (_gm->_state._language == 2)
_vm->renderMessage("Komisch! Auf einmal kannst du|das Schild lesen! Darauf steht:|\"Zutritt nur fr Personal\".");
obj1._description = "Darauf steht:|\"Zutritt nur fr Personal\".";
- if (_gm->_state.language == 1)
+ if (_gm->_state._language == 1)
return false;
- _gm->_state.language = 1;
- } else if ((verb == ACTION_LOOK) && (obj1._id == BATHROOM_SIGN) && _gm->_state.language) {
- if (_gm->_state.language == 2)
+ _gm->_state._language = 1;
+ } else if ((verb == ACTION_LOOK) && (obj1._id == BATHROOM_SIGN) && _gm->_state._language) {
+ if (_gm->_state._language == 2)
_vm->renderMessage("Komisch! Auf einmal kannst|du das Schild lesen!|Darauf steht:\"Toilette\".");
obj1._description = "Darauf steht:|\"Toilette\".";
- if (_gm->_state.language == 1)
+ if (_gm->_state._language == 1)
return false;
- _gm->_state.language = 1;
+ _gm->_state._language = 1;
} else if ((verb == ACTION_WALK) && (obj1._id == MEETUP_EXIT)) {
if (!((_gm->_rooms[AIRLOCK]->getObject(4)->hasProperty(WORN)) &&
(_gm->_rooms[AIRLOCK]->getObject(5)->hasProperty(WORN)) &&
@@ -1590,12 +1591,12 @@ bool ArsanoRoger::interact(Action verb, Object &obj1, Object &obj2) {
_vm->removeMessage();
_vm->_menuBrightness = 0;
_vm->paletteBrightness();
- _gm->_state.timeStarting -= 125000; /* 2 Stunden */
- _gm->_state.timeAlarmSystem -= 125000;
- _gm->_state.eventTime = _vm->getDOSTicks() + 4000;
+ _gm->_state._timeStarting -= 7200000; // 2 hours
+ _gm->_state._timeAlarmSystem -= 7200000;
+ _gm->_state._eventTime = _vm->_system->getMillis() + 220000;
// TODO: implement event calling
// _gm->_state.event = &supernova;
- _gm->_state.alarmOn = (_gm->_state.timeAlarmSystem > _vm->getDOSTicks());
+ _gm->_state._alarmOn = (_gm->_state._timeAlarmSystem > _vm->_system->getMillis());
setSectionVisible(11, false);
setSectionVisible(1, false);
_vm->renderRoom(*this);
@@ -1790,13 +1791,13 @@ bool ArsanoMeetup2::interact(Action verb, Object &obj1, Object &obj2) {
_vm->removeMessage();
_vm->paletteFadeOut();
g_system->fillScreen(kColorBlack);
- _gm->_state.dream = false;
+ _gm->_state._dream = false;
// TODO:
// if (!load_game(-2)) error_temp();
_gm->loadTime();
_gm->_newRoom = true;
_gm->_rooms[CAVE]->getObject(1)->_exitRoom = MEETUP3;
- _gm->_state.dream = true;
+ _gm->_state._dream = true;
}
} else {
_gm->changeRoom(MEETUP2);
@@ -1901,9 +1902,9 @@ bool ArsanoMeetup3::interact(Action verb, Object &obj1, Object &obj2) {
_gm->_inventory.add(*_gm->_rooms[INTRO]->getObject(3)); // Discman
_gm->changeRoom(CELL);
_gm->_newRoom = true;
- _gm->_state.benOverlay = 2;
+ _gm->_state._benOverlay = 2;
_gm->_newOverlay = true;
- _gm->_state.dream = true;
+ _gm->_state._dream = true;
} else
return false;
@@ -1911,76 +1912,76 @@ bool ArsanoMeetup3::interact(Action verb, Object &obj1, Object &obj2) {
}
void AxacussCell::onEntrance() {
- if (_gm->_state.dream) {
+ if (_gm->_state._dream) {
_vm->renderMessage("Du wachst auf und findest dich in|einem geschlossenen Raum wieder.");
- _gm->_state.timeStarting = _gm->_state.time - 500000;
- _gm->_state.timeAlarmSystem = _gm->_state.timeAlarm + _gm->_state.timeStarting;
- _gm->_state.alarmOn = (_gm->_state.timeAlarmSystem > _gm->_state.time);
- _gm->_state.powerOff = false;
- _gm->_state.dream = false;
+ _gm->_state._timeStarting = _gm->_state._time - 500000;
+ _gm->_state._timeAlarmSystem = _gm->_state._timeAlarm + _gm->_state._timeStarting;
+ _gm->_state._alarmOn = (_gm->_state._timeAlarmSystem > _gm->_state._time);
+ _gm->_state._powerOff = false;
+ _gm->_state._dream = false;
}
}
void AxacussCell::animation() {
- ++_gm->_state.timeRobot;
+ ++_gm->_state._timeRobot;
- if (_gm->_state.timeRobot == 299) {
+ if (_gm->_state._timeRobot == 299) {
_gm->drawImage(_gm->invertSection(31));
_gm->drawImage(28);
getObject(0)->_click = 255;
getObject(1)->setProperty(EXIT | OPENABLE | OPENED | CLOSED);
- } else if ((_gm->_state.timeRobot >= 301) && (_gm->_state.timeRobot <= 320)) {
- _gm->drawImage(_gm->invertSection(329 - _gm->_state.timeRobot));
- _gm->drawImage(328 - _gm->_state.timeRobot);
- } else if (_gm->_state.timeRobot == 321) {
+ } else if ((_gm->_state._timeRobot >= 301) && (_gm->_state._timeRobot <= 320)) {
+ _gm->drawImage(_gm->invertSection(329 - _gm->_state._timeRobot));
+ _gm->drawImage(328 - _gm->_state._timeRobot);
+ } else if (_gm->_state._timeRobot == 321) {
_gm->drawImage(31);
setSectionVisible(8, false);
getObject(0)->_click = 1;
getObject(1)->setProperty(EXIT | OPENABLE | CLOSED);
}
- if (_gm->_state.timeRobot == 599) {
+ if (_gm->_state._timeRobot == 599) {
_gm->drawImage(_gm->invertSection(31));
_gm->drawImage(8);
getObject(0)->_click = 255;
getObject(1)->setProperty(EXIT | OPENABLE | OPENED | CLOSED);
- } else if ((_gm->_state.timeRobot >= 601) && (_gm->_state.timeRobot <= 620)) {
- _gm->drawImage(_gm->_state.timeRobot - 593 + 128);
- _gm->drawImage(_gm->_state.timeRobot - 592);
- } else if (_gm->_state.timeRobot == 621) {
+ } else if ((_gm->_state._timeRobot >= 601) && (_gm->_state._timeRobot <= 620)) {
+ _gm->drawImage(_gm->_state._timeRobot - 593 + 128);
+ _gm->drawImage(_gm->_state._timeRobot - 592);
+ } else if (_gm->_state._timeRobot == 621) {
_gm->drawImage(31);
setSectionVisible(28, false);
getObject(0)->_click = 1;
getObject(1)->setProperty(EXIT | OPENABLE | CLOSED);
- } else if (_gm->_state.timeRobot == 700) {
- _gm->_state.timeRobot = 0;
- } else if (_gm->_state.timeRobot == 10002) {
+ } else if (_gm->_state._timeRobot == 700) {
+ _gm->_state._timeRobot = 0;
+ } else if (_gm->_state._timeRobot == 10002) {
_gm->drawImage(18 + 128);
_gm->drawImage(29);
_gm->drawImage(7);
getObject(2)->_click = 13;
- } else if (_gm->_state.timeRobot == 10003) {
+ } else if (_gm->_state._timeRobot == 10003) {
setSectionVisible(29, false);
_gm->drawImage(30);
getObject(8)->_click = 12;
getObject(7)->_click = 14;
_vm->playSound(kAudioUndef4);
- } else if (_gm->_state.timeRobot == 10010) {
- --_gm->_state.timeRobot;
+ } else if (_gm->_state._timeRobot == 10010) {
+ --_gm->_state._timeRobot;
}
- if (_gm->_state.timeRobot == 312) {
+ if (_gm->_state._timeRobot == 312) {
_gm->drawImage(7);
getObject(2)->_click = 13;
- } else if (_gm->_state.timeRobot == 610) {
+ } else if (_gm->_state._timeRobot == 610) {
setSectionVisible(7, false);
getObject(2)->_click = 255;
}
if ((isSectionVisible(6)) &&
- ((_gm->_state.timeRobot == 310) || (_gm->_state.timeRobot == 610))) {
+ ((_gm->_state._timeRobot == 310) || (_gm->_state._timeRobot == 610))) {
_vm->playSound(kAudioUndef3);
- _gm->_state.timeRobot = 10000;
+ _gm->_state._timeRobot = 10000;
}
_gm->setAnimationTimer(3);
@@ -2169,12 +2170,12 @@ bestechen:
if (_gm->dialog(2, nullptr, nullptr, 0) == 0) { // rows, dialog2
_gm->reply("Nein!", 1, 1 + 128);
setSectionVisible(kMaxSection - 2, false);
- if (_gm->_state.money == 0) {
+ if (_gm->_state._money == 0) {
_gm->removeSentence(2, 2);
_gm->removeSentence(3, 2);
} else {
- _dialog3[2] += Common::String::format("%d Xa.", _gm->_state.money - 200);
- _dialog3[3] += Common::String::format("%d Xa.", _gm->_state.money);
+ _dialog3[2] += Common::String::format("%d Xa.", _gm->_state._money - 200);
+ _dialog3[3] += Common::String::format("%d Xa.", _gm->_state._money);
}
switch (_gm->dialog(4, nullptr, nullptr, 2)) { // rows, dialog3
case 1:
@@ -2188,13 +2189,13 @@ bestechen:
_gm->shot(3, _gm->invertSection(3));
break;
case 3:
- if (_gm->_state.money >= 900) {
- sum = _gm->_state.money;
+ if (_gm->_state._money >= 900) {
+ sum = _gm->_state._money;
goto genug;
}
case 2:
- if (_gm->_state.money > 1100) {
- sum = _gm->_state.money - 200;
+ if (_gm->_state._money > 1100) {
+ sum = _gm->_state._money - 200;
goto genug;
}
_gm->reply("Das máte schon ein biáchen mehr sein.", 1, 1 + 128);
@@ -2316,12 +2317,12 @@ bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) {
_gm->drawImage(_gm->invertSection(obj1._id - DOOR1 + 1));
_vm->playSound(kAudioDoorClose);
if (obj1.hasProperty(OCCUPIED)) {
- _gm->_state.destination = 255;
+ _gm->_state._destination = 255;
obj1.setProperty(EXIT | OPENABLE | CLOSED | CAUGHT);
if (!_gm->_rooms[OFFICE_L1 + obj1._id - DOOR1]->isSectionVisible(4))
_gm->search(180);
else
- _gm->_state.eventTime = 0xffffffff;
+ _gm->_state._eventTime = 0xffffffff;
} else
obj1.setProperty(EXIT | OPENABLE | CLOSED);
} else if (((verb == ACTION_WALK) || ((verb == ACTION_OPEN) && !obj1.hasProperty(OPENED))) &&
@@ -2374,7 +2375,7 @@ bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) {
}
} else if ((verb == ACTION_LOOK) &&
(obj1._id >= DOOR1) && (obj1._id <= DOOR4)) {
- _gm->_state.nameSeen |= 1 << (obj1._id - DOOR1);
+ _gm->_state._nameSeen |= 1 << (obj1._id - DOOR1);
return false;
} else if ((verb == ACTION_WALK) &&
((obj1._id == PILLAR1) || (obj1._id == PILLAR2))) {
@@ -2601,9 +2602,9 @@ bool AxacussElevator::interact(Action verb, Object &obj1, Object &obj2) {
getObject(3)->resetProperty(EXIT);
getObject(3)->_click = 2;
_gm->drawImage(_gm->invertSection(1));
- if (!(_gm->_state.greatFlag & 0x4000)) {
+ if (!(_gm->_state._greatFlag & 0x4000)) {
_vm->playSound(kAudioGreat);
- _gm->_state.greatFlag |= 0x4000;
+ _gm->_state._greatFlag |= 0x4000;
}
}
} else if ((verb == ACTION_PRESS) && (obj1._id == BUTTON2)) {
@@ -2680,7 +2681,7 @@ bool AxacussSign::interact(Action verb, Object &obj1, Object &obj2) {
_gm->takeMoney(-180);
_gm->drawImage(2);
setSectionVisible(1, false);
- _gm->_state.eventTime = _vm->getDOSTicks() + 600;
+ _gm->_state._eventTime = _vm->_system->getMillis() + ticksToMsec(600);
// *event = &taxi;
return true;
}
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 51cc97f486..b6a186e352 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -221,33 +221,35 @@ void GameManager::initState() {
_timer1 = 0;
_animationTimer = 0;
- _state.time = 2840 * kMsecPerTick;
- _state.timeSleep = 0;
- _state.timeStarting = 50400000; // 2 pm -- Originally: systime() - 917650
- _state.timeAlarm = 25200000; // 7 am
- _state.timeAlarmSystem = _state.timeAlarm + _state.timeStarting;
- _state.eventTime = 0xffffffff;
- _state.shipEnergy = 2135;
- _state.landingModuleEnergy = 923;
- _state.greatFlag = 0;
- _state.timeRobot = 0;
- _state.money = 0;
- _state.coins = 0;
- _state.shoes = 0;
- _state.nameSeen = 0;
- _state.destination = 255;
- _state.benOverlay = 0;
- _state.language = 0;
- _state.corridorSearch = false;
- _state.alarmOn = false;
- _state.terminalStripConnected = false;
- _state.terminalStripWire = false;
- _state.cableConnected = false;
- _state.powerOff = false;
- _state.cockpitSeen = false;
- _state.airlockSeen = false;
- _state.holdSeen = false;
- _state.dream = false;
+ _state._time = ticksToMsec(2840);
+ _state._timeSleep = 0;
+ // NOTE: systime() calls int 1A, means it gets number of ticks since midnight.
+ // So, it doesn't matter if we overflow by substraction?
+ _state._timeStarting = _vm->_system->getMillis() - ticksToMsec(917650); // 2 pm
+ _state._timeAlarm = ticksToMsec(458808); // 7 am
+ _state._timeAlarmSystem = _state._timeAlarm + _state._timeStarting;
+ _state._eventTime = 0xffffffff;
+ _state._shipEnergy = 2135;
+ _state._landingModuleEnergy = 923;
+ _state._greatFlag = 0;
+ _state._timeRobot = 0;
+ _state._money = 0;
+ _state._coins = 0;
+ _state._shoes = 0;
+ _state._nameSeen = 0;
+ _state._destination = 255;
+ _state._benOverlay = 0;
+ _state._language = 0;
+ _state._corridorSearch = false;
+ _state._alarmOn = false;
+ _state._terminalStripConnected = false;
+ _state._terminalStripWire = false;
+ _state._cableConnected = false;
+ _state._powerOff = false;
+ _state._cockpitSeen = false;
+ _state._airlockSeen = false;
+ _state._holdSeen = false;
+ _state._dream = false;
}
void GameManager::initRooms() {
@@ -518,7 +520,7 @@ void GameManager::drawImage(int section) {
}
void GameManager::corridorOnEntrance() {
- if (_state.corridorSearch)
+ if (_state._corridorSearch)
busted(0);
}
@@ -534,11 +536,11 @@ void GameManager::startSearch() {
if ((_currentRoom >= _rooms[CORRIDOR1]) && (_currentRoom <= _rooms[BCORRIDOR]))
busted(0);
- _state.corridorSearch = true;
+ _state._corridorSearch = true;
}
void GameManager::search(int time) {
- _state.eventTime = _vm->getDOSTicks() + time;
+ _state._eventTime = _vm->_system->getMillis() + time;
// *event = &search_start;
}
@@ -631,12 +633,12 @@ void GameManager::taxi() {
}
void GameManager::outro() {
- _state.benOverlay = 3;
+ _state._benOverlay = 3;
// load_overlay();
// title = 2;
_vm->playSoundMod(49);
// title = 0;
- _state.benOverlay = 0;
+ _state._benOverlay = 0;
_vm->paletteFadeOut();
_vm->renderImage(55, 0);
_vm->paletteFadeIn();
@@ -647,11 +649,11 @@ void GameManager::outro() {
}
void GameManager::great(uint number) {
- if (number && (_state.greatFlag & (1 << number)))
+ if (number && (_state._greatFlag & (1 << number)))
return;
_vm->playSound(kAudioUndef7);
- _state.greatFlag |= 1 << number;
+ _state._greatFlag |= 1 << number;
}
bool GameManager::airless() {
@@ -689,18 +691,18 @@ int GameManager::dialog(int num, byte *rowLength[], const char **text[6], int nu
}
void GameManager::turnOff() {
- if (_state.powerOff)
+ if (_state._powerOff)
return;
- _state.powerOff = true;
+ _state._powerOff = true;
roomBrightness();
}
void GameManager::turnOn() {
- if (!_state.powerOff)
+ if (!_state._powerOff)
return;
- _state.powerOff = false;
+ _state._powerOff = false;
_vm->paletteBrightness();
Room *room = _rooms[SLEEP];
room->setSectionVisible(1, false);
@@ -814,15 +816,82 @@ void GameManager::mouseWait(int delay) {
// STUB
}
+static void dimColor(SupernovaEngine *vm, int color) {
+ color -= 16;
+ color *= 3;
+ // TODO: alters palette image data permanently (get system palette instead?)
+ vm->_currentImage->_palette[color + 0] = vm->_currentImage->_palette[color + 0] * 3 / 5;
+ vm->_currentImage->_palette[color + 1] = vm->_currentImage->_palette[color + 1] * 3 / 5;
+ vm->_currentImage->_palette[color + 2] = vm->_currentImage->_palette[color + 2] * 3 / 5;
+}
+
void GameManager::roomBrightness() {
- // STUB
+ const byte specialColors[2][18] = {
+ {0x42, 0x49, 0x55, 0x68, 0x50, 0x5d, 0x3c, 1},
+ {0x85, 0x91, 0x99, 0x92, 0x9b, 0x96, 0x9a, 0xa6,
+ 0xb0, 0xb4, 0xb5, 0xc2, 0xd1, 0xbe, 0xb6, 0xa8,
+ 0x6b, 1}
+ };
+ char sf;
+ int i;
+ if ((_currentRoom == _rooms[HOLD]) && (_state._benOverlay == 1)) {
+ if (_state._powerOff) {
+ for (int f = 16; f < 255; f++) {
+ i = 0;
+ do {
+ sf = specialColors[0][i] - 1;
+ i++;
+ } while (sf && (sf != f));
+ if (!sf)
+ dimColor(_vm, f);
+ }
+ }
+ if (!(_state._landingModuleEnergy && _rooms[LANDINGMODULE]->isSectionVisible(7))) {
+ i = 0;
+ while (sf = specialColors[0][i] - 1) {
+ dimColor(_vm, sf);
+ i++;
+ };
+ }
+ } else if ((_currentRoom == _rooms[LANDINGMODULE]) && (_state._benOverlay == 1)) {
+ if (!(_state._landingModuleEnergy && _rooms[LANDINGMODULE]->isSectionVisible(7))) {
+ for (int f = 16; f < 255; f++) {
+ i=0;
+ do {
+ sf = specialColors[1][i] - 1;
+ i++;
+ } while (sf && (sf != f));
+ if (!sf)
+ dimColor(_vm, f);
+ }
+ }
+ if (_state._powerOff) {
+ i=0;
+ while (sf = specialColors[1][i] - 1) {
+ dimColor(_vm, sf);
+ i++;
+ };
+ }
+ } else if ((_currentRoom == _rooms[CAVE]) && (_state._benOverlay == 1)) {
+ _vm->_brightness = 0;
+ } else if ((_currentRoom != _rooms[OUTSIDE]) &&
+ (_currentRoom < _rooms[ROCKS]) && (_state._benOverlay == 1)) {
+ if (_state._powerOff)
+ for (int f = 16; f < 255; f++)
+ dimColor(_vm, f);
+ } else if ((_currentRoom == _rooms[GUARD3]) && (_state._benOverlay == 2)) {
+ if (_state._powerOff)
+ _vm->_brightness = 0;
+ }
+
+ _vm->paletteBrightness();
}
void GameManager::loadTime() {
- _state.timeStarting += _state.time;
- if (_state.eventTime != 1)
- _state.eventTime += _state.time;
- _state.timeAlarmSystem = _state.timeAlarm + _state.timeStarting;
+ _state._timeStarting += _state._time;
+ if (_state._eventTime != 1)
+ _state._eventTime += _state._time;
+ _state._timeAlarmSystem = _state._timeAlarm + _state._timeStarting;
}
void GameManager::saveTime() {
@@ -843,8 +912,7 @@ void GameManager::errorTemp() {
}
void GameManager::wait2(int ticks) {
- // 1 tick = 1/18.2s
- uint end = g_system->getMillis() + (55 * ticks);
+ uint end = g_system->getMillis() + ticksToMsec(ticks);
while (g_system->getMillis() < end) {
_vm->updateEvents();
g_system->updateScreen();
@@ -853,12 +921,12 @@ void GameManager::wait2(int ticks) {
}
void GameManager::setAnimationTimer(int ticks) {
- _animationTimer = g_system->getMillis() + (55 * ticks);
+ _animationTimer = g_system->getMillis() + ticksToMsec(ticks);
}
void GameManager::handleTime() {
- _state.time = g_system->getMillis();
- if (_animationTimer <= _state.time)
+ _state._time = g_system->getMillis();
+ if (_animationTimer <= _state._time)
_animationTimer = 0;
}
@@ -998,7 +1066,7 @@ void GameManager::shot(int a, int b) {
}
void GameManager::takeMoney(int amount) {
- _state.money += amount;
+ _state._money += amount;
if (amount > 0)
great(0);
// TODO: kmaxobject - 1?
@@ -1007,7 +1075,7 @@ void GameManager::takeMoney(int amount) {
// strcpy(raumz[OFFICE_R1]->object[5].name,ltoa((long)_state.money));
// strcat(raumz[OFFICE_R1]->object[5].name," Xa");
- if (_state.money) {
+ if (_state._money) {
if (!_rooms[OFFICE_R1]->getObject(5)->hasProperty(CARRIED))
takeObject(*_rooms[OFFICE_R1]->getObject(5));
} else {
@@ -1134,13 +1202,13 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) {
_vm->renderMessage("Du iát die Tablette und merkst,|daá sich irgendetwas ver„ndert hat.");
great(0);
_inventory.remove(obj1);
- _state.language = 2;
+ _state._language = 2;
takeObject(*_rooms[ENTRANCE]->getObject(17));
}
} else if ((verb == ACTION_LOOK) && (obj1._id == PILL_HULL) &&
- (_state.language == 2)) {
+ (_state._language == 2)) {
_vm->renderMessage("Komisch! Auf einmal kannst du die Schrift lesen!|Darauf steht:\"Wenn Sie diese Schrift jetzt|lesen k”nnen, hat die Tablette gewirkt.\"");
- _state.language = 1;
+ _state._language = 1;
} else if ((verb == ACTION_OPEN) && (obj1._id == WALLET)) {
if (!_rooms[ROGER]->getObject(3)->hasProperty(CARRIED)) {
_vm->renderMessage("Das muát du erst nehmen.");
@@ -1175,8 +1243,8 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) {
"Es ist eine Uhr mit extra|lautem Wecker. "
"Sie hat einen|Knopf zum Verstellen der Alarmzeit.|"
"Uhrzeit: %s Alarmzeit: %s",
- timeToString(_state.time + _state.timeStarting).c_str(),
- timeToString(_state.timeAlarm).c_str()).c_str());
+ timeToString(_state._time + _state._timeStarting).c_str(),
+ timeToString(_state._timeAlarm).c_str()).c_str());
} else if ((verb == ACTION_PRESS) && (obj1._id == WATCH)) {
char *min;
int hours, minutes;
@@ -1185,6 +1253,7 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) {
_vm->saveScreen(88, 87, 144, 24);
_vm->renderBox(88, 87, 144, 24, kColorWhite35);
_vm->renderText("Neue Alarmzeit (hh:mm) :", 91, 90, kColorWhite99);
+ // TODO: Adjust for msec time instead of ticks
do {
_vm->renderBox(91, 99, 138, 9, kColorDarkBlue);
do {
@@ -1206,19 +1275,22 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) {
}
for (uint i = 0; i < strlen(t); i++)
- if ((t[i] < '0') || (t[i] > '9')) f = true;
+ if ((t[i] < '0') || (t[i] > '9'))
+ f = true;
for (uint i = 0; i < strlen(min); i++)
- if ((min[i] < '0') || (min[i] > '9')) f = true;
+ if ((min[i] < '0') || (min[i] > '9'))
+ f = true;
hours = atoi(t);
minutes = atoi(min);
- if ((hours > 23) || (minutes > 59)) f = true;
+ if ((hours > 23) || (minutes > 59))
+ f = true;
animationOn();
} while (f && (_key.keycode != Common::KEYCODE_ESCAPE));
_vm->restoreScreen();
if (_key.keycode != Common::KEYCODE_ESCAPE) {
- _state.timeAlarm = (hours * 60 + minutes) * 1092.3888 + 8;
- _state.timeAlarmSystem = _state.timeAlarm + _state.timeStarting;
- _state.alarmOn = (_state.timeAlarmSystem > _vm->getDOSTicks());
+ _state._timeAlarm = (hours * 60 + minutes) * 60 + 8;
+ _state._timeAlarmSystem = _state._timeAlarm + _state._timeStarting;
+ _state._alarmOn = (_state._timeAlarmSystem > _vm->_system->getMillis());
}
} else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, TERMINALSTRIP, WIRE)) {
r = _rooms[CABIN_L3];
@@ -1231,8 +1303,8 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) {
r->getObject(8)->_name = "Leitung mit Lsterklemme";
r = _rooms[HOLD];
_inventory.remove(*r->getObject(2));
- _state.terminalStripConnected = true;
- _state.terminalStripWire = true;
+ _state._terminalStripConnected = true;
+ _state._terminalStripWire = true;
_vm->renderMessage("Ok.");
}
} else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, TERMINALSTRIP, SPOOL)) {
@@ -1241,11 +1313,11 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) {
r->getObject(9)->_name = "Kabelrolle mit Lsterklemme";
r = _rooms[HOLD];
_inventory.remove(*r->getObject(2));
- _state.terminalStripConnected = true;
+ _state._terminalStripConnected = true;
_vm->renderMessage("Ok.");
} else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, WIRE, SPOOL)) {
r = _rooms[CABIN_L3];
- if (!_state.terminalStripConnected) {
+ if (!_state._terminalStripConnected) {
if (r->isSectionVisible(26))
_vm->renderMessage("Womit denn?");
else
@@ -1260,7 +1332,7 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) {
r->getObject(8)->_name = "langes Kabel mit Stecker";
r = _rooms[CABIN_L2];
_inventory.remove(*r->getObject(9));
- _state.cableConnected = true;
+ _state._cableConnected = true;
_vm->renderMessage("Ok.");
}
}
diff --git a/engines/supernova/state.h b/engines/supernova/state.h
index 4ab3cf12b6..9e91ff3a78 100644
--- a/engines/supernova/state.h
+++ b/engines/supernova/state.h
@@ -29,33 +29,33 @@
namespace Supernova {
struct GameState {
- int32 time;
- int32 timeSleep;
- int32 timeStarting;
- int32 timeAlarm;
- int32 timeAlarmSystem;
- int32 eventTime;
- int32 shipEnergy;
- int32 landingModuleEnergy;
- uint16 greatFlag;
- int16 timeRobot;
- int16 money;
- byte coins;
- byte shoes;
- byte nameSeen;
- byte destination;
- byte benOverlay;
- byte language;
- bool corridorSearch;
- bool alarmOn;
- bool terminalStripConnected;
- bool terminalStripWire;
- bool cableConnected;
- bool powerOff;
- bool cockpitSeen;
- bool airlockSeen;
- bool holdSeen;
- bool dream;
+ int32 _time;
+ int32 _timeSleep;
+ int32 _timeStarting;
+ int32 _timeAlarm;
+ int32 _timeAlarmSystem;
+ int32 _eventTime;
+ int32 _shipEnergy;
+ int32 _landingModuleEnergy;
+ uint16 _greatFlag;
+ int16 _timeRobot;
+ int16 _money;
+ byte _coins;
+ byte _shoes;
+ byte _nameSeen;
+ byte _destination;
+ byte _benOverlay;
+ byte _language;
+ bool _corridorSearch;
+ bool _alarmOn;
+ bool _terminalStripConnected;
+ bool _terminalStripWire;
+ bool _cableConnected;
+ bool _powerOff;
+ bool _cockpitSeen;
+ bool _airlockSeen;
+ bool _holdSeen;
+ bool _dream;
};
class Inventory {