diff options
author | Joseph-Eugene Winzer | 2017-08-25 18:33:12 +0200 |
---|---|---|
committer | Thierry Crozat | 2018-01-23 01:47:02 +0000 |
commit | b948a53f2ff69a2139e4377aa103f77de68d6c29 (patch) | |
tree | e8989e7ed0e3a4107f3e0259fe8b777277a9ce94 | |
parent | 714b38dde4e016f5b474d6fc4846008b13579162 (diff) | |
download | scummvm-rg350-b948a53f2ff69a2139e4377aa103f77de68d6c29.tar.gz scummvm-rg350-b948a53f2ff69a2139e4377aa103f77de68d6c29.tar.bz2 scummvm-rg350-b948a53f2ff69a2139e4377aa103f77de68d6c29.zip |
SUPERNOVA: Substitutes static variables with privates
-rw-r--r-- | engines/supernova/rooms.cpp | 43 | ||||
-rw-r--r-- | engines/supernova/rooms.h | 9 |
2 files changed, 28 insertions, 24 deletions
diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp index 65a4f17cfd..2e2dd5a377 100644 --- a/engines/supernova/rooms.cpp +++ b/engines/supernova/rooms.cpp @@ -254,7 +254,6 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) { } void ShipSleepCabin::animation() { - static char color; if (_gm->_state._powerOff && _gm->_state._arrivalDaysLeft) { if (_gm->_guiEnabled) { if (isSectionVisible(1)) { @@ -265,13 +264,13 @@ void ShipSleepCabin::animation() { setSectionVisible(2, false); } } else { - if (color == kColorLightRed) { - color = kColorDarkBlue; + if (_color == kColorLightRed) { + _color = kColorDarkBlue; } else { - color = kColorLightRed; + _color = kColorLightRed; } - _vm->renderText("Achtung", 60, 75, color); + _vm->renderText("Achtung", 60, 75, _color); } } else if (isSectionVisible(5) && _gm->_guiEnabled) { if (isSectionVisible(4)) @@ -332,17 +331,15 @@ bool ShipCockpit::interact(Action verb, Object &obj1, Object &obj2) { return true; } void ShipCockpit::animation() { - static byte color; - if (!_gm->_guiEnabled) { - if (color) { - color = kColorBlack; + if (_color) { + _color = kColorBlack; _gm->setAnimationTimer(5); } else { - color = kColorLightYellow; + _color = kColorLightYellow; _gm->setAnimationTimer(10); } - _vm->renderText("Achtung: Triebwerke funktionsunf\204hig", 50, 145, color); + _vm->renderText("Achtung: Triebwerke funktionsunf\204hig", 50, 145, _color); } else { if (isSectionVisible(21)) { _gm->drawImage(_gm->invertSection(21)); @@ -354,8 +351,8 @@ void ShipCockpit::animation() { } if (_gm->_state._powerOff) { if (!_gm->_guiEnabled) { - _vm->renderText("Energievorrat ersch\224pft", 97, 165, color); - _vm->renderText("Notstromversorgung aktiv", 97, 175, color); + _vm->renderText("Energievorrat ersch\224pft", 97, 165, _color); + _vm->renderText("Notstromversorgung aktiv", 97, 175, _color); } else { if (isSectionVisible(21)) _gm->drawImage(22); @@ -682,13 +679,11 @@ void ShipAirlock::onEntrance() { } bool ShipHold::interact(Action verb, Object &obj1, Object &obj2) { - static char beschr2[] = "Ein St\201ck Schrott."; - Room *r; + Room *room; - if ((verb == ACTION_LOOK) && (obj1._id == SCRAP_LK) && - (obj1._description != beschr2)) { + if ((verb == ACTION_LOOK) && (obj1._id == SCRAP_LK) && (obj1._description != _descriptionScrap)) { _vm->renderMessage(obj1._description.c_str()); - obj1._description = beschr2; + obj1._description = _descriptionScrap; _gm->takeObject(*getObject(2)); } else if (((verb == ACTION_OPEN) || (verb == ACTION_CLOSE)) && (obj1._id == OUTERHATCH_TOP)) { @@ -712,16 +707,16 @@ bool ShipHold::interact(Action verb, Object &obj1, Object &obj2) { _gm->drawImage(5); getObject(0)->_name = "langes Kabel mit Stecker"; getObject(0)->_click = 10; - r = _gm->_rooms[CABIN_L2]; + room = _gm->_rooms[CABIN_L2]; _gm->_inventory.remove(*getObject(9)); } } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, HOLD_WIRE, GENERATOR_TOP)) { if (isSectionVisible(5)) { - r = _gm->_rooms[GENERATOR]; - r->getObject(0)->_click = 15; - r->getObject(1)->_click = 13; - r->setSectionVisible(6, false); - r->setSectionVisible(8, false); + room = _gm->_rooms[GENERATOR]; + room->getObject(0)->_click = 15; + room->getObject(1)->_click = 13; + room->setSectionVisible(6, false); + room->setSectionVisible(8, false); _gm->drawImage(_gm->invertSection(5)); _gm->drawImage(6); setSectionVisible(4, false); diff --git a/engines/supernova/rooms.h b/engines/supernova/rooms.h index b66e8165f2..f19f9c3e95 100644 --- a/engines/supernova/rooms.h +++ b/engines/supernova/rooms.h @@ -181,6 +181,7 @@ public: private: Common::String _codeword_DE; Common::String _codeword_EN; + byte _color; }; class ShipCockpit : public Room { @@ -201,6 +202,9 @@ public: virtual bool interact(Action verb, Object &obj1, Object &obj2); virtual void animation(); virtual void onEntrance(); + +private: + byte _color; }; class ShipCabinL1: public Room { @@ -496,10 +500,15 @@ public: _objectState[9] = Object("Ausgang",Object::defaultDescription,NULLOBJECT,EXIT,255,255,0,AIRLOCK,22); _objectState[10] = Object("Luke","Sie f\201hrt nach drau\341en.",OUTERHATCH_TOP,EXIT | OPENABLE | OPENED,3,3,0,GENERATOR,8); _objectState[11] = Object("Generator","Er versorgt das Raumschiff mit Strom.",GENERATOR_TOP,EXIT,12,12,0,GENERATOR,8); + + _descriptionScrap = "Ein St\201ck Schrott."; } virtual bool interact(Action verb, Object &obj1, Object &obj2); virtual void onEntrance(); + +private: + Common::String _descriptionScrap; }; class ShipLandingModule : public Room { |