aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-07-25 02:03:35 +0200
committerThierry Crozat2018-01-23 00:28:29 +0000
commit4227195a82098a095a310efbf71b83a63c97db3b (patch)
treecdb1fc7d5ce633790381839d6b08501c44bd525a /engines
parentdaf55369a9a454607ed649c8fd102ef3b7826dd4 (diff)
downloadscummvm-rg350-4227195a82098a095a310efbf71b83a63c97db3b.tar.gz
scummvm-rg350-4227195a82098a095a310efbf71b83a63c97db3b.tar.bz2
scummvm-rg350-4227195a82098a095a310efbf71b83a63c97db3b.zip
SUPERNOVA: Rewrites animation for Cockpit and SleepCabin
Diffstat (limited to 'engines')
-rw-r--r--engines/supernova/rooms.cpp30
-rw-r--r--engines/supernova/state.cpp4
-rw-r--r--engines/supernova/state.h3
3 files changed, 21 insertions, 16 deletions
diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp
index 2a05471e3d..41210d54bc 100644
--- a/engines/supernova/rooms.cpp
+++ b/engines/supernova/rooms.cpp
@@ -264,26 +264,26 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
void ShipSleepCabin::animation() {
static char color;
- if (isSectionVisible(kMaxSection - 1)) {
+ if (!_gm->_guiEnabled) {
if (color) {
color = kColorBlack;
- _gm->_timer2 = 5;
+ _gm->setAnimationTimer(5);
} else {
color = kColorLightYellow;
- _gm->_timer2 = 10;
+ _gm->setAnimationTimer(10);
}
_vm->renderText("Achtung: Triebwerke funktionsunfähig",50,145,color);
} else {
if (isSectionVisible(21)) {
_gm->drawImage(_gm->invertSection(21));
- _gm->_timer2 = 5;
+ _gm->setAnimationTimer(5);
} else {
_gm->drawImage(21);
- _gm->_timer2 = 10;
+ _gm->setAnimationTimer(10);
}
}
if (_gm->_state.powerOff) {
- if (isSectionVisible(kMaxSection - 1)) {
+ if (!_gm->_guiEnabled) {
_vm->renderText("Energievorrat erschöpft",97,165,color);
_vm->renderText("Notstromversorgung aktiv",97,175,color);
} else {
@@ -350,28 +350,28 @@ bool ShipCockpit::interact(Action verb, Object &obj1, Object &obj2) {
return true;
}
void ShipCockpit::animation() {
- static char color;
+ static byte color;
- if (isSectionVisible(kMaxSection - 1)) {
+ if (!_gm->_guiEnabled) {
if (color) {
- color = 0;
- _gm->_timer2 = 5;
+ color = kColorBlack;
+ _gm->setAnimationTimer(5);
} else {
- color = 14;
- _gm->_timer2 = 10;
+ color = kColorLightYellow;
+ _gm->setAnimationTimer(10);
}
_vm->renderText("Achtung: Triebwerke funktionsunf„hig", 50, 145, color);
} else {
if (isSectionVisible(21)) {
_gm->drawImage(_gm->invertSection(21));
- _gm->_timer2 = 5;
+ _gm->setAnimationTimer(5);
} else {
_gm->drawImage(21);
- _gm->_timer2 = 10;
+ _gm->setAnimationTimer(10);
}
}
if (_gm->_state.powerOff) {
- if (isSectionVisible(kMaxSection - 1)) {
+ if (!_gm->_guiEnabled) {
_vm->renderText("Energievorrat ersch”pft", 97, 165, color);
_vm->renderText("Notstromversorgung aktiv", 97, 175, color);
} else {
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 2b79bb1aed..45a20696af 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -560,6 +560,10 @@ void GameManager::wait2(int ticks) {
}
}
+void GameManager::setAnimationTimer(int ticks) {
+ _animationTimer = g_system->getMillis() + (55 * ticks);
+}
+
void GameManager::screenShake() {
// STUB
}
diff --git a/engines/supernova/state.h b/engines/supernova/state.h
index d37069efa8..79b8a8e70d 100644
--- a/engines/supernova/state.h
+++ b/engines/supernova/state.h
@@ -123,7 +123,7 @@ public:
bool _newRoom;
bool _newOverlay;
int _timer1;
- int _timer2;
+ int _animationTimer;
int _inventoryScroll;
int _exitList[25];
GuiElement _guiCommandButton[10];
@@ -169,6 +169,7 @@ public:
void drawImage(int section);
void changeRoom(RoomID id);
void resetInputState();
+ void setAnimationTimer(int ticks);
};
}