diff options
author | Joseph-Eugene Winzer | 2018-03-09 11:20:47 +0100 |
---|---|---|
committer | Joseph-Eugene Winzer | 2018-03-11 23:25:00 +0100 |
commit | a38db245ed349e1088dbeec8c41dd0c4c7549ade (patch) | |
tree | 982313561dd30b86e6983bd6f92a189cd4f21ec9 /engines/supernova | |
parent | 0770800844854ade735524b33e04b0a7858eefe7 (diff) | |
download | scummvm-rg350-a38db245ed349e1088dbeec8c41dd0c4c7549ade.tar.gz scummvm-rg350-a38db245ed349e1088dbeec8c41dd0c4c7549ade.tar.bz2 scummvm-rg350-a38db245ed349e1088dbeec8c41dd0c4c7549ade.zip |
SUPERNOVA: Fixes formatting
Because of confusion when indentation level is raised and thus tabs or
spaces should be used when aligning code, this commit switches to tabs
to avoid any further confusion.
Diffstat (limited to 'engines/supernova')
-rw-r--r-- | engines/supernova/detection.cpp | 16 | ||||
-rw-r--r-- | engines/supernova/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/supernova/msn_def.h | 4 | ||||
-rw-r--r-- | engines/supernova/rooms.cpp | 118 | ||||
-rw-r--r-- | engines/supernova/rooms.h | 8 | ||||
-rw-r--r-- | engines/supernova/state.cpp | 118 | ||||
-rw-r--r-- | engines/supernova/state.h | 4 | ||||
-rw-r--r-- | engines/supernova/supernova.cpp | 34 | ||||
-rw-r--r-- | engines/supernova/supernova.h | 10 |
9 files changed, 157 insertions, 157 deletions
diff --git a/engines/supernova/detection.cpp b/engines/supernova/detection.cpp index 61a99f083c..8e9db14db4 100644 --- a/engines/supernova/detection.cpp +++ b/engines/supernova/detection.cpp @@ -30,9 +30,9 @@ #include "supernova/supernova.h" static const PlainGameDescriptor supernovaGames[] = { - {"msn1", "Mission Supernova 1"}, - {"msn2", "Mission Supernova 2"}, - {NULL, NULL} + {"msn1", "Mission Supernova 1"}, + {"msn2", "Mission Supernova 2"}, + {NULL, NULL} }; namespace Supernova { @@ -133,7 +133,7 @@ SaveStateList SupernovaMetaEngine::listSaves(const char *target) const { SaveStateList saveFileList; for (Common::StringArray::const_iterator file = filenames.begin(); - file != filenames.end(); ++file) { + file != filenames.end(); ++file) { int saveSlot = atoi(file->c_str() + file->size() - 3); if (saveSlot >= 0 && saveSlot <= getMaximumSaveSlot()) { Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading(*file); @@ -166,7 +166,7 @@ void SupernovaMetaEngine::removeSaveState(const char *target, int slot) const { SaveStateDescriptor SupernovaMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("msn_save.%03d", slot); Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading(fileName); - + if (savefile) { uint saveHeader = savefile->readUint32LE(); if (saveHeader != SAVEGAME_HEADER) { @@ -178,7 +178,7 @@ SaveStateDescriptor SupernovaMetaEngine::querySaveMetaInfos(const char *target, delete savefile; return SaveStateDescriptor(); } - + int descriptionSize = savefile->readSint16LE(); char* description = new char[descriptionSize]; savefile->read(description, descriptionSize); @@ -205,10 +205,10 @@ SaveStateDescriptor SupernovaMetaEngine::querySaveMetaInfos(const char *target, } delete savefile; - + return desc; } - + return SaveStateDescriptor(); } diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp index d7839c1dcb..3a29bacacc 100644 --- a/engines/supernova/graphics.cpp +++ b/engines/supernova/graphics.cpp @@ -248,7 +248,7 @@ void MSNImageDecoder::destroy() { _encodedImage = NULL; } for (Common::Array<Graphics::Surface *>::iterator it = _sectionSurfaces.begin(); - it != _sectionSurfaces.end(); ++it) { + it != _sectionSurfaces.end(); ++it) { (*it)->free(); } } diff --git a/engines/supernova/msn_def.h b/engines/supernova/msn_def.h index c2086cd4f8..c18baa068c 100644 --- a/engines/supernova/msn_def.h +++ b/engines/supernova/msn_def.h @@ -583,7 +583,7 @@ struct Object { , _direction(0) {} Object(byte roomId, StringID name, StringID description, ObjectID id, ObjectType type, - byte click, byte click2, byte section = 0, RoomID exitRoom = NULLROOM, byte direction = 0) + byte click, byte click2, byte section = 0, RoomID exitRoom = NULLROOM, byte direction = 0) : _name(name) , _description(description) , _id(id) @@ -621,7 +621,7 @@ struct Object { static bool combine(Object &obj1, Object &obj2, ObjectID id1, ObjectID id2) { if (obj1.hasProperty(COMBINABLE)) return (((obj1._id == id1) && (obj2._id == id2)) || - ((obj1._id == id2) && (obj2._id == id1))); + ((obj1._id == id2) && (obj2._id == id1))); else return false; } diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp index dc6721ceda..ce06f442c2 100644 --- a/engines/supernova/rooms.cpp +++ b/engines/supernova/rooms.cpp @@ -118,7 +118,7 @@ Intro::Intro(SupernovaEngine *vm, GameManager *gm) { TAKE | COMBINABLE, 255, 255, 0, NULLROOM, 0); _objectState[4] = Object(_id, kStringInventoryMoney, kStringDefaultDescription, MONEY, - TAKE | COMBINABLE, 255, 255, 0); + TAKE | COMBINABLE, 255, 255, 0); _shouldExit = false; @@ -155,12 +155,12 @@ public: }; Marquee(SupernovaEngine *vm, MarqueeIndex id, const char *text) - : _text(text) - , _textBegin(text) - , _delay(0) - , _color(kColorLightBlue) - , _loop(false) - , _vm(vm) + : _text(text) + , _textBegin(text) + , _delay(0) + , _color(kColorLightBlue) + , _loop(false) + , _vm(vm) { if (id == kMarqueeIntro) { _y = 191; @@ -315,7 +315,7 @@ bool Intro::animate(int section1, int section2, int duration) { } bool Intro::animate(int section1, int section2, int duration, - MessagePosition position, StringID textId) { + MessagePosition position, StringID textId) { Common::KeyCode key = Common::KEYCODE_INVALID; const Common::String& text = _vm->getGameString(textId); _vm->renderMessage(text, position); @@ -340,7 +340,7 @@ bool Intro::animate(int section1, int section2, int duration, } bool Intro::animate(int section1, int section2, int section3, int section4, - int duration, MessagePosition position, StringID textId) { + int duration, MessagePosition position, StringID textId) { Common::KeyCode key = Common::KEYCODE_INVALID; const Common::String& text = _vm->getGameString(textId); _vm->renderMessage(text, position); @@ -690,7 +690,7 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) { // Sleep duration in days _vm->renderText(kStringShipSleepCabin4, 30, 85, kColorWhite99); _vm->renderText(Common::String::format("%d",_gm->_state._timeSleep).c_str(), - 150, 85, kColorWhite99); + 150, 85, kColorWhite99); _vm->renderText(kStringShipSleepCabin5, 30, 105, kColorWhite99); _gm->getInput(); } else { @@ -737,7 +737,7 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) { _gm->_guiEnabled = true; input.clear(); } else if (((verb == ACTION_WALK) || (verb == ACTION_USE)) && - ((obj1._id == CABINS) || (obj1._id == CABIN))) { + ((obj1._id == CABINS) || (obj1._id == CABIN))) { room = _gm->_rooms[AIRLOCK]; if (!(obj1._id == CABIN) || !isSectionVisible(5)) { _vm->renderMessage(kStringShipSleepCabin10); @@ -889,7 +889,7 @@ bool ShipCockpit::interact(Action verb, Object &obj1, Object &obj2) { _vm->renderText(kStringShipCockpit6); _vm->renderText(kStringShipCockpit7, 50, 110, kColorLightYellow); _vm->renderText(Common::String::format("%d", _gm->_state._arrivalDaysLeft).c_str(), - 50, 120, kColorLightYellow); + 50, 120, kColorLightYellow); _vm->renderText(kStringShipCockpit8); _gm->getInput(); @@ -1196,8 +1196,8 @@ bool ShipAirlock::interact(Action verb, Object &obj1, Object &obj2) { _vm->renderImage(_gm->invertSection(4)); r = _gm->_rooms[AIRLOCK]; if (!r->getObject(4)->hasProperty(WORN) || - !r->getObject(5)->hasProperty(WORN) || - !r->getObject(6)->hasProperty(WORN)) { + !r->getObject(5)->hasProperty(WORN) || + !r->getObject(6)->hasProperty(WORN)) { _gm->dead(kStringShipAirlock1); return true; } @@ -1231,7 +1231,7 @@ bool ShipHold::interact(Action verb, Object &obj1, Object &obj2) { else if ((verb == ACTION_CLOSE) && (obj1._id == LANDINGMOD_HATCH) && (isSectionVisible(4) || isSectionVisible(6))) _vm->renderMessage(kStringCable1); else if (((verb == ACTION_TAKE) && (obj1._id == HOLD_WIRE)) || - ((verb == ACTION_USE) && Object::combine(obj1, obj2, HOLD_WIRE, LANDINGMOD_HATCH))) + ((verb == ACTION_USE) && Object::combine(obj1, obj2, HOLD_WIRE, LANDINGMOD_HATCH))) _vm->renderMessage(kStringCable2); else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, TERMINALSTRIP, HOLD_WIRE)) { getObject(0)->_name = kStringWireAndClip; @@ -1404,7 +1404,7 @@ bool ShipGenerator::interact(Action verb, Object &obj1, Object &obj2) { _vm->playSound(kAudioDoorClose); } } else if ((verb == ACTION_WALK) && (obj1._id == OUTERHATCH) && - isSectionVisible(7)) { + isSectionVisible(7)) { if (!obj1.hasProperty(OPENED)) _vm->renderMessage(kStringShipHold9); else if (!isSectionVisible(11)) @@ -1416,13 +1416,13 @@ bool ShipGenerator::interact(Action verb, Object &obj1, Object &obj2) { } else if ((verb == ACTION_TAKE) && (obj1._id == GENERATOR_WIRE)) _vm->renderMessage(kStringCable2); else if ((verb == ACTION_PULL) && (obj1._id == SHORT_WIRE) && - (obj1._click != 11)) { + (obj1._click != 11)) { _vm->renderImage(3); _vm->renderImage(4); obj1._click = 11; _gm->turnOff(); } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, SHORT_WIRE, CLIP) && - (getObject(11)->_click == 11) && !isSectionVisible(9)) { + (getObject(11)->_click == 11) && !isSectionVisible(9)) { _vm->renderImage(2); setSectionVisible(3, false); setSectionVisible(4, false); @@ -1451,7 +1451,7 @@ bool ShipGenerator::interact(Action verb, Object &obj1, Object &obj2) { return false; } } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, GENERATOR_WIRE, CLIP) && - isSectionVisible(3) && (getObject(0)->_click != 16)) { + isSectionVisible(3) && (getObject(0)->_click != 16)) { _vm->renderImage(_gm->invertSection(8)); _vm->renderImage(2); setSectionVisible(4, false); @@ -1475,9 +1475,9 @@ bool ShipGenerator::interact(Action verb, Object &obj1, Object &obj2) { _gm->turnOff(); _gm->_rooms[HOLD]->setSectionVisible(7, false); } else if ((verb == ACTION_USE) && - (Object::combine(obj1, obj2, WIRE, CLIP) || - Object::combine(obj1, obj2, SPOOL, CLIP)) && - isSectionVisible(3)) { + (Object::combine(obj1, obj2, WIRE, CLIP) || + Object::combine(obj1, obj2, SPOOL, CLIP)) && + isSectionVisible(3)) { _vm->renderMessage(kStringShipHold11); } else if ((verb == ACTION_LOOK) && (obj1._id == VOLTMETER)) { if (_gm->_state._powerOff) @@ -1523,7 +1523,7 @@ void ArsanoRocks::onEntrance() { bool ArsanoRocks::interact(Action verb, Object &obj1, Object &obj2) { if (((verb == ACTION_PULL) || (verb == ACTION_PRESS)) && - (obj1._id == STONE) && !isSectionVisible(3)) { + (obj1._id == STONE) && !isSectionVisible(3)) { _vm->renderImage(1); _gm->wait2(2); _vm->renderImage(2); @@ -1568,8 +1568,8 @@ void ArsanoMeetup::animation() { bool ArsanoMeetup::interact(Action verb, Object &obj1, Object &obj2) { if ((verb == ACTION_WALK) && - ((obj1._id == SPACESHIPS) || - ((obj1._id == SPACESHIP) && !obj1.hasProperty(OPENED)))) { + ((obj1._id == SPACESHIPS) || + ((obj1._id == SPACESHIP) && !obj1.hasProperty(OPENED)))) { _vm->renderMessage(kStringArsanoMeetup1); } else if ((verb == ACTION_WALK) && (obj1._id == SPACESHIP)) _gm->changeRoom(GLIDER); @@ -1819,8 +1819,8 @@ bool ArsanoEntrance::interact(Action verb, Object &obj1, Object &obj2) { _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)) && - (_gm->_rooms[AIRLOCK]->getObject(6)->hasProperty(WORN)))) { + (_gm->_rooms[AIRLOCK]->getObject(5)->hasProperty(WORN)) && + (_gm->_rooms[AIRLOCK]->getObject(6)->hasProperty(WORN)))) { _vm->renderMessage(kStringArsanoEntrance26); _gm->_rooms[AIRLOCK]->getObject(4)->setProperty(WORN); _gm->_rooms[AIRLOCK]->getObject(5)->setProperty(WORN); @@ -2084,7 +2084,7 @@ bool ArsanoRoger::interact(Action verb, Object &obj1, Object &obj2) { } } } else if (((verb == ACTION_USE) && Object::combine(obj1, obj2, CHESS, ROGER_W)) || - ((verb == ACTION_GIVE) && (obj1._id == CHESS) && (obj2._id == ROGER_W))) { + ((verb == ACTION_GIVE) && (obj1._id == CHESS) && (obj2._id == ROGER_W))) { _vm->renderImage(11); _gm->great(0); _gm->say(kStringArsanoRoger36); @@ -2141,7 +2141,7 @@ bool ArsanoGlider::interact(Action verb, Object &obj1, Object &obj2) { getObject(5)->_click = 10; _gm->_inventory.remove(*_gm->_rooms[ROGER]->getObject(8)); } else if (((verb == ACTION_TAKE) || (verb == ACTION_PULL)) && - (obj1._id == GLIDER_KEYCARD)) { + (obj1._id == GLIDER_KEYCARD)) { _vm->renderImage(_gm->invertSection(5)); _vm->renderImage(_gm->invertSection(8)); getObject(5)->_click = 255; @@ -2150,7 +2150,7 @@ bool ArsanoGlider::interact(Action verb, Object &obj1, Object &obj2) { _vm->renderImage(_gm->invertSection(i)); l = r = 0; } else if ((verb == ACTION_PRESS) && - (obj1._id >= GLIDER_BUTTON1) && (obj1._id <= GLIDER_BUTTON4)) { + (obj1._id >= GLIDER_BUTTON1) && (obj1._id <= GLIDER_BUTTON4)) { int i = obj1._id - GLIDER_BUTTON1 + 1; _vm->renderImage(i); if (isSectionVisible(8)) { @@ -2217,8 +2217,8 @@ bool ArsanoMeetup2::interact(Action verb, Object &obj1, Object &obj2) { static byte row4[6] = {2, 1, 0, 0, 0, 0}; if (((verb == ACTION_WALK) && - ((obj1._id == SPACESHIP) || (obj1._id == ROGER_W))) || - ((verb == ACTION_TALK) && (obj1._id == ROGER_W))) { + ((obj1._id == SPACESHIP) || (obj1._id == ROGER_W))) || + ((verb == ACTION_TALK) && (obj1._id == ROGER_W))) { _gm->changeRoom(INTRO); _vm->setCurrentImage(30); _vm->renderImage(0); @@ -2512,7 +2512,7 @@ void AxacussCell::animation() { } if ((isSectionVisible(6)) && - ((_gm->_state._timeRobot == 310) || (_gm->_state._timeRobot == 610))) { + ((_gm->_state._timeRobot == 310) || (_gm->_state._timeRobot == 610))) { _vm->playSound(kAudioRobotShock); _gm->_state._timeRobot = 10000; } @@ -2524,9 +2524,9 @@ bool AxacussCell::interact(Action verb, Object &obj1, Object &obj2) { if ((verb == ACTION_PRESS) && (obj1._id == CELL_BUTTON)) _vm->renderMessage(kStringAxacussCell_2); else if ((verb == ACTION_PULL) && (obj1._id == CELL_WIRE) && - !isSectionVisible(2) && - !isSectionVisible(3) && - !isSectionVisible(5)) { + !isSectionVisible(2) && + !isSectionVisible(3) && + !isSectionVisible(5)) { if (isSectionVisible(1)) { _vm->renderImage(_gm->invertSection(1)); _vm->renderImage(2); @@ -2541,7 +2541,7 @@ bool AxacussCell::interact(Action verb, Object &obj1, Object &obj2) { getObject(5)->_click = 10; } } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, CELL_WIRE, SOCKET) && - !isSectionVisible(1) && !isSectionVisible(4) && !isSectionVisible(6)) { + !isSectionVisible(1) && !isSectionVisible(4) && !isSectionVisible(6)) { if (isSectionVisible(2)) { _vm->renderImage(_gm->invertSection(2)); _vm->renderImage(1); @@ -2560,7 +2560,7 @@ bool AxacussCell::interact(Action verb, Object &obj1, Object &obj2) { getObject(5)->_click = 9; } } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, CELL_WIRE, KNIFE) && - ((isSectionVisible(1)) || (isSectionVisible(2)))) { + ((isSectionVisible(1)) || (isSectionVisible(2)))) { if (isSectionVisible(1)) _gm->shock(); else { @@ -2569,10 +2569,10 @@ bool AxacussCell::interact(Action verb, Object &obj1, Object &obj2) { getObject(5)->_click = 8; } } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, CELL_WIRE, CELL_TABLE) && - !isSectionVisible(1) && - !isSectionVisible(2) && - !isSectionVisible(5) && - !isSectionVisible(6)) { + !isSectionVisible(1) && + !isSectionVisible(2) && + !isSectionVisible(5) && + !isSectionVisible(6)) { if (isSectionVisible(3)) { _vm->renderImage(_gm->invertSection(3)); _vm->renderImage(5); @@ -2649,7 +2649,7 @@ bool AxacussCorridor4::interact(Action verb, Object &obj1, Object &obj2) { if (isSectionVisible(29)) _vm->renderImage(29); } else if (((verb == ACTION_USE) && Object::combine(obj1, obj2, TABLE, WATCH)) || - ((verb == ACTION_GIVE) && (obj1._id == WATCH) && (obj2._id == TABLE))) { + ((verb == ACTION_GIVE) && (obj1._id == WATCH) && (obj2._id == TABLE))) { if (obj1._id == WATCH) _gm->_inventory.remove(obj1); else @@ -2754,7 +2754,7 @@ void AxacussCorridor6::onEntrance() { bool AxacussCorridor6::interact(Action verb, Object &obj1, Object &obj2) { if ((verb == ACTION_CLOSE) && (obj1._id == DOOR) && - (obj1.hasProperty(OPENED))) { + (obj1.hasProperty(OPENED))) { _vm->renderImage(6); setSectionVisible(7, false); obj1.resetProperty(EXIT | OPENABLE | CLOSED); @@ -2835,7 +2835,7 @@ void AxacussBcorridor::onEntrance() { bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) { if (obj1.hasProperty(EXIT) || - ((verb == ACTION_USE) && obj1.hasProperty(COMBINABLE) && obj2.hasProperty(EXIT))) { + ((verb == ACTION_USE) && obj1.hasProperty(COMBINABLE) && obj2.hasProperty(EXIT))) { _gm->_state._playerHidden = false; } @@ -2854,11 +2854,11 @@ bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) { _gm->_state._eventTime = kMaxTimerValue; } } else if (((verb == ACTION_WALK) || ((verb == ACTION_OPEN) && !obj1.hasProperty(OPENED))) && - (obj1._id >= DOOR1) && (obj1._id <= DOOR4) && - obj1.hasProperty(OCCUPIED)) { + (obj1._id >= DOOR1) && (obj1._id <= DOOR4) && + obj1.hasProperty(OCCUPIED)) { _vm->renderMessage(kStringDontEnter); } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, MASTERKEYCARD, DOOR1) && - !getObject(4)->hasProperty(OPENED)) { + !getObject(4)->hasProperty(OPENED)) { if (getObject(4)->hasProperty(OCCUPIED)) _vm->renderMessage(kStringDontEnter); else { @@ -2973,13 +2973,13 @@ bool AxacussExit::interact(Action verb, Object &obj1, Object &obj2) { bool AxacussOffice1::interact(Action verb, Object &obj1, Object &obj2) { Common::String input; if ((verb == ACTION_CLOSE) && (obj1._id == DOOR) && - obj1.hasProperty(OPENED)) { + obj1.hasProperty(OPENED)) { _vm->renderImage(_gm->invertSection(9)); obj1.disableProperty(OPENED); obj1.setProperty(CLOSED); _vm->playSound(kAudioDoorClose); } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, MASTERKEYCARD, DOOR) && - !getObject(0)->hasProperty(OPENED)) { + !getObject(0)->hasProperty(OPENED)) { _vm->renderImage(9); getObject(0)->disableProperty(CLOSED); getObject(0)->setProperty(OPENED); @@ -2994,8 +2994,8 @@ bool AxacussOffice1::interact(Action verb, Object &obj1, Object &obj2) { else _gm->telomat(0); } else if (((verb == ACTION_OPEN) || (verb == ACTION_USE)) && - (obj1._id == LOCKER) && - !obj1.hasProperty(OPENED)) { + (obj1._id == LOCKER) && + !obj1.hasProperty(OPENED)) { _vm->renderMessage(kStringAxacussOffice1_1); _vm->renderBox(160, 70, 70, 10, kColorDarkBlue); _gm->edit(input, 161, 71, 10); @@ -3057,7 +3057,7 @@ bool AxacussOffice1::interact(Action verb, Object &obj1, Object &obj2) { bool AxacussOffice2::interact(Action verb, Object &obj1, Object &obj2) { if ((verb == ACTION_CLOSE) && (obj1._id == DOOR) && - obj1.hasProperty(OPENED)) { + obj1.hasProperty(OPENED)) { _vm->renderImage(_gm->invertSection(9)); obj1.disableProperty(OPENED); obj1.setProperty(CLOSED); @@ -3084,13 +3084,13 @@ bool AxacussOffice2::interact(Action verb, Object &obj1, Object &obj2) { bool AxacussOffice3::interact(Action verb, Object &obj1, Object &obj2) { if ((verb == ACTION_CLOSE) && (obj1._id == DOOR) && - obj1.hasProperty(OPENED)) { + obj1.hasProperty(OPENED)) { _vm->renderImage(_gm->invertSection(3)); obj1.disableProperty(OPENED); obj1.setProperty(CLOSED); _vm->playSound(kAudioDoorClose); } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, MASTERKEYCARD, DOOR) && - !getObject(0)->hasProperty(OPENED)) { + !getObject(0)->hasProperty(OPENED)) { _vm->renderImage(3); getObject(0)->disableProperty(CLOSED); getObject(0)->setProperty(OPENED); @@ -3120,7 +3120,7 @@ bool AxacussOffice4::interact(Action verb, Object &obj1, Object &obj2) { obj1.setProperty(CLOSED); _vm->playSound(kAudioDoorClose); } else if ((verb == ACTION_USE) && Object::combine(obj1, obj2, MASTERKEYCARD, DOOR) && - !getObject(0)->hasProperty(OPENED)) { + !getObject(0)->hasProperty(OPENED)) { _vm->renderImage(3); getObject(0)->disableProperty(CLOSED); getObject(0)->setProperty(OPENED); @@ -3235,7 +3235,7 @@ bool AxacussStation::interact(Action verb, Object &obj1, Object &obj2) { bool AxacussSign::interact(Action verb, Object &obj1, Object &obj2) { if ((verb == ACTION_USE) && Object::combine(obj1, obj2, STATION_SLOT, MONEY) && - isSectionVisible(1)) { + isSectionVisible(1)) { _gm->takeMoney(-180); _vm->renderImage(2); setSectionVisible(1, false); @@ -3328,7 +3328,7 @@ void Outro::animate(int filenumber, int section1, int section2, int duration) { } void Outro::animate(int filenumber, int section1, int section2, int duration, - MessagePosition position, const char *text) { + MessagePosition position, const char *text) { _vm->renderMessage(text, position); int delay = (Common::strnlen(text, 512) + 20) * (10 - duration) * _vm->_textSpeed / 400; _vm->setCurrentImage(filenumber); @@ -3345,7 +3345,7 @@ void Outro::animate(int filenumber, int section1, int section2, int duration, } void Outro::animate(int filenumber, int section1, int section2, int section3, int section4, - int duration, MessagePosition position, const char *text) { + int duration, MessagePosition position, const char *text) { _vm->renderMessage(text, position); if (duration == 0) duration = (Common::strnlen(text, 512) + 20) * _vm->_textSpeed / 40; diff --git a/engines/supernova/rooms.h b/engines/supernova/rooms.h index 454034dccc..3cedc356db 100644 --- a/engines/supernova/rooms.h +++ b/engines/supernova/rooms.h @@ -129,9 +129,9 @@ public: private: bool animate(int section1, int section2, int duration); bool animate(int section1, int section2, int duration, MessagePosition position, - StringID text); + StringID text); bool animate(int section1, int section2, int section3, int section4, int duration, - MessagePosition position, StringID text); + MessagePosition position, StringID text); void titleScreen(); void titleFadeIn(); @@ -1377,9 +1377,9 @@ public: private: void animate(int filenumber, int section1, int section2, int duration); void animate(int filenumber, int section1, int section2, int duration, MessagePosition position, - const char *text); + const char *text); void animate(int filenumber, int section1, int section2, int section3, int section4, int duration, - MessagePosition position, const char *text); + MessagePosition position, const char *text); Common::String _outroText; }; diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp index 8fed73cf5a..93c9d695a9 100644 --- a/engines/supernova/state.cpp +++ b/engines/supernova/state.cpp @@ -286,8 +286,8 @@ StringID GameManager::guiStatusCommands[] = { }; GameManager::GameManager(SupernovaEngine *vm) - : _inventory(_inventoryScroll) - , _vm(vm) { + : _inventory(_inventoryScroll) + , _vm(vm) { initRooms(); changeRoom(INTRO); initState(); @@ -669,13 +669,13 @@ void GameManager::processInput() { } else { /* normal item */ for (int i = 0; (_currentRoom->getObject(i)->_id != INVALIDOBJECT) && - (field == -1) && i < kMaxObject; i++) { + (field == -1) && i < kMaxObject; i++) { click = _currentRoom->getObject(i)->_click; if (click != 255 && _vm->_currentImage) { MSNImageDecoder::ClickField *clickField = _vm->_currentImage->_clickField; do { if ((_mouseX >= clickField[click].x1) && (_mouseX <= clickField[click].x2) && - (_mouseY >= clickField[click].y1) && (_mouseY <= clickField[click].y2)) + (_mouseY >= clickField[click].y1) && (_mouseY <= clickField[click].y2)) field = i; click = clickField[click].next; @@ -718,7 +718,7 @@ void GameManager::processInput() { mouseLocation = onInventoryArrowDown; else mouseLocation = onNone; - + switch (mouseLocation) { case onInventoryArrowUp: case onInventoryArrowDown: @@ -800,7 +800,7 @@ void GameManager::telomat(int nr) { do edit(input, 50, 105, 30); while ((_key.keycode != Common::KEYCODE_RETURN) && (_key.keycode != Common::KEYCODE_ESCAPE)); - + if (_key.keycode == Common::KEYCODE_ESCAPE) { _vm->renderBox(0, 0, 320, 200, kColorBlack); _vm->renderRoom(*_currentRoom); @@ -1132,7 +1132,7 @@ void GameManager::walk(int imgId) { void GameManager::guardWalkEvent() { _prevImgId = 0; bool behind = (!_rooms[BCORRIDOR]->getObject(_state._origin + 4)->hasProperty(OCCUPIED) || - _rooms[BCORRIDOR]->getObject(_state._origin + 4)->hasProperty(OPENED)); + _rooms[BCORRIDOR]->getObject(_state._origin + 4)->hasProperty(OPENED)); _rooms[BCORRIDOR]->getObject(_state._origin + 4)->disableProperty(OCCUPIED); if (_currentRoom == _rooms[BCORRIDOR]) { if (_vm->_messageDisplayed) @@ -1187,7 +1187,7 @@ void GameManager::guardWalkEvent() { walk(19); walk(18); } - + if (!_state._playerHidden) { if (_state._origin & 1) walk(10); @@ -1306,15 +1306,15 @@ void GameManager::great(uint number) { bool GameManager::airless() { return (_currentRoom->getId() == HOLD || - _currentRoom->getId() == LANDINGMODULE || - _currentRoom->getId() == GENERATOR || - _currentRoom->getId() == OUTSIDE || - _currentRoom->getId() == ROCKS || - _currentRoom->getId() == CAVE || - _currentRoom->getId() == MEETUP || - _currentRoom->getId() == MEETUP2 || - _currentRoom->getId() == MEETUP3 || - (_currentRoom->getId() == AIRLOCK && _rooms[AIRLOCK]->getObject(1)->hasProperty(OPENED))); + _currentRoom->getId() == LANDINGMODULE || + _currentRoom->getId() == GENERATOR || + _currentRoom->getId() == OUTSIDE || + _currentRoom->getId() == ROCKS || + _currentRoom->getId() == CAVE || + _currentRoom->getId() == MEETUP || + _currentRoom->getId() == MEETUP2 || + _currentRoom->getId() == MEETUP3 || + (_currentRoom->getId() == AIRLOCK && _rooms[AIRLOCK]->getObject(1)->hasProperty(OPENED))); } void GameManager::sentence(int number, bool brightness) { @@ -1470,54 +1470,54 @@ void GameManager::takeObject(Object &obj) { void GameManager::drawCommandBox() { for (int i = 0; i < ARRAYSIZE(_guiCommandButton); ++i) { _vm->renderBox(_guiCommandButton[i].left, - _guiCommandButton[i].top, - _guiCommandButton[i].width(), - _guiCommandButton[i].height(), - _guiCommandButton[i]._bgColor); + _guiCommandButton[i].top, + _guiCommandButton[i].width(), + _guiCommandButton[i].height(), + _guiCommandButton[i]._bgColor); int space = (_guiCommandButton[i].width() - _vm->textWidth(_guiCommandButton[i]._text)) / 2; _vm->renderText(_guiCommandButton[i]._text, - _guiCommandButton[i]._textPosition.x + space, - _guiCommandButton[i]._textPosition.y, - _guiCommandButton[i]._textColor); + _guiCommandButton[i]._textPosition.x + space, + _guiCommandButton[i]._textPosition.y, + _guiCommandButton[i]._textColor); } } void GameManager::drawInventory() { for (int i = 0; i < ARRAYSIZE(_guiInventory); ++i) { _vm->renderBox(_guiInventory[i].left, - _guiInventory[i].top, - _guiInventory[i].width(), - _guiInventory[i].height(), - _guiInventory[i]._bgColor); + _guiInventory[i].top, + _guiInventory[i].width(), + _guiInventory[i].height(), + _guiInventory[i]._bgColor); _vm->renderText(_inventory.get(i + _inventoryScroll)->_name, - _guiInventory[i]._textPosition.x, - _guiInventory[i]._textPosition.y, - _guiInventory[i]._textColor); + _guiInventory[i]._textPosition.x, + _guiInventory[i]._textPosition.y, + _guiInventory[i]._textColor); } _vm->renderBox(_guiInventoryArrow[0].left, - _guiInventoryArrow[0].top, - _guiInventoryArrow[0].width(), - _guiInventoryArrow[0].height(), - _guiInventoryArrow[0]._bgColor); + _guiInventoryArrow[0].top, + _guiInventoryArrow[0].width(), + _guiInventoryArrow[0].height(), + _guiInventoryArrow[0]._bgColor); _vm->renderBox(_guiInventoryArrow[1].left, - _guiInventoryArrow[1].top, - _guiInventoryArrow[1].width(), - _guiInventoryArrow[1].height(), - _guiInventoryArrow[1]._bgColor); + _guiInventoryArrow[1].top, + _guiInventoryArrow[1].width(), + _guiInventoryArrow[1].height(), + _guiInventoryArrow[1]._bgColor); if (_inventory.getSize() > ARRAYSIZE(_guiInventory)) { if (_inventoryScroll != 0) { _vm->renderText(_guiInventoryArrow[0]._text, - _guiInventoryArrow[0]._textPosition.x, - _guiInventoryArrow[0]._textPosition.y, - _guiInventoryArrow[0]._textColor); + _guiInventoryArrow[0]._textPosition.x, + _guiInventoryArrow[0]._textPosition.y, + _guiInventoryArrow[0]._textColor); } if (_inventoryScroll + ARRAYSIZE(_guiInventory) < _inventory.getSize()) { _vm->renderText(_guiInventoryArrow[1]._text, - _guiInventoryArrow[1]._textPosition.x, - _guiInventoryArrow[1]._textPosition.y, - _guiInventoryArrow[1]._textColor); + _guiInventoryArrow[1]._textPosition.x, + _guiInventoryArrow[1]._textPosition.y, + _guiInventoryArrow[1]._textColor); } } } @@ -1528,15 +1528,15 @@ uint16 GameManager::getKeyInput(bool blockForPrintChar) { if (_keyPressed) { if (blockForPrintChar) { if (Common::isPrint(_key.keycode) || - _key.keycode == Common::KEYCODE_BACKSPACE || - _key.keycode == Common::KEYCODE_DELETE || - _key.keycode == Common::KEYCODE_RETURN || - _key.keycode == Common::KEYCODE_SPACE || - _key.keycode == Common::KEYCODE_ESCAPE || - _key.keycode == Common::KEYCODE_UP || - _key.keycode == Common::KEYCODE_DOWN || - _key.keycode == Common::KEYCODE_LEFT || - _key.keycode == Common::KEYCODE_RIGHT) { + _key.keycode == Common::KEYCODE_BACKSPACE || + _key.keycode == Common::KEYCODE_DELETE || + _key.keycode == Common::KEYCODE_RETURN || + _key.keycode == Common::KEYCODE_SPACE || + _key.keycode == Common::KEYCODE_ESCAPE || + _key.keycode == Common::KEYCODE_UP || + _key.keycode == Common::KEYCODE_DOWN || + _key.keycode == Common::KEYCODE_LEFT || + _key.keycode == Common::KEYCODE_RIGHT) { if (_key.flags & Common::KBD_SHIFT) return toupper(_key.ascii); else @@ -1593,7 +1593,7 @@ void GameManager::roomBrightness() { if (_vm->_brightness != 0) _vm->_brightness = _roomBrightness; - + _vm->paletteBrightness(); } @@ -1734,7 +1734,7 @@ void GameManager::edit(Common::String &input, int x, int y, uint length) { uint cursorIndex = input.size(); // NOTE: Pixels for char needed = kFontWidth + 2px left and right side bearing int overdrawWidth = ((int)((length + 1) * (kFontWidth + 2)) > (kScreenWidth - x)) ? - kScreenWidth - x : (length + 1) * (kFontWidth + 2); + kScreenWidth - x : (length + 1) * (kFontWidth + 2); while (isEditing) { _vm->_textCursorX = x; @@ -1944,7 +1944,7 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) { takeObject(*_rooms[ENTRANCE]->getObject(17)); } } else if ((verb == ACTION_LOOK) && (obj1._id == PILL_HULL) && - (_state._language == 2)) { + (_state._language == 2)) { _vm->renderMessage(kStringGenericInteract_6); _state._language = 1; } else if ((verb == ACTION_OPEN) && (obj1._id == WALLET)) { @@ -2231,8 +2231,8 @@ void GameManager::handleInput() { case ACTION_CLOSE: if (!_inputObject[0]->hasProperty(OPENABLE) || - (_inputObject[0]->hasProperty(CLOSED) && - _inputObject[0]->hasProperty(OPENED))) { + (_inputObject[0]->hasProperty(CLOSED) && + _inputObject[0]->hasProperty(OPENED))) { // This can't be closed. _vm->renderMessage(kStringGenericInteract_41); } else if (!_inputObject[0]->hasProperty(OPENED)) { diff --git a/engines/supernova/state.h b/engines/supernova/state.h index 25a4a74351..9072aa26f1 100644 --- a/engines/supernova/state.h +++ b/engines/supernova/state.h @@ -64,8 +64,8 @@ struct GameState { class Inventory { public: Inventory(int &inventoryScroll) - : _numObjects(0) - , _inventoryScroll(inventoryScroll) + : _numObjects(0) + , _inventoryScroll(inventoryScroll) {} void add(Object &obj); diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index a9f29748f9..084c8b5ad9 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -228,11 +228,11 @@ void SupernovaEngine::updateEvents() { case Common::EVENT_KEYDOWN: _gm->_keyPressed = true; if (event.kbd.keycode == Common::KEYCODE_d && - (event.kbd.flags & Common::KBD_CTRL)) { + (event.kbd.flags & Common::KBD_CTRL)) { _console->attach(); } if (event.kbd.keycode == Common::KEYCODE_x && - (event.kbd.flags & Common::KBD_CTRL)) { + (event.kbd.flags & Common::KBD_CTRL)) { // TODO: Draw exit box } @@ -301,7 +301,7 @@ Common::Error SupernovaEngine::loadGameStrings() { GUIErrorMessage(msg); return Common::kReadingFailed; } - + int version = f.readByte(); if (version != SUPERNOVA_DAT_VERSION) { Common::String msg = Common::String::format( @@ -393,8 +393,8 @@ void SupernovaEngine::playSound(AudioIndex sample) { return; Audio::SeekableAudioStream *audioStream = Audio::makeRawStream( - _soundSamples[sample]._buffer, _soundSamples[sample]._length, - 11931, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, DisposeAfterUse::NO); + _soundSamples[sample]._buffer, _soundSamples[sample]._length, + 11931, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, DisposeAfterUse::NO); stopSound(); _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, audioStream); } @@ -416,7 +416,7 @@ void SupernovaEngine::playSoundMod(int filenumber) stopSound(); _mixer->playStream(Audio::Mixer::kMusicSoundType, &_soundHandle, audioStream, - -1, Audio::Mixer::kMaxChannelVolume, 0); + -1, Audio::Mixer::kMaxChannelVolume, 0); } void SupernovaEngine::renderImageSection(int section) { @@ -431,9 +431,9 @@ void SupernovaEngine::renderImageSection(int section) { return; Common::Rect sectionRect(_currentImage->_section[section].x1, - _currentImage->_section[section].y1, - _currentImage->_section[section].x2 + 1, - _currentImage->_section[section].y2 + 1) ; + _currentImage->_section[section].y1, + _currentImage->_section[section].x2 + 1, + _currentImage->_section[section].y2 + 1) ; if (_currentImage->_filenumber == 1 || _currentImage->_filenumber == 2) { sectionRect.setWidth(640); sectionRect.setHeight(480); @@ -459,9 +459,9 @@ void SupernovaEngine::renderImageSection(int section) { } _system->copyRectToScreen(static_cast<const byte *>(_currentImage->_sectionSurfaces[section]->getPixels()) + offset, - pitch, - sectionRect.left, sectionRect.top, - sectionRect.width(), sectionRect.height()); + pitch, + sectionRect.left, sectionRect.top, + sectionRect.width(), sectionRect.height()); } void SupernovaEngine::renderImage(int section) { @@ -1025,7 +1025,7 @@ bool SupernovaEngine::loadGame(int slot) { delete savefile; return false; //Common::kUnknownError } - + byte saveVersion = savefile->readByte(); // Save version 1 was used during development and is no longer supported if (saveVersion > SAVEGAME_VERSION || saveVersion == 1) { @@ -1065,7 +1065,7 @@ bool SupernovaEngine::saveGame(int slot, const Common::String &description) { Common::OutSaveFile *savefile = _saveFileMan->openForSaving(filename); if (!savefile) return false; - + savefile->writeUint32LE(SAVEGAME_HEADER); savefile->writeByte(SAVEGAME_VERSION); @@ -1092,7 +1092,7 @@ bool SupernovaEngine::saveGame(int slot, const Common::String &description) { } void SupernovaEngine::errorTempSave(bool saving) { - GUIErrorMessage(saving + GUIErrorMessage(saving ? "Failed to save temporary game state. Make sure your save game directory is set in ScummVM and that you can write to it." : "Failed to load temporary game state."); error("Unrecoverable error"); @@ -1146,8 +1146,8 @@ void ScreenBufferStack::restore() { --_last; g_system->lockScreen()->copyRectToSurface( - _last->_pixels, _last->_width, _last->_x, _last->_y, - _last->_width, _last->_height); + _last->_pixels, _last->_width, _last->_x, _last->_y, + _last->_width, _last->_height); g_system->unlockScreen(); delete[] _last->_pixels; diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h index 90ea884f0b..0725e0c05c 100644 --- a/engines/supernova/supernova.h +++ b/engines/supernova/supernova.h @@ -78,8 +78,8 @@ private: struct SoundSample { SoundSample() - : _buffer(NULL) - , _length(0) + : _buffer(NULL) + , _length(0) {} ~SoundSample() { @@ -124,8 +124,8 @@ public: int _textCursorY; int _textColor; - int textWidth(const char *text); - int textWidth(const uint16 key); + int textWidth(const char *text); + int textWidth(const uint16 key); Common::Error loadGameStrings(); void initData(); void initPalette(); @@ -169,7 +169,7 @@ public: _gameStrings[idx] = string; } - int textWidth(const Common::String &text) { + int textWidth(const Common::String &text) { if (text.empty()) return 0; return textWidth(text.c_str()); |