diff options
Diffstat (limited to 'engines')
99 files changed, 452 insertions, 452 deletions
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index cf987e66dc..f3828e00d2 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -347,7 +347,7 @@ int AgiEngine::playGame() { } interpretCycle(); - + // Check if the user has asked to load a game from the command line // or the launcher if (firstLoop) { diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index b99c24043a..86422a7d01 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -195,7 +195,7 @@ static const AGIGameDescription gameDescriptions[] = { // Black Cauldron (PC 5.25") 2.10 11/10/88 [AGI 3.002.098] GAME3("bc", "2.10 1988-11-10 5.25\"", "bcdir", "0c5a9acbcc7e51127c34818e75806df6", 0x3149, GID_BC), - + // Black Cauldron (PC) 2.10 [AGI 3.002.097] GAME3("bc", "2.10", "bcdir", "0de3953c9225009dc91e5b0d1692967b", 0x3149, GID_BC), @@ -524,7 +524,7 @@ static const AGIGameDescription gameDescriptions[] = { // Troll's Tale GAMEpre_PS("troll", "", "troll.img", "62903f264b3d849be4214b3a5c42a2fa", 184320, 0x0000, GID_TROLL, Common::kPlatformPC), - + // Winnie the Pooh in the Hundred Acre Wood GAMEpre_P("winnie", "", "title.pic", "2e7900c1ccaa7671d65405f6d1efed30", 0x0000, GID_WINNIE, Common::kPlatformPC), diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index ca8b47aded..155fe1ad06 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -115,7 +115,7 @@ bool Mickey::chooseY_N(int ofsPrompt, bool fErrorMsg) { break; } } - + return false; } @@ -509,7 +509,7 @@ bool Mickey::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) { animate(); drawMenu(menu, *sel0, *sel1); } - + return false; } @@ -535,7 +535,7 @@ void Mickey::getMenuSel(char *buffer, int *sel0, int *sel1) { } } } - + if (_clickToMove || getMenuSelRow(menu, sel0, sel1, 2)) { break; } @@ -1358,11 +1358,11 @@ void Mickey::intro() { // show copyright and play theme printExeMsg(IDO_MSA_COPYRIGHT); - + // Quit if necessary if (_vm->shouldQuit()) return; - + playSound(IDI_MSA_SND_THEME); // load game @@ -1375,7 +1375,7 @@ void Mickey::intro() { return; } } - + // Quit if necessary if (_vm->shouldQuit()) return; @@ -1386,7 +1386,7 @@ void Mickey::intro() { drawRoom(); printRoomDesc(); - + // Quit if necessary if (_vm->shouldQuit()) return; @@ -2104,7 +2104,7 @@ void Mickey::waitAnyKey(bool anim) { break; } } - + if (anim) { animate(); _vm->_gfx->doUpdate(); diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index f6d3fffd24..b72a617948 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -565,7 +565,7 @@ void Troll::gameLoop() { memset(_roomStates, 0, sizeof(_roomStates)); memset(_inventory, 0, sizeof(_inventory)); - + while (!done && !_vm->shouldQuit()) { *menu = 0; diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index 81305e9590..1341adcef8 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -446,7 +446,7 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { _vm->_gfx->doUpdate(); _vm->_system->updateScreen(); } - + return IDI_WTP_PAR_OK; } @@ -1016,7 +1016,7 @@ phase2: if (parser(hdr.ofsDesc[iBlock] - _roomOffset, iBlock, roomdata) == IDI_WTP_PAR_BACK) goto phase1; } - + while (!_vm->shouldQuit()) { for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) { switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) { diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index 403709ddde..73d64eee4d 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -46,11 +46,11 @@ AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, S uint16 type = READ_LE_UINT16(data); switch (type) { // Create a sound object based on the type - case AGI_SOUND_SAMPLE: + case AGI_SOUND_SAMPLE: return new IIgsSample(data, len, resnum, manager); - case AGI_SOUND_MIDI: + case AGI_SOUND_MIDI: return new IIgsMidi (data, len, resnum, manager); - case AGI_SOUND_4CHN: + case AGI_SOUND_4CHN: return new PCjrSound (data, len, resnum, manager); } diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index da7f34fc19..63b109ee83 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -272,9 +272,9 @@ char *AgiEngine::wordWrapString(const char *s, int *len) { if (wLen) { memcpy(outStr, pWord, wLen); outStr += wLen; - } + } lnLen += wLen+1; - + if (lnLen > msgWidth) { msgWidth = lnLen; diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp index 0c1e731d80..b7f9af427e 100644 --- a/engines/agos/charset-fontdata.cpp +++ b/engines/agos/charset-fontdata.cpp @@ -1770,104 +1770,104 @@ static const byte english_elvira1Font[] = { }; static const byte english_pnFont[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, - 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x24, 0x7E, 0x24, 0x24, 0x7E, 0x24, 0x00, - 0x00, 0x08, 0x3E, 0x28, 0x3E, 0x0A, 0x3E, 0x08, - 0x00, 0x62, 0x64, 0x08, 0x10, 0x26, 0x46, 0x00, - 0x00, 0x10, 0x28, 0x10, 0x2A, 0x44, 0x3A, 0x00, - 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x08, 0x08, 0x08, 0x08, 0x04, 0x00, - 0x00, 0x20, 0x10, 0x10, 0x10, 0x10, 0x20, 0x00, - 0x00, 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14, 0x00, - 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, - 0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, - 0x00, 0x3C, 0x46, 0x4A, 0x52, 0x62, 0x3C, 0x00, - 0x00, 0x18, 0x28, 0x08, 0x08, 0x08, 0x3E, 0x00, - 0x00, 0x3C, 0x42, 0x02, 0x3C, 0x40, 0x7E, 0x00, - 0x00, 0x3C, 0x42, 0x0C, 0x02, 0x42, 0x3C, 0x00, - 0x00, 0x08, 0x18, 0x28, 0x48, 0x7E, 0x08, 0x00, - 0x00, 0x7E, 0x40, 0x7C, 0x02, 0x42, 0x3C, 0x00, - 0x00, 0x3C, 0x40, 0x7C, 0x42, 0x42, 0x3C, 0x00, - 0x00, 0x7E, 0x02, 0x04, 0x08, 0x10, 0x10, 0x00, - 0x00, 0x3C, 0x42, 0x3C, 0x42, 0x42, 0x3C, 0x00, - 0x00, 0x3C, 0x42, 0x42, 0x3E, 0x02, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, - 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, - 0x00, 0x00, 0x04, 0x08, 0x10, 0x08, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x08, 0x04, 0x08, 0x10, 0x00, - 0x00, 0x3C, 0x42, 0x04, 0x08, 0x00, 0x08, 0x00, - 0x00, 0x3C, 0x4A, 0x56, 0x5E, 0x40, 0x3C, 0x00, - 0x00, 0x3C, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x00, - 0x00, 0x7C, 0x42, 0x7C, 0x42, 0x42, 0x7C, 0x00, - 0x00, 0x3C, 0x42, 0x40, 0x40, 0x42, 0x3C, 0x00, - 0x00, 0x78, 0x44, 0x42, 0x42, 0x44, 0x78, 0x00, - 0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00, - 0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x00, - 0x00, 0x3C, 0x42, 0x40, 0x4E, 0x42, 0x3C, 0x00, - 0x00, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x00, - 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x3E, 0x00, - 0x00, 0x02, 0x02, 0x02, 0x42, 0x42, 0x3C, 0x00, - 0x00, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, 0x00, - 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x00, - 0x00, 0x42, 0x66, 0x5A, 0x42, 0x42, 0x42, 0x00, - 0x00, 0x42, 0x62, 0x52, 0x4A, 0x46, 0x42, 0x00, - 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, - 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x40, 0x40, 0x00, - 0x00, 0x3C, 0x42, 0x42, 0x52, 0x4A, 0x3C, 0x00, - 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x44, 0x42, 0x00, - 0x00, 0x3C, 0x40, 0x3C, 0x02, 0x42, 0x3C, 0x00, - 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, - 0x00, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00, - 0x00, 0x42, 0x42, 0x42, 0x42, 0x5A, 0x24, 0x00, - 0x00, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x00, - 0x00, 0x82, 0x44, 0x28, 0x10, 0x10, 0x10, 0x00, - 0x00, 0x7E, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x00, - 0x00, 0x0E, 0x08, 0x08, 0x08, 0x08, 0x0E, 0x00, - 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, - 0x00, 0x70, 0x10, 0x10, 0x10, 0x10, 0x70, 0x00, - 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, - 0x00, 0x1C, 0x22, 0x78, 0x20, 0x20, 0x7E, 0x00, - 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, - 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x3C, 0x00, - 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, - 0x00, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3C, 0x00, - 0x00, 0x00, 0x38, 0x44, 0x78, 0x40, 0x3C, 0x00, - 0x00, 0x0C, 0x10, 0x18, 0x10, 0x10, 0x10, 0x00, - 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x38, - 0x00, 0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x00, - 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x38, 0x00, - 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x24, 0x18, - 0x00, 0x20, 0x28, 0x30, 0x30, 0x28, 0x24, 0x00, - 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x00, - 0x00, 0x00, 0x68, 0x54, 0x54, 0x54, 0x54, 0x00, - 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x44, 0x00, - 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, - 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x06, - 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x20, 0x00, - 0x00, 0x00, 0x38, 0x40, 0x38, 0x04, 0x78, 0x00, - 0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x0C, 0x00, - 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, - 0x00, 0x00, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00, - 0x00, 0x00, 0x44, 0x54, 0x54, 0x54, 0x28, 0x00, - 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, - 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, - 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, - 0x00, 0x0E, 0x08, 0x30, 0x08, 0x08, 0x0E, 0x00, - 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, - 0x00, 0x70, 0x10, 0x0C, 0x10, 0x10, 0x70, 0x00, - 0x00, 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3C, 0x42, 0x99, 0xA1, 0xA1, 0x99, 0x42, 0x3C, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, + 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x24, 0x7E, 0x24, 0x24, 0x7E, 0x24, 0x00, + 0x00, 0x08, 0x3E, 0x28, 0x3E, 0x0A, 0x3E, 0x08, + 0x00, 0x62, 0x64, 0x08, 0x10, 0x26, 0x46, 0x00, + 0x00, 0x10, 0x28, 0x10, 0x2A, 0x44, 0x3A, 0x00, + 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x08, 0x08, 0x08, 0x08, 0x04, 0x00, + 0x00, 0x20, 0x10, 0x10, 0x10, 0x10, 0x20, 0x00, + 0x00, 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14, 0x00, + 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, + 0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x3C, 0x46, 0x4A, 0x52, 0x62, 0x3C, 0x00, + 0x00, 0x18, 0x28, 0x08, 0x08, 0x08, 0x3E, 0x00, + 0x00, 0x3C, 0x42, 0x02, 0x3C, 0x40, 0x7E, 0x00, + 0x00, 0x3C, 0x42, 0x0C, 0x02, 0x42, 0x3C, 0x00, + 0x00, 0x08, 0x18, 0x28, 0x48, 0x7E, 0x08, 0x00, + 0x00, 0x7E, 0x40, 0x7C, 0x02, 0x42, 0x3C, 0x00, + 0x00, 0x3C, 0x40, 0x7C, 0x42, 0x42, 0x3C, 0x00, + 0x00, 0x7E, 0x02, 0x04, 0x08, 0x10, 0x10, 0x00, + 0x00, 0x3C, 0x42, 0x3C, 0x42, 0x42, 0x3C, 0x00, + 0x00, 0x3C, 0x42, 0x42, 0x3E, 0x02, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, + 0x00, 0x00, 0x04, 0x08, 0x10, 0x08, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x08, 0x04, 0x08, 0x10, 0x00, + 0x00, 0x3C, 0x42, 0x04, 0x08, 0x00, 0x08, 0x00, + 0x00, 0x3C, 0x4A, 0x56, 0x5E, 0x40, 0x3C, 0x00, + 0x00, 0x3C, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x00, + 0x00, 0x7C, 0x42, 0x7C, 0x42, 0x42, 0x7C, 0x00, + 0x00, 0x3C, 0x42, 0x40, 0x40, 0x42, 0x3C, 0x00, + 0x00, 0x78, 0x44, 0x42, 0x42, 0x44, 0x78, 0x00, + 0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00, + 0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x3C, 0x42, 0x40, 0x4E, 0x42, 0x3C, 0x00, + 0x00, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x00, + 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x3E, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x42, 0x42, 0x3C, 0x00, + 0x00, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, 0x00, + 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x00, + 0x00, 0x42, 0x66, 0x5A, 0x42, 0x42, 0x42, 0x00, + 0x00, 0x42, 0x62, 0x52, 0x4A, 0x46, 0x42, 0x00, + 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, + 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x40, 0x40, 0x00, + 0x00, 0x3C, 0x42, 0x42, 0x52, 0x4A, 0x3C, 0x00, + 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x44, 0x42, 0x00, + 0x00, 0x3C, 0x40, 0x3C, 0x02, 0x42, 0x3C, 0x00, + 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, + 0x00, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00, + 0x00, 0x42, 0x42, 0x42, 0x42, 0x5A, 0x24, 0x00, + 0x00, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x00, + 0x00, 0x82, 0x44, 0x28, 0x10, 0x10, 0x10, 0x00, + 0x00, 0x7E, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x00, + 0x00, 0x0E, 0x08, 0x08, 0x08, 0x08, 0x0E, 0x00, + 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, + 0x00, 0x70, 0x10, 0x10, 0x10, 0x10, 0x70, 0x00, + 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, + 0x00, 0x1C, 0x22, 0x78, 0x20, 0x20, 0x7E, 0x00, + 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, + 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x3C, 0x00, + 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, + 0x00, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3C, 0x00, + 0x00, 0x00, 0x38, 0x44, 0x78, 0x40, 0x3C, 0x00, + 0x00, 0x0C, 0x10, 0x18, 0x10, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x38, + 0x00, 0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x00, + 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x38, 0x00, + 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x24, 0x18, + 0x00, 0x20, 0x28, 0x30, 0x30, 0x28, 0x24, 0x00, + 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x00, + 0x00, 0x00, 0x68, 0x54, 0x54, 0x54, 0x54, 0x00, + 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x44, 0x00, + 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, + 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x06, + 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x00, 0x00, 0x38, 0x40, 0x38, 0x04, 0x78, 0x00, + 0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x0C, 0x00, + 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, + 0x00, 0x00, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00, + 0x00, 0x00, 0x44, 0x54, 0x54, 0x54, 0x28, 0x00, + 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, + 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, + 0x00, 0x0E, 0x08, 0x30, 0x08, 0x08, 0x0E, 0x00, + 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x70, 0x10, 0x0C, 0x10, 0x10, 0x70, 0x00, + 0x00, 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3C, 0x42, 0x99, 0xA1, 0xA1, 0x99, 0x42, 0x3C, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) { diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp index d52bcc175a..8bdb35d3ae 100644 --- a/engines/agos/debug.cpp +++ b/engines/agos/debug.cpp @@ -539,7 +539,7 @@ void AGOSEngine::dumpBitmap(const char *filename, const byte *offs, uint16 w, ui src += 5; } while (--count); dst += w; - } + } } else if (flags & 0x80) { for (i = 0; i != w; i += 2) { byte *c = vc10_depackColumn(&state); @@ -580,7 +580,7 @@ void AGOSEngine::palLoad(byte *pal, const byte *vga1, int a, int b) { const byte *src; uint16 num, palSize; byte *palptr = (byte *)&pal[0]; - + if (getGameType() == GType_FF || getGameType() == GType_PP) { num = 256; palSize = 768; diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp index 58599ce5f6..0472b1192b 100644 --- a/engines/agos/icons.cpp +++ b/engines/agos/icons.cpp @@ -354,11 +354,11 @@ void AGOSEngine::drawIcon(WindowBlock *window, uint icon, uint x, uint y) { dst += _dxSurfacePitch; } } else { - uint8 palette[4]; - palette[0] = *src >> 4; - palette[1] = *src++ & 0xf; - palette[2] = *src >> 4; - palette[3] = *src++ & 0xf; + uint8 palette[4]; + palette[0] = *src >> 4; + palette[1] = *src++ & 0xf; + palette[2] = *src >> 4; + palette[3] = *src++ & 0xf; for (int yp = 0; yp < 24; ++yp, src += 6) { // Get bit-set representing the 24 pixels for the line uint32 v1 = (READ_BE_UINT16(src) << 8) | *(src + 4); diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp index a8c1bf4bfa..cf6e808384 100644 --- a/engines/agos/input.cpp +++ b/engines/agos/input.cpp @@ -463,9 +463,9 @@ bool AGOSEngine::processSpecialKeys() { _lastMinute = t1; } } - + if (shouldQuit()) - _exitCutscene = true; + _exitCutscene = true; switch (_keyPressed.keycode) { case Common::KEYCODE_UP: @@ -694,7 +694,7 @@ void AGOSEngine_PN::interact(char *buffer, uint8 size) { _inputting = true; _inputReady = true; } - + while (!shouldQuit() && _inputReady) { if (!_noScanFlag && _scanFlag) { buffer[0] = 1; @@ -744,7 +744,7 @@ void AGOSEngine_PN::clearCursor(WindowBlock *window) { bool AGOSEngine_PN::processSpecialKeys() { if (shouldQuit()) - _exitCutscene = true; + _exitCutscene = true; switch (_keyPressed.keycode) { case Common::KEYCODE_ESCAPE: diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp index f6cac8c36a..4278ed11e6 100644 --- a/engines/agos/res.cpp +++ b/engines/agos/res.cpp @@ -704,7 +704,7 @@ static bool getBit(Common::Stack<uint32> &dataList, uint32 &srcVal) { static uint32 copyBits(Common::Stack<uint32> &dataList, uint32 &srcVal, int numBits) { uint32 destVal = 0; - + for (int i = 0; i < numBits; ++i) { bool f = getBit(dataList, srcVal); destVal = (destVal << 1) | (f ? 1 : 0); diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp index 2dbd4e52fb..62ca94e387 100644 --- a/engines/agos/script_pn.cpp +++ b/engines/agos/script_pn.cpp @@ -147,7 +147,7 @@ void AGOSEngine_PN::opn_opcode01() { int32 sp = varval() + varval(); _variableArray[12] = sp % 65536; _variableArray[13] = sp / 65536; - if (sp > 65535) + if (sp > 65535) sp=65535; writeval(str, (int)sp); setScriptReturn(true); @@ -329,7 +329,7 @@ void AGOSEngine_PN::opn_opcode25() { void AGOSEngine_PN::opn_opcode26() { while ((_stackbase->classnum != -1) && (_stackbase != NULL)) junkstack(); - dumpstack(); + dumpstack(); setScriptReturn(true); } @@ -371,10 +371,10 @@ void AGOSEngine_PN::opn_opcode31() { slot = matchSaveGame(_saveFile, countSaveGames()); strcpy(bf, genSaveName(slot)); break; - case 1: + case 1: strcpy(bf, "test.sav"); break; - case 2: + case 2: // NOTE: Is this case ever used? error("opn_opcode31: case 2"); break; @@ -776,7 +776,7 @@ void AGOSEngine_PN::writeval(uint8 *ptr, int val) { _workptr = ptr; _linct = 255; - if ((a = readfromline()) < 247) + if ((a = readfromline()) < 247) error("writeval: Write to constant (%d)", a); switch (a) { @@ -836,7 +836,7 @@ int AGOSEngine_PN::actCallD(int n) { funcentry(pf, n); addstack(-1); funccpy(pf); - setposition(n, 0); + setposition(n, 0); return(doline(1)); } @@ -1065,7 +1065,7 @@ void AGOSEngine_PN::dumpstack() { if (_stackbase == NULL) error("dumpstack: Stack underflow or unknown longjmp"); - a = _stackbase->nextframe; + a = _stackbase->nextframe; free((char *)_stackbase); _stackbase = a; } @@ -1076,7 +1076,7 @@ void AGOSEngine_PN::junkstack() { if (_stackbase == NULL) error("junkstack: Stack underflow or unknown longjmp"); - a = _stackbase->nextframe; + a = _stackbase->nextframe; if (_stackbase->classnum == -1) free((char *)_stackbase->savearea); free((char *)_stackbase); @@ -1100,7 +1100,7 @@ void AGOSEngine_PN::popstack(int type) { b = 0; while (a < 6) _variableArray[b++] = _stackbase->flag[a++]; - b = 24; + b = 24; a = 0; while (a < 8) _variableArray[b++] = _stackbase->param[a++]; diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index 6f5fb391e5..4a88e3aad1 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -56,7 +56,7 @@ byte *AGOSEngine::uncompressToken(byte a, byte *ptr) { if (a == 0xFF || a == 0xFE || a == 0xFD) { if (a == 0xFF) ptr2 = _twoByteTokenStrings; - if (a == 0xFE) + if (a == 0xFE) ptr2 = _secondTwoByteTokenStrings; if (a == 0xFD) ptr2 = _thirdTwoByteTokenStrings; @@ -79,7 +79,7 @@ byte *AGOSEngine::uncompressToken(byte a, byte *ptr) { count1++; } ptr1 = _byteTokenStrings; /* Find it */ - while (count1--) { + while (count1--) { while (*ptr1++) ; } @@ -224,7 +224,7 @@ l1: _stringTabPtr[i++] = mem; ; mem++; } - + _stringTabPos = i; } } @@ -936,7 +936,7 @@ char *AGOSEngine_PN::unctok(char *c, int n) { *c = 0; return c; } - + void AGOSEngine_PN::uncomstr(char *c, uint32 x) { if (x > _textBaseSize) error("UNCOMSTR: TBASE over-run\n"); @@ -1441,7 +1441,7 @@ void AGOSEngine_PN::getResponse(uint16 charNum, uint16 objNum, uint16 &msgNum1, } ptr++; } - + while ((num = *ptr++) != 0) { if (num == objNum) { msgNum2 = *ptr++; @@ -1534,7 +1534,7 @@ char *AGOSEngine_PN::getMessage(char *msg, uint16 num) { char *tmpPtr = strPtr1; char *strPtr2 = strPtr1; - while (*strPtr2 != 0 && *strPtr2 != 32) + while (*strPtr2 != 0 && *strPtr2 != 32) strPtr2++; while (*strPtr2) { diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index aee42f001b..742ac48ac8 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -540,7 +540,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) { // WORKAROUND: If the game is saved, right after Simon is thrown in the dungeon of Sordid's Fortress of Doom, // the saved game fails to load correctly. When loading the saved game, the sequence of Simon waking is started, - // before the scene is actually reloaded, due to a script bug. We manually add the extra script code from the + // before the scene is actually reloaded, due to a script bug. We manually add the extra script code from the // updated DOS CD release, which fixed this particular script bug. if (getGameType() == GType_SIMON2 && sub->id == 12101) { const byte bit = 228; @@ -577,7 +577,7 @@ restart: } // WORKAROUND: Feeble walks in the incorrect direction, when looking at the Vent in the Research and Testing area of - // the Company Central Command Compound. We manually add the extra script code from the updated English 2CD release, + // the Company Central Command Compound. We manually add the extra script code from the updated English 2CD release, // which fixed this particular script bug. if (getGameType() == GType_FF && _language == Common::EN_ANY) { if (sub->id == 39125 && readVariable(84) == 2) { diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp index c348401968..2486f09626 100644 --- a/engines/agos/verb.cpp +++ b/engines/agos/verb.cpp @@ -754,7 +754,7 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) { if (_clickOnly) return; - + if (best_ha->flags & kBFInvertTouch) { if (!(best_ha->flags & kBFBoxSelected)) { hitarea_leave(best_ha, false); @@ -763,7 +763,7 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) { } else { if (mode == 0) return; - + if (!(best_ha->flags & kBFInvertSelect)) return; @@ -1145,7 +1145,7 @@ void AGOSEngine_PN::hitBox1(HitArea *ha) { _mousePrintFG++; _mouseString1 = _mouseString; _mouseString = (const char*)"showname \0"; - + } } diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index 0a8db1855b..49edaef5e4 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -331,7 +331,7 @@ Palette &Palette::load(const byte *buf, const uint size, const Graphics::PixelFo const int rBytePos = bytePos(format.rShift, format.bytesPerPixel, isBigEndian(endian)); const int gBytePos = bytePos(format.gShift, format.bytesPerPixel, isBigEndian(endian)); const int bBytePos = bytePos(format.bShift, format.bytesPerPixel, isBigEndian(endian)); - + for (uint i = 0; i < numColors; i++) { // format.rMax(), format.gMax(), format.bMax() are also used as masks here _colors[i].r = (buf[i * format.bytesPerPixel + rBytePos] >> (format.rShift % 8)) & format.rMax(); diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp index 4d68773fec..535620c7df 100644 --- a/engines/cruise/actor.cpp +++ b/engines/cruise/actor.cpp @@ -750,7 +750,7 @@ void processAnimation(void) { currentActor->flag = 1; } - currentActor->pathId = computePathfinding(moveInfo, params.X, params.Y, + currentActor->pathId = computePathfinding(moveInfo, params.X, params.Y, aniX, aniY, currentActor->stepX, currentActor->stepY, currentActor->pathId); if (currentActor->pathId == ANIM_WAIT) { @@ -804,7 +804,7 @@ void processAnimation(void) { // , so 'break' statements should *not* be used at the end of case areas switch (currentActor->phase) { case ANIM_PHASE_STATIC_END: - case ANIM_PHASE_STATIC: + case ANIM_PHASE_STATIC: { // In-place (on the spot) animationos diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp index 3d9abacea3..03ed552018 100644 --- a/engines/cruise/backgroundIncrust.cpp +++ b/engines/cruise/backgroundIncrust.cpp @@ -81,7 +81,7 @@ void restoreBackground(backgroundIncrustStruct *pIncrust) { int xp = j + X; int yp = i + Y; - if ((xp >= 0) && (yp >= 0) && (xp < 320) && (yp < 200)) + if ((xp >= 0) && (yp >= 0) && (xp < 320) && (yp < 200)) pBackground[yp * 320 + xp] = pIncrust->ptr[i * width + j]; } } @@ -101,7 +101,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, int16 objectIdx, // Don't process any further if not a sprite or polygon if (!ptr) return NULL; - if ((filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_SPRITE) && + if ((filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_SPRITE) && (filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_POLY)) { return NULL; } diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index ee3d87b940..522e0a0d81 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -570,8 +570,8 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) { cellStruct *currentObject = cellHead.prev; while (currentObject) { - if (currentObject->overlay > 0 && overlayTable[currentObject->overlay].alreadyLoaded && - (currentObject->type == OBJ_TYPE_SPRITE || currentObject->type == OBJ_TYPE_MASK || + if (currentObject->overlay > 0 && overlayTable[currentObject->overlay].alreadyLoaded && + (currentObject->type == OBJ_TYPE_SPRITE || currentObject->type == OBJ_TYPE_MASK || currentObject->type == OBJ_TYPE_EXIT || currentObject->type == OBJ_TYPE_VIRTUAL)) { const char* pObjectName = getObjectName(currentObject->idx, overlayTable[currentObject->overlay].ovlData->arrayNameObj); @@ -633,7 +633,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) { offset += j; if (offset >= 0) { - if (filesDatabase[offset].resType == OBJ_TYPE_LINE && + if (filesDatabase[offset].resType == OBJ_TYPE_LINE && filesDatabase[offset].subData.ptr) { dataPtr = (int16 *)filesDatabase[offset].subData.ptr; } diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index 2e62fb8657..df0a39d2fa 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -424,7 +424,7 @@ int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentD localBuffer.hotspotY = s4.readUint16BE(); localBuffer.hotspotX = s4.readUint16BE(); - if (sec == 1) + if (sec == 1) // Type 1: Width - (1*2) , Type 5: Width - (5*2) localBuffer.width -= localBuffer.type * 2; diff --git a/engines/cruise/debugger.cpp b/engines/cruise/debugger.cpp index eb1cf585fc..3d3d69be58 100644 --- a/engines/cruise/debugger.cpp +++ b/engines/cruise/debugger.cpp @@ -47,8 +47,8 @@ bool Debugger::cmd_hotspots(int argc, const char **argv) { cellStruct *currentObject = cellHead.prev; while (currentObject) { - if (currentObject->overlay > 0 && overlayTable[currentObject->overlay].alreadyLoaded && - (currentObject->type == OBJ_TYPE_SPRITE || currentObject->type == OBJ_TYPE_MASK || + if (currentObject->overlay > 0 && overlayTable[currentObject->overlay].alreadyLoaded && + (currentObject->type == OBJ_TYPE_SPRITE || currentObject->type == OBJ_TYPE_MASK || currentObject->type == OBJ_TYPE_EXIT || currentObject->type == OBJ_TYPE_VIRTUAL)) { const char *pObjectName = getObjectName(currentObject->idx, overlayTable[currentObject->overlay].ovlData->arrayNameObj); diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 59a9fd50bb..0f601a582b 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -1394,7 +1394,7 @@ int16 Op_SongSize(void) { *pSize = size; } else oldSize = 0; - + return oldSize; } @@ -1412,7 +1412,7 @@ int16 Op_SetPattern(void) { int16 Op_FadeSong(void) { _vm->music().fadeSong(); - + return 0; } @@ -1646,7 +1646,7 @@ int16 Op_SetVolume(void) { int volume = 63 - newVolume; _vm->music().setVolume(volume << 2); } - + return oldVolume >> 2; } diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index 0df77b60e9..0c393ca568 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -180,7 +180,7 @@ static void syncFilesDatabase(Common::Serializer &s) { s.syncAsUint16LE(fe.width); s.syncAsUint16LE(fe.resType); s.syncAsUint16LE(fe.height); - + // TODO: Have a look at the saving/loading of this pointer tmp = (fe.subData.ptr) ? 1 : 0; s.syncAsUint32LE(tmp); @@ -602,7 +602,7 @@ static void DoSync(Common::Serializer &s) { syncBackgroundTable(s); syncPalScreen(s); syncSoundList(s); - + for (int i = 0; i < stateID; ++i) s.syncAsSint16LE(globalVars[i]); diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp index 114e37679a..fd638e6be5 100644 --- a/engines/cruise/sound.cpp +++ b/engines/cruise/sound.cpp @@ -188,7 +188,7 @@ void MusicPlayer::removeSong() { } _songPlayed = false; - + strcpy(_musicName, ""); } diff --git a/engines/cruise/sound.h b/engines/cruise/sound.h index 2a2d6864ce..faf3df995d 100644 --- a/engines/cruise/sound.h +++ b/engines/cruise/sound.h @@ -45,7 +45,7 @@ private: byte _masterVolume; byte *_songPointer; - // TODO: lib_SongSize + // TODO: lib_SongSize int _songSize; void patchMidi(uint32 adr, const byte *data, int size); diff --git a/engines/cruise/staticres.cpp b/engines/cruise/staticres.cpp index 1d6f26ac7b..d49d12c05b 100644 --- a/engines/cruise/staticres.cpp +++ b/engines/cruise/staticres.cpp @@ -135,8 +135,8 @@ int16 german_fontCharacterTable[256] = { 86, 87, 88, 89, 90, 91, 92, -1, -1, -1, 0x72, - -1, -1, - 0x5e, + -1, -1, + 0x5e, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x6a, -1, -1, -1, -1, -1, diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp index d9a217e84c..58a62ed564 100644 --- a/engines/gob/dataio.cpp +++ b/engines/gob/dataio.cpp @@ -371,7 +371,7 @@ void DataIO::openDataFile(const char *src, bool itk) { ChunkDesc *dataDesc; char path[128]; int16 file; - char *fakeTotPtr; + char *fakeTotPtr; strncpy0(path, src, 127); if (!strchr(path, '.')) { diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp index d9d6b1e949..29f638b33b 100644 --- a/engines/gob/demos/demoplayer.cpp +++ b/engines/gob/demos/demoplayer.cpp @@ -44,7 +44,7 @@ DemoPlayer::Script DemoPlayer::_scripts[] = { {kScriptSourceFile, "e.scn"}, {kScriptSourceFile, "i.scn"}, {kScriptSourceFile, "s.scn"}, - {kScriptSourceDirect, + {kScriptSourceDirect, "slide machu.imd 20\nslide conseil.imd 20\nslide cons.imd 20\n" \ "slide tumia.imd 1\nslide tumib.imd 1\nslide tumic.imd 1\n" \ "slide tumid.imd 1\nslide post.imd 1\nslide posta.imd 1\n" \ diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 1982cff27f..fc6478e5d5 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -849,7 +849,7 @@ static const GOBGameDescription gameDescriptions[] = { kFeaturesNone, 0, 0, 0 }, - { // Supplied by goodoldgeorg in bug report #2563539 + { // Supplied by goodoldgeorg in bug report #2563539 { "ween", "", @@ -1489,7 +1489,7 @@ static const GOBGameDescription gameDescriptions[] = { kGameTypeFascination, kFeaturesNone, "disk0.stk", 0, 0 - }, + }, { { "fascination", @@ -1502,7 +1502,7 @@ static const GOBGameDescription gameDescriptions[] = { kGameTypeFascination, kFeaturesNone, "disk0.stk", 0, 0 - }, + }, { { "fascination", @@ -1515,7 +1515,7 @@ static const GOBGameDescription gameDescriptions[] = { kGameTypeFascination, kFeaturesNone, "disk0.stk", 0, 0 - }, + }, { { "fascination", @@ -1528,7 +1528,7 @@ static const GOBGameDescription gameDescriptions[] = { kGameTypeFascination, kFeaturesNone, "disk0.stk", 0, 0 - }, + }, { { "geisha", diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp index cd9685db2e..4bcf3c81cd 100644 --- a/engines/gob/inter.cpp +++ b/engines/gob/inter.cpp @@ -234,7 +234,7 @@ void Inter::funcBlock(int16 retFlag) { // The EGA, Mac and Windows versions of gob1 doesn't add a delay after // showing images between levels. We manually add it here. if ((_vm->getGameType() == kGameTypeGob1) && - ( _vm->isEGA() || + ( _vm->isEGA() || (_vm->getPlatform() == Common::kPlatformMacintosh) || (_vm->getPlatform() == Common::kPlatformWindows))) { diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp index 6be278295e..c325c29713 100644 --- a/engines/gob/inter_fascin.cpp +++ b/engines/gob/inter_fascin.cpp @@ -55,8 +55,8 @@ const int Inter_Fascination::_goblinFuncLookUp[][2] = { {10, 9}, {11, 10}, {12, 11}, - {1000, 12}, - {1001, 13}, + {1000, 12}, + {1001, 13}, {1002, 14} }; @@ -515,7 +515,7 @@ void Inter_Fascination::setupOpcodes() { _opcodesDrawFascination = opcodesDraw; _opcodesFuncFascination = opcodesFunc; - _opcodesGoblinFascination = opcodesGoblin; + _opcodesGoblinFascination = opcodesGoblin; } void Inter_Fascination::executeDrawOpcode(byte i) { @@ -676,14 +676,14 @@ void Inter_Fascination::oFascin_cdUnknown6() { void Inter_Fascination::oFascin_setRenderFlags() { int16 expr; -// warning("Fascination oFascin_cdUnknown10 (set render flags)"); +// warning("Fascination oFascin_cdUnknown10 (set render flags)"); evalExpr(&expr); warning("_draw_renderFlags <- %d",expr); _vm->_draw->_renderFlags = expr; } void Inter_Fascination::oFascin_cdUnknown11() { -// warning("Fascination oFascin_cdUnknown11 (set variable)"); +// warning("Fascination oFascin_cdUnknown11 (set variable)"); evalExpr(0); } @@ -744,7 +744,7 @@ const char *Inter_Fascination::getOpcodeGoblinDesc(int i) { for (int j = 0; j < ARRAYSIZE(_goblinFuncLookUp); j++) if (_goblinFuncLookUp[j][0] == i) return _opcodesGoblinFascination[_goblinFuncLookUp[j][1]].desc; - warning("Error in getOpcodeGoblinDesc %d",i); + warning("Error in getOpcodeGoblinDesc %d",i); return ""; } diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp index eeb935fdc0..46621582e5 100644 --- a/engines/gob/inter_v5.cpp +++ b/engines/gob/inter_v5.cpp @@ -1001,7 +1001,7 @@ void Inter_v5::o5_gob96(OpGobParams ¶ms) { warning("Dynasty Stub: GobFunc 96: %d, %d, %d, %d", speedThrottle4, speedThrottle3, speedThrottle2, speedThrottle1); - // TODO + // TODO } void Inter_v5::o5_gob97(OpGobParams ¶ms) { diff --git a/engines/gob/parse.h b/engines/gob/parse.h index 058d94afa6..d72b4d5c2b 100644 --- a/engines/gob/parse.h +++ b/engines/gob/parse.h @@ -86,7 +86,7 @@ enum { enum { // FIXME: The following two 'truth values' are stored inside the list // of "operators". So they somehow coincide with OP_LOAD_VAR_UINT32 - // and OP_LOAD_VAR_UINT32_AS_UINT16. I haven't yet quite understood + // and OP_LOAD_VAR_UINT32_AS_UINT16. I haven't yet quite understood // how, resp. what that means. You have been warned. GOB_TRUE = 24, GOB_FALSE = 23 diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp index 716d52c564..647eaa913b 100644 --- a/engines/groovie/graphics.cpp +++ b/engines/groovie/graphics.cpp @@ -60,7 +60,7 @@ void GraphicsMan::update() { _fading = 0; // Clear the buffer when ending the fade out - if (_fading == 2) + if (_fading == 2) _foreground.fillRect(Common::Rect(640, 320), 0); } } diff --git a/engines/lure/lure.h b/engines/lure/lure.h index ecf8269fd3..12494870ad 100644 --- a/engines/lure/lure.h +++ b/engines/lure/lure.h @@ -99,17 +99,17 @@ public: virtual GUI::Debugger *getDebugger(); bool isEGA() const { return (getFeatures() & GF_EGA) != 0; } - virtual Common::Error loadGameState(int slot) { + virtual Common::Error loadGameState(int slot) { return loadGame(slot) ? Common::kReadingFailed : Common::kNoError; } virtual Common::Error saveGameState(int slot, const char *desc) { String s(desc); return saveGame(slot, s) ? Common::kReadingFailed : Common::kNoError; } - virtual bool canLoadGameStateCurrently() { + virtual bool canLoadGameStateCurrently() { return _saveLoadAllowed && !Fights.isFighting(); } - virtual bool canSaveGameStateCurrently() { + virtual bool canSaveGameStateCurrently() { return _saveLoadAllowed && !Fights.isFighting(); } }; diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 7656d9c5c4..763ea0840d 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -431,7 +431,7 @@ void GameDatabaseV2::load(Common::SeekableReadStream &sourceS) { // "Decrypt" the text data for (uint32 i = 0; i < textSize; i++) _gameText[i] += 0x1E; - + sourceS.seek(objectsOffs); if (version == 40) { diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index 950db959f3..e43b00146f 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -244,7 +244,7 @@ static const MadeGameDescription gameDescriptions[] = { GF_CD_COMPRESSED, 3, }, - + { // Return to Zork - French CD version 1.2 5/13/95 (installed) // Patch #2685032 submitted by goodoldgeorg diff --git a/engines/made/graphics.cpp b/engines/made/graphics.cpp index 89ec7b20a4..7e8330d3f4 100644 --- a/engines/made/graphics.cpp +++ b/engines/made/graphics.cpp @@ -77,7 +77,7 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u byte *cmdBuffer = source + cmdOffs; ValueReader maskReader(source + maskOffs, (maskFlags & 2) != 0); ValueReader pixelReader(source + pixelOffs, (pixelFlags & 2) != 0); - + if ((maskFlags != 0) && (maskFlags != 2) && (pixelFlags != 0) && (pixelFlags != 2) && (cmdFlags != 0)) error("decompressImage() Unsupported flags: cmdFlags = %02X; maskFlags = %02X, pixelFlags = %02X", cmdFlags, maskFlags, pixelFlags); diff --git a/engines/made/made.cpp b/engines/made/made.cpp index 10e8c5d7e9..50a14c3e34 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -280,7 +280,7 @@ Common::Error MadeEngine::run() { } else { error ("Unknown MADE game"); } - + if ((getFeatures() & GF_CD) || (getFeatures() & GF_CD_COMPRESSED)) checkCD(); diff --git a/engines/made/made.h b/engines/made/made.h index be369053cb..c512ecde1d 100644 --- a/engines/made/made.h +++ b/engines/made/made.h @@ -117,7 +117,7 @@ public: bool _autoStopSound; uint _soundEnergyIndex; SoundEnergyArray *_soundEnergyArray; - + uint32 _musicBeatStart; uint32 _cdTimeStart; diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp index b44c2d100c..b8742b1327 100644 --- a/engines/made/resource.cpp +++ b/engines/made/resource.cpp @@ -64,7 +64,7 @@ void PictureResource::load(byte *source, int size) { void PictureResource::loadRaw(byte *source, int size) { // Loads a "raw" picture as used in RtZ, LGoP2, Manhole:N&E and Rodney's Funscreen - + Common::MemoryReadStream *sourceS = new Common::MemoryReadStream(source, size); _hasPalette = (sourceS->readByte() != 0); @@ -118,7 +118,7 @@ void PictureResource::loadChunked(byte *source, int size) { uint32 chunkType = sourceS->readUint32BE(); uint32 chunkSize = sourceS->readUint32BE(); - + if (sourceS->eos()) break; diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp index b89ecce70a..7d1c3ed0a7 100644 --- a/engines/made/screenfx.cpp +++ b/engines/made/screenfx.cpp @@ -51,15 +51,15 @@ ScreenEffects::ScreenEffects(Screen *screen) : _screen(screen) { vfxY1 = 0; vfxWidth = 0; vfxHeight = 0; - + _fxPalette = new byte[768]; - + } ScreenEffects::~ScreenEffects() { delete[] _fxPalette; } - + void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { // Workaround: we set up the final palette beforehand, to reduce CPU usage during the screen effect. // The visual difference is not noticeable, but CPU load is much much less (as palette updates are very expensive). diff --git a/engines/made/screenfx.h b/engines/made/screenfx.h index 9004cc9a35..912eb8e0f7 100644 --- a/engines/made/screenfx.h +++ b/engines/made/screenfx.h @@ -53,7 +53,7 @@ private: void setPalette(byte *palette); void setBlendedPalette(byte *palette, byte *newPalette, int colorCount, int16 value, int16 maxValue); void copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2); - + void vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx01(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index 5b6ff37905..c0373dfa0d 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -632,7 +632,7 @@ int16 ScriptFunctions::sfClearMono(int16 argc, int16 *argv) { } int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) { - // This is called while in-game voices are played to animate + // This is called while in-game voices are played to animate // mouths when NPCs are talking int result = 0; if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle) && _vm->_soundEnergyArray) { diff --git a/engines/made/sound.cpp b/engines/made/sound.cpp index 99186fc008..5ff1f73b05 100644 --- a/engines/made/sound.cpp +++ b/engines/made/sound.cpp @@ -150,7 +150,7 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou uint16 ofs = 0; uint16 i = 0, l = 0; byte val; - + SoundEnergyItem soundEnergyItem; const int modeValues[3][4] = { @@ -225,11 +225,11 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou for (i = 0; i < workChunkSize; i++) soundBuffer[i] = *source++; workSample = soundBuffer[workChunkSize - 1] - 128; - + soundEnergyItem.energy = 4; if (soundEnergyArray) soundEnergyArray->push_back(soundEnergyItem); - + break; default: diff --git a/engines/saga/actor.h b/engines/saga/actor.h index d2ef43caf3..d998c65240 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -649,7 +649,7 @@ public: struct DebugPoint { Point point; byte color; - + DebugPoint() : color(0) {} DebugPoint(const Point &p, byte c): point(p), color(c) {} diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 27a1e2ae9b..7265860d86 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -104,7 +104,7 @@ enum GameFileTypes { GAME_SOUNDFILE = 1 << 2, // SFX (also contains voices and MIDI music in SAGA 2 games) GAME_VOICEFILE = 1 << 3, // Voices (also contains SFX in the ITE floppy version) // ITE specific - GAME_DIGITALMUSICFILE = 1 << 4, // ITE digital music, added by Wyrmkeep + GAME_DIGITALMUSICFILE = 1 << 4, // ITE digital music, added by Wyrmkeep GAME_MACBINARY = 1 << 5, // ITE Mac CD Guild GAME_DEMOFILE = 1 << 6, // Early ITE demo GAME_SWAPENDIAN = 1 << 7, // Used to identify the BE voice file in the ITE combined version diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp index 5546e81992..a7c802f0c9 100644 --- a/engines/saga/scene.cpp +++ b/engines/saga/scene.cpp @@ -399,7 +399,7 @@ void Scene::skipScene() { _sceneQueue.erase(_sceneQueue.begin(), queueIterator); endScene(); - + loadScene(*_sceneQueue.begin()); break; } diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 7a7e15c249..6fd6adfa10 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -316,7 +316,7 @@ void Script::setupScriptOpcodeList() { // String manipulation OPCODE(opDummy), // 71: opStrCat, string concatenation (unused) OPCODE(opDummy), // 72: opStrFormat, string formatting (unused) - // Assignment + // Assignment OPCODE(opDummy), // 73: assign (unused) OPCODE(opDummy), // 74: += (unused) OPCODE(opDummy), // 75: -= (unused) @@ -434,7 +434,7 @@ void Script::setupScriptOpcodeList() { // String manipulation OPCODE(opDummy), // 80: opStrCat, string concatenation (unused) OPCODE(opDummy), // 81: opStrFormat, string formatting (unused) - // Assignment + // Assignment OPCODE(opDummy), // 82: assign (unused) OPCODE(opDummy), // 83: += (unused) OPCODE(opDummy), // 84: -= (unused) @@ -660,7 +660,7 @@ void Script::opCcallV(SCRIPTOP_PARAMS) { (this->*scriptFunction)(thread, argumentsCount, stopParsing); if (stopParsing) return; - + if (scriptFunction == &Saga::Script::sfScriptGotoScene) { stopParsing = true; breakOut = true; diff --git a/engines/saga/script.h b/engines/saga/script.h index 85eb92b96c..fa2ea35c5d 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -444,7 +444,7 @@ protected: void setupScriptOpcodeList(); void opDummy(SCRIPTOP_PARAMS) { warning("Dummy opcode called"); } - void opNextBlock(SCRIPTOP_PARAMS) { + void opNextBlock(SCRIPTOP_PARAMS) { thread->_instructionOffset = (((thread->_instructionOffset) >> 10) + 1) << 10; } void opDup(SCRIPTOP_PARAMS); diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index 29f2ab28ce..b2744482bd 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -219,7 +219,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff file->open(soundFileName); soundResourceLength = file->size(); context->isBigEndian = true; - } else + } else #endif { ResourceData* resourceData = context->getResourceData(resourceId); diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 7cd39d3c7e..74a62da356 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -1042,7 +1042,7 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) { if (audioRes) { audioStream = Audio::makeLinearInputStream(audioRes->data, audioRes->size, _audioRate, Audio::Mixer::FLAG_UNSIGNED, 0, 0); - sampleLen = audioRes->size * 60 / _audioRate; + sampleLen = audioRes->size * 60 / _audioRate; } else { // No patch file found, read it from the audio volume byte volume; @@ -1057,8 +1057,8 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) { sprintf(filename, "AUDIO%03d.%03d", _lang, volume); // Try to load compressed - audioStream = Audio::AudioStream::openStreamFile(filename, start, duration); - if (!audioStream) { + audioStream = Audio::AudioStream::openStreamFile(filename, start, duration); + if (!audioStream) { // Compressed file load failed, try to load original raw data byte *soundbuff = (byte *)malloc(size); Common::File* audioFile = new Common::File(); @@ -1094,7 +1094,7 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) { case kSci1AudioPosition: if (mixer->isSoundHandleActive(_audioHandle)) { return make_reg(0, mixer->getSoundElapsedTime(_audioHandle) * 6 / 100); // return elapsed time in ticks - } else { + } else { return make_reg(0, -1); // Sound finished } case kSci1AudioRate: diff --git a/engines/sci/sfx/player/player.cpp b/engines/sci/sfx/player/player.cpp index 2336978743..5c811f8ab8 100644 --- a/engines/sci/sfx/player/player.cpp +++ b/engines/sci/sfx/player/player.cpp @@ -91,8 +91,8 @@ static void play_song(SongIterator *it) { } static void player_tell_synth(int buf_nr, byte *buf) { - byte op1 = (buf_nr < 2 ? 0 : buf[1]); - byte op2 = (buf_nr < 3 ? 0 : buf[2]); + byte op1 = (buf_nr < 2 ? 0 : buf[1]); + byte op2 = (buf_nr < 3 ? 0 : buf[2]); static_cast<MidiDriver *>(mididrv)->send(buf[0], op1, op2); } diff --git a/engines/sci/sfx/player/polled.cpp b/engines/sci/sfx/player/polled.cpp index 27d0f88ffe..842b7c5df5 100644 --- a/engines/sci/sfx/player/polled.cpp +++ b/engines/sci/sfx/player/polled.cpp @@ -99,7 +99,7 @@ protected: void PolledPlayerAudioStream::queryTimestamp() { Audio::Timestamp stamp; - + if (!new_song) { _mode = FEED_MODE_IDLE; } else { diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index 297d0a0d12..63feeb9385 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -522,7 +522,7 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) { } else if (argv[1][0] == '-') { result = Common::disableDebugChannel(argv[1] + 1); } - + if (result) { DebugPrintf("%s %s\n", (argv[1][0] == '+') ? "Enabled" : "Disabled", argv[1] + 1); } else { diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index d886ec4af3..f378f2225e 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -440,9 +440,9 @@ void ScummEngine_v3::processKeyboard(Common::KeyState lastKeyHit) { // SCUMM var 244 is the episode score // and var 245 is the series score char text[50]; - + updateIQPoints(); - + sprintf(text, "IQ Points: Episode = %d, Series = %d", _scummVars[244], _scummVars[245]); Indy3IQPointsDialog indy3IQPointsDialog(this, text); runDialog(indy3IQPointsDialog); diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index c5b7effd6a..a2cd4a0d4d 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -829,7 +829,7 @@ int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) { uint sum, bestsum, bestitem = 0; int startColor = (_game.version == 8) ? 24 : 1; - + if (_game.heversion >= 99) pal = _hePalettes + 1024 + startColor * 3; else diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index a24e3eeb04..f40391778c 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -452,7 +452,7 @@ void Control::doControlPanel(void) { if (SkyEngine::isDemo()) { return; } - + initPanel(); _savedCharSet = _skyText->giveCurrentCharSet(); @@ -783,7 +783,7 @@ uint16 Control::shiftDown(uint8 speed) { else return 0; } - + return SHIFTED; } diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index 9077e4f8c3..3ff943a3f0 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -149,14 +149,14 @@ void ControlButton::draw(void) { memset(HIFbuf, 0, _resMan->readUint16(&fHead->height) * _resMan->readUint16(&fHead->width)); Screen::decompressHIF(src, HIFbuf); src = HIFbuf; - + if (_resMan->readUint16(&fHead->width) < 300) for (uint16 cnt = 0; cnt < _resMan->readUint16(&fHead->height); cnt++) { for (uint16 cntx = 0; cntx < _resMan->readUint16(&fHead->width); cntx++) if (src[cntx]) dst[cntx] = src[cntx]; - - dst += SCREEN_WIDTH; + + dst += SCREEN_WIDTH; for (uint16 cntx = 0; cntx < _resMan->readUint16(&fHead->width); cntx++) if (src[cntx]) dst[cntx] = src[cntx]; @@ -191,14 +191,14 @@ void ControlButton::draw(void) { dst[cntx * 2] = src[cntx]; dst[cntx * 2 + 1] = src[cntx]; } - - dst += SCREEN_WIDTH; + + dst += SCREEN_WIDTH; for (uint16 cntx = 0; cntx < _resMan->readUint16(&fHead->width) / 2; cntx++) if (src[cntx]) { dst[cntx * 2] = src[cntx]; dst[cntx * 2 + 1] = src[cntx]; } - + dst += SCREEN_WIDTH; src += _resMan->readUint16(&fHead->width)/2; } @@ -214,7 +214,7 @@ void ControlButton::draw(void) { dst += SCREEN_WIDTH; src += _resMan->readUint16(&fHead->width); } - + _system->copyRectToScreen(_dstBuf, SCREEN_WIDTH, _x, _y, _width, _height); } @@ -1022,15 +1022,15 @@ void Control::renderText(const uint8 *str, uint16 x, uint16 y, uint8 mode) { Screen::decompressHIF(sprData, HIFbuf); sprData = HIFbuf; } - + for (uint16 cnty = 0; cnty < _resMan->getUint16(chSpr->height); cnty++) { for (uint16 cntx = 0; cntx < _resMan->getUint16(chSpr->width); cntx++) { if (sprData[cntx]) dst[cntx] = sprData[cntx]; } - + if(SwordEngine::isPsx()) { //On PSX version we need to double horizontal lines - dst += SCREEN_WIDTH; + dst += SCREEN_WIDTH; for (uint16 cntx = 0; cntx < _resMan->getUint16(chSpr->width); cntx++) if (sprData[cntx]) dst[cntx] = sprData[cntx]; @@ -1041,10 +1041,10 @@ void Control::renderText(const uint8 *str, uint16 x, uint16 y, uint8 mode) { } destX += _resMan->getUint16(chSpr->width) - 3; str++; - + free(HIFbuf); } - + _system->copyRectToScreen(_screenBuf + y * SCREEN_WIDTH + x, SCREEN_WIDTH, x, y, (destX - x) + 3, 28); } @@ -1070,7 +1070,7 @@ void Control::renderVolumeBar(uint8 id, uint8 volL, uint8 volR) { for (uint16 cnty = 0; cnty < barHeight; cnty++) { memcpy(destMem, srcMem, _resMan->getUint16(frHead->width)); - + if(SwordEngine::isPsx()) { //linedoubling destMem += SCREEN_WIDTH; memcpy(destMem, srcMem, _resMan->getUint16(frHead->width)); @@ -1079,7 +1079,7 @@ void Control::renderVolumeBar(uint8 id, uint8 volL, uint8 volR) { srcMem += _resMan->getUint16(frHead->width); destMem += SCREEN_WIDTH; } - + _system->copyRectToScreen(_screenBuf + destY * SCREEN_WIDTH + destX, SCREEN_WIDTH, destX, destY, _resMan->getUint16(frHead->width), _resMan->getUint16(frHead->height)); _resMan->resClose(SR_VLIGHT); destX += 32; @@ -1106,7 +1106,7 @@ void Control::saveGameToFile(uint8 slot) { outf->writeByte(SAVEGAME_VERSION); if (!isPanelShown()) // Generate a thumbnail only if we are outside of game menu - Graphics::saveThumbnail(*outf); + Graphics::saveThumbnail(*outf); // Date / time tm curTime; diff --git a/engines/sword1/control.h b/engines/sword1/control.h index 6b0d838f96..d6adc61c3a 100644 --- a/engines/sword1/control.h +++ b/engines/sword1/control.h @@ -44,7 +44,7 @@ class Music; class Sound; #define SAVEGAME_HEADER MKID_BE('BS_1') -#define SAVEGAME_VERSION 2 +#define SAVEGAME_VERSION 2 #define MAX_BUTTONS 16 diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index 2c3678d020..c51d311e16 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -54,7 +54,7 @@ static const char *g_dirNames[] = { "clusters", "speech" }; #define NUM_COMMON_FILES_TO_CHECK 1 #define NUM_PC_FILES_TO_CHECK 3 #define NUM_MAC_FILES_TO_CHECK 4 -#define NUM_PSX_FILES_TO_CHECK 2 +#define NUM_PSX_FILES_TO_CHECK 2 #define NUM_DEMO_FILES_TO_CHECK 1 #define NUM_MAC_DEMO_FILES_TO_CHECK 1 #define NUM_FILES_TO_CHECK NUM_COMMON_FILES_TO_CHECK + NUM_PC_FILES_TO_CHECK + NUM_MAC_FILES_TO_CHECK + NUM_PSX_FILES_TO_CHECK + NUM_DEMO_FILES_TO_CHECK + NUM_MAC_DEMO_FILES_TO_CHECK @@ -264,7 +264,7 @@ SaveStateDescriptor SwordMetaEngine::querySaveMetaInfos(const char *target, int if (versionSave < 2) // These older version of the savegames used a flag to signal presence of thumbnail in->skip(1); - + if (Graphics::checkThumbnailHeader(*in)) { Graphics::Surface *thumbnail = new Graphics::Surface(); assert(thumbnail); @@ -323,7 +323,7 @@ Common::Error SwordEngine::loadGameState(int slot) { _control->restoreGameFromFile(slot); reinitialize(); _control->doRestore(); - reinitRes(); + reinitRes(); return Common::kNoError; // TODO: return success/failure } diff --git a/engines/sword1/mouse.cpp b/engines/sword1/mouse.cpp index 18fb9908fc..020586d702 100644 --- a/engines/sword1/mouse.cpp +++ b/engines/sword1/mouse.cpp @@ -210,7 +210,7 @@ void Mouse::createPointer(uint32 ptrId, uint32 luggageId) { uint16 resSizeX; uint16 resSizeY; - if (SwordEngine::isPsx()) //PSX pointers are half height + if (SwordEngine::isPsx()) //PSX pointers are half height ptrSizeY *= 2; if (luggageId) { @@ -244,7 +244,7 @@ void Mouse::createPointer(uint32 ptrId, uint32 luggageId) { for (uint32 cntx = 0; cntx < luggSizeX; cntx++) if (luggSrc[cntx]) dstData[cntx] = luggSrc[cntx]; - + if(SwordEngine::isPsx()) { dstData += resSizeX; for (uint32 cntx = 0; cntx < luggSizeX; cntx++) @@ -258,7 +258,7 @@ void Mouse::createPointer(uint32 ptrId, uint32 luggageId) { } _resMan->resClose(luggageId); } - + uint8 *dstData = ptrData; uint8 *srcData = (uint8*)ptr + sizeof(MousePtr); for (uint32 frameCnt = 0; frameCnt < noFrames; frameCnt++) { @@ -267,7 +267,7 @@ void Mouse::createPointer(uint32 ptrId, uint32 luggageId) { if (srcData[cntx]) dstData[cntx] = srcData[cntx]; - if(SwordEngine::isPsx()) { + if(SwordEngine::isPsx()) { dstData +=resSizeX; for (uint32 cntx = 0; cntx < ptrSizeX; cntx++) if (srcData[cntx]) diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index 850a861f67..feb48b0750 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -261,7 +261,7 @@ bool MusicHandle::playPSX(uint16 id, bool loop) { if (!_file.isOpen()) if (!_file.open("tunes.dat")) return false; - + Common::File tableFile; if (!tableFile.open("tunes.tab")) return false; @@ -280,7 +280,7 @@ bool MusicHandle::playPSX(uint16 id, bool loop) { _audioSource = NULL; return false; } - + return true; } diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp index d0b5827a13..7e067cd1a0 100644 --- a/engines/sword1/resman.cpp +++ b/engines/sword1/resman.cpp @@ -354,8 +354,8 @@ MemHandle *ResMan::resHandle(uint32 id) { // portuguese subtitles (cluster file 2, group 6) with a version that do not // contain subtitles for this languages (i.e. has only 6 languages and not 7). if (cluster >= _prj.noClu || group >= _prj.clu[cluster].noGrp) - return NULL; - + return NULL; + return &(_prj.clu[cluster].grp[group].resHandle[id & 0xFFFF]); } @@ -376,7 +376,7 @@ uint32 ResMan::resOffset(uint32 id) { id = _srIdList[id & 0xFFFF]; uint8 cluster = (uint8)((id >> 24) - 1); uint8 group = (uint8)(id >> 16); - + if (cluster >= _prj.noClu || group >= _prj.clu[cluster].noGrp) return 0; diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp index 3f2544d8cf..e6193e4137 100644 --- a/engines/sword1/screen.cpp +++ b/engines/sword1/screen.cpp @@ -348,7 +348,7 @@ void Screen::newScreen(uint32 screen) { void Screen::quitScreen(void) { uint8 cnt; - if (SwordEngine::isPsx()) + if (SwordEngine::isPsx()) flushPsxCache(); for (cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers; cnt++) _resMan->resClose(_roomDefTable[_currentScreen].layers[cnt]); @@ -363,9 +363,9 @@ void Screen::quitScreen(void) { void Screen::draw(void) { uint8 cnt; - + debug(8, "Screen::draw() -> _currentScreen %u", _currentScreen); - + if (_currentScreen == 54) { // rm54 has a BACKGROUND parallax layer in parallax[0] if (_parallax[0] && !SwordEngine::isPsx() ) //Avoid drawing this parallax on PSX edition, it gets occluded by background @@ -400,7 +400,7 @@ void Screen::draw(void) { } else { //We are using PSX version if(_currentScreen == 45 || _currentScreen == 55 || _currentScreen == 57 || _currentScreen == 63 || _currentScreen == 71) { // Width shrinked backgrounds - if (!_psxCache.decodedBackground) + if (!_psxCache.decodedBackground) _psxCache.decodedBackground = psxShrinkedBackgroundToIndexed(_layerBlocks[0], _scrnSizeX, _scrnSizeY); } else { if (!_psxCache.decodedBackground) @@ -425,11 +425,11 @@ void Screen::draw(void) { if (_parallax[1]) renderParallax(_parallax[1]); - // PSX version has parallax layer for this room in an external file (TRAIN.PLX) + // PSX version has parallax layer for this room in an external file (TRAIN.PLX) if(SwordEngine::isPsx() && _currentScreen == 63) { // FIXME: this should be handled in a cleaner way... if (!_psxCache.extPlxCache) { - Common::File parallax; + Common::File parallax; parallax.open("TRAIN.PLX"); _psxCache.extPlxCache = (uint8*) malloc(parallax.size()); parallax.read(_psxCache.extPlxCache, parallax.size()); @@ -448,9 +448,9 @@ void Screen::processImage(uint32 id) { Object *compact; FrameHeader *frameHead; int scale; - + compact = _objMan->fetchObject(id); - + if (compact->o_type == TYPE_TEXT) frameHead = _textMan->giveSpriteData((uint8)compact->o_target); else @@ -460,7 +460,7 @@ void Screen::processImage(uint32 id) { uint16 spriteX = compact->o_anim_x; uint16 spriteY = compact->o_anim_y; - + if (compact->o_status & STAT_SHRINK) { scale = (compact->o_scale_a * compact->o_ycoord + compact->o_scale_b) / 256; spriteX += ((int16)_resMan->readUint16(&frameHead->offsetX) * scale) / 256; @@ -514,7 +514,7 @@ void Screen::processImage(uint32 id) { } else sprSizeY = (_resMan->readUint16(&frameHead->height)); } - + if (!(compact->o_status & STAT_OVERRIDE)) { //mouse size linked to exact size & coordinates of sprite box - shrink friendly if (_resMan->readUint16(&frameHead->offsetX) || _resMan->readUint16(&frameHead->offsetY)) { @@ -537,7 +537,7 @@ void Screen::processImage(uint32 id) { spriteClipAndSet(&spriteX, &spriteY, &sprSizeX, &sprSizeY, &incr); if ((sprSizeX > 0) && (sprSizeY > 0)) { - if( (!(SwordEngine::isPsx()) || (compact->o_type == TYPE_TEXT) + if( (!(SwordEngine::isPsx()) || (compact->o_type == TYPE_TEXT) || (compact->o_resource == LVSFLY) || (!(compact->o_resource == GEORGE_MEGA) && (sprSizeX < 260)))) drawSprite(sprData + incr, spriteX, spriteY, sprSizeX, sprSizeY, sprPitch); else if (((sprSizeX >= 260) && (sprSizeX < 450)) || ((compact->o_resource == GMWRITH) && (sprSizeX < 515)) // a psx shrinked sprite (1/2 width) @@ -550,13 +550,13 @@ void Screen::processImage(uint32 id) { if (!(compact->o_status&STAT_FORE) && !(SwordEngine::isPsx() && (compact->o_resource == MOUBUSY))) // Check fixes moue sprite being masked by layer, happens only on psx verticalMask(spriteX, spriteY, sprSizeX, sprSizeY); } - + if (compact->o_type != TYPE_TEXT) _resMan->resClose(compact->o_resource); - + if (tonyBuf) free(tonyBuf); - + if (hifBuf) free(hifBuf); } @@ -569,7 +569,7 @@ void Screen::verticalMask(uint16 x, uint16 y, uint16 bWidth, uint16 bHeight) { bHeight *= 2; bWidth *= 2; } - + bWidth = (bWidth + (x & (SCRNGRID_X - 1)) + (SCRNGRID_X - 1)) / SCRNGRID_X; bHeight = (bHeight + (y & (SCRNGRID_Y - 1)) + (SCRNGRID_Y - 1)) / SCRNGRID_Y; @@ -615,14 +615,14 @@ void Screen::blitBlockClear(uint16 x, uint16 y, uint8 *data) { for (uint8 cntx = 0; cntx < SCRNGRID_X; cntx++) if (data[cntx]) dest[cntx] = data[cntx]; - + if (SwordEngine::isPsx()) { dest += _scrnSizeX; for (uint8 cntx = 0; cntx < SCRNGRID_X; cntx++) if (data[cntx]) dest[cntx] = data[cntx]; - } - + } + data += SCRNGRID_X; dest += _scrnSizeX; } @@ -717,19 +717,19 @@ void Screen::renderParallax(uint8 *data) { void Screen::drawSprite(uint8 *sprData, uint16 sprX, uint16 sprY, uint16 sprWidth, uint16 sprHeight, uint16 sprPitch) { uint8 *dest = _screenBuf + (sprY * _scrnSizeX) + sprX; - + for (uint16 cnty = 0; cnty < sprHeight; cnty++) { for (uint16 cntx = 0; cntx < sprWidth; cntx++) if (sprData[cntx]) dest[cntx] = sprData[cntx]; - + if (SwordEngine::isPsx()) { //On PSX version we need to double horizontal lines - dest += _scrnSizeX; + dest += _scrnSizeX; for (uint16 cntx = 0; cntx < sprWidth; cntx++) if (sprData[cntx]) dest[cntx] = sprData[cntx]; } - + sprData += sprPitch; dest += _scrnSizeX; } @@ -738,14 +738,14 @@ void Screen::drawSprite(uint8 *sprData, uint16 sprX, uint16 sprY, uint16 sprWidt // Used to draw psx sprites which are 1/2 of original width void Screen::drawPsxHalfShrinkedSprite(uint8 *sprData, uint16 sprX, uint16 sprY, uint16 sprWidth, uint16 sprHeight, uint16 sprPitch) { uint8 *dest = _screenBuf + (sprY * _scrnSizeX) + sprX; - + for (uint16 cnty = 0; cnty < sprHeight; cnty++) { for (uint16 cntx = 0; cntx < sprWidth; cntx++) if (sprData[cntx]) { dest[cntx * 2] = sprData[cntx]; //In these sprites we need to double vetical lines too... dest[cntx * 2 + 1] = sprData[cntx]; } - + dest += _scrnSizeX; for (uint16 cntx = 0; cntx < sprWidth; cntx++) if (sprData[cntx]) { @@ -754,7 +754,7 @@ void Screen::drawPsxHalfShrinkedSprite(uint8 *sprData, uint16 sprX, uint16 sprY, } sprData += sprPitch; - dest += _scrnSizeX; + dest += _scrnSizeX; } } @@ -769,7 +769,7 @@ void Screen::drawPsxFullShrinkedSprite(uint8 *sprData, uint16 sprX, uint16 sprY, dest[cntx * 3 + 1] = sprData[cntx]; dest[cntx * 3 + 2] = sprData[cntx]; } - + dest += _scrnSizeX; for (uint16 cntx = 0; cntx < sprWidth; cntx++) if (sprData[cntx]) { @@ -777,7 +777,7 @@ void Screen::drawPsxFullShrinkedSprite(uint8 *sprData, uint16 sprX, uint16 sprY, dest[cntx * 3 + 1] = sprData[cntx]; dest[cntx * 3 + 2] = sprData[cntx]; } - + sprData += sprPitch; dest += _scrnSizeX; } @@ -790,7 +790,7 @@ void Screen::fastShrink(uint8 *src, uint32 width, uint32 height, uint32 scale, u uint32 step = 0x10000 / scale; uint8 columnTab[160]; uint32 res = step >> 1; - + for (uint16 cnt = 0; cnt < resWidth; cnt++) { columnTab[cnt] = (uint8)(res >> 8); res += step; @@ -865,8 +865,8 @@ uint8* Screen::psxBackgroundToIndexed(uint8 *psxBackground, uint32 bakXres, uint psxBackground += 4; //We skip the id tag for (uint32 currentTile = 0; currentTile < totTiles; currentTile++) { - uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); - + uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); + if(isCompressed) decompressHIF(psxBackground + tileOffset - 4, decomp_tile); //Decompress the tile into decomp_tile else @@ -875,10 +875,10 @@ uint8* Screen::psxBackgroundToIndexed(uint8 *psxBackground, uint32 bakXres, uint if (currentTile > 0 && !(currentTile % xresInTiles)) { //Finished a line of tiles, going down tileYpos++; tileXpos = 0; - } - + } + for (byte tileLine = 0; tileLine < 16; tileLine++) { // Copy data to destination buffer - memcpy(fullres_buffer + tileLine * bakXres * 2 + tileXpos * 16 + tileYpos * bakXres * 16 * 2, decomp_tile + tileLine * 16, 16); + memcpy(fullres_buffer + tileLine * bakXres * 2 + tileXpos * 16 + tileYpos * bakXres * 16 * 2, decomp_tile + tileLine * 16, 16); memcpy(fullres_buffer + tileLine * bakXres * 2 + bakXres + tileXpos * 16 + tileYpos * bakXres * 16 * 2, decomp_tile + tileLine * 16, 16); } tileXpos++; @@ -909,8 +909,8 @@ uint8* Screen::psxShrinkedBackgroundToIndexed(uint8 *psxBackground, uint32 bakXr uint32 currentTile; for (currentTile = 0; currentTile < totTiles; currentTile++) { - uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); - + uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); + if(isCompressed) decompressHIF(psxBackground + tileOffset - 4, decomp_tile); //Decompress the tile into decomp_tile else @@ -919,8 +919,8 @@ uint8* Screen::psxShrinkedBackgroundToIndexed(uint8 *psxBackground, uint32 bakXr if (currentTile > 0 && !(currentTile % xresInTiles)) { //Finished a line of tiles, going down tileYpos++; tileXpos = 0; - } - + } + for (byte tileLine = 0; tileLine < 16; tileLine++) { uint8 *dest = fullres_buffer + tileLine * bakXres * 2 + tileXpos * 32 + tileYpos * bakXres * 16 * 2; for (byte tileColumn = 0; tileColumn < 16; tileColumn++) { @@ -947,7 +947,7 @@ uint8* Screen::psxShrinkedBackgroundToIndexed(uint8 *psxBackground, uint32 bakXr tileXpos = 0; for (; currentTile < totTiles + remainingTiles; currentTile++) { - uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); + uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); if(isCompressed) decompressHIF(psxBackground + tileOffset - 4, decomp_tile); //Decompress the tile into decomp_tile @@ -955,7 +955,7 @@ uint8* Screen::psxShrinkedBackgroundToIndexed(uint8 *psxBackground, uint32 bakXr memcpy(decomp_tile, psxBackground + tileOffset - 4, 256); for (byte tileLine = 0; tileLine < tileHeight; tileLine++) { // Write the decoded tiles into last lines of background - memcpy(fullres_buffer + tileXpos * 16 + (tileLine + (yresInTiles - 1) * 16) * bakXres * 2, decomp_tile + tileLine * 16, 16); + memcpy(fullres_buffer + tileXpos * 16 + (tileLine + (yresInTiles - 1) * 16) * bakXres * 2, decomp_tile + tileLine * 16, 16); memcpy(fullres_buffer + tileXpos * 16 + (tileLine + (yresInTiles - 1) * 16) * bakXres * 2 + bakXres, decomp_tile + tileLine * 16, 16); } tileXpos++; @@ -997,10 +997,10 @@ void Screen::drawPsxParallax(uint8 *psxParallax, uint16 paraScrlX, uint16 scrnSc int32 tileBegin = (tileXpos * 16) - paraScrlX; tileBegin = (tileBegin < 0) ? 0 : tileBegin; uint16 currentLine = (tileYpos * 16); //Current line of the image we are drawing upon, used to avoid going out of screen - + if (tileXpos >= skipRow) { // Tiles not needed in the screen buffer are not uncompressed uint32 tileOffset = READ_LE_UINT32(plxOff + 4 * currentTile); - uint16 rightScreenLimit = _scrnSizeX - scrnScrlX; // Do not write over and beyond this limit, lest we get memory corruption + uint16 rightScreenLimit = _scrnSizeX - scrnScrlX; // Do not write over and beyond this limit, lest we get memory corruption uint8 *dest = _screenBuf + (tileYpos * 16 * _scrnSizeX) + tileBegin + scrnScrlX; uint8 *src = tile_buffer; @@ -1008,15 +1008,15 @@ void Screen::drawPsxParallax(uint8 *psxParallax, uint16 paraScrlX, uint16 scrnSc if (tileXpos != skipRow) { // This tile will surely be drawn fully in the buffer for (byte tileLine = 0; (tileLine < 16) && (currentLine < SCREEN_DEPTH); tileLine++) { // Check that we are not going outside the bottom screen part - for (byte tileColumn = 0; (tileColumn < 16) && (tileBegin + tileColumn) < rightScreenLimit; tileColumn++) - if (*(src + tileColumn)) *(dest + tileColumn) = *(src + tileColumn); - dest += _scrnSizeX; + for (byte tileColumn = 0; (tileColumn < 16) && (tileBegin + tileColumn) < rightScreenLimit; tileColumn++) + if (*(src + tileColumn)) *(dest + tileColumn) = *(src + tileColumn); + dest += _scrnSizeX; currentLine++; if (currentLine < SCREEN_DEPTH) { - for (byte tileColumn = 0; (tileColumn < 16) && (tileBegin + tileColumn) < rightScreenLimit; tileColumn++) - if (*(src + tileColumn)) *(dest + tileColumn) = *(src + tileColumn); - dest += _scrnSizeX; + for (byte tileColumn = 0; (tileColumn < 16) && (tileBegin + tileColumn) < rightScreenLimit; tileColumn++) + if (*(src + tileColumn)) *(dest + tileColumn) = *(src + tileColumn); + dest += _scrnSizeX; currentLine++; } src += 16; // get to next line of decoded tile @@ -1024,15 +1024,15 @@ void Screen::drawPsxParallax(uint8 *psxParallax, uint16 paraScrlX, uint16 scrnSc } else { // This tile may be drawn only partially src += leftPixelSkip; //Skip hidden pixels for (byte tileLine = 0; (tileLine < 16) && (currentLine < SCREEN_DEPTH); tileLine++) { - for (byte tileColumn = 0; tileColumn < (16 - leftPixelSkip); tileColumn++) - if (*(src + tileColumn)) *(dest + tileColumn) = *(src + tileColumn); - dest += _scrnSizeX; + for (byte tileColumn = 0; tileColumn < (16 - leftPixelSkip); tileColumn++) + if (*(src + tileColumn)) *(dest + tileColumn) = *(src + tileColumn); + dest += _scrnSizeX; currentLine++; if (currentLine < SCREEN_DEPTH) { - for (byte tileColumn = 0; tileColumn < (16 - leftPixelSkip); tileColumn++) - if (*(src + tileColumn)) *(dest + tileColumn) = *(src + tileColumn); - dest += _scrnSizeX; + for (byte tileColumn = 0; tileColumn < (16 - leftPixelSkip); tileColumn++) + if (*(src + tileColumn)) *(dest + tileColumn) = *(src + tileColumn); + dest += _scrnSizeX; currentLine++; } src += 16; @@ -1100,9 +1100,9 @@ void Screen::decompressHIF(uint8 *src, uint8 *dest) { src += 2; if (info_word == 0xFFFF) return; //Got 0xFFFF code, finished. - int32 repeat_count = (info_word >> 12) + 2; //How many time data needs to be refetched + int32 repeat_count = (info_word >> 12) + 2; //How many time data needs to be refetched while(repeat_count >= 0) { - uint8 *old_data_src = dest - ((info_word & 0xFFF) + 1); + uint8 *old_data_src = dest - ((info_word & 0xFFF) + 1); *dest++ = *old_data_src; repeat_count--; } @@ -1178,7 +1178,7 @@ void Screen::spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *pSprWidth, u *pSprWidth = 0; else *pSprWidth = (uint16)sprW; - + *pSprX = (uint16)sprX; *pSprY = (uint16)sprY; @@ -1186,18 +1186,18 @@ void Screen::spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *pSprWidth, u // sprite will be drawn, so mark it in the grid buffer uint16 gridH = (*pSprHeight + (sprY & (SCRNGRID_Y - 1)) + (SCRNGRID_Y - 1)) / SCRNGRID_Y; uint16 gridW = (*pSprWidth + (sprX & (SCRNGRID_X - 1)) + (SCRNGRID_X - 1)) / SCRNGRID_X; - - if(SwordEngine::isPsx()) { + + if(SwordEngine::isPsx()) { gridH *= 2; // This will correct the PSX sprite being cut at half height gridW *= 2; // and masking problems when sprites are stretched in width - + uint16 bottomSprPos = (*pSprY + (*pSprHeight) * 2); //Position of bottom line of sprite if ( bottomSprPos > _scrnSizeY ) { //Check that resized psx sprite isn't drawn outside of screen boundaries uint16 outScreen = bottomSprPos - _scrnSizeY; *pSprHeight -= (outScreen % 2) ? (outScreen + 1) / 2 : outScreen / 2; } - } + } uint16 gridX = sprX / SCRNGRID_X; uint16 gridY = sprY / SCRNGRID_Y; @@ -1226,7 +1226,7 @@ void Screen::showFrame(uint16 x, uint16 y, uint32 resId, uint32 frameNo, const b int i, j; if(SwordEngine::isPsx()) - memset(frame, 0, sizeof(frame)); // PSX top menu is black + memset(frame, 0, sizeof(frame)); // PSX top menu is black else memset(frame, 199, sizeof(frame)); // Dark gray background @@ -1245,11 +1245,11 @@ void Screen::showFrame(uint16 x, uint16 y, uint32 resId, uint32 frameNo, const b frame[(i * 2 + 1 + 4) * 40 + j + 2] = data; //Linedoubling the sprite } } - + free(frameBufferPSX); } else { - for (i = 0; i < _resMan->getUint16(frameHead->height); i++) - for (j = 0; j < _resMan->getUint16(frameHead->height); j++) + for (i = 0; i < _resMan->getUint16(frameHead->height); i++) + for (j = 0; j < _resMan->getUint16(frameHead->height); j++) frame[(i + 4) * 40 + j + 2] = frameData[i * _resMan->getUint16(frameHead->width) + j]; } diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index d03afa809a..1f2ad04f08 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -161,12 +161,12 @@ void Sound::playSample(QueueElement *elem) { if (_fxList[elem->id].roomVolList[cnt].roomNo) { if ((_fxList[elem->id].roomVolList[cnt].roomNo == (int)Logic::_scriptVars[SCREEN]) || (_fxList[elem->id].roomVolList[cnt].roomNo == -1)) { - + uint8 volL = (_fxList[elem->id].roomVolList[cnt].leftVol * 10 * _sfxVolL) / 255; uint8 volR = (_fxList[elem->id].roomVolList[cnt].rightVol * 10 * _sfxVolR) / 255; int8 pan = (volR - volL) / 2; uint8 volume = (volR + volL) / 2; - + if (SwordEngine::isPsx()) { ; uint32 size = READ_LE_UINT32(sampleData); Audio::AudioStream *audStream = new Audio::VagStream(new Common::MemoryReadStream(sampleData + 4, size-4), _fxList[elem->id].type == FX_LOOP); @@ -195,7 +195,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { warning("Sound::startSpeech: COW file isn't open"); return false; } - + uint32 locIndex = 0xFFFFFFFF; uint32 sampleSize = 0; uint32 index = 0; @@ -203,49 +203,49 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { if (_cowMode == CowPSX) { Common::File file; uint16 i; - + if (!file.open("speech.lis")) { warning ("Could not open speech.lis"); return false; } - for (i = 0; !file.eos() && !file.err(); i++) + for (i = 0; !file.eos() && !file.err(); i++) if (file.readUint16LE() == roomNo) { locIndex = i; break; } file.close(); - + if (locIndex == 0xFFFFFFFF) { warning ("Could not find room %d in speech.lis", roomNo); return false; } - + if (!file.open("speech.inf")) { warning ("Could not open speech.inf"); return false; } - + file.seek(locIndex * 4 + 2); // 4 bytes per room, skip first 2 bytes - + uint16 numLines = file.readUint16LE(); - uint16 roomOffset = file.readUint16LE(); + uint16 roomOffset = file.readUint16LE(); file.seek(0x112 + roomOffset * 2); // The offset is in terms of uint16's, so multiply by 2. Skip the 0x112 byte header too. - + locIndex = 0xFFFFFFFF; - + for (i = 0; i < numLines; i++) if (file.readUint16LE() == localNo) { locIndex = i; break; } - + if (locIndex == 0xFFFFFFFF) { warning ("Could not find local number %d in room %d in speech.inf", roomNo, localNo); return false; } - + file.close(); index = _cowHeader[(roomOffset + locIndex) * 2]; @@ -255,9 +255,9 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { sampleSize = _cowHeader[locIndex + (localNo * 2)]; index = _cowHeader[locIndex + (localNo * 2) - 1]; } - + debug(6, "startSpeech(%d, %d): locIndex %d, sampleSize %d, index %d", roomNo, localNo, locIndex, sampleSize, index); - + if (sampleSize) { uint8 speechVol = (_speechVolR + _speechVolL) / 2; int8 speechPan = (_speechVolR - _speechVolL) / 2; @@ -493,7 +493,7 @@ void Sound::initCowSystem(void) { debug(1, "Using uncompressed Speech Cluster"); _cowMode = CowWave; } - + if (SwordEngine::isPsx()) { // There's only one file on the PSX, so set it to the current disc. _currentCowFile = SwordEngine::_systemVars.currentCD; @@ -503,16 +503,16 @@ void Sound::initCowSystem(void) { _cowMode = CowPSX; } } - + if (!_cowFile.isOpen()) _cowFile.open("speech.clu"); - + if (!_cowFile.isOpen()) { _cowFile.open("cows.mad"); if (_cowFile.isOpen()) _cowMode = CowDemo; } - + if (_cowFile.isOpen()) { if (SwordEngine::isPsx()) { // Get data from the external table file diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 1fb6a265aa..18a3f2a7c4 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -380,7 +380,7 @@ void SwordEngine::showFileErrorMsg(uint8 type, bool *fileExists) { warning("\"%s\"", _macCdFileList[i].name); pos += sprintf(pos, "\"%s\"\n", _macCdFileList[i].name); } - } + } } else { for (int i = 0; i < ARRAYSIZE(_pcCdFileList); i++) if (!fileExists[i]) { diff --git a/engines/sword1/sword1.h b/engines/sword1/sword1.h index 1aaa5da5e0..6c336a35ae 100644 --- a/engines/sword1/sword1.h +++ b/engines/sword1/sword1.h @@ -66,7 +66,7 @@ struct SystemVars { uint8 showText; uint8 language; bool isDemo; - uint32 engineStartTime; // Used for playtime + uint32 engineStartTime; // Used for playtime Common::Platform platform; }; @@ -80,7 +80,7 @@ public: uint32 _features; bool mouseIsActive(); - + static bool isMac() { return _systemVars.platform == Common::kPlatformMacintosh; } static bool isPsx() { return _systemVars.platform == Common::kPlatformPSX; } diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp index fd9b9dea28..1ca6fdd27d 100644 --- a/engines/sword1/text.cpp +++ b/engines/sword1/text.cpp @@ -80,7 +80,7 @@ uint32 Text::lowTextManager(uint8 *ascii, int32 width, uint8 pen) { void Text::makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen) { LineInfo lines[MAX_LINES]; uint16 numLines = analyzeSentence(text, maxWidth, lines); - + uint16 sprWidth = 0; uint16 lineCnt; for (lineCnt = 0; lineCnt < numLines; lineCnt++) @@ -103,7 +103,7 @@ void Text::makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen) { memset(linePtr, NO_COL, sprSize); for (lineCnt = 0; lineCnt < numLines; lineCnt++) { uint8 *sprPtr = linePtr + (sprWidth - lines[lineCnt].width) / 2; // center the text - for (uint16 pos = 0; pos < lines[lineCnt].length; pos++) + for (uint16 pos = 0; pos < lines[lineCnt].length; pos++) sprPtr += copyChar(*text++, sprPtr, sprWidth, pen) - OVERLAP; text++; // skip space at the end of the line if(SwordEngine::isPsx()) //Chars are half height in psx version @@ -166,7 +166,7 @@ uint16 Text::copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen) { uint8 *decBuf = NULL; uint8 *decChr; uint16 frameHeight = 0; - + if(SwordEngine::isPsx()) { frameHeight = _resMan->getUint16(chFrame->height)/2; if(_fontId == CZECH_GAME_FONT) { //Czech game fonts are compressed @@ -179,7 +179,7 @@ uint16 Text::copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen) { frameHeight = _resMan->getUint16(chFrame->height); decChr = chData; } - + for (uint16 cnty = 0; cnty < frameHeight; cnty++) { for (uint16 cntx = 0; cntx < _resMan->getUint16(chFrame->width); cntx++) { if (*decChr == LETTER_COL) diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index e0b8bcbe52..21ab645bfe 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -197,7 +197,7 @@ void MoviePlayer::drawTextObject(uint32 index, byte *screen) { uint16 height = text->_textSprite.h; // Resize text sprites for PSX version - if (Sword2Engine::isPsx()) { + if (Sword2Engine::isPsx()) { height *= 2; byte *buffer = (byte *)malloc(width * height); Screen::resizePsxSprite(buffer, src, width, height); diff --git a/engines/sword2/anims.cpp b/engines/sword2/anims.cpp index dae300d0bd..1bf3967047 100644 --- a/engines/sword2/anims.cpp +++ b/engines/sword2/anims.cpp @@ -103,7 +103,7 @@ int Router::doAnimate(byte *ob_logic, byte *ob_graph, int32 animRes, bool revers // point to anim header anim_head.read(_vm->fetchAnimHeader(anim_file)); - + // now running an anim, looping back to this call again obLogic.setLooping(1); obGraph.setAnimResource(animRes); diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp index 2de831aebf..7428cbb534 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -269,9 +269,9 @@ Dialog::Dialog(Sword2Engine *vm) // Usually the mouse pointer will already be "normal", but not always. _vm->_mouse->setMouse(NORMAL_MOUSE_ID); - // Force mouse mode as system menu: normally not needed, - // but value is not correct in case of game start dialog - // (when asking to restart or load a game). + // Force mouse mode as system menu: normally not needed, + // but value is not correct in case of game start dialog + // (when asking to restart or load a game). // This is forced to avoid GMM loading/saving being enabled // during initial dialog. _vm->_mouse->setMouseMode(MOUSE_system_menu); diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp index 259fdb2f5d..7a0da04925 100644 --- a/engines/sword2/function.cpp +++ b/engines/sword2/function.cpp @@ -71,7 +71,7 @@ int32 Logic::fnInitBackground(int32 *params) { // params: 0 res id of normal background layer - cannot be 0 // 1 1 yes 0 no for a new palette - + if (Sword2Engine::isPsx()) _vm->_screen->initPsxBackground(params[0], params[1]); else @@ -395,13 +395,13 @@ int32 Logic::fnSetFrame(int32 *params) { assert(_vm->_resman->fetchType(res) == ANIMATION_FILE); // set up pointer to the animation header - AnimHeader anim_head; - + AnimHeader anim_head; + anim_head.read(_vm->fetchAnimHeader(anim_file)); - + // set up anim resource in graphic object ObjectGraphic obGraph(decodePtr(params[0])); - + obGraph.setAnimResource(res); obGraph.setAnimPc(params[2] ? anim_head.noAnimFrames - 1 : 0); diff --git a/engines/sword2/header.h b/engines/sword2/header.h index 875ccbfc4d..67cbba35af 100644 --- a/engines/sword2/header.h +++ b/engines/sword2/header.h @@ -168,7 +168,7 @@ struct AnimHeader { blend = readS.readUint16LE(); runTimeComp = readS.readByte(); feetStartDir = readS.readByte(); - feetEndDir = readS.readByte(); + feetEndDir = readS.readByte(); } else { runTimeComp = readS.readByte(); noAnimFrames = readS.readUint16LE(); @@ -631,7 +631,7 @@ struct PSXFontEntry { writeS.writeUint16LE(skipLines); writeS.writeUint16LE(charWidth); writeS.writeUint16LE(charHeight); - } + } }; } // End of namespace Sword2 diff --git a/engines/sword2/layers.cpp b/engines/sword2/layers.cpp index c54003920f..d97b1395d5 100644 --- a/engines/sword2/layers.cpp +++ b/engines/sword2/layers.cpp @@ -179,7 +179,7 @@ void Screen::initBackground(int32 res, int32 new_palette) { } // Background parallax layers - + for (i = 0; i < 2; i++) { if (screenLayerTable.bg_parallax[i]) initialiseBackgroundLayer(_vm->fetchBackgroundParallaxLayer(file, i)); @@ -188,11 +188,11 @@ void Screen::initBackground(int32 res, int32 new_palette) { } // Normal backround layer - + initialiseBackgroundLayer(_vm->fetchBackgroundLayer(file)); // Foreground parallax layers - + for (i = 0; i < 2; i++) { if (screenLayerTable.fg_parallax[i]) initialiseBackgroundLayer(_vm->fetchForegroundParallaxLayer(file, i)); diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp index ccfeda24a2..0c29e5719c 100644 --- a/engines/sword2/maketext.cpp +++ b/engines/sword2/maketext.cpp @@ -224,7 +224,7 @@ byte *FontRenderer::buildTextSprite(byte *sentence, uint32 fontRes, uint8 pen, L // Check that text sprite has even horizontal resolution in PSX version // (needed to work around a problem in some sprites, which reports an odd // number as horiz resolution, but then have the next even number as true width) - if (Sword2Engine::isPsx()) + if (Sword2Engine::isPsx()) spriteWidth = (spriteWidth % 2) ? spriteWidth + 1 : spriteWidth; // Find the total height of the text sprite: the total height of the @@ -297,7 +297,7 @@ byte *FontRenderer::buildTextSprite(byte *sentence, uint32 fontRes, uint8 pen, L // Skip space at end of last word in this line pos++; - + if (Sword2Engine::isPsx()) linePtr += (char_height / 2 + _lineSpacing) * spriteWidth; else @@ -369,11 +369,11 @@ uint16 FontRenderer::charHeight(uint32 fontRes) { */ byte *FontRenderer::findChar(byte ch, byte *charSet) { - + // PSX version doesn't use an animation table to keep all letters, // instead a big sprite (char atlas) is used, and the single char // must be extracted from that. - + if (Sword2Engine::isPsx()) { byte *buffer; PSXFontEntry header; @@ -390,7 +390,7 @@ byte *FontRenderer::findChar(byte ch, byte *charSet) { // We have no such character, generate an empty one // on the fly, size 6x12. if (header.charWidth == 0) { - + // Prepare a "bogus" FrameHeader to be returned with // "empty" character data. bogusHeader.compSize = 0; @@ -400,7 +400,7 @@ byte *FontRenderer::findChar(byte ch, byte *charSet) { buffer = (byte *)malloc(24 * 3 + FrameHeader::size()); memset(buffer, 0, 24 * 3 + FrameHeader::size()); bogusHeader.write(buffer); - + return buffer; } @@ -471,8 +471,8 @@ void FontRenderer::copyChar(byte *charPtr, byte *spritePtr, uint16 spriteWidth, // Do nothing if source pixel is zero, // ie. transparent break; - case LETTER_COL_PSX1: // Values for colored zone - case LETTER_COL_PSX2: + case LETTER_COL_PSX1: // Values for colored zone + case LETTER_COL_PSX2: case LETTER_COL: *dest = pen; break; @@ -516,7 +516,7 @@ uint32 FontRenderer::buildNewBloc(byte *ascii, int16 x, int16 y, uint16 width, u assert(i < MAX_text_blocs); // Create and position the sprite - + _blocList[i].text_mem = makeTextSprite(ascii, width, pen, fontRes); // 'NO_JUSTIFICATION' means print sprite with top-left at (x,y) diff --git a/engines/sword2/menu.cpp b/engines/sword2/menu.cpp index c90a1a9df3..921a3c77b5 100644 --- a/engines/sword2/menu.cpp +++ b/engines/sword2/menu.cpp @@ -43,7 +43,7 @@ void Mouse::clearIconArea(int menu, int pocket, Common::Rect *r) { byte *buf = _vm->_screen->getScreen(); int16 screenWide = _vm->_screen->getScreenWide(); byte menuIconWidth; - + // Initialize menu icon width at correct size // depending if we are using pc or psx version. if (Sword2Engine::isPsx()) @@ -80,8 +80,8 @@ void Mouse::processMenu() { byte *buf = _vm->_screen->getScreen(); int16 screenWide = _vm->_screen->getScreenWide(); - byte menuIconWidth; - + byte menuIconWidth; + if (Sword2Engine::isPsx()) menuIconWidth = RDMENU_PSXICONWIDE; else @@ -219,7 +219,7 @@ int32 Mouse::showMenu(uint8 menu) { // Do not show menu in PSX version, as there was really // nothing similar in the original game (menu was started // using SELECT button in psx pad) - if (Sword2Engine::isPsx() && menu == RDMENU_TOP) + if (Sword2Engine::isPsx() && menu == RDMENU_TOP) return RD_OK; // Check for invalid menu parameter @@ -296,7 +296,7 @@ void Mouse::closeMenuImmediately() { int32 Mouse::setMenuIcon(uint8 menu, uint8 pocket, byte *icon) { Common::Rect r; byte menuIconWidth; - + if (Sword2Engine::isPsx()) menuIconWidth = RDMENU_PSXICONWIDE; else diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp index d940ec8a2d..65175a759e 100644 --- a/engines/sword2/mouse.cpp +++ b/engines/sword2/mouse.cpp @@ -339,8 +339,8 @@ void Mouse::systemMenuMouse() { // Do nothing if using PSX version and are on TOP menu. - if ((icon_list[hit] == OPTIONS_ICON || icon_list[hit] == QUIT_ICON - || icon_list[hit] == SAVE_ICON || icon_list[hit] == RESTORE_ICON + if ((icon_list[hit] == OPTIONS_ICON || icon_list[hit] == QUIT_ICON + || icon_list[hit] == SAVE_ICON || icon_list[hit] == RESTORE_ICON || icon_list[hit] == RESTART_ICON ) && Sword2Engine::isPsx() ) return; @@ -1522,9 +1522,9 @@ void Mouse::decompressMouse(byte *decomp, byte *comp, uint8 frame, int width, in } free(buffer); - + } else { - comp = comp + READ_LE_UINT32(comp + frame * 4) - MOUSE_ANIM_HEADER_SIZE; + comp = comp + READ_LE_UINT32(comp + frame * 4) - MOUSE_ANIM_HEADER_SIZE; while (i < size) { if (*comp > 183) { @@ -1604,12 +1604,12 @@ void Mouse::drawMouse() { _mouseAnim.mousew, _mouseAnim.mouseh, mouse_width); // Fix height for mouse sprite in PSX version - if (Sword2Engine::isPsx()) { + if (Sword2Engine::isPsx()) { mouse_height *= 2; - + byte *buffer = (byte *)malloc(mouse_width * mouse_height); Screen::resizePsxSprite(buffer, mouseData, mouse_width, mouse_height); - + free(mouseData); mouseData = buffer; } diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp index 4e20eebcf1..fee75f7638 100644 --- a/engines/sword2/music.cpp +++ b/engines/sword2/music.cpp @@ -295,7 +295,7 @@ Audio::AudioStream *makeCLUStream(Common::File *file, int size) { } Audio::AudioStream *makePSXCLUStream(Common::File *file, int size) { - + // Buffer audio file data, and ask MemoryReadStream to dispose of it // when not needed anymore. diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp index 6015f4bcf6..1ac863c3fb 100644 --- a/engines/sword2/palette.cpp +++ b/engines/sword2/palette.cpp @@ -50,9 +50,9 @@ void Screen::startNewPalette() { // Don't fetch palette match table while using PSX version, // because it is not present. - if(!Sword2Engine::isPsx()) + if(!Sword2Engine::isPsx()) memcpy(_paletteMatch, _vm->fetchPaletteMatchTable(screenFile), PALTABLESIZE); - + setPalette(0, 256, _vm->fetchPalette(screenFile), RDPAL_FADE); // Indicating that it's a screen palette @@ -120,12 +120,12 @@ void Screen::setFullPalette(int32 palRes) { } else { if (_thisScreen.background_layer_id) { byte *data = _vm->_resman->openResource(_thisScreen.background_layer_id); - + // Do not fetch palette match table when using PSX version, // because it is not present. - if (!Sword2Engine::isPsx()) + if (!Sword2Engine::isPsx()) memcpy(_paletteMatch, _vm->fetchPaletteMatchTable(data), PALTABLESIZE); - + setPalette(0, 256, _vm->fetchPalette(data), RDPAL_INSTANT); _vm->_resman->closeResource(_thisScreen.background_layer_id); } else diff --git a/engines/sword2/protocol.cpp b/engines/sword2/protocol.cpp index e5fbf53ee9..dcb5b5f5b0 100644 --- a/engines/sword2/protocol.cpp +++ b/engines/sword2/protocol.cpp @@ -72,7 +72,7 @@ byte *Sword2Engine::fetchPalette(byte *screenFile) { */ byte *Sword2Engine::fetchPaletteMatchTable(byte *screenFile) { - + if (isPsx()) return NULL; MultiScreenHeader mscreenHeader; @@ -90,7 +90,7 @@ byte *Sword2Engine::fetchPaletteMatchTable(byte *screenFile) { byte *Sword2Engine::fetchScreenHeader(byte *screenFile) { if (isPsx()) { // In PSX version there's no MultiScreenHeader, so just skip resource header return screenFile + ResHeader::size(); - } else { + } else { MultiScreenHeader mscreenHeader; mscreenHeader.read(screenFile + ResHeader::size()); @@ -116,7 +116,7 @@ byte *Sword2Engine::fetchLayerHeader(byte *screenFile, uint16 layerNo) { return screenFile + ResHeader::size() + ScreenHeader::size() + 2 + 0x400 + layerNo * LayerHeader::size(); } else { MultiScreenHeader mscreenHeader; - + mscreenHeader.read(screenFile + ResHeader::size()); return screenFile + ResHeader::size() + mscreenHeader.layers + layerNo * LayerHeader::size(); } @@ -174,7 +174,7 @@ byte *Sword2Engine::fetchCdtEntry(byte *animFile, uint16 frameNo) { byte *Sword2Engine::fetchFrameHeader(byte *animFile, uint16 frameNo) { // required address = (address of the start of the anim header) + frameOffset - + CdtEntry cdt; cdt.read(fetchCdtEntry(animFile, frameNo)); @@ -231,7 +231,7 @@ byte *Sword2Engine::fetchBackgroundLayer(byte *screenFile) { psxBackground = fetchPsxBackground(locNo); _screen->setPsxScrCache(psxBackground, 1); return psxBackground; - } + } } else { MultiScreenHeader mscreenHeader; @@ -259,7 +259,7 @@ byte *Sword2Engine::fetchForegroundParallaxLayer(byte *screenFile, int layer) { psxParallax = fetchPsxParallax(locNo, 1); _screen->setPsxScrCache(psxParallax, 2); return psxParallax; - } + } } else { MultiScreenHeader mscreenHeader; @@ -310,7 +310,7 @@ byte *Sword2Engine::fetchPsxBackground(uint32 location) { } file.seek(location * 4, SEEK_SET); - screenOffset = file.readUint32LE(); + screenOffset = file.readUint32LE(); if (screenOffset == 0) { // We don't have screen data for this location number. file.close(); @@ -319,10 +319,10 @@ byte *Sword2Engine::fetchPsxBackground(uint32 location) { // Get to the beginning of PSXScreensEntry file.seek(screenOffset + ResHeader::size(), SEEK_SET); - + buffer = (byte *)malloc(PSXScreensEntry::size()); file.read(buffer, PSXScreensEntry::size()); - + // Prepare the header header.read(buffer); free(buffer); @@ -336,7 +336,7 @@ byte *Sword2Engine::fetchPsxBackground(uint32 location) { buffer = (byte *)malloc(totSize); // Write some informations before background data - WRITE_LE_UINT16(buffer, header.bgXres); + WRITE_LE_UINT16(buffer, header.bgXres); WRITE_LE_UINT16(buffer + 2, header.bgYres); WRITE_LE_UINT32(buffer + 4, header.bgOffset); @@ -378,17 +378,17 @@ byte *Sword2Engine::fetchPsxParallax(uint32 location, uint8 level) { } file.seek(location * 4, SEEK_SET); - screenOffset = file.readUint32LE(); + screenOffset = file.readUint32LE(); if (screenOffset == 0) // There is no screen here return NULL; // Get to the beginning of PSXScreensEntry file.seek(screenOffset + ResHeader::size(), SEEK_SET); - + buffer = (byte *)malloc(PSXScreensEntry::size()); file.read(buffer, PSXScreensEntry::size()); - + // Initialize the header header.read(buffer); free(buffer); @@ -422,14 +422,14 @@ byte *Sword2Engine::fetchPsxParallax(uint32 location, uint8 level) { // Insert parallax resolution information in the buffer, // preceding parallax data. - WRITE_LE_UINT16(buffer, plxXres); + WRITE_LE_UINT16(buffer, plxXres); WRITE_LE_UINT16(buffer + 2, plxYres); - WRITE_LE_UINT16(buffer + 4, horTiles); + WRITE_LE_UINT16(buffer + 4, horTiles); WRITE_LE_UINT16(buffer + 6, verTiles); // Read parallax data from file and store it inside the buffer, // skipping the generated header. - file.read(buffer + 8, totSize - 8); + file.read(buffer + 8, totSize - 8); file.close(); return buffer; diff --git a/engines/sword2/render.cpp b/engines/sword2/render.cpp index f9032187b9..7d41ccd207 100644 --- a/engines/sword2/render.cpp +++ b/engines/sword2/render.cpp @@ -260,13 +260,13 @@ void Screen::renderParallax(byte *ptr, int16 l) { return; // Fetch resolution data from parallax - + if (Sword2Engine::isPsx()) { xRes = READ_LE_UINT16(ptr); yRes = READ_LE_UINT16(ptr + 2) * 2; } else { Parallax p; - + p.read(ptr); xRes = p.w; yRes = p.h; @@ -588,7 +588,7 @@ int32 Screen::initialisePsxBackgroundLayer(byte *parallax) { _xBlocks[_layer] = (bgXres + BLOCKWIDTH - 1) / BLOCKWIDTH; _yBlocks[_layer] = (bgYres + BLOCKHEIGHT - 1) / BLOCKHEIGHT; - + uint16 remLines = bgYres % 64; byte *tileChunk = (byte *)malloc(BLOCKHEIGHT * BLOCKWIDTH); @@ -615,7 +615,7 @@ int32 Screen::initialisePsxBackgroundLayer(byte *parallax) { memset(tileChunk, 1, BLOCKHEIGHT * BLOCKWIDTH); - if (!(remLines && posY == _yBlocks[_layer] - 1)) + if (!(remLines && posY == _yBlocks[_layer] - 1)) remLines = 32; for(j = 0; j < remLines; j++) { @@ -628,7 +628,7 @@ int32 Screen::initialisePsxBackgroundLayer(byte *parallax) { block_has_data = true; else block_is_transparent = true; - } + } int tileIndex = totStripes * posY + posX; @@ -657,7 +657,7 @@ int32 Screen::initialisePsxBackgroundLayer(byte *parallax) { free(tileChunk); _layer++; - return RD_OK; + return RD_OK; } /** @@ -728,7 +728,7 @@ int32 Screen::initialisePsxParallaxLayer(byte *parallax) { block_has_data = true; // If one of the two grouped blocks is without data, then we also have transparency - if(!firstTilePresent || !secondTilePresent) + if(!firstTilePresent || !secondTilePresent) block_is_transparent = true; } @@ -747,7 +747,7 @@ int32 Screen::initialisePsxParallaxLayer(byte *parallax) { // If we didn't find transparency in first block and we have // a second tile, check it - if (secondTilePresent && !block_is_transparent) { + if (secondTilePresent && !block_is_transparent) { for (k = 0; k < 0x400; k++) { if ( *(block + k) == 0) { block_is_transparent = true; diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp index 3b6592c9f4..e29a73f225 100644 --- a/engines/sword2/resman.cpp +++ b/engines/sword2/resman.cpp @@ -217,7 +217,7 @@ bool ResourceManager::init() { file.close(); - // We check the presence of resource files in cd.inf + // We check the presence of resource files in cd.inf // This is ok in PC version, but in PSX version we don't // have cd.inf so we'll have to skip this. if (!Sword2Engine::isPsx()) { @@ -264,7 +264,7 @@ byte *ResourceManager::openResource(uint32 res, bool dump) { // FIXME: In PSX edition, not all top menu icons are present (TOP menu is not used). // Though, at present state, the engine still ask for the resources. - if (Sword2Engine::isPsx()) { // We need to "rewire" missing icons + if (Sword2Engine::isPsx()) { // We need to "rewire" missing icons if (res == 342) res = 364; // Rewire RESTORE ICON to SAVE ICON } @@ -273,7 +273,7 @@ byte *ResourceManager::openResource(uint32 res, bool dump) { if (!_resList[res].ptr) { // Fetch the correct file and read in the correct portion. uint16 cluFileNum = _resConvTable[res * 2]; // points to the number of the ascii filename - + assert(cluFileNum != 0xffff); // Relative resource within the file @@ -286,7 +286,7 @@ byte *ResourceManager::openResource(uint32 res, bool dump) { // of the CDs, remember which one so that we can play the // correct speech and music. - if (Sword2Engine::isPsx()) // We have only one disk in PSX version + if (Sword2Engine::isPsx()) // We have only one disk in PSX version setCD(CD1); else setCD(_resFiles[cluFileNum].cd); @@ -513,7 +513,7 @@ uint8 ResourceManager::fetchType(byte *ptr) { if (!Sword2Engine::isPsx()) { return ptr[0]; } else { // in PSX version, some files got a "garbled" resource header, with type stored in ninth byte - if (ptr[0]) { + if (ptr[0]) { return ptr[0]; } else if (ptr[8]) { return ptr[8]; diff --git a/engines/sword2/resman.h b/engines/sword2/resman.h index fb253a010f..72bdf73b98 100644 --- a/engines/sword2/resman.h +++ b/engines/sword2/resman.h @@ -64,7 +64,7 @@ private: void removeFromCacheList(Resource *res); void addToCacheList(Resource *res); void checkMemUsage(); - + Sword2Engine *_vm; int _curCD; diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp index 6782a0691c..79818945dd 100644 --- a/engines/sword2/screen.cpp +++ b/engines/sword2/screen.cpp @@ -76,7 +76,7 @@ Screen::Screen(Sword2Engine *vm, int16 width, int16 height) { _needFullRedraw = false; memset(&_thisScreen, 0, sizeof(_thisScreen)); - + _fps = 0; _frameCount = 0; _cycleTime = 0; @@ -101,7 +101,7 @@ Screen::Screen(Sword2Engine *vm, int16 width, int16 height) { _pauseTicks = 0; _pauseStartTick = 0; - // Clean the cache for PSX version SCREENS.CLU + // Clean the cache for PSX version SCREENS.CLU _psxScrCache[0] = NULL; _psxScrCache[1] = NULL; _psxScrCache[2] = NULL; @@ -521,7 +521,7 @@ void Screen::processLayer(byte *file, uint32 layer_number) { // Layers are uncompressed in PSX version, RLE256 compressed // in PC version. - if (Sword2Engine::isPsx()) { + if (Sword2Engine::isPsx()) { spriteInfo.type = RDSPR_TRANS | RDSPR_NOCOMPRESSION; spriteInfo.data = file + layer_head.offset; } else { @@ -554,9 +554,9 @@ void Screen::processImage(BuildUnit *build_unit) { // We have some problematic animation frames in PSX demo (looks like there is missing data), // so we just skip them. if ( (Sword2Engine::isPsx() && _vm->_logic->readVar(DEMO)) && - ((build_unit->anim_resource == 369 && build_unit->anim_pc == 0) || + ((build_unit->anim_resource == 369 && build_unit->anim_pc == 0) || (build_unit->anim_resource == 296 && build_unit->anim_pc == 5) || - (build_unit->anim_resource == 534 && build_unit->anim_pc == 13)) ) + (build_unit->anim_resource == 534 && build_unit->anim_pc == 13)) ) return; byte *file = _vm->_resman->openResource(build_unit->anim_resource); @@ -1309,7 +1309,7 @@ bool Screen::getPsxScrCacheStatus(uint8 level) { if (level > 3) { level = 0; } - + return _psxCacheEnabled[level]; } diff --git a/engines/sword2/screen.h b/engines/sword2/screen.h index c098b155ed..2f72b75980 100644 --- a/engines/sword2/screen.h +++ b/engines/sword2/screen.h @@ -215,7 +215,7 @@ private: // positions, etc. ScreenInfo _thisScreen; - + int32 _renderCaps; int8 _renderLevel; @@ -459,7 +459,7 @@ public: void rollCredits(); void splashScreen(); - // Some sprites are compressed in HIF format + // Some sprites are compressed in HIF format static uint32 decompressHIF(byte *src, byte *dst, uint32 *skipData = NULL); // This is used to resize psx sprites back to original resolution static void resizePsxSprite(byte *dst, byte *src, uint16 destW, uint16 destH); diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp index 706143aded..ed27622000 100644 --- a/engines/sword2/sound.cpp +++ b/engines/sword2/sound.cpp @@ -211,9 +211,9 @@ void Sound::playMovieSound(int32 res, int type) { byte *data = _vm->_resman->openResource(res); uint32 len = _vm->_resman->fetchLen(res); - + assert(_vm->_resman->fetchType(data) == WAV_FILE); - + // In PSX version we have nothing to skip here, as data starts right away if (!Sword2Engine::isPsx()) { data += ResHeader::size(); @@ -300,7 +300,7 @@ void Sound::queueFx(int32 res, int32 type, int32 delay, int32 volume, int32 pan) _fxQueue[i].data = data; else _fxQueue[i].data = data + ResHeader::size(); - + _fxQueue[i].len = len; _fxQueue[i].delay = delay; _fxQueue[i].volume = volume; diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp index 2474293500..1e55792adb 100644 --- a/engines/sword2/sprite.cpp +++ b/engines/sword2/sprite.cpp @@ -141,7 +141,7 @@ int32 Screen::decompressRLE256(byte *dst, byte *src, int32 decompSize) { void Screen::unwindRaw16(byte *dst, byte *src, uint16 blockSize, byte *colTable) { // for each pair of pixels while (blockSize > 1) { - + if (Sword2Engine::isPsx()) { // 1st colour = number in table at position given by upper // nibble of source byte @@ -282,7 +282,7 @@ uint32 Screen::decompressHIF(byte *src, byte *dst, uint32 *skipData) { while(repeat_count >= 0) { uint16 refetchData = (info_word & 0xFFF) + 1; if (refetchData > decompSize) return 0; // We have a problem here... - uint8 *old_data_src = dst - refetchData; + uint8 *old_data_src = dst - refetchData; *dst++ = *old_data_src; decompSize++; repeat_count--; @@ -298,7 +298,7 @@ uint32 Screen::decompressHIF(byte *src, byte *dst, uint32 *skipData) { } } -// Double line image to keep aspect ratio. +// Double line image to keep aspect ratio. // Used in PSX version. void Screen::resizePsxSprite(byte *dst, byte *src, uint16 destW, uint16 destH) { for (int i = 0; i < destH / 2; i++) { @@ -547,7 +547,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { free(tempBuf); } else { // PC RLE16 sprites sprite = (byte *)malloc(s->w * s->h); - + if (!sprite) return RDERR_OUTOFMEMORY; @@ -573,7 +573,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { s->w = (decompData / (s->h / 2)); sprite = (byte *)malloc(s->w * s->h); - + if (!sprite) return RDERR_OUTOFMEMORY; @@ -695,7 +695,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { return RDERR_OUTOFMEMORY; } - // We cannot use good scaling for PSX version, as we are missing + // We cannot use good scaling for PSX version, as we are missing // some required data. if (_renderCaps & RDBLTFX_EDGEBLEND && !Sword2Engine::isPsx()) scaleImageGood(newSprite, s->scaledWidth, s->scaledWidth, s->scaledHeight, sprite, s->w, s->w, s->h, _buffer + _screenWide * rd.top + rd.left); diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 54c646c326..01e6d432cf 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -473,11 +473,11 @@ Common::Error Sword2Engine::run() { // Handle GMM Loading if (_gmmLoadSlot != -1) { - + // Hide mouse cursor and fade screen _mouse->hideMouse(); _screen->fadeDown(); - + // Clean up and load game _logic->_router->freeAllRouteMem(); diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h index 84530fc4f2..457f585841 100644 --- a/engines/sword2/sword2.h +++ b/engines/sword2/sword2.h @@ -163,7 +163,7 @@ public: Common::Error saveGameState(int slot, const char *desc); bool canSaveGameStateCurrently(); Common::Error loadGameState(int slot); - bool canLoadGameStateCurrently(); + bool canLoadGameStateCurrently(); uint32 _features; @@ -218,7 +218,7 @@ public: byte *fetchTextLine(byte *file, uint32 text_line); bool checkTextLine(byte *file, uint32 text_line); byte *fetchPaletteMatchTable(byte *screenFile); - + uint32 saveGame(uint16 slotNo, const byte *description); uint32 restoreGame(uint16 slotNo); uint32 getSaveDescription(uint16 slotNo, byte *description); diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index edfc8c1243..dad86f9d43 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -596,7 +596,7 @@ static int MovieCommand(char cmd, int commandOffset) { PPRINT_CMD pCmd; pCmd = (PPRINT_CMD)(bigBuffer + commandOffset); - + MovieText(nullContext, (int16)READ_LE_UINT16(&pCmd->stringId), (int16)READ_LE_UINT16(&pCmd->x), (int16)READ_LE_UINT16(&pCmd->y), diff --git a/engines/tinsel/coroutine.h b/engines/tinsel/coroutine.h index aec2e6cdad..c562ecdabb 100644 --- a/engines/tinsel/coroutine.h +++ b/engines/tinsel/coroutine.h @@ -137,7 +137,7 @@ public: #define CORO_END_CONTEXT(x) } *x = (CoroContextTag *)coroParam /** - * Begin the code section of a coroutine. + * Begin the code section of a coroutine. * @param x name of the coroutine context * @see CORO_BEGIN_CODE */ diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 8bf9fb1896..26c912a24a 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -53,7 +53,7 @@ extern uint8 transPalette[MAX_COLOURS]; uint8* psxPJCRLEUnwinder(uint16 imageWidth, uint16 imageHeight, uint8 *srcIdx) { uint32 remainingBlocks = 0; - uint16 compressionType = 0; // Kind of decompression to apply + uint16 compressionType = 0; // Kind of decompression to apply uint16 controlBits = 0; // Control bits used to calculate the number of decompressed indexes uint16 baseIndex = 0; // Base index to be repeated / incremented. @@ -82,7 +82,7 @@ uint8* psxPJCRLEUnwinder(uint16 imageWidth, uint16 imageHeight, uint8 *srcIdx) { // else there is no compression. if (controlData & 0x4000) compressionType = 2; - else if (controlData & 0x8000) + else if (controlData & 0x8000) compressionType = 1; else compressionType = 0; @@ -749,10 +749,10 @@ void DrawObject(DRAWOBJECT *pObj) { if (TinselV1PSX) { uint8 paletteType = *(srcPtr); // if 0x88 we are using an 8bit palette type, if 0x44 we are using a 4 bit PSX CLUT uint8 indexType = *(srcPtr + 1); // if 0xCC indexes for this image are compressed with PCJRLE, if 0xDD indexes are not compressed - + switch (paletteType) { case 0x88: // Normal 8-bit palette - psxFourBitClut = false; + psxFourBitClut = false; psxSkipBytes = 0; switch (indexType) { case 0xDD: // Normal uncompressed indexes diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index 9fb40f8d09..065fc24ae6 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -107,12 +107,12 @@ COLORREF* psxClutToRGBPal(uint8 *srcClut, int *colours) { clutEntry = READ_LE_UINT16(srcClut); // Read PSX CLUT entry srcClut += sizeof(uint16); - if ((clutEntry == 0) && (coloursInPalette == 0)) + if ((clutEntry == 0) && (coloursInPalette == 0)) coloursInPalette++; else if ((clutEntry == 0) && (coloursInPalette != 0)) { *colours = coloursInPalette; return dstPal; - } else + } else coloursInPalette++; // Extract color data diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index 5631d5551a..f7309bc38c 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -138,7 +138,7 @@ struct LINEINFO { /** * POLY structure class. This is implemented as a class, because the structure * of POLY's changed between TINSEL v1 and v2. - * + * * FIXME: Right now, we always read *all* data in a polygon, even if only a single * field is needed. This is rather inefficient. */ diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index 47b7ffc51a..a07a417723 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -100,16 +100,16 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound uint32 sampleLen = _sampleStream.readUint32LE(); if (_sampleStream.ioFailed()) error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); - + if (TinselV1PSX) { // Read the stream and create a VAG Audio stream Audio::AudioStream *vagStream = new Audio::VagStream(_sampleStream.readStream(sampleLen), false, 44100); - + // FIXME: Should set this in a different place ;) _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, volSound); //_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, volVoice); - + // Play the audio stream _vm->_mixer->playInputStream(type, &curChan.handle, vagStream); } else { diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index b4e7e14016..54d678c198 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -646,7 +646,7 @@ void CdDoChange(CORO_PARAM) { return; CORO_INVOKE_0(CdCD); - + CdHasChanged(); CORO_END_CODE; diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 1e4878291b..cedd9ec723 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -3120,7 +3120,7 @@ int TuckerEngine::executeTableInstruction() { case kCode_bso: _backgroundSprOffset = readTableInstructionParam(3); return 0; - case kCode_bus: + case kCode_bus: _speechSoundNum = readTableInstructionParam(3) - 1; rememberSpeechSound(); startSpeechSound(_partNum * 3000 + _ptTextOffset + _speechSoundNum - 3000, _speechVolume); @@ -3130,7 +3130,7 @@ int TuckerEngine::executeTableInstruction() { _actionCharacterNum = 99; _charSpeechSoundCounter = kDefaultCharSpeechSoundCounter; return 0; - case kCode_buw: + case kCode_buw: _selectedObject.xPos = readTableInstructionParam(3); _selectedObject.yPos = readTableInstructionParam(3); _locationMaskIgnore = 1; |