diff --git a/engines/mutationofjb/animationdecoder.cpp b/engines/mutationofjb/animationdecoder.cpp index 81323858ee76..712cb42c9766 100644 --- a/engines/mutationofjb/animationdecoder.cpp +++ b/engines/mutationofjb/animationdecoder.cpp @@ -114,7 +114,7 @@ void AnimationDecoder::loadPalette(Common::SeekableReadStream &file) { copyCount = PALETTE_COLORS; } - while(packets--) { + while (packets--) { file.read(_palette + skipCount * 3, copyCount * 3); for (int j = skipCount * 3; j < (skipCount + copyCount) * 3; ++j) { @@ -145,7 +145,7 @@ void AnimationDecoder::loadFullFrame(EncryptedFile &file, uint32 size) { // RLE - Copy color n times. uint8 color = file.readByte(); readBytes++; - while(n--) { + while (n--) { *ptr++ = color; } } else { diff --git a/engines/mutationofjb/assets.cpp b/engines/mutationofjb/assets.cpp index d532469e8782..2adda51c0957 100644 --- a/engines/mutationofjb/assets.cpp +++ b/engines/mutationofjb/assets.cpp @@ -26,11 +26,11 @@ namespace MutationOfJB { Assets::Assets(Game &game) : _game(game), _toSayList("tosay.ger"), _responseList("response.ger") {} -Font& Assets::getSystemFont() { +Font &Assets::getSystemFont() { return _systemFont; } -Font& Assets::getSpeechFont() { +Font &Assets::getSpeechFont() { return _speechFont; } diff --git a/engines/mutationofjb/assets.h b/engines/mutationofjb/assets.h index 1d47641a031d..2cd0612f200b 100644 --- a/engines/mutationofjb/assets.h +++ b/engines/mutationofjb/assets.h @@ -34,11 +34,11 @@ class Assets { public: Assets(Game &game); - Font& getSystemFont(); - Font& getSpeechFont(); + Font &getSystemFont(); + Font &getSpeechFont(); - ConversationLineList& getToSayList(); - ConversationLineList& getResponseList(); + ConversationLineList &getToSayList(); + ConversationLineList &getResponseList(); private: Game &_game; diff --git a/engines/mutationofjb/commands/additemcommand.cpp b/engines/mutationofjb/commands/additemcommand.cpp index 1a670f7d2766..67d3e131885f 100644 --- a/engines/mutationofjb/commands/additemcommand.cpp +++ b/engines/mutationofjb/commands/additemcommand.cpp @@ -24,11 +24,11 @@ #include "mutationofjb/gamedata.h" #include "mutationofjb/script.h" -/* - "ADDITEM" " " - - Adds item to inventory. -*/ +/** @file + * "ADDITEM " + * + * Adds item to inventory. + */ namespace MutationOfJB { diff --git a/engines/mutationofjb/commands/callmacrocommand.cpp b/engines/mutationofjb/commands/callmacrocommand.cpp index 49b948c48d49..01470f2ba10b 100644 --- a/engines/mutationofjb/commands/callmacrocommand.cpp +++ b/engines/mutationofjb/commands/callmacrocommand.cpp @@ -25,11 +25,11 @@ #include "mutationofjb/game.h" #include "common/translation.h" -/* - "_" - - Calls macro with the specified name. -*/ +/** @file + * "_" + * + * Calls macro with the specified name. + */ namespace MutationOfJB { diff --git a/engines/mutationofjb/commands/camefromcommand.cpp b/engines/mutationofjb/commands/camefromcommand.cpp index 058318788487..485e0c54c969 100644 --- a/engines/mutationofjb/commands/camefromcommand.cpp +++ b/engines/mutationofjb/commands/camefromcommand.cpp @@ -25,13 +25,13 @@ #include "mutationofjb/script.h" #include "common/str.h" -/* - "CAMEFROM" - - This command tests whether last scene (the scene player came from) is sceneId. - If true, the execution continues after this command. - Otherwise the execution continues after first '#' found. -*/ +/** @file + * "CAMEFROM" + * + * This command tests whether last scene (the scene player came from) is sceneId. + * If true, the execution continues after this command. + * Otherwise the execution continues after first '#' found. + */ namespace MutationOfJB { diff --git a/engines/mutationofjb/commands/changecommand.cpp b/engines/mutationofjb/commands/changecommand.cpp index 4eac41e619d9..5d6833b82ca0 100644 --- a/engines/mutationofjb/commands/changecommand.cpp +++ b/engines/mutationofjb/commands/changecommand.cpp @@ -27,15 +27,21 @@ namespace MutationOfJB { -// CHANGEe rr ss ii val -// 1B Entity to change register for. -// D door -// O object -// S static -// 2B Register name. -// 2B Scene ID. -// 2B Entity ID. -// VL Value. +/** @file + * "CHANGE" " " " " " " " " + * + * Changes entity register value for specified scene. + * 1B Entity to change register for. + * Possible values: + * 'D' - door + * 'O' - object + * 'S' - static + * '' - scene + * 2B Register name. + * 2B Scene ID. + * 2B Entity ID. + * *B Value (variable length). + */ bool ChangeCommandParser::parseValueString(const Common::String &valueString, bool changeEntity, uint8 &sceneId, uint8 &entityId, ChangeCommand::ChangeRegister ®, ChangeCommand::ChangeOperation &op, ChangeCommandValue &ccv) { if (changeEntity) { @@ -102,7 +108,7 @@ bool ChangeCommandParser::parseValueString(const Common::String &valueString, bo ccv._byteVal = parseInteger(val, op); } else if (valueString.hasPrefix("FR")) { reg = ChangeCommand::FR; - ccv._byteVal = parseInteger(val, op); + ccv._byteVal = parseInteger(val, op); } else if (valueString.hasPrefix("NA")) { reg = ChangeCommand::NA; ccv._byteVal = parseInteger(val, op); @@ -234,32 +240,58 @@ int ChangeCommandParser::parseInteger(const char *val, ChangeCommand::ChangeOper const char *ChangeCommand::getRegisterAsString() const { switch (_register) { - case NM: return "NM"; - case LT: return "LT"; - case SX: return "SX"; - case SY: return "SY"; - case XX: return "XX"; - case YY: return "YY"; - case XL: return "XL"; - case YL: return "YL"; - case WX: return "WX"; - case WY: return "WY"; - case SP: return "SP"; - case AC: return "AC"; - case FA: return "FA"; - case FR: return "FR"; - case NA: return "NA"; - case FS: return "FS"; - case CA: return "CA"; - case DS: return "DS"; - case DL: return "DL"; - case ND: return "ND"; - case NO: return "NO"; - case NS: return "NS"; - case PF: return "PF"; - case PL: return "PL"; - case PD: return "PD"; - default: return "(unknown)"; + case NM: + return "NM"; + case LT: + return "LT"; + case SX: + return "SX"; + case SY: + return "SY"; + case XX: + return "XX"; + case YY: + return "YY"; + case XL: + return "XL"; + case YL: + return "YL"; + case WX: + return "WX"; + case WY: + return "WY"; + case SP: + return "SP"; + case AC: + return "AC"; + case FA: + return "FA"; + case FR: + return "FR"; + case NA: + return "NA"; + case FS: + return "FS"; + case CA: + return "CA"; + case DS: + return "DS"; + case DL: + return "DL"; + case ND: + return "ND"; + case NO: + return "NO"; + case NS: + return "NS"; + case PF: + return "PF"; + case PL: + return "PL"; + case PD: + return "PD"; + default: + return "(unknown)"; } } diff --git a/engines/mutationofjb/commands/changecommand.h b/engines/mutationofjb/commands/changecommand.h index 6fa090ef6dc1..a88cdc11efc1 100644 --- a/engines/mutationofjb/commands/changecommand.h +++ b/engines/mutationofjb/commands/changecommand.h @@ -44,7 +44,7 @@ class ChangeCommand : public SeqCommand { YL, // Height WX, // Walk to X WY, // Walk to Y - SP, // + SP, // AC, // Active FA, // First animation FR, @@ -67,7 +67,7 @@ class ChangeCommand : public SeqCommand { SubtractValue }; - ChangeCommand(uint8 sceneId, uint8 entityId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue& val) : + ChangeCommand(uint8 sceneId, uint8 entityId, ChangeRegister reg, ChangeOperation op, const ChangeCommandValue &val) : _sceneId(sceneId), _entityId(entityId), _register(reg), _operation(op), _value(val) {} protected: diff --git a/engines/mutationofjb/commands/definestructcommand.cpp b/engines/mutationofjb/commands/definestructcommand.cpp index 93dbfc80bc8f..4ccf2e863142 100644 --- a/engines/mutationofjb/commands/definestructcommand.cpp +++ b/engines/mutationofjb/commands/definestructcommand.cpp @@ -50,7 +50,7 @@ bool DefineStructCommandParser::parse(const Common::String &line, ScriptParseCon continue; } - const char* linePtr = convLineStr.c_str(); + const char *linePtr = convLineStr.c_str(); ConversationInfo::Line convLine; diff --git a/engines/mutationofjb/commands/endblockcommand.cpp b/engines/mutationofjb/commands/endblockcommand.cpp index b883beed487b..c7fbd41f0012 100644 --- a/engines/mutationofjb/commands/endblockcommand.cpp +++ b/engines/mutationofjb/commands/endblockcommand.cpp @@ -27,29 +27,29 @@ #include "common/debug.h" #include "common/translation.h" -/* - ("#L " | "-L ") - ("#W " | "-W ") - ("#T " | "-T ") - ("#P " | "-P ") - ("#U " | "-U ") [] - ("#ELSE" | "-ELSE") [] - "#MACRO " - "#EXTRA" - - If a line starts with '#', '=', '-', it is treated as the end of a section. - However, at the same time it can also start a new section depending on what follows. - - #L (look), #W (walk), #T (talk), #U (use) sections are executed - when the user starts corresponding action on the object or in case of "use" up to two objects. - The difference between '#' and '-' version is whether the player walks towards the object ('#') or not ('-'). - - #ELSE is used by conditional commands (see comments for IfCommand and others). - - #MACRO starts a new macro. Global script can call macros from local script and vice versa. - - #EXTRA defines an "extra" section. This is called from dialog responses ("TALK TO HIM" command). -*/ +/** @file + * ("#L " | "-L ") + * ("#W " | "-W ") + * ("#T " | "-T ") + * ("#P " | "-P ") + * ("#U " | "-U ") [] + * ("#ELSE" | "-ELSE") [] + * "#MACRO " + * "#EXTRA" + * + * If a line starts with '#', '=', '-', it is treated as the end of a section. + * However, at the same time it can also start a new section depending on what follows. + * + * #L (look), #W (walk), #T (talk), #U (use) sections are executed + * when the user starts corresponding action on the object or in case of "use" up to two objects. + * The difference between '#' and '-' version is whether the player walks towards the object ('#') or not ('-'). + * + * #ELSE is used by conditional commands (see comments for IfCommand and others). + * + * #MACRO starts a new macro. Global script can call macros from local script and vice versa. + * + * #EXTRA defines an "extra" section. This is called from dialog responses ("TALK TO HIM" command). + */ namespace MutationOfJB { diff --git a/engines/mutationofjb/commands/gotocommand.cpp b/engines/mutationofjb/commands/gotocommand.cpp index bc24e2c55275..b8d15a713106 100644 --- a/engines/mutationofjb/commands/gotocommand.cpp +++ b/engines/mutationofjb/commands/gotocommand.cpp @@ -25,11 +25,11 @@ #include "mutationofjb/gamedata.h" #include "mutationofjb/script.h" -/* - "GOTO "