diff options
Diffstat (limited to 'engines')
167 files changed, 1927 insertions, 661 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h index e9923aba2e..ea3afa5ca3 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -631,7 +631,7 @@ struct AgiGame { AgiLogic *_curLogic; // words - Common::Array<AgiWord*> words[26]; + Common::Array<AgiWord *> words[26]; // view table VtEntry viewTable[MAX_VIEWTABLE]; diff --git a/engines/agi/menu.h b/engines/agi/menu.h index e659c71fab..1d5828d78a 100644 --- a/engines/agi/menu.h +++ b/engines/agi/menu.h @@ -33,8 +33,8 @@ namespace Agi { struct AgiMenu; struct AgiMenuOption; -typedef Common::List<AgiMenu*> MenuList; -typedef Common::List<AgiMenuOption*> MenuOptionList; +typedef Common::List<AgiMenu *> MenuList; +typedef Common::List<AgiMenuOption *> MenuOptionList; class GfxMgr; class PictureMgr; diff --git a/engines/agi/preagi_mickey.h b/engines/agi/preagi_mickey.h index 673839a592..18b0593d78 100644 --- a/engines/agi/preagi_mickey.h +++ b/engines/agi/preagi_mickey.h @@ -704,7 +704,7 @@ protected: void readOfsData(int, int, uint8*, long); bool chooseY_N(int, bool); int choose1to9(int); - void printStr(char*); + void printStr(char *); void printLine(const char*); void printExeStr(int); void printExeMsg(int); diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index 50b2945383..b7d2801076 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -455,7 +455,7 @@ int TrollEngine::drawRoom(char *menu) { _gfx->doUpdate(); char tmp[10]; - strncat(menu, (char*)_gameData + _locMessagesIdx[_currentRoom], 39); + strncat(menu, (char *)_gameData + _locMessagesIdx[_currentRoom], 39); for (int i = 0; i < 3; i++) { if (_roomDescs[_roomPicture - 1].options[i]) { @@ -725,7 +725,7 @@ void TrollEngine::fillOffsets() { void TrollEngine::init() { _picture->setPictureVersion(AGIPIC_V15); - //SetScreenPar(320, 200, (char*)ibm_fontdata); + //SetScreenPar(320, 200, (char *)ibm_fontdata); const int gaps[] = { 0x3A40, 0x4600, 0x4800, 0x5800, 0x5a00, 0x6a00, 0x6c00, 0x7400, 0x7600, 0x7c00, 0x7e00, 0x8e00, diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index b15950f31d..bfc8d4d8f3 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -68,10 +68,10 @@ int SoundGen2GS::readBuffer(int16 *buffer, const int numSamples) { static uint data_available = 0; static uint data_offset = 0; uint n = numSamples << 1; - uint8 *p = (uint8*)buffer; + uint8 *p = (uint8 *)buffer; while (n > data_available) { - memcpy(p, (uint8*)_out + data_offset, data_available); + memcpy(p, (uint8 *)_out + data_offset, data_available); p += data_available; n -= data_available; @@ -81,7 +81,7 @@ int SoundGen2GS::readBuffer(int16 *buffer, const int numSamples) { data_offset = 0; } - memcpy(p, (uint8*)_out + data_offset, n); + memcpy(p, (uint8 *)_out + data_offset, n); data_offset += n; data_available -= n; diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp index a2baf89d12..576801bc56 100644 --- a/engines/agi/sound_sarien.cpp +++ b/engines/agi/sound_sarien.cpp @@ -330,7 +330,7 @@ void SoundGenSarien::fillAudio(int16 *stream, uint len) { debugC(5, kDebugLevelSound, "(%p, %d)", (void *)stream, len); while (len > data_available) { - memcpy((uint8 *)stream + p, (uint8*)_sndBuffer + data_offset, data_available); + memcpy((uint8 *)stream + p, (uint8 *)_sndBuffer + data_offset, data_available); p += data_available; len -= data_available; @@ -339,7 +339,7 @@ void SoundGenSarien::fillAudio(int16 *stream, uint len) { data_offset = 0; } - memcpy((uint8 *)stream + p, (uint8*)_sndBuffer + data_offset, len); + memcpy((uint8 *)stream + p, (uint8 *)_sndBuffer + data_offset, len); data_offset += len; data_available -= len; } diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp index 8d13be3f68..ea2d329fb0 100644 --- a/engines/agi/sprite.cpp +++ b/engines/agi/sprite.cpp @@ -55,7 +55,7 @@ void *SpritesMgr::poolAlloc(int size) { // Adjust size to sizeof(void *) boundary to prevent data misalignment // errors. - const int alignPadding = sizeof(void*) - 1; + const int alignPadding = sizeof(void *) - 1; size = (size + alignPadding) & ~alignPadding; x = _poolTop; diff --git a/engines/agi/sprite.h b/engines/agi/sprite.h index 68f0e32b86..851c2438fb 100644 --- a/engines/agi/sprite.h +++ b/engines/agi/sprite.h @@ -27,7 +27,7 @@ namespace Agi { struct Sprite; -typedef Common::List<Sprite*> SpriteList; +typedef Common::List<Sprite *> SpriteList; class AgiEngine; class GfxMgr; diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp index 1001c66b20..4400112247 100644 --- a/engines/agi/words.cpp +++ b/engines/agi/words.cpp @@ -130,7 +130,7 @@ int AgiEngine::findWord(const char *word, int *flen) { return -1; *flen = 0; - Common::Array<AgiWord*> &a = _game.words[c]; + Common::Array<AgiWord *> &a = _game.words[c]; for (int i = 0; i < (int)a.size(); i++) { int wlen = strlen(a[i]->word); diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index c7176fe7e8..29d1b36e19 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -312,7 +312,7 @@ void MoviePlayerDXA::startSound() { _fileStream->seek(size, SEEK_CUR); - in.open((const char *)"audio.wav"); + in.open("audio.wav"); if (!in.isOpen()) { error("Can't read offset file 'audio.wav'"); } diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp index 3fa3dbd7ff..b3ef31f30f 100644 --- a/engines/cge/detection.cpp +++ b/engines/cge/detection.cpp @@ -104,7 +104,7 @@ static const ADFileBasedFallback fileBasedFallback[] = { class CGEMetaEngine : public AdvancedMetaEngine { public: CGEMetaEngine() : AdvancedMetaEngine(CGE::gameDescriptions, sizeof(ADGameDescription), CGEGames) { - _singleid = "Soltys"; + _singleid = "soltys"; } virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index 01e05bed6d..918d522606 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -1801,7 +1801,7 @@ void maskBgOverlay(const byte *bgPtr, const byte *maskPtr, int16 width, int16 he for (it = g_cine->_bgIncrustList.begin(); it != g_cine->_bgIncrustList.end(); ++it) { tmpWidth = g_cine->_animDataTable[it->frame]._realWidth; tmpHeight = g_cine->_animDataTable[it->frame]._height; - mask = (byte*)malloc(tmpWidth * tmpHeight); + mask = (byte *)malloc(tmpWidth * tmpHeight); if (it->param == 0) { generateMask(g_cine->_animDataTable[it->frame].data(), mask, tmpWidth * tmpHeight, it->part); diff --git a/engines/composer/detection.cpp b/engines/composer/detection.cpp index af355402c2..835f3c5683 100644 --- a/engines/composer/detection.cpp +++ b/engines/composer/detection.cpp @@ -53,9 +53,12 @@ Common::Language ComposerEngine::getLanguage() const { static const PlainGameDescriptor composerGames[] = { {"composer", "Composer Game"}, + {"babayaga", "Magic Tales: Baba Yaga and the Magic Geese"}, {"darby", "Darby the Dragon"}, {"gregory", "Gregory and the Hot Air Balloon"}, + {"imoking", "Magic Tales: Imo and the King"}, {"liam", "Magic Tales: Liam Finds a Story"}, + {"littlesamurai", "Magic Tales: The Little Samurai"}, {"princess", "The Princess and the Crab"}, {"sleepingcub", "Sleeping Cub's Test of Courage"}, {0, 0} @@ -64,6 +67,90 @@ static const PlainGameDescriptor composerGames[] = { namespace Composer { static const ComposerGameDescription gameDescriptions[] = { + // Magic Tales: Baba Yaga and the Magic Geese - from bug #3485018 + { + { + "babayaga", + "", + AD_ENTRY1s("book.ini", "412b7f4b0ef07f442009d28e3a819974", 3852), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: Baba Yaga and the Magic Geese Mac - from bug #3466402 + { + { + "babayaga", + "", + AD_ENTRY1("Baba Yaga", "ae3a4445f42fe10253da7ee4ea0d37"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: Imo and the King - from bug #3485018 + { + { + "imoking", + "", + AD_ENTRY1s("book.ini", "62b52a1763cce7d7d6ccde9f9d32fd4b", 3299), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: Imo and the King Mac - from bug #3466402 + { + { + "imoking", + "", + AD_ENTRY1("imo and the king", "b0277885fec943b5f19409f35b33964c"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: The Little Samurai - from bug #3485018 + { + { + "littlesamurai", + "", + AD_ENTRY1s("book.ini", "7a851869d022a9041e0dd11e5bace09b", 3747), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + + // Magic Tales: The Little Samurai Mac - from bug #3466402 + { + { + "littlesamurai", + "", + AD_ENTRY1("The Little Samurai", "38121dd649c24e8676aa108cf35d44b5"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV1 + }, + // from Liam Finds a Story CD { { @@ -91,6 +178,24 @@ static const ComposerGameDescription gameDescriptions[] = { GType_ComposerV2 }, + // Liam Finds a Story Mac - from bug #3463201 + { + { + "liam", + 0, + { + {"liam finds a story.ini", 0, "85a1ca6002ded8572920bbdb73d35b0a", -1}, + {"page99.rsc", 0, "11b0a19c6b6d73c39e2bd289a457c1dc", -1}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV2 + }, + // from Liam Finds a Story CD { { @@ -208,6 +313,24 @@ static const ComposerGameDescription gameDescriptions[] = { GType_ComposerV2 }, + // The Princess and the Crab Mac - From Bug #3461984 + { + { + "princess", + 0, + { + {"the princess and the crab.ini", 0, "f6b551a7304643004bd5e4df7ac1e76e", -1}, + {"page99.rsc", 0, "fd5ebd3b5e36c4651c50241619525355", -1}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV2 + }, + { // Provided by sev { "sleepingcub", @@ -225,6 +348,24 @@ static const ComposerGameDescription gameDescriptions[] = { GType_ComposerV2 }, + // Sleeping Cub Mac - From Bug #3461369 + { + { + "sleepingcub", + 0, + { + {"sleeping cub.ini", 0, "39642a4036cb51443f5e90052c3ad0b2", -1}, + {"page99.rsc", 0, "219fbd9bd2ff87c7023814405d753145", -1}, + AD_LISTEND + }, + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_ComposerV2 + }, + { AD_TABLE_END_MARKER, 0 } }; @@ -235,6 +376,7 @@ using namespace Composer; // we match from data too, to stop detection from a non-top-level directory const static char *directoryGlobs[] = { "data", + "liam", "programs", "princess", "sleepcub", diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index 4d1284a802..9da5413013 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -129,7 +129,7 @@ int loadBackground(const char *name, int idx) { flagSpeed = 0; } - if (!strcmp((char*)ptr, "PAL")) { + if (!strcmp((char *)ptr, "PAL")) { memcpy(palScreen[idx], ptr + 4, 256*3); gfxModuleData_setPal256(palScreen[idx]); } else { diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp index 39286670ed..ddda8dee45 100644 --- a/engines/cruise/backgroundIncrust.cpp +++ b/engines/cruise/backgroundIncrust.cpp @@ -46,7 +46,7 @@ void backupBackground(backgroundIncrustStruct *pIncrust, int X, int Y, int width pIncrust->savedX = X; pIncrust->savedY = Y; - pIncrust->ptr = (uint8*)MemAlloc(width * height); + pIncrust->ptr = (uint8 *)MemAlloc(width * height); for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { int xp = j + X; @@ -169,7 +169,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, int16 objectIdx, int sizeTable[4]; // 0 = left, 1 = right, 2 = bottom, 3 = top // this function checks if the dataPtr is not 0, else it retrives the data for X, Y, scale and DataPtr again (OLD: mainDrawSub1Sub1) - flipPoly(params.fileIdx, (int16*)filesDatabase[params.fileIdx].subData.ptr, params.scale, &newFrame, newElement->X, newElement->Y, &newX, &newY, &newScale); + flipPoly(params.fileIdx, (int16 *)filesDatabase[params.fileIdx].subData.ptr, params.scale, &newFrame, newElement->X, newElement->Y, &newX, &newY, &newScale); // this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2) getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame); @@ -213,7 +213,7 @@ void regenerateBackgroundIncrust(backgroundIncrustStruct *pHead) { drawSprite(width, height, NULL, filesDatabase[frame].subData.ptr, pl->Y, pl->X, backgroundScreens[pl->backgroundIdx], filesDatabase[frame].subData.ptrMask); } else { // Poly - addBackgroundIncrustSub1(frame, pl->X, pl->Y, NULL, pl->scale, (char*)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr); + addBackgroundIncrustSub1(frame, pl->X, pl->Y, NULL, pl->scale, (char *)backgroundScreens[pl->backgroundIdx], (char *)filesDatabase[frame].subData.ptr); } backgroundChanged[pl->backgroundIdx] = true; diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index 94f8759d01..9782df8f09 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -116,7 +116,7 @@ public: static uint32 const cookie = 0x41424344; }; - Common::List<MemInfo*> _memList; + Common::List<MemInfo *> _memList; typedef Common::List<Common::Rect> RectList; diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index a1337aefa7..6e2847d6d7 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -45,7 +45,7 @@ typedef CruiseEngine::MemInfo MemInfo; void MemoryList() { if (!_vm->_memList.empty()) { debug("Current list of un-freed memory blocks:"); - Common::List<MemInfo*>::iterator i; + Common::List<MemInfo *>::iterator i; for (i = _vm->_memList.begin(); i != _vm->_memList.end(); ++i) { MemInfo const *const v = *i; debug("%s - %d", v->fname, v->lineNum); @@ -691,7 +691,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) { if ((filesDatabase[j].subData.resourceType == OBJ_TYPE_POLY) && (filesDatabase[j].subData.ptr)) { int zoom = params.scale; - int16* dataPtr = (int16*)filesDatabase[j].subData.ptr; + int16* dataPtr = (int16 *)filesDatabase[j].subData.ptr; if (*dataPtr == 0) { int16 offset; @@ -723,7 +723,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) { y -= newY; } - if (dataPtr && findPoly((char*)dataPtr, x, y, zoom, mouseX, mouseY)) { + if (dataPtr && findPoly((char *)dataPtr, x, y, zoom, mouseX, mouseY)) { *outObjOvl = linkedObjOvl; *outObjIdx = linkedObjIdx; diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index 76479d7a10..94d075ecc3 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -420,7 +420,7 @@ int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentD int sec = 0; uint16 numIdx; - if (!strcmp((char*)ptr, "SEC")) { + if (!strcmp((char *)ptr, "SEC")) { sec = 1; } diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp index a6680f7a02..2fd86a11b7 100644 --- a/engines/cruise/font.cpp +++ b/engines/cruise/font.cpp @@ -106,7 +106,7 @@ void loadFNT(const char *fileName) { fontFileHandle.read(header, 4); - if (strcmp((char*)header, "FNT") == 0) { + if (strcmp((char *)header, "FNT") == 0) { uint32 fontSize = fontFileHandle.readUint32BE(); _systemFNT = (uint8 *)mallocAndZero(fontSize); diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 27b9be7e79..610465e962 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -142,7 +142,7 @@ int16 Op_AddProc() { if (procBss) { for (long int i = 0; i < pop1; i++) { - int16* ptr = (int16*)(procBss + i * 2); + int16* ptr = (int16 *)(procBss + i * 2); *ptr = param[i]; bigEndianShortToNative(ptr); } @@ -1046,7 +1046,7 @@ int16 Op_ComputeLine() { int y1 = popVar(); int x1 = popVar(); - point* pDest = (point*)popPtr(); + point* pDest = (point *)popPtr(); int maxValue = cor_droite(x1, y1, x2, y2, pDest); @@ -1334,7 +1334,7 @@ int16 Op_TrackAnim() { // setup actor position } int16 Op_BgName() { - char* bgName = (char*)popPtr(); + char* bgName = (char *)popPtr(); int bgIdx = popVar(); if ((bgIdx >= 0) && (bgIdx < NBSCREENS) && bgName) { @@ -1524,7 +1524,7 @@ int16 Op_Itoa() { param[i] = popVar(); int val = popVar(); - char* pDest = (char*)popPtr(); + char* pDest = (char *)popPtr(); if (!nbp) sprintf(txt, "%d", val); @@ -1645,7 +1645,7 @@ int16 Op_SetVolume() { } int16 Op_SongExist() { - const char *songName = (char*)popPtr(); + const char *songName = (char *)popPtr(); if (songName) { char name[33]; diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index 9a5df69cae..24f65500db 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -185,7 +185,7 @@ void flipPoly(int fileId, int16 *dataPtr, int scale, char** newFrame, int X, int Y -= newY; } - *newFrame = (char*)dataPtr; + *newFrame = (char *)dataPtr; *outX = X; *outY = Y; *outScale = scale; @@ -1077,7 +1077,7 @@ void mainDrawPolygons(int fileIndex, cellStruct *plWork, int X, int scale, int Y int sizeTable[4]; // 0 = left, 1 = right, 2 = bottom, 3 = top // this function checks if the dataPtr is not 0, else it retrives the data for X, Y, scale and DataPtr again (OLD: mainDrawSub1Sub1) - flipPoly(fileIndex, (int16*)dataPtr, scale, &newFrame, X, Y, &newX, &newY, &newScale); + flipPoly(fileIndex, (int16 *)dataPtr, scale, &newFrame, X, Y, &newX, &newY, &newScale); // this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2) getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame); @@ -1143,7 +1143,7 @@ void mainDrawPolygons(int fileIndex, cellStruct *plWork, int X, int scale, int Y } // this function builds the poly model and then calls the draw functions (OLD: mainDrawSub1Sub5) - buildPolyModel(newX, newY, newScale, (char*)polygonMask, destBuffer, newFrame); + buildPolyModel(newX, newY, newScale, (char *)polygonMask, destBuffer, newFrame); } void drawMessage(const gfxEntryStruct *pGfxPtr, int globalX, int globalY, int width, int newColor, uint8 *ouputPtr) { @@ -1419,7 +1419,7 @@ void mainDraw(int16 param) { currentObjPtr = cellHead.next; #ifdef _DEBUG - /* polyOutputBuffer = (char*)bgPtr; + /* polyOutputBuffer = (char *)bgPtr; drawCtp(); */ #endif diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index e2bd1ebc34..26bea0441c 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -924,10 +924,10 @@ Common::Error loadSavegameData(int saveGameIdx) { if (ptr) { ASSERT(0); - //*(int16*)(currentcellHead->datas+0x2E) = getSprite(ptr,*(int16*)(currentcellHead->datas+0xE)); + //*(int16 *)(currentcellHead->datas+0x2E) = getSprite(ptr,*(int16 *)(currentcellHead->datas+0xE)); } else { ASSERT(0); - //*(int16*)(currentcellHead->datas+0x2E) = 0; + //*(int16 *)(currentcellHead->datas+0x2E) = 0; } } diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp index cf28548e7d..d753d938bd 100644 --- a/engines/cruise/script.cpp +++ b/engines/cruise/script.cpp @@ -33,7 +33,7 @@ scriptInstanceStruct procHead; scriptInstanceStruct *currentScriptPtr; int8 getByteFromScript() { - int8 var = *(int8*)(currentData3DataPtr + currentScriptPtr->scriptOffset); + int8 var = *(int8 *)(currentData3DataPtr + currentScriptPtr->scriptOffset); ++currentScriptPtr->scriptOffset; return (var); @@ -202,7 +202,7 @@ int32 opcodeType1() { di = currentScriptPtr->overlayNumber; } - if ((var == 0x85) && !strcmp((char*)currentCtpName, "S26.CTP") && !di && mode == 1) { // patch in bar + if ((var == 0x85) && !strcmp((char *)currentCtpName, "S26.CTP") && !di && mode == 1) { // patch in bar var = 0x87; } diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index 92ce7d31d9..965cdabf3e 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -318,7 +318,7 @@ void Text::repeatedlySplitLongLines(uint maxWidth) { } void Text::splitLinesLongerThan(uint maxWidth) { - char *start = const_cast<char*> (_text.c_str()); // hacky + char *start = const_cast<char *> (_text.c_str()); // hacky while (1) { char *end = strchr(start, '|'); if (end) { diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp index 761ce7696f..4779d0baef 100644 --- a/engines/dreamweb/saveload.cpp +++ b/engines/dreamweb/saveload.cpp @@ -260,7 +260,7 @@ void DreamWebEngine::saveGame() { } char descbuf[17] = { 2, 0 }; - Common::strlcpy((char*)descbuf + 1, game_description.c_str(), 16); + Common::strlcpy((char *)descbuf + 1, game_description.c_str(), 16); unsigned int desclen = game_description.size(); if (desclen > 15) desclen = 15; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index d93add6b42..5f8ea53ada 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -30,76 +30,91 @@ namespace DreamWeb { uint8 g_keyBuffer[16]; const Room g_roomData[] = { + // location 0 { "DREAMWEB.R00", // Ryan's apartment 5,255,33,10, 255,255,255,0, 1,6,2,255,3,255,255,255,255,255,0 }, + // location 1 { "DREAMWEB.R01", 1,255,44,10, 255,255,255,0, 7,2,255,255,255,255,6,255,255,255,1 }, + // location 2: Louis' (?) { "DREAMWEB.R02", 2,255,33,0, 255,255,255,0, 1,0,255,255,1,255,3,255,255,255,2 }, + // location 3 { "DREAMWEB.R03", 5,255,33,10, 255,255,255,0, 2,2,0,2,4,255,0,255,255,255,3 }, + // location 4 { "DREAMWEB.R04", 23,255,11,30, 255,255,255,0, 1,4,0,5,255,255,3,255,255,255,4 }, + // location 5: In hotel, lift noise audible (?) { "DREAMWEB.R05", 5,255,22,30, // if demo: 22,255,22,30, 255,255,255,0, 1,2,0,4,255,255,3,255,255,255,5 }, + // location 6: sarters (?) { "DREAMWEB.R06", 5,255,11,30, 255,255,255,0, 1,0,0,1,2,255,0,255,255,255,6 }, + // location 7 { "DREAMWEB.R07", 255,255,0,20, 255,255,255,0, 2,2,255,255,255,255,0,255,255,255,7 }, + // location 8: TV studio (?) { "DREAMWEB.R08", 8,255,0,10, 255,255,255,0, 1,2,255,255,255,255,0,11,40,0,8 }, + // location 9 { "DREAMWEB.R09", 9,255,22,10, 255,255,255,0, 4,6,255,255,255,255,0,255,255,255,9 }, + // location 10 { "DREAMWEB.R10", 10,255,33,30, 255,255,255,0, 2,0,255,255,2,2,4,22,30,255,10 }, // 22,30,0 switches // off path 0 in skip + // location 11 { "DREAMWEB.R11", 11,255,11,20, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,11 }, + // location 12 { "DREAMWEB.R12", 12,255,22,20, 255,255,255,0, 1,4,255,255,255,255,255,255,255,255,12 }, + // location 13: boathouse (?) { "DREAMWEB.R13", 12,255,22,20, 255,255,255,0, 1,4,255,255,255,255,255,255,255,255,13 }, + // location 14 { "DREAMWEB.R14", 14,255,44,20, 255,255,255,0, @@ -110,166 +125,196 @@ const Room g_roomData[] = { { "", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, { "", 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, + // location 19 { "DREAMWEB.R19", 19,255,0,0, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,19 }, + // location 20: Sart room (?) { "DREAMWEB.R20", 22,255,0,20, 255,255,255,0, 1,4,2,15,255,255,255,255,255,255,20 }, + // location 21: lift noise audible (?) { "DREAMWEB.R21", 5,255,11,10, // if demo: 22,255,11,10, 255,255,255,0, 1,4,2,15,1,255,255,255,255,255,21 }, + // location 22: pool room (?) { "DREAMWEB.R22", 22,255,22,10, 255,255,255,0, 0,4,255,255,1,255,255,255,255,255,22 }, + // location 23 { "DREAMWEB.R23", 23,255,22,30, 255,255,255,0, 1,4,2,15,3,255,255,255,255,255,23 }, + // location 24: only room in which initialInv() is active, i.e. we get initial inventory here { "DREAMWEB.R24", 5,255,44,0, 255,255,255,0, 1,6,2,15,255,255,255,255,255,255,24 }, + // location 25: helicopter (?) { "DREAMWEB.R25", 22,255,11,40, 255,255,255,0, 1,0,255,255,255,255,255,255,255,255,25 }, + // location 26: reached via trap door (?) { "DREAMWEB.R26", 9,255,22,20, 255,255,255,0, 4,2,255,255,255,255,255,255,255,255,26 }, + // location 27: rock room (?) { "DREAMWEB.R27", 22,255,11,20, 255,255,255,0, 0,6,255,255,255,255,255,255,255,255,27 }, + // location 28: related to TV studiou (?), see resetLocation() { "DREAMWEB.R28", 5,255,11,30, 255,255,255,0, 0,0,255,255,2,255,255,255,255,255,28 }, + // location 29: aide (?) { "DREAMWEB.R29", 22,255,11,10, 255,255,255,0, 0,2,255,255,255,255,255,255,255,255,29 }, - + // location 30 { "DREAMWEB.R05", // Duplicate of hotel lobby, but emerging from the lift. 5,255,22,10, // if demo: 22,255,22,10 255,255,255,0, 1,4,1,15,255,255,255,255,255,255,5 }, + // location 31 { "DREAMWEB.R04", // Duplicate of pool hall lobby, 23,255,22,20, // but emerging from the lift. 255,255,255,0, 1,4,2,15,255,255,255,255,255,255,4 }, + // location 32 { "DREAMWEB.R10", // entering alley via skip 10,255,22,30, 255,255,255,0, 3,6,255,255,255,255,255,255,255,255,10 }, + // location 33 { "DREAMWEB.R12", // on the beach, getting up. 12,255,22,20, 255,255,255,0, 0,2,255,255,255,255,255,255,255,255,12 }, + // location 34 { "DREAMWEB.R03", // Duplicate of Eden's lobby 5,255,44,0, // but emerging from the lift 255,255,255,0, 1,6,2,255,4,255,255,255,255,255,3 }, + // location 35: Location when starting the game, after dream (?) { "DREAMWEB.R24", // Duplicate of Eden's flat 5,255,22,0, // but starting on the bed 255,255,255,0, 3,6,0,255,255,255,255,33,0,3,24 }, // 33,0,3 turns off path for lift + // location 36 { "DREAMWEB.R22", // Duplicate 22,255,22,20, // of hotel but in pool room 255,255,255,0, 1,4,255,255,255,255,255,255,255,255,22 }, + // location 37 { "DREAMWEB.R22", // Duplicate 22,255,22,20, // of hotel but in pool room 255,255,255,0, // coming out of bedroom 0,2,255,255,255,255,255,255,255,255,22 }, + // location 38 { "DREAMWEB.R11", // Duplicate 11,255,22,30, // of carpark but getting 255,255,255,0, // up off the floor 0,0,255,255,255,255,255,255,255,255,11 }, + // location 39 { "DREAMWEB.R28", 5,255,11,20, 255,255,255,0, 0,6,255,255,2,255,255,255,255,255,28 }, + // location 40 { "DREAMWEB.R21", 5,255,11,10, // if demo: 22,255,11,10 255,255,255,0, 1,4,2,15,1,255,255,255,255,255,21 }, + // location 41 { "DREAMWEB.R26", 9,255,0,40, 255,255,255,0, 0,0,255,255,255,255,255,255,255,255,26 }, + // location 42 { "DREAMWEB.R19", 19,255,0,0, 255,255,255,0, 2,2,255,255,255,255,255,255,255,255,19 }, + // location 43 { "DREAMWEB.R08", // leaving tvstudio into street 8,255,11,40, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,8 }, + // location 44 { "DREAMWEB.R01", 1,255,44,10, 255,255,255,0, 3,6,255,255,255,255,255,255,255,255,1 }, + // location 45 { "DREAMWEB.R45", // Dream room 35,255,22,30, 255,255,255,0, 0,6,255,255,255,255,255,255,255,255,45 }, + // location 46 { "DREAMWEB.R46", // Dream room 35,255,22,40, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,46 }, + // location 47 { "DREAMWEB.R47", // Dream room 35,255,0,0, 255,255,255,0, 0,0,255,255,255,255,255,255,255,255,47 }, + // location 48 { "DREAMWEB.R45", // Dream room 35,255,22,30, 255,255,255,0, 4,0,255,255,255,255,255,255,255,255,45 }, + // location 49 { "DREAMWEB.R46", // Dream room 35,255,22,50, 255,255,255,0, 0,4,255,255,255,255,255,255,255,255,46 }, - + // location 50 { "DREAMWEB.R50", // Intro sequence one 35,255,22,30, 255,255,255,0, diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index a8b4417459..68415233f4 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -373,7 +373,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) { DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) { rect.translate(0, -80); _vm->_graphicsMan->_foreground.frameRect(rect, 250); - _vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320); + _vm->_system->copyRectToScreen((byte *)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320); _vm->_system->updateScreen(); } diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index 892c144393..896e8fa2ce 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -1104,7 +1104,7 @@ void Scheduler::restoreEvents(Common::ReadStream *f) { if ((index == -1) && (subElem == -1)) _events[i].action = 0; else - _events[i].action = (act*)&_actListArr[index][subElem]; + _events[i].action = (act *)&_actListArr[index][subElem]; _events[i].localActionFl = (f->readByte() == 1) ? true : false; _events[i].time = f->readUint32BE(); diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index 9dcd7d346a..d0b4e3dfe8 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -256,7 +256,7 @@ void SoundHandler::checkMusic() { } void SoundHandler::loopPlayer(void *refCon) { - ((SoundHandler*)refCon)->pcspkr_player(); + ((SoundHandler *)refCon)->pcspkr_player(); } /** diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h index e3ea533c63..dff2427ddb 100644 --- a/engines/kyra/eobcommon.h +++ b/engines/kyra/eobcommon.h @@ -623,7 +623,7 @@ protected: uint32 _envAudioTimer; uint16 _teleporterPulse; - Common::Array<const int16*> _dscWallMapping; + Common::Array<const int16 *> _dscWallMapping; const int16 *_dscShapeCoords; const uint8 *_dscItemPosIndex; @@ -945,11 +945,11 @@ protected: void printNoEffectWarning(); void spellCallback_start_empty() {} - bool spellCallback_end_empty(void*) { return true; } + bool spellCallback_end_empty(void *) { return true; } void spellCallback_start_armor(); void spellCallback_start_burningHands(); void spellCallback_start_detectMagic(); - bool spellCallback_end_detectMagic(void*); + bool spellCallback_end_detectMagic(void *); void spellCallback_start_magicMissile(); bool spellCallback_end_magicMissile(void *obj); void spellCallback_start_shockingGrasp(); @@ -981,7 +981,7 @@ protected: void spellCallback_start_fleshToStone(); void spellCallback_start_stoneToFlesh(); void spellCallback_start_trueSeeing(); - bool spellCallback_end_trueSeeing(void*); + bool spellCallback_end_trueSeeing(void *); void spellCallback_start_slayLiving(); void spellCallback_start_powerWordStun(); void spellCallback_start_causeLightWounds(); diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index fd2c1870a8..0ba173d9d0 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -171,7 +171,7 @@ KyraEngine_HoF::~KyraEngine_HoF() { delete[] _conversationState[i]; delete[] _conversationState; - for (Common::Array<const TIMOpcode*>::iterator i = _timOpcodes.begin(); i != _timOpcodes.end(); ++i) + for (Common::Array<const TIMOpcode *>::iterator i = _timOpcodes.begin(); i != _timOpcodes.end(); ++i) delete *i; _timOpcodes.clear(); } diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index 320f930b56..182854cdf1 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -656,7 +656,7 @@ protected: int t2_resetChat(const TIM *tim, const uint16 *param); int t2_playSoundEffect(const TIM *tim, const uint16 *param); - Common::Array<const TIMOpcode*> _timOpcodes; + Common::Array<const TIMOpcode *> _timOpcodes; // sound int _oldTalkFile; diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 4e07c8f343..39ed0d038a 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -183,7 +183,7 @@ KyraEngine_MR::~KyraEngine_MR() { delete[] _sceneStrings; delete[] _talkObjectList; - for (Common::Array<const Opcode*>::iterator i = _opcodesDialog.begin(); i != _opcodesDialog.end(); ++i) + for (Common::Array<const Opcode *>::iterator i = _opcodesDialog.begin(); i != _opcodesDialog.end(); ++i) delete *i; _opcodesDialog.clear(); diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h index 7c022534a2..004236ca04 100644 --- a/engines/kyra/kyra_mr.h +++ b/engines/kyra/kyra_mr.h @@ -463,7 +463,7 @@ private: void npcChatSequence(const char *str, int object, int vocHigh, int vocLow); - Common::Array<const Opcode*> _opcodesDialog; + Common::Array<const Opcode *> _opcodesDialog; int o3d_updateAnim(EMCState *script); int o3d_delay(EMCState *script); diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp index b8d56b3ecb..b28292562a 100644 --- a/engines/kyra/kyra_rpg.cpp +++ b/engines/kyra/kyra_rpg.cpp @@ -148,7 +148,7 @@ Common::Error KyraRpgEngine::init() { _levelDecorationProperties = new LevelDecorationProperty[100]; memset(_levelDecorationProperties, 0, 100 * sizeof(LevelDecorationProperty)); _levelDecorationShapes = new uint8*[400]; - memset(_levelDecorationShapes, 0, 400 * sizeof(uint8*)); + memset(_levelDecorationShapes, 0, 400 * sizeof(uint8 *)); _levelBlockProperties = new LevelBlockProperty[1025]; memset(_levelBlockProperties, 0, 1025 * sizeof(LevelBlockProperty)); @@ -178,7 +178,7 @@ Common::Error KyraRpgEngine::init() { _vcnExpTable[i] = i & 0x0f; _doorShapes = new uint8*[6]; - memset(_doorShapes, 0, 6 * sizeof(uint8*)); + memset(_doorShapes, 0, 6 * sizeof(uint8 *)); initStaticResource(); diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 67332eccdb..04bfab2cb8 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -326,7 +326,7 @@ protected: // opcode virtual void setupOpcodeTable() = 0; - Common::Array<const Opcode*> _opcodes; + Common::Array<const Opcode *> _opcodes; int o1_queryGameFlag(EMCState *script); int o1_setGameFlag(EMCState *script); diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 72d743710d..563416bf1e 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -224,7 +224,7 @@ protected: // Sequences EMCData _animationScriptData; EMCState _animationScriptState; - Common::Array<const Opcode*> _opcodesAnimation; + Common::Array<const Opcode *> _opcodesAnimation; void runAnimationScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload); @@ -252,7 +252,7 @@ protected: virtual void uninitAnimationShapes(int count, uint8 *filedata) = 0; // Shapes - typedef Common::HashMap<int, uint8*> ShapeMap; + typedef Common::HashMap<int, uint8 *> ShapeMap; ShapeMap _gameShapes; uint8 *getShapePtr(int index) const; diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index bb8f24eb66..dbd461267f 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -447,7 +447,7 @@ private: uint16 _envSfxQueuedBlocks[10]; int _nextSpeechId; int _nextSpeaker; - typedef Common::List<Audio::SeekableAudioStream*> SpeechList; + typedef Common::List<Audio::SeekableAudioStream *> SpeechList; SpeechList _speechList; int _curTlkFile; @@ -762,14 +762,14 @@ private: // tim opcode void setupOpcodeTable(); - Common::Array<const TIMOpcode*> _timIntroOpcodes; + Common::Array<const TIMOpcode *> _timIntroOpcodes; int tlol_setupPaletteFade(const TIM *tim, const uint16 *param); int tlol_loadPalette(const TIM *tim, const uint16 *param); int tlol_setupPaletteFadeEx(const TIM *tim, const uint16 *param); int tlol_processWsaFrame(const TIM *tim, const uint16 *param); int tlol_displayText(const TIM *tim, const uint16 *param); - Common::Array<const TIMOpcode*> _timOutroOpcodes; + Common::Array<const TIMOpcode *> _timOutroOpcodes; int tlol_fadeInScene(const TIM *tim, const uint16 *param); int tlol_unusedResourceFunc(const TIM *tim, const uint16 *param); int tlol_fadeInPalette(const TIM *tim, const uint16 *param); @@ -778,7 +778,7 @@ private: int tlol_delayForChat(const TIM *tim, const uint16 *param); int tlol_fadeOutSound(const TIM *tim, const uint16 *param); - Common::Array<const TIMOpcode*> _timIngameOpcodes; + Common::Array<const TIMOpcode *> _timIngameOpcodes; int tlol_initSceneWindowDialogue(const TIM *tim, const uint16 *param); int tlol_restoreAfterSceneWindowDialogue(const TIM *tim, const uint16 *param); int tlol_giveItem(const TIM *tim, const uint16 *param); @@ -1156,7 +1156,7 @@ private: // spells typedef Common::Functor1Mem<ActiveSpell *, int, LoLEngine> SpellProc; - Common::Array<const SpellProc*> _spellProcs; + Common::Array<const SpellProc *> _spellProcs; typedef void (LoLEngine::*SpellProcCallback)(WSAMovie_v2 *, int, int); int castSpell(int charNum, int spellType, int spellLevel); diff --git a/engines/kyra/saveload_rpg.cpp b/engines/kyra/saveload_rpg.cpp index 2e9f0228cf..f3eef0d811 100644 --- a/engines/kyra/saveload_rpg.cpp +++ b/engines/kyra/saveload_rpg.cpp @@ -118,7 +118,7 @@ void KyraRpgEngine::restoreFlyingObjectTempData(LevelTempData *tmp) { } void KyraRpgEngine::releaseFlyingObjectTempData(LevelTempData *tmp) { - EoBFlyingObject *p = (EoBFlyingObject*)tmp->flyingObjects; + EoBFlyingObject *p = (EoBFlyingObject *)tmp->flyingObjects; delete[] p; } diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 2b701e3b81..6a76cfd0d5 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -3200,7 +3200,7 @@ void Screen::crossFadeRegion(int x1, int y1, int x2, int y2, int w, int h, int s hideMouse(); - uint16 *wB = (uint16*)_pagePtrs[14]; + uint16 *wB = (uint16 *)_pagePtrs[14]; uint8 *hB = _pagePtrs[14] + 640; for (int i = 0; i < w; i++) diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index dd74692a5d..62ea35af9e 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -554,7 +554,7 @@ protected: uint8 _sjisInvisibleColor; Palette *_screenPalette; - Common::Array<Palette*> _palettes; + Common::Array<Palette *> _palettes; Palette *_internFadePalette; Font *_fonts[FID_NUM]; diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index 1981341063..303cbb45aa 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -95,7 +95,7 @@ bool EMCInterpreter::callback(Common::IFFChunk &chunk) { return false; } -bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Common::Array<const Opcode*> *opcodes) { +bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Common::Array<const Opcode *> *opcodes) { Common::SeekableReadStream *stream = _vm->resource()->createReadStream(filename); if (!stream) { error("Couldn't open script file '%s'", filename); diff --git a/engines/kyra/script.h b/engines/kyra/script.h index dffb4e27f5..ccbe733e4d 100644 --- a/engines/kyra/script.h +++ b/engines/kyra/script.h @@ -41,7 +41,7 @@ struct EMCData { uint16 *ordr; uint16 dataSize; - const Common::Array<const Opcode*> *sysFuncs; + const Common::Array<const Opcode *> *sysFuncs; }; struct EMCState { @@ -109,7 +109,7 @@ class EMCInterpreter { public: EMCInterpreter(KyraEngine_v1 *vm); - bool load(const char *filename, EMCData *data, const Common::Array<const Opcode*> *opcodes); + bool load(const char *filename, EMCData *data, const Common::Array<const Opcode *> *opcodes); void unload(EMCData *data); void init(EMCState *scriptState, const EMCData *data); diff --git a/engines/kyra/script_eob.h b/engines/kyra/script_eob.h index 391791522a..fc8b4cfc31 100644 --- a/engines/kyra/script_eob.h +++ b/engines/kyra/script_eob.h @@ -99,7 +99,7 @@ private: InfProc *proc; Common::String desc; }; - Common::Array<const InfOpcode*> _opcodes; + Common::Array<const InfOpcode *> _opcodes; int8 *_scriptData; uint16 _scriptSize; diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index 73b6915c89..b80b8105a1 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -1480,7 +1480,7 @@ typedef Common::Functor2Mem<const TIM *, const uint16 *, int, KyraEngine_HoF> TI #define OpcodeTimUnImpl() _timOpcodes.push_back(new TIMOpcodeV2(this, 0)) void KyraEngine_HoF::setupOpcodeTable() { - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; _opcodes.reserve(176); SetOpcodeTable(_opcodes); diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index 56b2a48b89..afe11aba02 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -1129,7 +1129,7 @@ typedef Common::Functor1Mem<EMCState *, int, KyraEngine_MR> OpcodeV3; #define Opcode(x) table->push_back(new OpcodeV3(this, &KyraEngine_MR::x)) #define OpcodeUnImpl() table->push_back(new OpcodeV3(this, 0)) void KyraEngine_MR::setupOpcodeTable() { - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; _opcodes.reserve(176); SetOpcodeTable(_opcodes); diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 7995ad21f1..177d7993a0 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -135,7 +135,7 @@ bool TIMInterpreter::callback(Common::IFFChunk &chunk) { return false; } -TIM *TIMInterpreter::load(const char *filename, const Common::Array<const TIMOpcode*> *opcodes) { +TIM *TIMInterpreter::load(const char *filename, const Common::Array<const TIMOpcode *> *opcodes) { if (!_vm->resource()->exists(filename)) return 0; diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index e132ed78c5..aa512daae8 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -146,7 +146,7 @@ struct TIM { uint16 *avtl; uint8 *text; - const Common::Array<const TIMOpcode*> *opcodes; + const Common::Array<const TIMOpcode *> *opcodes; // TODO: Get rid of this ugly HACK to allow the // Lands of Lore outro to be working properly. @@ -159,7 +159,7 @@ public: TIMInterpreter(KyraEngine_v1 *engine, Screen_v2 *screen_v2, OSystem *system); virtual ~TIMInterpreter(); - TIM *load(const char *filename, const Common::Array<const TIMOpcode*> *opcodes); + TIM *load(const char *filename, const Common::Array<const TIMOpcode *> *opcodes); void unload(TIM *&tim) const; bool callback(Common::IFFChunk &chunk); diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp index 073ca3f175..54c2d87b89 100644 --- a/engines/lastexpress/entities/alexei.cpp +++ b/engines/lastexpress/entities/alexei.cpp @@ -355,7 +355,7 @@ IMPLEMENT_FUNCTION_IS(16, Alexei, function16, TimeValue) break; case kActionDefault: - getEntities()->drawSequenceLeft(kEntityAlexei, (char*)¶ms->seq); + getEntities()->drawSequenceLeft(kEntityAlexei, (char *)¶ms->seq); getObjects()->update(kObjectCompartment2, kEntityAlexei, kObjectLocation1, kCursorHandKnock, kCursorHand); getObjects()->update(kObjectHandleInsideBathroom, kEntityAlexei, kObjectLocation1, kCursorHandKnock, kCursorHand); break; diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h index bf75e022de..2da0da15b3 100644 --- a/engines/lastexpress/entities/entity_intern.h +++ b/engines/lastexpress/entities/entity_intern.h @@ -94,7 +94,7 @@ void class::setup_##name() { \ // Expose parameters and check validity #define EXPOSE_PARAMS(type) \ - type *params = (type*)_data->getCurrentParameters(); \ + type *params = (type *)_data->getCurrentParameters(); \ if (!params) \ error("[EXPOSE_PARAMS] Trying to call an entity function with invalid parameters"); \ @@ -307,7 +307,7 @@ void class::setup_##name() { \ ////////////////////////////////////////////////////////////////////////// #define RESET_ENTITY_STATE(entity, class, function) \ getEntities()->resetState(entity); \ - ((class*)getEntities()->get(entity))->function(); + ((class *)getEntities()->get(entity))->function(); ////////////////////////////////////////////////////////////////////////// // Parameters macros (for default IIII parameters) diff --git a/engines/lastexpress/game/entities.cpp b/engines/lastexpress/game/entities.cpp index 894663dda6..f27087a609 100644 --- a/engines/lastexpress/game/entities.cpp +++ b/engines/lastexpress/game/entities.cpp @@ -615,9 +615,9 @@ void Entities::resetSequences(EntityIndex entityIndex) const { getData(entityIndex)->field_4A9 = false; getData(entityIndex)->field_4AA = false; - strcpy((char*)&getData(entityIndex)->sequenceNameCopy, ""); - strcpy((char*)&getData(entityIndex)->sequenceName, ""); - strcpy((char*)&getData(entityIndex)->sequenceName2, ""); + strcpy((char *)&getData(entityIndex)->sequenceNameCopy, ""); + strcpy((char *)&getData(entityIndex)->sequenceName, ""); + strcpy((char *)&getData(entityIndex)->sequenceName2, ""); getScenes()->resetQueue(); } diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp index 0aecae22ec..bf0abdea07 100644 --- a/engines/lure/sound.cpp +++ b/engines/lure/sound.cpp @@ -635,7 +635,7 @@ MidiMusic::MidiMusic(MidiDriver *driver, ChannelEntry channels[NUM_CHANNELS], for (uint i = 0; i < packedSize; i++) #if defined(SCUMM_NEED_ALIGNMENT) - memcpy(dataDest++, (byte*)((byte*)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); + memcpy(dataDest++, (byte *)((byte *)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); #else *dataDest++ = data[*(idx + i)]; #endif diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 454fe09a38..2b87f97392 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -56,7 +56,7 @@ const char *Object::getString() { void Object::setString(const char *str) { if (getClass() == 0x7FFF) { - char *objStr = (char*)getData(); + char *objStr = (char *)getData(); if (str) strncpy(objStr, str, getSize()); else @@ -86,10 +86,10 @@ int16 Object::getVectorSize() { int16 Object::getVectorItem(int16 index) { if (getClass() == 0x7FFF) { - byte *vector = (byte*)getData(); + byte *vector = (byte *)getData(); return vector[index]; } else if (getClass() <= 0x7FFE) { - int16 *vector = (int16*)getData(); + int16 *vector = (int16 *)getData(); return READ_LE_UINT16(&vector[index]); } else { // should never reach here @@ -100,10 +100,10 @@ int16 Object::getVectorItem(int16 index) { void Object::setVectorItem(int16 index, int16 value) { if (getClass() == 0x7FFF) { - byte *vector = (byte*)getData(); + byte *vector = (byte *)getData(); vector[index] = value; } else if (getClass() <= 0x7FFE) { - int16 *vector = (int16*)getData(); + int16 *vector = (int16 *)getData(); WRITE_LE_UINT16(&vector[index], value); } } @@ -526,7 +526,7 @@ int16 *GameDatabaseV2::findObjectProperty(int16 objectIndex, int16 propertyId, i error("GameDatabaseV2::findObjectProperty(%04X, %04X) Not an object", objectIndex, propertyId); } - int16 *prop = (int16*)obj->getData(); + int16 *prop = (int16 *)obj->getData(); byte count1 = obj->getCount1(); byte count2 = obj->getCount2(); @@ -553,7 +553,7 @@ int16 *GameDatabaseV2::findObjectProperty(int16 objectIndex, int16 propertyId, i obj = getObject(parentObjectIndex); - prop = (int16*)obj->getData(); + prop = (int16 *)obj->getData(); count1 = obj->getCount1(); count2 = obj->getCount2(); @@ -750,7 +750,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i error("GameDatabaseV2::findObjectProperty(%04X, %04X) Not an object", objectIndex, propertyId); } - int16 *prop = (int16*)obj->getData(); + int16 *prop = (int16 *)obj->getData(); byte count1 = obj->getCount1(); byte count2 = obj->getCount2(); @@ -762,7 +762,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) { if (READ_LE_UINT16(prop) & 0x4000) { propertyFlag = 1; - return (int16*)_gameState + READ_LE_UINT16(propPtr1); + return (int16 *)_gameState + READ_LE_UINT16(propPtr1); } else { propertyFlag = obj->getFlags() & 1; return propPtr1; @@ -782,7 +782,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i obj = getObject(parentObjectIndex); - prop = (int16*)obj->getData(); + prop = (int16 *)obj->getData(); count1 = obj->getCount1(); count2 = obj->getCount2(); @@ -794,7 +794,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) { if (READ_LE_UINT16(prop) & 0x4000) { propertyFlag = 1; - return (int16*)_gameState + READ_LE_UINT16(propPtr1); + return (int16 *)_gameState + READ_LE_UINT16(propPtr1); } else { propertyFlag = obj->getFlags() & 1; return propPtr1; @@ -806,7 +806,7 @@ int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, i if ((READ_LE_UINT16(prop) & 0x3FFF) == propertyId) { if (READ_LE_UINT16(prop) & 0x4000) { propertyFlag = 1; - return (int16*)_gameState + READ_LE_UINT16(propertyPtr); + return (int16 *)_gameState + READ_LE_UINT16(propertyPtr); } else { propertyFlag = obj->getFlags() & 1; return propertyPtr; diff --git a/engines/made/database.h b/engines/made/database.h index 63f0557196..89b4b45357 100644 --- a/engines/made/database.h +++ b/engines/made/database.h @@ -151,9 +151,9 @@ public: void dumpObject(int16 index); protected: - typedef Common::HashMap<uint32, int16*> ObjectPropertyCacheMap; + typedef Common::HashMap<uint32, int16 *> ObjectPropertyCacheMap; MadeEngine *_vm; - Common::Array<Object*> _objects; + Common::Array<Object *> _objects; ObjectPropertyCacheMap _objectPropertyCache; byte *_gameState; uint32 _gameStateSize; diff --git a/engines/made/graphics.cpp b/engines/made/graphics.cpp index 30496d8595..4d3fc7116a 100644 --- a/engines/made/graphics.cpp +++ b/engines/made/graphics.cpp @@ -83,7 +83,7 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u if ((maskFlags != 0) && (maskFlags != 2) && (pixelFlags != 0) && (pixelFlags != 2) && (cmdFlags != 0)) error("decompressImage() Unsupported flags: cmdFlags = %02X; maskFlags = %02X, pixelFlags = %02X", cmdFlags, maskFlags, pixelFlags); - byte *destPtr = (byte*)surface.getBasePtr(0, 0); + byte *destPtr = (byte *)surface.getBasePtr(0, 0); byte lineBuf[640 * 4]; byte bitBuf[40]; @@ -196,7 +196,7 @@ void decompressMovieImage(byte *source, Graphics::Surface &surface, uint16 cmdOf byte *maskBuffer = source + maskOffs; byte *pixelBuffer = source + pixelOffs; - byte *destPtr = (byte*)surface.getBasePtr(0, 0); + byte *destPtr = (byte *)surface.getBasePtr(0, 0); byte bitBuf[40]; diff --git a/engines/made/resource.h b/engines/made/resource.h index 537801bdc8..a789069272 100644 --- a/engines/made/resource.h +++ b/engines/made/resource.h @@ -111,7 +111,7 @@ public: int16 getWidth() const { return _width; } int16 getHeight() const { return _height; } protected: - Common::Array<Graphics::Surface*> _frames; + Common::Array<Graphics::Surface *> _frames; uint16 _flags; int16 _width, _height; }; @@ -210,7 +210,7 @@ protected: bool _isV1; typedef Common::Array<ResourceSlot> ResourceSlots; - typedef Common::HashMap<uint32, ResourceSlots*> ResMap; + typedef Common::HashMap<uint32, ResourceSlots *> ResMap; void openResourceBlock(const char *filename, Common::File *blockFile, uint32 resType); ResMap _resSlots; @@ -224,7 +224,7 @@ protected: ResourceSlot *slot = getResourceSlot(resType, index); if (!slot) return NULL; - T *res = (T*)getResourceFromCache(slot); + T *res = (T *)getResourceFromCache(slot); if (!res) { byte *buffer; uint32 size; diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp index 168902d577..b49bfff840 100644 --- a/engines/made/screen.cpp +++ b/engines/made/screen.cpp @@ -179,10 +179,10 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f clipHeight = clipInfo.clipRect.bottom - y; } - source = (byte*)sourceSurface->getBasePtr(0, startY); - dest = (byte*)clipInfo.destSurface->getBasePtr(x, y); + source = (byte *)sourceSurface->getBasePtr(0, startY); + dest = (byte *)clipInfo.destSurface->getBasePtr(x, y); if (_vm->getGameID() != GID_RTZ) - maskp = (byte*)_maskDrawCtx.destSurface->getBasePtr(x, y); + maskp = (byte *)_maskDrawCtx.destSurface->getBasePtr(x, y); int32 sourcePitch, linePtrAdd, sourceAdd; byte *linePtr; @@ -633,7 +633,7 @@ void Screen::printChar(uint c, int16 x, int16 y, byte color) { return; byte p; - byte *dest = (byte*)_fontDrawCtx.destSurface->getBasePtr(x, y); + byte *dest = (byte *)_fontDrawCtx.destSurface->getBasePtr(x, y); for (uint yc = 0; yc < height; yc++) { p = charData[yc]; diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp index ff0d393885..4e0d463b53 100644 --- a/engines/made/screenfx.cpp +++ b/engines/made/screenfx.cpp @@ -231,10 +231,10 @@ void ScreenEffects::copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, i vfxY1 = y1 & 7; - byte *source = (byte*)surface->getBasePtr(x1, y1); + byte *source = (byte *)surface->getBasePtr(x1, y1); Graphics::Surface *vgaScreen = _screen->lockScreen(); - byte *dest = (byte*)vgaScreen->getBasePtr(x1, y1); + byte *dest = (byte *)vgaScreen->getBasePtr(x1, y1); int16 addX = x2 / 16; diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h index 6b3301755d..03d29c4592 100644 --- a/engines/made/scriptfuncs.h +++ b/engines/made/scriptfuncs.h @@ -68,7 +68,7 @@ protected: Audio::SoundHandle _pcSpeakerHandle1, _pcSpeakerHandle2; Audio::PCSpeaker *_pcSpeaker1, *_pcSpeaker2; - Common::Array<const ExternalFunc*> _externalFuncs; + Common::Array<const ExternalFunc *> _externalFuncs; Common::Array<const char *> _externalFuncNames; GenericResource *_musicRes; diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 2b1b28716e..08df0a2cbe 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -1011,6 +1011,22 @@ static const MohawkGameDescription gameDescriptions[] = { 0, }, + // Tortoise and the Hare Hebrew variant - From georgeqgreg on bug #3441928 + { + { + "tortoise", + "", + AD_ENTRY1("TORTB.LB", "23135777370cf1ff00aa7247e93642d3"), + Common::HE_ISR, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_LIVINGBOOKSV2, + 0, + 0, + }, + // From afholman in bug#3309308 { { @@ -1293,6 +1309,23 @@ static const MohawkGameDescription gameDescriptions[] = { 0 }, + // Just Grandma and Me 2.0 Macintosh + // From aluff in bug #3461368 + { + { + "grandma", + "v2.0", + AD_ENTRY1("BookOutline", "99fe5c8ace79f0542e6390bc3b58f25a"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_UNSTABLE, + GUIO1(GUIO_NOASPECT) + }, + GType_LIVINGBOOKSV3, + 0, + 0 + }, + // Just Grandma and Me 1.0 // From scoriae { @@ -1782,6 +1815,23 @@ static const MohawkGameDescription gameDescriptions[] = { 0 }, + // Arthur Birthday (English) Version 2.0 Macintosh + // From aluff in bug #3461368 + { + { + "arthurbday", + "", + AD_ENTRY1("BookOutline", "8e4fddb5b761c8cf2a3b448dd38422be"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_UNSTABLE, + GUIO1(GUIO_NOASPECT) + }, + GType_LIVINGBOOKSV3, + 0, + 0 + }, + { { "arthurbday", @@ -2251,6 +2301,22 @@ static const MohawkGameDescription gameDescriptions[] = { 0 }, + // From aluff in bug #3461368 + { + { + "beardark", + "", + AD_ENTRY1("BookOutline", "b56746b3b2c062c8588bfb6b28e137c1"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_NO_FLAGS, + GUIO1(GUIO_NOASPECT) + }, + GType_LIVINGBOOKSV3, + 0, + 0 + }, + { { "arthurcomp", diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index dcb0c7940d..2ffabf1e8c 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -108,9 +108,9 @@ GraphicsManager::~GraphicsManager() { } void GraphicsManager::clearCache() { - for (Common::HashMap<uint16, MohawkSurface*>::iterator it = _cache.begin(); it != _cache.end(); it++) + for (Common::HashMap<uint16, MohawkSurface *>::iterator it = _cache.begin(); it != _cache.end(); it++) delete it->_value; - for (Common::HashMap<uint16, Common::Array<MohawkSurface*> >::iterator it = _subImageCache.begin(); it != _subImageCache.end(); it++) { + for (Common::HashMap<uint16, Common::Array<MohawkSurface *> >::iterator it = _subImageCache.begin(); it != _subImageCache.end(); it++) { Common::Array<MohawkSurface *> &array = it->_value; for (uint i = 0; i < array.size(); i++) delete array[i]; diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index 463608a2aa..8fa5d5f895 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -99,8 +99,8 @@ protected: private: // An image cache that stores images until clearCache() is called - Common::HashMap<uint16, MohawkSurface*> _cache; - Common::HashMap<uint16, Common::Array<MohawkSurface*> > _subImageCache; + Common::HashMap<uint16, MohawkSurface *> _cache; + Common::HashMap<uint16, Common::Array<MohawkSurface *> > _subImageCache; }; #ifdef ENABLE_MYST @@ -222,7 +222,7 @@ private: uint16 frameCount; Common::Rect rect; uint16 speed; - Common::Array<Common::SeekableReadStream*> frameScripts; + Common::Array<Common::SeekableReadStream *> frameScripts; // Cur frame uint16 curFrame; diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 02f0a46e3f..30770f7ec9 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -173,7 +173,7 @@ public: MystGraphics *_gfx; MystGameState *_gameState; MystScriptParser *_scriptParser; - Common::Array<MystResource*> _resources; + Common::Array<MystResource *> _resources; MystResource *_dragResource; Common::RandomSource *_rnd; diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h index 136356ea4f..297a7cc92b 100644 --- a/engines/mohawk/myst_areas.h +++ b/engines/mohawk/myst_areas.h @@ -137,7 +137,7 @@ public: protected: uint16 _var7; uint16 _numSubResources; - Common::Array<MystResource*> _subResources; + Common::Array<MystResource *> _subResources; }; class MystResourceType8 : public MystResourceType7 { diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h index 18f5b27a6d..ccb76e0dc8 100644 --- a/engines/mohawk/myst_scripts.h +++ b/engines/mohawk/myst_scripts.h @@ -143,7 +143,7 @@ protected: const char *desc; }; - Common::Array<MystOpcode*> _opcodes; + Common::Array<MystOpcode *> _opcodes; MystResource *_invokingResource; diff --git a/engines/mohawk/riven_external.h b/engines/mohawk/riven_external.h index 5f5d0cb0b2..9f076325a2 100644 --- a/engines/mohawk/riven_external.h +++ b/engines/mohawk/riven_external.h @@ -53,7 +53,7 @@ private: ExternalCmd proc; }; - Common::Array<RivenExternalCmd*> _externalCommands; + Common::Array<RivenExternalCmd *> _externalCommands; void setupCommands(); // Supplementary Functions diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h index 2932ba5939..a871f0afa0 100644 --- a/engines/mohawk/riven_scripts.h +++ b/engines/mohawk/riven_scripts.h @@ -125,7 +125,7 @@ private: DECLARE_OPCODE(activateMLST); }; -typedef Common::Array<RivenScript*> RivenScriptList; +typedef Common::Array<RivenScript *> RivenScriptList; class RivenScriptManager { public: diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index 7958906897..8d72fa3f72 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -261,7 +261,7 @@ bool VideoManager::updateMovies() { // Clip the width/height to make sure we stay on the screen (Myst does this a few times) uint16 width = MIN<int32>(_videoStreams[i]->getWidth(), _vm->_system->getWidth() - _videoStreams[i].x); uint16 height = MIN<int32>(_videoStreams[i]->getHeight(), _vm->_system->getHeight() - _videoStreams[i].y); - _vm->_system->copyRectToScreen((byte*)frame->pixels, frame->pitch, _videoStreams[i].x, _videoStreams[i].y, width, height); + _vm->_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, _videoStreams[i].x, _videoStreams[i].y, width, height); // We've drawn something to the screen, make sure we update it updateScreen = true; diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp index f74eef18e1..1ddd401b20 100644 --- a/engines/parallaction/balloons.cpp +++ b/engines/parallaction/balloons.cpp @@ -179,7 +179,7 @@ protected: uint16 rx = 10; uint16 ry = 4 + _lines * _font->height(); // y - byte *dst = (byte*)_surf->getBasePtr(rx, ry); + byte *dst = (byte *)_surf->getBasePtr(rx, ry); _font->setColor(_color); _font->drawString(dst, _surf->w, _line.c_str()); } @@ -494,7 +494,7 @@ protected: uint16 rx = _x + (_surf->w - _lineWidth) / 2; uint16 ry = _y + _lines * _font->height(); // y - byte *dst = (byte*)_surf->getBasePtr(rx, ry); + byte *dst = (byte *)_surf->getBasePtr(rx, ry); _font->setColor(_color); _font->drawString(dst, _surf->w, _line.c_str()); } diff --git a/engines/parallaction/callables_br.cpp b/engines/parallaction/callables_br.cpp index ac5ff88560..7d3e63dfba 100644 --- a/engines/parallaction/callables_br.cpp +++ b/engines/parallaction/callables_br.cpp @@ -26,31 +26,31 @@ namespace Parallaction { -void Parallaction_br::_c_null(void*) { +void Parallaction_br::_c_null(void *) { // do nothing :) } -void Parallaction_br::_c_blufade(void*) { +void Parallaction_br::_c_blufade(void *) { warning("Parallaction_br::_c_blufade() not yet implemented"); } -void Parallaction_br::_c_resetpalette(void*) { +void Parallaction_br::_c_resetpalette(void *) { warning("Parallaction_br::_c_resetpalette() not yet implemented"); } -void Parallaction_br::_c_ferrcycle(void*) { +void Parallaction_br::_c_ferrcycle(void *) { warning("Parallaction_br::_c_ferrcycle() not yet implemented"); } -void Parallaction_br::_c_lipsinc(void*) { +void Parallaction_br::_c_lipsinc(void *) { warning("Unexpected lipsinc routine call! Please notify the team"); } -void Parallaction_br::_c_albcycle(void*) { +void Parallaction_br::_c_albcycle(void *) { warning("Parallaction_br::_c_albcycle() not yet implemented"); } -void Parallaction_br::_c_password(void*) { +void Parallaction_br::_c_password(void *) { warning("Parallaction_br::_c_password() not yet implemented"); } diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index 77f54fcc98..64885c7ff3 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -260,7 +260,7 @@ void Parallaction_ns::stopMovingSarcophagus() { void Parallaction_ns::_c_moveSarc(void *parm) { if (!_movingSarcophagus) { - startMovingSarcophagus(*(ZonePtr*)parm); + startMovingSarcophagus(*(ZonePtr *)parm); } else { stopMovingSarcophagus(); } @@ -417,18 +417,18 @@ void Parallaction_ns::_c_testResult(void *parm) { return; } -void Parallaction_ns::_c_offSound(void*) { +void Parallaction_ns::_c_offSound(void *) { _soundManI->stopSfx(0); _soundManI->stopSfx(1); _soundManI->stopSfx(2); _soundManI->stopSfx(3); } -void Parallaction_ns::_c_startMusic(void*) { +void Parallaction_ns::_c_startMusic(void *) { _soundManI->playMusic(); } -void Parallaction_ns::_c_closeMusic(void*) { +void Parallaction_ns::_c_closeMusic(void *) { _soundManI->stopMusic(); } @@ -490,7 +490,7 @@ void Parallaction_ns::_c_moveSheet(void *parm) { } void zeroMask(int x, int y, int color, void *data) { - BackgroundInfo *info = (BackgroundInfo*)data; + BackgroundInfo *info = (BackgroundInfo *)data; uint16 _ax = x + y * info->_mask->w; info->_mask->data[_ax >> 2] &= ~(3 << ((_ax & 3) << 1)); @@ -575,16 +575,16 @@ int16 projectorProgram[] = { 25, 116, 25, 115, 25, 114, 25, 113, 25, 112, 25, 111, 25, 110, 25, -1, -1 }; -void Parallaction_ns::_c_projector(void*) { +void Parallaction_ns::_c_projector(void *) { _gfx->setHalfbriteMode(true); _gfx->setProjectorProgram(projectorProgram); } -void Parallaction_ns::_c_HBOff(void*) { +void Parallaction_ns::_c_HBOff(void *) { _gfx->setHalfbriteMode(false); } -void Parallaction_ns::_c_HBOn(void*) { +void Parallaction_ns::_c_HBOn(void *) { _gfx->setHalfbriteMode(true); } diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp index 72f26cb6b9..0cb329e0f0 100644 --- a/engines/parallaction/debug.cpp +++ b/engines/parallaction/debug.cpp @@ -69,14 +69,14 @@ bool Debugger::Cmd_Location(int argc, const char **argv) { switch (argc) { case 3: - character = const_cast<char*>(argv[2]); - location = const_cast<char*>(argv[1]); + character = const_cast<char *>(argv[2]); + location = const_cast<char *>(argv[1]); sprintf(tmp, "%s.%s", location, character); _vm->scheduleLocationSwitch(tmp); break; case 2: - location = const_cast<char*>(argv[1]); + location = const_cast<char *>(argv[1]); _vm->scheduleLocationSwitch(location); break; diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index 61172d0896..f20e05771a 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -38,7 +38,7 @@ void ILBMLoader::setupBuffer(uint32 w, uint32 h) { } _surf->create(w, h, Graphics::PixelFormat::createFormatCLUT8()); _mode = Graphics::ILBMDecoder::ILBM_UNPACK_PLANES; - _intBuffer = (byte*)_surf->pixels; + _intBuffer = (byte *)_surf->pixels; break; case BODYMODE_MASKBUFFER: @@ -82,7 +82,7 @@ bool ILBMLoader::callback(Common::IFFChunk &chunk) { case ID_CRNG: if (_crng) { PaletteFxRange *ptr = &_crng[_numCRNG]; - chunk._stream->read((byte*)ptr, chunk._size); + chunk._stream->read((byte *)ptr, chunk._size); ptr->_timer = FROM_BE_16(ptr->_timer); ptr->_step = FROM_BE_16(ptr->_step); ptr->_flags = FROM_BE_16(ptr->_flags); diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index f9e368ab39..5e39c893db 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -283,7 +283,7 @@ Sprites* DosDisk_br::createSprites(Common::ReadStream *stream) { spr->w = stream->readUint16LE(); spr->h = stream->readUint16LE(); - spr->packedData = (byte*)malloc(spr->size); + spr->packedData = (byte *)malloc(spr->size); stream->read(spr->packedData, spr->size); } delete stream; @@ -450,7 +450,7 @@ void AmigaDisk_br::init() { void AmigaDisk_br::adjustForPalette(Graphics::Surface &surf, int transparentColor) { uint size = surf.w * surf.h; - byte *data = (byte*)surf.pixels; + byte *data = (byte *)surf.pixels; for (uint i = 0; i < size; i++, data++) { if (transparentColor == -1 || transparentColor != *data) *data += 16; @@ -609,7 +609,7 @@ GfxObj* AmigaDisk_br::loadStatic(const char* name) { stream->read(shadow, shadowSize); for (int32 i = 0; i < surf->h; ++i) { byte *src = shadow + shadowWidth * i; - byte *dst = (byte*)surf->pixels + surf->pitch * i; + byte *dst = (byte *)surf->pixels + surf->pitch * i; for (int32 j = 0; j < surf->w; ++j, ++dst) { byte bit = src[j/8] & (1 << (7 - (j & 7))); @@ -637,7 +637,7 @@ Sprites* AmigaDisk_br::createSprites(Common::ReadStream *stream) { spr->w = stream->readUint16BE(); spr->h = stream->readUint16BE() - 1; - spr->packedData = (byte*)malloc(spr->size); + spr->packedData = (byte *)malloc(spr->size); stream->read(spr->packedData, spr->size); } @@ -725,7 +725,7 @@ GfxObj* AmigaDisk_br::loadObjects(const char *name, uint8 part) { max = 72; byte *data = new byte[max * 2601]; - byte *srcPtr = (byte*)loader._surf->getBasePtr(0,0); + byte *srcPtr = (byte *)loader._surf->getBasePtr(0,0); int w = loader._surf->w; // Convert to the expected display format diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index e145743f09..b2285d0da3 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -473,7 +473,7 @@ void DosDisk_ns::loadBackground(BackgroundInfo& info, const char *filename) { // read bitmap, mask and path data and extract them into the 3 buffers info.bg.create(info.width, info.height, Graphics::PixelFormat::createFormatCLUT8()); createMaskAndPathBuffers(info); - unpackBackground(stream, (byte*)info.bg.pixels, info._mask->data, info._path->data); + unpackBackground(stream, (byte *)info.bg.pixels, info._mask->data, info._path->data); delete stream; } @@ -661,10 +661,10 @@ public: stream.seek(-4, SEEK_END); uint32 decrlen = stream.readUint32BE() >> 8; - byte *dest = (byte*)malloc(decrlen); + byte *dest = (byte *)malloc(decrlen); uint32 crlen = stream.size() - 4; - byte *src = (byte*)malloc(crlen); + byte *src = (byte *)malloc(crlen); stream.seek(4, SEEK_SET); stream.read(src, crlen); @@ -757,14 +757,14 @@ void AmigaDisk_ns::unpackFrame(byte *dst, byte *src, uint16 planeSize) { */ void AmigaDisk_ns::patchFrame(byte *dst, byte *dlta, uint16 bytesPerPlane, uint16 height) { - uint32 *dataIndex = (uint32*)dlta; - uint32 *ofslenIndex = (uint32*)dlta + 8; + uint32 *dataIndex = (uint32 *)dlta; + uint32 *ofslenIndex = (uint32 *)dlta + 8; - uint16 *base = (uint16*)dlta; + uint16 *base = (uint16 *)dlta; uint16 wordsPerLine = bytesPerPlane >> 1; for (uint j = 0; j < NUM_PLANES; j++) { - uint16 *dst16 = (uint16*)(dst + j * bytesPerPlane * height); + uint16 *dst16 = (uint16 *)(dst + j * bytesPerPlane * height); uint16 *data = base + READ_BE_UINT32(dataIndex); dataIndex++; @@ -804,7 +804,7 @@ void AmigaDisk_ns::unpackBitmap(byte *dst, byte *src, uint16 numFrames, uint16 b uint size = READ_BE_UINT32(src + 4); if (tempBuffer == 0) - tempBuffer = (byte*)malloc(planeSize * NUM_PLANES); + tempBuffer = (byte *)malloc(planeSize * NUM_PLANES); memcpy(tempBuffer, baseFrame, planeSize * NUM_PLANES); diff --git a/engines/parallaction/exec.h b/engines/parallaction/exec.h index b7b8a571f4..b966d677cd 100644 --- a/engines/parallaction/exec.h +++ b/engines/parallaction/exec.h @@ -55,7 +55,7 @@ struct CommandContext { // in Parallaction_XX }; typedef Common::Functor1<CommandContext&, void> CommandOpcode; -typedef Common::Array<const CommandOpcode*> CommandOpcodeSet; +typedef Common::Array<const CommandOpcode *> CommandOpcodeSet; #define DECLARE_UNQUALIFIED_COMMAND_OPCODE(op) void cmdOp_##op(CommandContext &) struct ProgramContext { @@ -67,7 +67,7 @@ struct ProgramContext { bool _suspend; }; typedef Common::Functor1<ProgramContext&, void> ProgramOpcode; -typedef Common::Array<const ProgramOpcode*> ProgramOpcodeSet; +typedef Common::Array<const ProgramOpcode *> ProgramOpcodeSet; #define DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(op) void instOp_##op(ProgramContext &) diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index cc7f320e1c..d4c9aefd32 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -57,17 +57,17 @@ public: _numGlyphs = stream.readByte(); _height = stream.readUint32BE(); - _widths = (byte*)malloc(_numGlyphs); + _widths = (byte *)malloc(_numGlyphs); stream.read(_widths, _numGlyphs); - _offsets = (uint*)malloc(_numGlyphs * sizeof(uint)); + _offsets = (uint *)malloc(_numGlyphs * sizeof(uint)); _offsets[0] = 0; for (uint i = 1; i < _numGlyphs; i++) _offsets[i] = _offsets[i-1] + _widths[i-1] * _height; uint size = _offsets[_numGlyphs-1] + _widths[_numGlyphs-1] * _height; - _data = (byte*)malloc(size); + _data = (byte *)malloc(size); stream.read(_data, size); } @@ -503,25 +503,25 @@ AmigaFont::AmigaFont(Common::SeekableReadStream &stream) { stream.seek(32); // skips dummy header _dataSize = stream.size() - stream.pos(); - _data = (byte*)malloc(_dataSize); + _data = (byte *)malloc(_dataSize); stream.read(_data, _dataSize); - _font = (AmigaDiskFont*)(_data + 78); + _font = (AmigaDiskFont *)(_data + 78); _font->_ySize = FROM_BE_16(_font->_ySize); _font->_xSize = FROM_BE_16(_font->_xSize); _font->_baseline = FROM_BE_16(_font->_baseline); _font->_modulo = FROM_BE_16(_font->_modulo); - _charLoc = (CharLoc*)(_data + FROM_BE_32(_font->_charLoc)); + _charLoc = (CharLoc *)(_data + FROM_BE_32(_font->_charLoc)); _charData = _data + FROM_BE_32(_font->_charData); _charSpace = 0; _charKern = 0; if (_font->_charSpace != 0) - _charSpace = (uint16*)(_data + FROM_BE_32(_font->_charSpace)); + _charSpace = (uint16 *)(_data + FROM_BE_32(_font->_charSpace)); if (_font->_charKern != 0) - _charKern = (uint16*)(_data + FROM_BE_32(_font->_charKern)); + _charKern = (uint16 *)(_data + FROM_BE_32(_font->_charKern)); } diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index c351551e36..852235ce34 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -235,7 +235,7 @@ void Gfx::drawGfxObject(GfxObj *obj, Graphics::Surface &surf) { } void Gfx::drawText(Font *font, Graphics::Surface* surf, uint16 x, uint16 y, const char *text, byte color) { - byte *dst = (byte*)surf->getBasePtr(x, y); + byte *dst = (byte *)surf->getBasePtr(x, y); font->setColor(color); font->drawString(dst, surf->w, text); } @@ -308,7 +308,7 @@ void Gfx::bltMaskScale(const Common::Rect& r, byte *data, Graphics::Surface *sur dp.y = dstRect.top; byte *s = data + srcRect.left + srcRect.top * width; - byte *d = (byte*)surf->getBasePtr(dp.x, dp.y); + byte *d = (byte *)surf->getBasePtr(dp.x, dp.y); uint line = 0, col = 0; @@ -380,7 +380,7 @@ void Gfx::bltMaskNoScale(const Common::Rect& r, byte *data, Graphics::Surface *s q.translate(-r.left, -r.top); byte *s = data + q.left + q.top * r.width(); - byte *d = (byte*)surf->getBasePtr(dp.x, dp.y); + byte *d = (byte *)surf->getBasePtr(dp.x, dp.y); uint sPitch = r.width() - q.width(); uint dPitch = surf->w - q.width(); @@ -422,7 +422,7 @@ void Gfx::bltNoMaskNoScale(const Common::Rect& r, byte *data, Graphics::Surface q.translate(-r.left, -r.top); byte *s = data + q.left + q.top * r.width(); - byte *d = (byte*)surf->getBasePtr(dp.x, dp.y); + byte *d = (byte *)surf->getBasePtr(dp.x, dp.y); uint sPitch = r.width() - q.width(); uint dPitch = surf->w - q.width(); diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index a006edf114..6868505c52 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -44,7 +44,7 @@ namespace Parallaction { void halfbritePixel(int x, int y, int color, void *data) { Graphics::Surface *surf = (Graphics::Surface *)data; - byte *pixel = (byte*)surf->getBasePtr(x, y); + byte *pixel = (byte *)surf->getBasePtr(x, y); *pixel &= ~0x20; } @@ -319,7 +319,7 @@ void Gfx::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int y += _scrollPosY; } - byte *dst = (byte*)_backBuffer.getBasePtr(x, y); + byte *dst = (byte *)_backBuffer.getBasePtr(x, y); for (int i = 0; i < h; i++) { memcpy(dst, buf, w); buf += pitch; @@ -357,7 +357,7 @@ void Gfx::unlockScreen() { void Gfx::updateScreenIntern() { if (_doubleBuffering) { - byte *data = (byte*)_backBuffer.getBasePtr(_scrollPosX, _scrollPosY); + byte *data = (byte *)_backBuffer.getBasePtr(_scrollPosX, _scrollPosY); _vm->_system->copyRectToScreen(data, _backBuffer.pitch, 0, 0, _vm->_screenWidth, _vm->_screenHeight); } @@ -425,7 +425,7 @@ void Gfx::updateScreen() { // background may not cover the whole screen, so adjust bulk update size uint w = _backgroundInfo->width; uint h = _backgroundInfo->height; - byte *backgroundData = (byte*)_backgroundInfo->bg.getBasePtr(0, 0); + byte *backgroundData = (byte *)_backgroundInfo->bg.getBasePtr(0, 0); uint16 backgroundPitch = _backgroundInfo->bg.pitch; copyRectToScreen(backgroundData, backgroundPitch, _backgroundInfo->_x, _backgroundInfo->_y, w, h); } @@ -450,7 +450,7 @@ void Gfx::applyHalfbriteEffect_NS(Graphics::Surface &surf) { return; } - byte *buf = (byte*)surf.pixels; + byte *buf = (byte *)surf.pixels; for (int i = 0; i < surf.w*surf.h; i++) { *buf++ |= 0x20; } @@ -493,7 +493,7 @@ void Gfx::patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask) r.moveTo(x, y); uint16 z = (mask) ? _backgroundInfo->getMaskLayer(y) : LAYER_FOREGROUND; - blt(r, (byte*)surf.pixels, &_backgroundInfo->bg, z, 100, 0); + blt(r, (byte *)surf.pixels, &_backgroundInfo->bg, z, 100, 0); } void Gfx::fillBackground(const Common::Rect& r, byte color) { @@ -502,7 +502,7 @@ void Gfx::fillBackground(const Common::Rect& r, byte color) { void Gfx::invertBackground(const Common::Rect& r) { - byte *d = (byte*)_backgroundInfo->bg.getBasePtr(r.left, r.top); + byte *d = (byte *)_backgroundInfo->bg.getBasePtr(r.left, r.top); for (int i = 0; i < r.height(); i++) { for (int j = 0; j < r.width(); j++) { @@ -536,12 +536,12 @@ GfxObj *Gfx::renderFloatingLabel(Font *font, char *text) { setupLabelSurface(*cnv, w, h); font->setColor((_gameType == GType_BRA) ? 0 : 7); - font->drawString((byte*)cnv->pixels + 1, cnv->w, text); - font->drawString((byte*)cnv->pixels + 1 + cnv->w * 2, cnv->w, text); - font->drawString((byte*)cnv->pixels + cnv->w, cnv->w, text); - font->drawString((byte*)cnv->pixels + 2 + cnv->w, cnv->w, text); + font->drawString((byte *)cnv->pixels + 1, cnv->w, text); + font->drawString((byte *)cnv->pixels + 1 + cnv->w * 2, cnv->w, text); + font->drawString((byte *)cnv->pixels + cnv->w, cnv->w, text); + font->drawString((byte *)cnv->pixels + 2 + cnv->w, cnv->w, text); font->setColor((_gameType == GType_BRA) ? 11 : 1); - font->drawString((byte*)cnv->pixels + 1 + cnv->w, cnv->w, text); + font->drawString((byte *)cnv->pixels + 1 + cnv->w, cnv->w, text); } else { w = font->getStringWidth(text); h = font->height(); @@ -703,8 +703,8 @@ void Gfx::unregisterLabel(GfxObj *label) { void Gfx::copyRect(const Common::Rect &r, Graphics::Surface &src, Graphics::Surface &dst) { - byte *s = (byte*)src.getBasePtr(r.left, r.top); - byte *d = (byte*)dst.getBasePtr(0, 0); + byte *s = (byte *)src.getBasePtr(r.left, r.top); + byte *d = (byte *)dst.getBasePtr(0, 0); for (uint16 i = 0; i < r.height(); i++) { memcpy(d, s, r.width()); @@ -1017,7 +1017,7 @@ void MaskBuffer::create(uint16 width, uint16 height) { internalWidth = w >> 2; h = height; size = (internalWidth * h); - data = (byte*)calloc(size, 1); + data = (byte *)calloc(size, 1); } void MaskBuffer::free() { @@ -1096,7 +1096,7 @@ void PathBuffer::create(uint16 width, uint16 height) { internalWidth = w >> 3; h = height; size = (internalWidth * h); - data = (byte*)calloc(size, 1); + data = (byte *)calloc(size, 1); } void PathBuffer::free() { diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index dacf7715ae..b43dd193b5 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -103,7 +103,7 @@ public: } byte* getData(uint16 index) { assert(index == 0); - return (byte*)_surf->getBasePtr(0,0); + return (byte *)_surf->getBasePtr(0,0); } void getRect(uint16 index, Common::Rect &r) { assert(index == 0); @@ -341,12 +341,12 @@ public: */ struct BackgroundInfo { protected: - typedef Common::Array<MaskBuffer*> MaskPatches; + typedef Common::Array<MaskBuffer *> MaskPatches; MaskPatches _maskPatches; MaskBuffer _maskBackup; void clearMaskData(); - typedef Common::Array<PathBuffer*> PathPatches; + typedef Common::Array<PathBuffer *> PathPatches; PathPatches _pathPatches; PathBuffer _pathBackup; void clearPathData(); @@ -415,7 +415,7 @@ public: }; -typedef Common::Array<GfxObj*> GfxObjArray; +typedef Common::Array<GfxObj *> GfxObjArray; #define SCENE_DRAWLIST_SIZE 100 class Gfx { diff --git a/engines/parallaction/gui.h b/engines/parallaction/gui.h index 95c5653220..a6eed240c4 100644 --- a/engines/parallaction/gui.h +++ b/engines/parallaction/gui.h @@ -36,7 +36,7 @@ namespace Parallaction { class MenuInputState; class MenuInputHelper { - typedef Common::HashMap<Common::String, MenuInputState*> StateMap; + typedef Common::HashMap<Common::String, MenuInputState *> StateMap; StateMap _map; MenuInputState *_state; diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index 56148d78d8..5bc5acf630 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -488,10 +488,10 @@ public: _font->setColor(0); int x = (w - questionW)/2; int y = 13; - _font->drawString((byte*)surf->getBasePtr(x, y), surf->pitch, question); + _font->drawString((byte *)surf->getBasePtr(x, y), surf->pitch, question); x = (w - optionW)/2; y = 13 + _font->height()*2; - _font->drawString((byte*)surf->getBasePtr(x,y), surf->pitch, option); + _font->drawString((byte *)surf->getBasePtr(x,y), surf->pitch, option); _obj = new GfxObj(kGfxObjTypeMenu, new SurfaceToFrames(surf), "quitdialog"); assert(_obj); diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index 8fd9f56802..1cae63be42 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -183,7 +183,7 @@ ItemPosition InventoryRenderer::hitTest(const Common::Point &p) const { void InventoryRenderer::drawItem(ItemPosition pos, ItemName name) { Common::Rect r; getItemRect(pos, r); - byte* d = (byte*)_surf.getBasePtr(r.left, r.top); + byte* d = (byte *)_surf.getBasePtr(r.left, r.top); drawItem(name, d, _surf.pitch); } @@ -238,7 +238,7 @@ void InventoryRenderer::getItemRect(ItemPosition pos, Common::Rect &r) { } Inventory::Inventory(int maxItems, InventoryItem *verbs) : _numItems(0), _maxItems(maxItems) { - _items = (InventoryItem*)calloc(_maxItems, sizeof(InventoryItem)); + _items = (InventoryItem *)calloc(_maxItems, sizeof(InventoryItem)); int i = 0; for ( ; verbs[i]._id; i++) { diff --git a/engines/parallaction/inventory.h b/engines/parallaction/inventory.h index 91c06d1e93..a3b7bf953f 100644 --- a/engines/parallaction/inventory.h +++ b/engines/parallaction/inventory.h @@ -108,7 +108,7 @@ public: void highlightItem(ItemPosition pos, byte color); void drawItem(ItemName name, byte *buffer, uint pitch); - byte* getData() const { return (byte*)_surf.pixels; } + byte* getData() const { return (byte *)_surf.pixels; } void getRect(Common::Rect &r) const; int16 getNumLines() const; diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index fe21732f03..d3529c5dd9 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -386,11 +386,11 @@ ScriptVar::~ScriptVar() { Table::Table(uint32 size) : _size(size), _used(0), _disposeMemory(true) { - _data = (char**)calloc(size, sizeof(char*)); + _data = (char**)calloc(size, sizeof(char *)); } Table::Table(uint32 size, const char **data) : _size(size), _used(size), _disposeMemory(false) { - _data = const_cast<char**>(data); + _data = const_cast<char **>(data); } Table::~Table() { diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 6c3ff11d15..0d56b62e2f 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -447,7 +447,7 @@ private: // callables data - typedef void (Parallaction_ns::*Callable)(void*); + typedef void (Parallaction_ns::*Callable)(void *); const Callable *_callables; ZonePtr _moveSarcGetZone; ZonePtr _moveSarcExaZone; @@ -468,37 +468,37 @@ private: PathWalker_NS *_walker; // common callables - void _c_play_boogie(void*); - void _c_startIntro(void*); - void _c_endIntro(void*); - void _c_moveSheet(void*); - void _c_sketch(void*); - void _c_shade(void*); - void _c_score(void*); - void _c_fade(void*); - void _c_moveSarc(void*); - void _c_contaFoglie(void*); - void _c_zeroFoglie(void*); - void _c_trasformata(void*); - void _c_offMouse(void*); - void _c_onMouse(void*); - void _c_setMask(void*); - void _c_endComment(void*); - void _c_frankenstein(void*); - void _c_finito(void*); - void _c_ridux(void*); - void _c_testResult(void*); + void _c_play_boogie(void *); + void _c_startIntro(void *); + void _c_endIntro(void *); + void _c_moveSheet(void *); + void _c_sketch(void *); + void _c_shade(void *); + void _c_score(void *); + void _c_fade(void *); + void _c_moveSarc(void *); + void _c_contaFoglie(void *); + void _c_zeroFoglie(void *); + void _c_trasformata(void *); + void _c_offMouse(void *); + void _c_onMouse(void *); + void _c_setMask(void *); + void _c_endComment(void *); + void _c_frankenstein(void *); + void _c_finito(void *); + void _c_ridux(void *); + void _c_testResult(void *); // dos specific callables - void _c_null(void*); + void _c_null(void *); // amiga specific callables - void _c_projector(void*); - void _c_HBOff(void*); - void _c_offSound(void*); - void _c_startMusic(void*); - void _c_closeMusic(void*); - void _c_HBOn(void*); + void _c_projector(void *); + void _c_HBOff(void *); + void _c_offSound(void *); + void _c_startMusic(void *); + void _c_closeMusic(void *); + void _c_HBOn(void *); }; @@ -582,7 +582,7 @@ private: void startIngameMenu(); void freeCharacter(); - typedef void (Parallaction_br::*Callable)(void*); + typedef void (Parallaction_br::*Callable)(void *); const Callable *_callables; static const Callable _dosCallables[6]; static const Callable _amigaCallables[6]; @@ -592,13 +592,13 @@ private: PathWalker_BR *_walker; // dos callables - void _c_null(void*); - void _c_blufade(void*); - void _c_resetpalette(void*); - void _c_ferrcycle(void*); - void _c_lipsinc(void*); - void _c_albcycle(void*); - void _c_password(void*); + void _c_null(void *); + void _c_blufade(void *); + void _c_resetpalette(void *); + void _c_ferrcycle(void *); + void _c_lipsinc(void *); + void _c_albcycle(void *); + void _c_password(void *); }; extern Parallaction *_vm; diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index 1cf8e2f7ff..3e2604eda2 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -57,7 +57,7 @@ public: typedef Common::Functor0<void> Opcode; -typedef Common::Array<const Opcode*> OpcodeSet; +typedef Common::Array<const Opcode *> OpcodeSet; @@ -69,8 +69,8 @@ public: uint _lookup; - Common::Stack<OpcodeSet*> _opcodes; - Common::Stack<Table*> _statements; + Common::Stack<OpcodeSet *> _opcodes; + Common::Stack<Table *> _statements; OpcodeSet *_currentOpcodes; Table *_currentStatements; @@ -199,7 +199,7 @@ protected: void addCommand(); void clearSet(OpcodeSet &opcodes) { - for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) + for (Common::Array<const Opcode *>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) delete *i; opcodes.clear(); } @@ -357,7 +357,7 @@ protected: virtual void parseRValue(ScriptVar &var, const char *str); void clearSet(OpcodeSet &opcodes) { - for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) + for (Common::Array<const Opcode *>::iterator i = opcodes.begin(); i != opcodes.end(); ++i) delete *i; opcodes.clear(); } diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index 82940340bc..0904dbf655 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -1131,7 +1131,7 @@ void LocationParser_br::init() { _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_br), _locationZoneStmtRes_br); _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_br), _locationAnimStmtRes_br); - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; SetOpcodeTable(_commandParsers); WARNING_PARSER(unexpected); @@ -1234,7 +1234,7 @@ void ProgramParser_br::init() { _instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_br), _instructionNamesRes_br); - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; SetOpcodeTable(_instructionParsers); INSTRUCTION_PARSER(defLocal); // invalid opcode -> local definition diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 36b8640a60..f1d1db53e9 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -1107,7 +1107,7 @@ void LocationParser_ns::init() { _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_ns), _locationZoneStmtRes_ns); _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_ns), _locationAnimStmtRes_ns); - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; SetOpcodeTable(_commandParsers); WARNING_PARSER(unexpected); @@ -1177,7 +1177,7 @@ void ProgramParser_ns::init() { _instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_ns), _instructionNamesRes_ns); - Common::Array<const Opcode*> *table = 0; + Common::Array<const Opcode *> *table = 0; SetOpcodeTable(_instructionParsers); INSTRUCTION_PARSER(defLocal); // invalid opcode -> local definition INSTRUCTION_PARSER(animation); // on diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index 16ffd24a82..0925e55309 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -378,7 +378,7 @@ Audio::AudioStream *AmigaSoundMan_br::loadChannelData(const char *filename, Chan if (_vm->getFeatures() & GF_DEMO) { uint32 dataSize = stream->size(); - int8 *data = (int8*)malloc(dataSize); + int8 *data = (int8 *)malloc(dataSize); if (stream->read(data, dataSize) != dataSize) error("DosSoundMan_br::loadChannelData: Read failed"); diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index b5d4c72ea4..3cc25b36b0 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -165,7 +165,7 @@ void DosSoundMan_ns::playCharacterMusic(const char *character) { return; } - char *name = const_cast<char*>(character); + char *name = const_cast<char *>(character); const char *newMusicFile = 0; if (!scumm_stricmp(name, _dinoName)) { diff --git a/engines/queen/music.cpp b/engines/queen/music.cpp index 858692703c..2835954003 100644 --- a/engines/queen/music.cpp +++ b/engines/queen/music.cpp @@ -303,7 +303,7 @@ void MidiMusic::playMusic() { for (uint i = 0; i < packedSize; i++) #if defined(SCUMM_NEED_ALIGNMENT) - memcpy(&_buf[i], (byte*)((byte*)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); + memcpy(&_buf[i], (byte *)((byte *)data + *(idx + i) * sizeof(uint16)), sizeof(uint16)); #else _buf[i] = data[*(idx + i)]; #endif diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index 8b2d1e9dad..fd602ff4fb 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -501,7 +501,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { } anim = getAnimation(animId); - displayBuffer = (byte*)_vm->_render->getBackGroundSurface()->pixels; + displayBuffer = (byte *)_vm->_render->getBackGroundSurface()->pixels; if (playing) { anim->state = ANIM_PLAYING; diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp index 8e98f0fbe7..62250a0820 100644 --- a/engines/saga/gfx.cpp +++ b/engines/saga/gfx.cpp @@ -156,7 +156,7 @@ void Surface::transitionDissolve(const byte *sourceBuffer, const Common::Rect &s if (sourceRect.contains(x1, y1)) { color = sourceBuffer[(x1-sourceRect.left) + sourceRect.width()*(y1-sourceRect.top)]; if (flags == 0 || color) - ((byte*)pixels)[seq] = color; + ((byte *)pixels)[seq] = color; } } } diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index ec6b13f313..945b4ad5a7 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -346,7 +346,7 @@ int16 IsoMap::findMulti(int16 tileIndex, int16 absU, int16 absV, int16 absH) { if (offset + sizeof(int16) > _multiTableData.size() * sizeof(int16)) { error("wrong multiTileEntryData->offset"); } - tiles = (int16*)((byte*)&_multiTableData.front() + offset); + tiles = (int16 *)((byte *)&_multiTableData.front() + offset); tileIndex = *tiles; if (tileIndex >= 256) { warning("something terrible happened"); diff --git a/engines/saga/resource.h b/engines/saga/resource.h index 2124f3e29f..a8e2e92361 100644 --- a/engines/saga/resource.h +++ b/engines/saga/resource.h @@ -157,7 +157,7 @@ protected: virtual void processPatches(Resource *resource, const GamePatchDescription *patchFiles) { } }; -typedef Common::List<ResourceContext*> ResourceContextList; +typedef Common::List<ResourceContext *> ResourceContextList; struct MetaResource { int16 sceneIndex; diff --git a/engines/saga/script.h b/engines/saga/script.h index 227b58a298..c4ea2d62b3 100644 --- a/engines/saga/script.h +++ b/engines/saga/script.h @@ -196,9 +196,9 @@ public: case kAddressModule: return _moduleBase; case kAddressStack: - return (byte*)&_stackBuf[_frameIndex]; + return (byte *)&_stackBuf[_frameIndex]; case kAddressThread: - return (byte*)_threadVars; + return (byte *)_threadVars; default: return _commonBase; } diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 395ba4a8c7..9607a8e66d 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1433,7 +1433,7 @@ bool Console::cmdSaid(int argc, const char **argv) { _engine->getVocabulary()->dumpParseTree(); _engine->getVocabulary()->parserIsValid = true; - int ret = said((byte*)spec, true); + int ret = said((byte *)spec, true); DebugPrintf("kSaid: %s\n", (ret == SAID_NO_MATCH ? "No match" : "Match")); } @@ -1605,7 +1605,7 @@ bool Console::cmdWindowList(int argc, const char **argv) { bool Console::cmdSavedBits(int argc, const char **argv) { SegManager *segman = _engine->_gamestate->_segMan; SegmentId id = segman->findSegmentByType(SEG_TYPE_HUNK); - HunkTable* hunks = (HunkTable*)segman->getSegmentObj(id); + HunkTable* hunks = (HunkTable *)segman->getSegmentObj(id); if (!hunks) { DebugPrintf("No hunk segment found.\n"); return true; @@ -1617,7 +1617,7 @@ bool Console::cmdSavedBits(int argc, const char **argv) { uint16 offset = entries[i].offset; const Hunk& h = hunks->_table[offset]; if (strcmp(h.type, "SaveBits()") == 0) { - byte* memoryPtr = (byte*)h.mem; + byte* memoryPtr = (byte *)h.mem; if (memoryPtr) { DebugPrintf("%04x:%04x:", PRINT_REG(entries[i])); @@ -1671,7 +1671,7 @@ bool Console::cmdShowSavedBits(int argc, const char **argv) { SegManager *segman = _engine->_gamestate->_segMan; SegmentId id = segman->findSegmentByType(SEG_TYPE_HUNK); - HunkTable* hunks = (HunkTable*)segman->getSegmentObj(id); + HunkTable* hunks = (HunkTable *)segman->getSegmentObj(id); if (!hunks) { DebugPrintf("No hunk segment found.\n"); return true; diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index ce903626e7..aade40fd9f 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -823,7 +823,7 @@ reg_t kFileIOWriteRaw(EngineState *s, int argc, reg_t *argv) { int size = argv[2].toUint16(); char *buf = new char[size]; bool success = false; - s->_segMan->memcpy((byte*)buf, argv[1], size); + s->_segMan->memcpy((byte *)buf, argv[1], size); debugC(kDebugLevelFile, "kFileIO(writeRaw): %d, %d", handle, size); FileHandle *f = getFileFromHandle(s, handle); diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp index f30f4e923e..cddd01e10c 100644 --- a/engines/sci/engine/message.cpp +++ b/engines/sci/engine/message.cpp @@ -345,7 +345,7 @@ bool MessageState::stringLit(Common::String &outStr, const Common::String &inStr } bool MessageState::stringStage(Common::String &outstr, const Common::String &inStr, uint &index) { - // Stage directions of the form (n*), where n is anything but a digit or a lowercase character + // Stage directions of the form (n *), where n is anything but a digit or a lowercase character if (inStr[index] != '(') return false; diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 554a6b6a2c..ef61b2e28a 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -727,7 +727,7 @@ void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *ke switch (mobj->getType()) { case SEG_TYPE_HUNK: { - HunkTable *ht = (HunkTable*)mobj; + HunkTable *ht = (HunkTable *)mobj; int index = argv[parmNr].offset; if (ht->isValidEntry(index)) { // NOTE: This ", deleted" isn't as useful as it could diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 04c61f7b7c..cc127c8dbc 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -691,7 +691,7 @@ void SegManager::memcpy(reg_t dest, const byte* src, size_t n) { if (dest_r.isRaw) { // raw -> raw - ::memcpy((char*)dest_r.raw, src, n); + ::memcpy((char *)dest_r.raw, src, n); } else { // raw -> non-raw for (uint i = 0; i < n; i++) diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index fcf9774a08..36b7d92c07 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -306,7 +306,7 @@ SegmentRef StringTable::dereference(reg_t pointer) { SegmentRef ret; ret.isRaw = true; ret.maxSize = _table[pointer.offset].getSize(); - ret.raw = (byte*)_table[pointer.offset].getRawData(); + ret.raw = (byte *)_table[pointer.offset].getRawData(); return ret; } diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index a939b042a7..daab532d0e 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -125,12 +125,17 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) { error("cursor resource %d has invalid size", resourceId); resourceData = resource->data; - // hotspot is specified for SCI1 cursors - hotspot.x = READ_LE_UINT16(resourceData); - hotspot.y = READ_LE_UINT16(resourceData + 2); - // bit 0 of resourceData[3] is set on <SCI1 games, which means center hotspot - if ((hotspot.x == 0) && (hotspot.y == 256)) - hotspot.x = hotspot.y = SCI_CURSOR_SCI0_HEIGHTWIDTH / 2; + + if (getSciVersion() <= SCI_VERSION_0_LATE) { + // SCI0 cursors contain hotspot flags, not actual hotspot coordinates. + // If bit 0 of resourceData[3] is set, the hotspot should be centered, + // otherwise it's in the top left of the mouse cursor. + hotspot.x = hotspot.y = resourceData[3] ? SCI_CURSOR_SCI0_HEIGHTWIDTH / 2 : 0; + } else { + // Cursors in newer SCI versions contain actual hotspot coordinates. + hotspot.x = READ_LE_UINT16(resourceData); + hotspot.y = READ_LE_UINT16(resourceData + 2); + } // Now find out what colors we are supposed to use colorMapping[0] = 0; // Black is hardcoded @@ -140,7 +145,7 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) { // Special case for the magnifier cursor in LB1 (bug #3487092). // No other SCI0 game has a cursor resource of 1, so this is handled // specifically for LB1. - if (resourceId == 1) + if (g_sci->getGameId() == GID_LAURABOW && resourceId == 1) colorMapping[3] = _screen->getColorWhite(); // Seek to actual data @@ -170,6 +175,11 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) { rawBitmap = upscaledBitmap; } + if (hotspot.x >= heightWidth || hotspot.y >= heightWidth) { + error("cursor %d's hotspot (%d, %d) is out of range of the cursor's dimensions (%dx%d)", + resourceId, hotspot.x, hotspot.y, heightWidth, heightWidth); + } + CursorMan.replaceCursor(rawBitmap, heightWidth, heightWidth, hotspot.x, hotspot.y, SCI_CURSOR_SCI0_TRANSPARENCYCOLOR); kernelShow(); diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 6469bc0cb3..4020518b72 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -438,7 +438,7 @@ void GfxScreen::bitsSaveScreen(Common::Rect rect, byte *screen, uint16 screenWid screen += (rect.top * screenWidth) + rect.left; for (y = rect.top; y < rect.bottom; y++) { - memcpy(memoryPtr, (void*)screen, width); memoryPtr += width; + memcpy(memoryPtr, (void *)screen, width); memoryPtr += width; screen += screenWidth; } } @@ -458,7 +458,7 @@ void GfxScreen::bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr) { } for (y = rect.top; y < rect.bottom; y++) { - memcpy(memoryPtr, (void*)screen, width); memoryPtr += width; + memcpy(memoryPtr, (void *)screen, width); memoryPtr += width; screen += _displayWidth; } } @@ -503,7 +503,7 @@ void GfxScreen::bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *scr screen += (rect.top * screenWidth) + rect.left; for (y = rect.top; y < rect.bottom; y++) { - memcpy((void*) screen, memoryPtr, width); memoryPtr += width; + memcpy((void *) screen, memoryPtr, width); memoryPtr += width; screen += screenWidth; } } @@ -523,7 +523,7 @@ void GfxScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) { } for (y = rect.top; y < rect.bottom; y++) { - memcpy((void*) screen, memoryPtr, width); memoryPtr += width; + memcpy((void *) screen, memoryPtr, width); memoryPtr += width; screen += _displayWidth; } } diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp index d44109faec..eff4a29f49 100644 --- a/engines/sci/parser/said.cpp +++ b/engines/sci/parser/said.cpp @@ -743,7 +743,7 @@ static void node_print_desc(ParseTreeNode* node) { } } #else -static void node_print_desc(ParseTreeNode*) { } +static void node_print_desc(ParseTreeNode *) { } #endif diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 41697d4a07..131a85f371 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -524,7 +524,7 @@ MidiDriver_AmigaMac::InstrumentSample *MidiDriver_AmigaMac::readInstrumentSCI0(C instrument->size = seg_size[0]; instrument->loop_size = seg_size[1]; - instrument->loop = (int8*)malloc(instrument->loop_size + 1); + instrument->loop = (int8 *)malloc(instrument->loop_size + 1); memcpy(instrument->loop, instrument->samples + loop_offset, instrument->loop_size); instrument->samples[instrument->size] = instrument->loop[0]; @@ -708,7 +708,7 @@ void MidiDriver_AmigaMac::generateSamples(int16 *data, int len) { if (len == 0) return; - int16 *buffers = (int16*)malloc(len * 2 * kChannels); + int16 *buffers = (int16 *)malloc(len * 2 * kChannels); memset(buffers, 0, len * 2 * kChannels); @@ -869,7 +869,7 @@ bool MidiDriver_AmigaMac::loadInstrumentsSCI0Mac(Common::SeekableReadStream &fil instrument->size = seg_size[0]; instrument->loop_size = seg_size[1] - seg_size[0]; - instrument->loop = (int8*)malloc(instrument->loop_size + 1); + instrument->loop = (int8 *)malloc(instrument->loop_size + 1); memcpy(instrument->loop, instrument->samples + loop_offset, instrument->loop_size); instrument->samples[instrument->size] = instrument->loop[0]; diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 53496428e3..b8722b6963 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -2040,7 +2040,7 @@ void Actor_v0::limbFrameCheck(int limb) { _limbFrameRepeat[limb] = _limbFrameRepeatNew[limb]; // 0x25C3 - _cost.active[limb] = ((V0CostumeLoader*)_vm->_costumeLoader)->getFrame(this, limb); + _cost.active[limb] = ((V0CostumeLoader *)_vm->_costumeLoader)->getFrame(this, limb); _cost.curpos[limb] = 0; _needRedraw = true; diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 2bbf3b3801..6e7e9ff688 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -668,7 +668,7 @@ void ClassicCostumeRenderer::procPCEngine(Codec1 &v1) { (v1.mask_ptr && (mask[0] & maskbit)); if (pcolor && !masked) { - WRITE_UINT16(dst, ((uint16*)_palette)[pcolor]); + WRITE_UINT16(dst, ((uint16 *)_palette)[pcolor]); } xPos += xStep; diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 36f06a4889..42f11498d9 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -636,7 +636,7 @@ void ScummEngine_v5::setBuiltinCursor(int idx) { byte *dst2 = (_textSurfaceMultiplier == 2) ? dst1 + 16 * scl : dst1; if (_outputPixelFormat.bytesPerPixel == 2) { for (int b = 0; b < scl; b += 2) { - *((uint16*)dst1) = *((uint16*)dst2) = color; + *((uint16 *)dst1) = *((uint16 *)dst2) = color; dst1 += 2; dst2 += 2; } diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 3e1ad53ed6..b47982af00 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -598,7 +598,7 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul } if (isDiskImg) - closeDiskImage((ScummDiskImage*)tmp); + closeDiskImage((ScummDiskImage *)tmp); delete tmp; } diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index bc6cfc761e..48ccdfd1cf 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -1136,7 +1136,7 @@ void ScummEngine::clearTextSurface() { _townsScreen->fillLayerRect(1, 0, 0, _textSurface.w, _textSurface.h, 0); #endif - fill((byte*)_textSurface.pixels, _textSurface.pitch, + fill((byte *)_textSurface.pixels, _textSurface.pitch, #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE _game.platform == Common::kPlatformFMTowns ? 0 : #endif @@ -2773,7 +2773,7 @@ void GdiNES::drawStripNESMask(byte *dst, int stripnr, int top, int height) const void readOffsetTable(const byte *ptr, uint16 **table, int *count) { int pos = 0; *count = READ_LE_UINT16(ptr) / 2 + 1; - *table = (uint16*)malloc(*count * sizeof(uint16)); + *table = (uint16 *)malloc(*count * sizeof(uint16)); for (int i = 0; i < *count; i++) { (*table)[i] = READ_LE_UINT16(ptr + pos) + pos + 2; pos += 2; @@ -2977,10 +2977,10 @@ void GdiPCEngine::decodePCEngineTileData(const byte *ptr) { if (_distaff) { free(_PCE.staffTiles); - _PCE.staffTiles = (byte*)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); + _PCE.staffTiles = (byte *)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); } else { free(_PCE.roomTiles); - _PCE.roomTiles = (byte*)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); + _PCE.roomTiles = (byte *)calloc(_PCE.numTiles * 8 * 8, sizeof(byte)); } for (int i = 0; i < _PCE.numTiles; ++i) { @@ -3023,7 +3023,7 @@ void GdiPCEngine::decodePCEngineMaskData(const byte *ptr) { readOffsetTable(ptr, &maskOffsets, &_PCE.numMasks); free(_PCE.masks); - _PCE.masks = (byte*)malloc(_PCE.numMasks * 8 * sizeof(byte)); + _PCE.masks = (byte *)malloc(_PCE.numMasks * 8 * sizeof(byte)); for (int i = 0; i < _PCE.numMasks; ++i) { mask = &_PCE.masks[i * 8]; diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 6a3f50a1af..8bffcab4a0 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -39,7 +39,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in int m = _textSurfaceMultiplier; uint8 *src1 = vs->getPixels(srcX, srcY); - uint8 *src2 = (uint8*)_textSurface.getBasePtr(srcX * m, (srcY + vs->topline - _screenTop) * m); + uint8 *src2 = (uint8 *)_textSurface.getBasePtr(srcX * m, (srcY + vs->topline - _screenTop) * m); uint8 *dst1 = _townsScreen->getLayerPixels(0, dstX, dstY); uint8 *dst2 = _townsScreen->getLayerPixels(1, dstX * m, dstY * m); @@ -52,7 +52,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in for (int h = 0; h < height; ++h) { if (_outputPixelFormat.bytesPerPixel == 2) { for (int w = 0; w < width; ++w) { - *(uint16*)dst1 = _16BitPalette[*src1++]; + *(uint16 *)dst1 = _16BitPalette[*src1++]; dst1 += _outputPixelFormat.bytesPerPixel; } @@ -245,7 +245,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void l->numCol = numCol; l->bpp = ((numCol - 1) & 0xff00) ? 2 : 1; l->pitch = width * l->bpp; - l->palette = (uint8*)pal; + l->palette = (uint8 *)pal; if (l->palette && _pixelFormat.bytesPerPixel == 1) warning("TownsScreen::setupLayer(): Layer palette usage requires 16 bit graphics setting.\nLayer palette will be ignored."); @@ -304,7 +304,7 @@ void TownsScreen::fillLayerRect(int layer, int x, int y, int w, int h, int col) for (int i = 0; i < h; ++i) { if (l->bpp == 2) { for (int ii = 0; ii < w; ++ii) { - *(uint16*)pos = col; + *(uint16 *)pos = col; pos += 2; } pos += (l->pitch - w * 2); @@ -472,10 +472,10 @@ void TownsScreen::updateOutputBuffer() { if (col || l->onBottom) { if (l->numCol == 16) col = (col >> 4) & (col & 0x0f); - *(uint16*)dst = l->bltTmpPal[col]; + *(uint16 *)dst = l->bltTmpPal[col]; } } else { - *(uint16*)dst = *(uint16*)src; + *(uint16 *)dst = *(uint16 *)src; } dst += 2; } diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 85e2a2f1dd..1007d2a7b0 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -652,7 +652,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) * even addresses, so the use of (void *) in the * following cast shuts the compiler from warning * unnecessarily. */ - size = voxStream->readBuffer((int16*)(void *)sound, size * 2); + size = voxStream->readBuffer((int16 *)(void *)sound, size * 2); size *= 2; // 16bits. delete voxStream; diff --git a/engines/scumm/player_apple2.h b/engines/scumm/player_apple2.h index c3e1b7fc60..b4a7d409fb 100644 --- a/engines/scumm/player_apple2.h +++ b/engines/scumm/player_apple2.h @@ -209,7 +209,7 @@ public: } uint32 readSamples(void *buffer, int numSamples) { - return _buffer.read((byte*)buffer, numSamples * 2) / 2; + return _buffer.read((byte *)buffer, numSamples * 2) / 2; } private: diff --git a/engines/scumm/player_sid.cpp b/engines/scumm/player_sid.cpp index ecfaef22c1..7a609364e5 100644 --- a/engines/scumm/player_sid.cpp +++ b/engines/scumm/player_sid.cpp @@ -1293,7 +1293,7 @@ int Player_SID::readBuffer(int16 *buffer, const int numSamples) { _cpuCyclesLeft = timingProps[_videoSystem].cyclesPerFrame; } // fetch samples - int sampleCount = _sid->updateClock(_cpuCyclesLeft, (short*)buffer, samplesLeft); + int sampleCount = _sid->updateClock(_cpuCyclesLeft, (short *)buffer, samplesLeft); samplesLeft -= sampleCount; buffer += sampleCount; } diff --git a/engines/scumm/player_v1.cpp b/engines/scumm/player_v1.cpp index 8afede8c5a..8e784e9866 100644 --- a/engines/scumm/player_v1.cpp +++ b/engines/scumm/player_v1.cpp @@ -351,8 +351,8 @@ parse_again: *_value_ptr_2 = _start_2; } debug(6, "chunk 1: %lu: %d step %d for %d, %lu: %d step %d for %d", - (long)(_value_ptr - (uint*)_channels), _start, _delta, _time_left, - (long)(_value_ptr_2 - (uint*)_channels), _start_2, _delta_2, _time_left_2); + (long)(_value_ptr - (uint *)_channels), _start, _delta, _time_left, + (long)(_value_ptr_2 - (uint *)_channels), _start_2, _delta_2, _time_left_2); break; case 2: diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index f445a44ded..b2093e9c1a 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -232,7 +232,7 @@ void ScummEngine::askForDisk(const char *filename, int disknum) { #endif } else { sprintf(buf, "Cannot find file: '%s'", filename); - InfoDialog dialog(this, (char*)buf); + InfoDialog dialog(this, (char *)buf); runDialog(dialog); error("Cannot find file: '%s'", filename); } @@ -350,7 +350,7 @@ void ScummEngine_v7::readIndexBlock(uint32 blocktype, uint32 itemsize) { switch (blocktype) { case MKTAG('A','N','A','M'): // Used by: The Dig, FT num = _fileHandle->readUint16LE(); - ptr = (char*)malloc(num * 9); + ptr = (char *)malloc(num * 9); _fileHandle->read(ptr, num * 9); _imuseDigital->setAudioNames(num, ptr); break; diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 6e54377199..beac077fd1 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -875,21 +875,21 @@ void ScummEngine::saveOrLoad(Serializer *s) { // vm.localvar grew from 25 to 40 script entries and then from // 16 to 32 bit variables (but that wasn't reflect here)... and // THEN from 16 to 25 variables. - MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 25, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(8), VER(8)), - MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 40, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(9), VER(14)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 25, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(8), VER(8)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 40, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(9), VER(14)), // We used to save 25 * 40 = 1000 blocks; but actually, each 'row consisted of 26 entry, // i.e. 26 * 40 = 1040. Thus the last 40 blocks of localvar where not saved at all. To be // able to load this screwed format, we use a trick: We load 26 * 38 = 988 blocks. // Then, we mark the followin 12 blocks (24 bytes) as obsolete. - MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 26, 38, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(15), VER(17)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 26, 38, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(15), VER(17)), MK_OBSOLETE_ARRAY(ScummEngine, vm.localvar[39][0], sleUint16, 12, VER(15), VER(17)), // This was the first proper multi dimensional version of the localvars, with 32 bit values - MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint32, 26, 40, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(18), VER(19)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint32, 26, 40, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(18), VER(19)), // Then we doubled the script slots again, from 40 to 80 - MKARRAY2(ScummEngine, vm.localvar[0][0], sleUint32, 26, NUM_SCRIPT_SLOT, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(20)), + MKARRAY2(ScummEngine, vm.localvar[0][0], sleUint32, 26, NUM_SCRIPT_SLOT, (byte *)vm.localvar[1] - (byte *)vm.localvar[0], VER(20)), MKARRAY(ScummEngine, _resourceMapper[0], sleByte, 128, VER(8)), @@ -1538,7 +1538,7 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) { ScummEngine::saveOrLoad(s); const SaveLoadEntry cursorEntries[] = { - MKARRAY2(ScummEngine_v5, _cursorImages[0][0], sleUint16, 16, 4, (byte*)_cursorImages[1] - (byte*)_cursorImages[0], VER(44)), + MKARRAY2(ScummEngine_v5, _cursorImages[0][0], sleUint16, 16, 4, (byte *)_cursorImages[1] - (byte *)_cursorImages[0], VER(44)), MKARRAY(ScummEngine_v5, _cursorHotspots[0], sleByte, 8, VER(44)), MKEND() }; diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index 90feee6dc0..d5f7ea526e 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -74,13 +74,13 @@ namespace Scumm { * what POD means refer to <http://en.wikipedia.org/wiki/Plain_Old_Data_Structures> or * to <http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=32&rl=1>) */ -#define OFFS(type,item) (((ptrdiff_t)(&((type*)42)->type::item))-42) +#define OFFS(type,item) (((ptrdiff_t)(&((type *)42)->type::item))-42) /** * Similar to the OFFS macro, this macro computes the size (in bytes) of a * member of a given struct/class type. */ -#define SIZE(type,item) sizeof(((type*)42)->type::item) +#define SIZE(type,item) sizeof(((type *)42)->type::item) // Any item that is still in use automatically gets a maxVersion equal to CURRENT_VER #define MKLINE(type,item,saveas,minVer) {OFFS(type,item),saveas,SIZE(type,item),minVer,CURRENT_VER} diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp index 8340f62dbc..1de9f08168 100644 --- a/engines/scumm/script_v4.cpp +++ b/engines/scumm/script_v4.cpp @@ -350,7 +350,7 @@ void ScummEngine_v4::loadIQPoints(byte *ptr, int size) { file = _saveFileMan->openForLoading(filename); if (file != NULL) { - byte *tmp = (byte*)malloc(size); + byte *tmp = (byte *)malloc(size); int nread = file->read(tmp, size); if (nread == size) { memcpy(ptr, tmp, size); @@ -414,7 +414,7 @@ void ScummEngine_v4::o4_saveLoadGame() { // use name entered by the user char* ptr; int firstSlot = (_game.id == GID_LOOM) ? STRINGID_SAVENAME1_LOOM : STRINGID_SAVENAME1; - ptr = (char*)getStringAddress(slot + firstSlot - 1); + ptr = (char *)getStringAddress(slot + firstSlot - 1); strncpy(name, ptr, sizeof(name)); } diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp index c8b92be3c8..f6f376f3c9 100644 --- a/engines/scumm/script_v8.cpp +++ b/engines/scumm/script_v8.cpp @@ -1122,7 +1122,7 @@ void ScummEngine_v8::o8_kernelSetFunctions() { } case 26: { // saveGameWrite // FIXME: This doesn't work - char *address = (char*)getStringAddress(args[2]); + char *address = (char *)getStringAddress(args[2]); debug(0, "o8_kernelSetFunctions: saveGame(%d, %s)", args[1], address); break; } diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp index bcb45e2e92..975307d0d0 100644 --- a/engines/scumm/string.cpp +++ b/engines/scumm/string.cpp @@ -112,7 +112,7 @@ void ScummEngine::showMessageDialog(const byte *msg) { if (_string[3].color == 0) _string[3].color = 4; - InfoDialog dialog(this, (char*)buf); + InfoDialog dialog(this, (char *)buf); VAR(VAR_KEYPRESS) = runDialog(dialog); } diff --git a/engines/sky/autoroute.cpp b/engines/sky/autoroute.cpp index 5273b21807..ab791cb066 100644 --- a/engines/sky/autoroute.cpp +++ b/engines/sky/autoroute.cpp @@ -242,7 +242,7 @@ uint16 AutoRoute::autoRoute(Compact *cpt) { clipCoordX(cpt->arTargetX, destX, initDestX); clipCoordY(cpt->arTargetY, destY, initDestY); - uint16 *routeDest = (uint16*)_skyCompact->fetchCpt(cpt->animScratchId); + uint16 *routeDest = (uint16 *)_skyCompact->fetchCpt(cpt->animScratchId); memset(routeDest, 0, 64); if ((startX == destX) && (startY == destY)) return 2; diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index fd81cb9bea..cf9bd55b1a 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -34,7 +34,7 @@ namespace Sky { #define SKY_CPT_SIZE 419427 -#define OFFS(type,item) (((ptrdiff_t)(&((type*)42)->item))-42) +#define OFFS(type,item) (((ptrdiff_t)(&((type *)42)->item))-42) #define MK32(type,item) OFFS(type, item),0,0,0 #define MK16(type,item) OFFS(type, item),0 #define MK32_A5(type, item) MK32(type, item[0]), MK32(type, item[1]), \ @@ -147,28 +147,28 @@ SkyCompact::SkyCompact() { _numDataLists = _cptFile->readUint16LE(); _cptNames = (char***)malloc(_numDataLists * sizeof(char**)); _dataListLen = (uint16 *)malloc(_numDataLists * sizeof(uint16)); - _cptSizes = (uint16 **)malloc(_numDataLists * sizeof(uint16*)); - _cptTypes = (uint16 **)malloc(_numDataLists * sizeof(uint16*)); + _cptSizes = (uint16 **)malloc(_numDataLists * sizeof(uint16 *)); + _cptTypes = (uint16 **)malloc(_numDataLists * sizeof(uint16 *)); _compacts = (Compact***)malloc(_numDataLists * sizeof(Compact**)); for (int i = 0; i < _numDataLists; i++) { _dataListLen[i] = _cptFile->readUint16LE(); - _cptNames[i] = (char**)malloc(_dataListLen[i] * sizeof(char*)); + _cptNames[i] = (char**)malloc(_dataListLen[i] * sizeof(char *)); _cptSizes[i] = (uint16 *)malloc(_dataListLen[i] * sizeof(uint16)); _cptTypes[i] = (uint16 *)malloc(_dataListLen[i] * sizeof(uint16)); - _compacts[i] = (Compact**)malloc(_dataListLen[i] * sizeof(Compact*)); + _compacts[i] = (Compact**)malloc(_dataListLen[i] * sizeof(Compact *)); } uint32 rawSize = _cptFile->readUint32LE() * sizeof(uint16); - uint16 *rawPos = _rawBuf = (uint16*)malloc(rawSize); + uint16 *rawPos = _rawBuf = (uint16 *)malloc(rawSize); uint32 srcSize = _cptFile->readUint32LE() * sizeof(uint16); - uint16 *srcBuf = (uint16*)malloc(srcSize); + uint16 *srcBuf = (uint16 *)malloc(srcSize); uint16 *srcPos = srcBuf; _cptFile->read(srcBuf, srcSize); uint32 asciiSize = _cptFile->readUint32LE(); - char *asciiPos = _asciiBuf = (char*)malloc(asciiSize); + char *asciiPos = _asciiBuf = (char *)malloc(asciiSize); _cptFile->read(_asciiBuf, asciiSize); // and fill them with the compact data @@ -177,7 +177,7 @@ SkyCompact::SkyCompact() { _cptSizes[lcnt][ecnt] = READ_LE_UINT16(srcPos++); if (_cptSizes[lcnt][ecnt]) { _cptTypes[lcnt][ecnt] = READ_LE_UINT16(srcPos++); - _compacts[lcnt][ecnt] = (Compact*)rawPos; + _compacts[lcnt][ecnt] = (Compact *)rawPos; _cptNames[lcnt][ecnt] = asciiPos; asciiPos += strlen(asciiPos) + 1; @@ -193,7 +193,7 @@ SkyCompact::SkyCompact() { free(srcBuf); uint16 numDlincs = _cptFile->readUint16LE(); - uint16 *dlincBuf = (uint16*)malloc(numDlincs * 2 * sizeof(uint16)); + uint16 *dlincBuf = (uint16 *)malloc(numDlincs * 2 * sizeof(uint16)); uint16 *dlincPos = dlincBuf; _cptFile->read(dlincBuf, numDlincs * 2 * sizeof(uint16)); // these compacts don't actually exist but only point to other ones... @@ -213,13 +213,13 @@ SkyCompact::SkyCompact() { // if this is v0.0288, parse this diff data uint16 numDiffs = _cptFile->readUint16LE(); uint16 diffSize = _cptFile->readUint16LE(); - uint16 *diffBuf = (uint16*)malloc(diffSize * sizeof(uint16)); + uint16 *diffBuf = (uint16 *)malloc(diffSize * sizeof(uint16)); _cptFile->read(diffBuf, diffSize * sizeof(uint16)); if (SkyEngine::_systemVars.gameVersion == 288) { uint16 *diffPos = diffBuf; for (cnt = 0; cnt < numDiffs; cnt++) { uint16 cptId = READ_LE_UINT16(diffPos++); - uint16 *rawCpt = (uint16*)fetchCpt(cptId); + uint16 *rawCpt = (uint16 *)fetchCpt(cptId); rawCpt += READ_LE_UINT16(diffPos++); uint16 len = READ_LE_UINT16(diffPos++); for (uint16 elemCnt = 0; elemCnt < len; elemCnt++) @@ -231,7 +231,7 @@ SkyCompact::SkyCompact() { // these are the IDs that have to be saved into savegame files. _numSaveIds = _cptFile->readUint16LE(); - _saveIds = (uint16*)malloc(_numSaveIds * sizeof(uint16)); + _saveIds = (uint16 *)malloc(_numSaveIds * sizeof(uint16)); _cptFile->read(_saveIds, _numSaveIds * sizeof(uint16)); for (cnt = 0; cnt < _numSaveIds; cnt++) _saveIds[cnt] = FROM_LE_16(_saveIds[cnt]); @@ -318,7 +318,7 @@ uint16 *SkyCompact::getSub(Compact *cpt, uint16 mode) { } uint16 *SkyCompact::getGrafixPtr(Compact *cpt) { - uint16 *gfxBase = (uint16*)fetchCpt(cpt->grafixProgId); + uint16 *gfxBase = (uint16 *)fetchCpt(cpt->grafixProgId); if (gfxBase == NULL) return NULL; @@ -358,7 +358,7 @@ MegaSet *SkyCompact::getMegaSet(Compact *cpt) { */ uint16 *SkyCompact::getTurnTable(Compact *cpt, uint16 dir) { MegaSet *m = getMegaSet(cpt); - TurnTable *turnTable = (TurnTable*)fetchCpt(m->turnTableId); + TurnTable *turnTable = (TurnTable *)fetchCpt(m->turnTableId); switch (dir) { case 0: return turnTable->turnTableUp; @@ -418,7 +418,7 @@ void *SkyCompact::getCompactElem(Compact *cpt, uint16 off) { uint8 *SkyCompact::createResetData(uint16 gameVersion) { _cptFile->seek(_resetDataPos); uint32 dataSize = _cptFile->readUint16LE() * sizeof(uint16); - uint16 *resetBuf = (uint16*)malloc(dataSize); + uint16 *resetBuf = (uint16 *)malloc(dataSize); _cptFile->read(resetBuf, dataSize); uint16 numDiffs = _cptFile->readUint16LE(); for (uint16 cnt = 0; cnt < numDiffs; cnt++) { @@ -429,7 +429,7 @@ uint8 *SkyCompact::createResetData(uint16 gameVersion) { uint16 pos = _cptFile->readUint16LE(); resetBuf[pos] = TO_LE_16(_cptFile->readUint16LE()); } - return (uint8*)resetBuf; + return (uint8 *)resetBuf; } else _cptFile->seek(diffFields * 2 * sizeof(uint16), SEEK_CUR); } diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index 036659a677..c1ed763281 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -1160,7 +1160,7 @@ uint32 Control::prepareSaveData(uint8 *destBuf) { for (cnt = 0; cnt < _skyCompact->_numSaveIds; cnt++) { uint16 numElems; - uint16 *rawCpt = (uint16*)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, NULL, NULL); + uint16 *rawCpt = (uint16 *)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, NULL, NULL); for (uint16 elemCnt = 0; elemCnt < numElems; elemCnt++) STOSW(destPos, rawCpt[elemCnt]); } @@ -1209,9 +1209,9 @@ void Control::importOldCompact(Compact* destCpt, uint8 **srcPos, uint16 numElems else if (graphType == OG_COMPACT) destCpt->grafixProgId = target; else if (graphType == OG_TALKTABLE) - destCpt->grafixProgId = ((uint16*)_skyCompact->fetchCpt(CPT_TALK_TABLE_LIST))[target]; + destCpt->grafixProgId = ((uint16 *)_skyCompact->fetchCpt(CPT_TALK_TABLE_LIST))[target]; else if (graphType == OG_COMPACTELEM) - destCpt->grafixProgId = *(uint16*)_skyCompact->getCompactElem(destCpt, target); + destCpt->grafixProgId = *(uint16 *)_skyCompact->getCompactElem(destCpt, target); else error("Illegal GrafixProg type encountered for compact %s", name); } @@ -1330,7 +1330,7 @@ uint16 Control::parseSaveData(uint8 *srcBuf) { LODSD(srcPos, mouseType); LODSD(srcPos, palette); - _skyLogic->parseSaveData((uint32*)srcPos); + _skyLogic->parseSaveData((uint32 *)srcPos); srcPos += NUM_SKY_SCRIPTVARS * sizeof(uint32); for (cnt = 0; cnt < 60; cnt++) @@ -1339,7 +1339,7 @@ uint16 Control::parseSaveData(uint8 *srcBuf) { if (saveRev == SAVE_FILE_REVISION) { for (cnt = 0; cnt < _skyCompact->_numSaveIds; cnt++) { uint16 numElems; - uint16 *rawCpt = (uint16*)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, NULL, NULL); + uint16 *rawCpt = (uint16 *)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, NULL, NULL); for (uint16 elemCnt = 0; elemCnt < numElems; elemCnt++) LODSW(srcPos, rawCpt[elemCnt]); } @@ -1348,19 +1348,19 @@ uint16 Control::parseSaveData(uint8 *srcBuf) { uint16 numElems; uint16 type; char name[128]; - uint16 *rawCpt = (uint16*)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, &type, name); + uint16 *rawCpt = (uint16 *)_skyCompact->fetchCptInfo(_skyCompact->_saveIds[cnt], &numElems, &type, name); if (type == COMPACT) { - importOldCompact((Compact*)rawCpt, &srcPos, numElems, type, name); + importOldCompact((Compact *)rawCpt, &srcPos, numElems, type, name); } else if (type == ROUTEBUF) { assert(numElems == 32); for (uint32 elemCnt = 0; elemCnt < numElems; elemCnt++) LODSW(srcPos, rawCpt[elemCnt]); } } - uint16 *rawCpt = (uint16*)_skyCompact->fetchCpt(0xBF); + uint16 *rawCpt = (uint16 *)_skyCompact->fetchCpt(0xBF); for (cnt = 0; cnt < 3; cnt++) LODSW(srcPos, rawCpt[cnt]); - rawCpt = (uint16*)_skyCompact->fetchCpt(0xC2); + rawCpt = (uint16 *)_skyCompact->fetchCpt(0xC2); for (cnt = 0; cnt < 13; cnt++) LODSW(srcPos, rawCpt[cnt]); } @@ -1467,7 +1467,7 @@ void Control::restartGame() { return; // no restart for floppy demo uint8 *resetData = _skyCompact->createResetData((uint16)SkyEngine::_systemVars.gameVersion); - parseSaveData((uint8*)resetData); + parseSaveData((uint8 *)resetData); free(resetData); _skyScreen->forceRefresh(); diff --git a/engines/sky/control.h b/engines/sky/control.h index 42ada564df..280f7e19cd 100644 --- a/engines/sky/control.h +++ b/engines/sky/control.h @@ -136,7 +136,7 @@ class ConResource { public: ConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen); virtual ~ConResource() {} - void setSprite(void *pSpData) { _spriteData = (DataFileHeader*)pSpData; } + void setSprite(void *pSpData) { _spriteData = (DataFileHeader *)pSpData; } void setText(uint32 pText) { if (pText) _text = pText + 0x7000; else _text = 0; } void setXY(uint16 x, uint16 y) { _x = x; _y = y; } bool isMouseOver(uint32 mouseX, uint32 mouseY); diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp index 99b707dcf1..e97aeb01a2 100644 --- a/engines/sky/disk.cpp +++ b/engines/sky/disk.cpp @@ -117,7 +117,7 @@ uint8 *Disk::loadFile(uint16 fileNr) { cflag = (uint8)((fileFlags >> 23) & 0x1); //if cflag == 0 then file is compressed, 1 == uncompressed - DataFileHeader *fileHeader = (DataFileHeader*)fileDest; + DataFileHeader *fileHeader = (DataFileHeader *)fileDest; if ((!cflag) && ((FROM_LE_16(fileHeader->flag) >> 7) & 1)) { debug(4, "File is RNC compressed."); @@ -175,7 +175,7 @@ uint8 *Disk::loadFile(uint16 fileNr) { } uint16 *Disk::loadScriptFile(uint16 fileNr) { - uint16 *buf = (uint16*)loadFile(fileNr); + uint16 *buf = (uint16 *)loadFile(fileNr); #ifdef SCUMM_BIG_ENDIAN for (uint i = 0; i < _lastLoadedFileSize / 2; i++) buf[i] = FROM_LE_16(buf[i]); diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index f1ea4d2df2..2f75a19b69 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -633,8 +633,8 @@ Intro::Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *t _skyText = text; _mixer = mixer; _system = system; - _textBuf = (uint8*)malloc(10000); - _saveBuf = (uint8*)malloc(10000); + _textBuf = (uint8 *)malloc(10000); + _saveBuf = (uint8 *)malloc(10000); _bgBuf = NULL; _relDelay = 0; } @@ -774,7 +774,7 @@ bool Intro::nextPart(uint16 *&data) { } bool Intro::floppyScrollFlirt() { - uint8 *scrollScreen = (uint8*)malloc(FRAME_SIZE * 2); + uint8 *scrollScreen = (uint8 *)malloc(FRAME_SIZE * 2); memset(scrollScreen, 0, FRAME_SIZE); memcpy(scrollScreen + FRAME_SIZE, _skyScreen->giveCurrent(), FRAME_SIZE); uint8 *scrollPos = scrollScreen + FRAME_SIZE; @@ -828,8 +828,8 @@ bool Intro::commandFlirt(uint16 *&data) { _skyText->displayText(*data++, _textBuf, true, INTRO_TEXT_WIDTH, 255); break; case IC_SHOW_TEXT: - ((DataFileHeader*)_textBuf)->s_x = *data++; - ((DataFileHeader*)_textBuf)->s_y = *data++; + ((DataFileHeader *)_textBuf)->s_x = *data++; + ((DataFileHeader *)_textBuf)->s_y = *data++; showTextBuf(); break; case IC_REMOVE_TEXT: @@ -858,10 +858,10 @@ bool Intro::commandFlirt(uint16 *&data) { } void Intro::showTextBuf() { - uint16 x = ((DataFileHeader*)_textBuf)->s_x; - uint16 y = ((DataFileHeader*)_textBuf)->s_y; - uint16 width = ((DataFileHeader*)_textBuf)->s_width; - uint16 height = ((DataFileHeader*)_textBuf)->s_height; + uint16 x = ((DataFileHeader *)_textBuf)->s_x; + uint16 y = ((DataFileHeader *)_textBuf)->s_y; + uint16 width = ((DataFileHeader *)_textBuf)->s_width; + uint16 height = ((DataFileHeader *)_textBuf)->s_height; uint8 *screenBuf = _skyScreen->giveCurrent() + y * GAME_SCREEN_WIDTH + x; memcpy(_saveBuf, _textBuf, sizeof(DataFileHeader)); uint8 *saveBuf = _saveBuf + sizeof(DataFileHeader); @@ -880,10 +880,10 @@ void Intro::showTextBuf() { } void Intro::restoreScreen() { - uint16 x = ((DataFileHeader*)_saveBuf)->s_x; - uint16 y = ((DataFileHeader*)_saveBuf)->s_y; - uint16 width = ((DataFileHeader*)_saveBuf)->s_width; - uint16 height = ((DataFileHeader*)_saveBuf)->s_height; + uint16 x = ((DataFileHeader *)_saveBuf)->s_x; + uint16 y = ((DataFileHeader *)_saveBuf)->s_y; + uint16 width = ((DataFileHeader *)_saveBuf)->s_width; + uint16 height = ((DataFileHeader *)_saveBuf)->s_height; uint8 *screenBuf = _skyScreen->giveCurrent() + y * GAME_SCREEN_WIDTH + x; uint8 *saveBuf = _saveBuf + sizeof(DataFileHeader); for (uint16 cnt = 0; cnt < height; cnt++) { diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index 18fb4f7e82..e92e768272 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -382,8 +382,8 @@ void Logic::mainAnim() { } }; - uint16 animId = *(uint16*)_skyCompact->getCompactElem(_compact, C_ANIM_UP + _compact->megaSet + dir * 4); - uint16 *animList = (uint16*)_skyCompact->fetchCpt(animId); + uint16 animId = *(uint16 *)_skyCompact->getCompactElem(_compact, C_ANIM_UP + _compact->megaSet + dir * 4); + uint16 *animList = (uint16 *)_skyCompact->fetchCpt(animId); uint16 arAnimIndex = _compact->arAnimIndex; if (!animList[arAnimIndex / 2]) { @@ -400,7 +400,7 @@ void Logic::mainAnim() { } void Logic::arTurn() { - uint16 *turnData = (uint16*)_skyCompact->fetchCpt(_compact->turnProgId) + _compact->turnProgPos; + uint16 *turnData = (uint16 *)_skyCompact->fetchCpt(_compact->turnProgId) + _compact->turnProgPos; _compact->frame = *turnData++; _compact->turnProgPos++; @@ -453,7 +453,7 @@ void Logic::anim() { } void Logic::turn() { - uint16 *turnData = (uint16*)_skyCompact->fetchCpt(_compact->turnProgId) + _compact->turnProgPos; + uint16 *turnData = (uint16 *)_skyCompact->fetchCpt(_compact->turnProgId) + _compact->turnProgPos; if (*turnData) { _compact->frame = *turnData; _compact->turnProgPos++; @@ -1425,12 +1425,12 @@ uint16 Logic::script(uint16 scriptNo, uint16 offset) { bool Logic::fnCacheChip(uint32 a, uint32 b, uint32 c) { _skySound->fnStopFx(); - _skyDisk->fnCacheChip((uint16*)_skyCompact->fetchCpt((uint16)a)); + _skyDisk->fnCacheChip((uint16 *)_skyCompact->fetchCpt((uint16)a)); return true; } bool Logic::fnCacheFast(uint32 a, uint32 b, uint32 c) { - _skyDisk->fnCacheFast((uint16*)_skyCompact->fetchCpt((uint16)a)); + _skyDisk->fnCacheFast((uint16 *)_skyCompact->fetchCpt((uint16)a)); return true; } @@ -1577,7 +1577,7 @@ bool Logic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) { warning("can't find _compact's getToTable. Place compact is NULL"); return false; } - uint16 *getToTable = (uint16*)_skyCompact->fetchCpt(cpt->getToTableId); + uint16 *getToTable = (uint16 *)_skyCompact->fetchCpt(cpt->getToTableId); if (!getToTable) { warning("Place compact's getToTable is NULL"); return false; @@ -1596,7 +1596,7 @@ bool Logic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) { bool Logic::fnSetToStand(uint32 a, uint32 b, uint32 c) { _compact->mood = 1; // high level stood still - _compact->grafixProgId = *(uint16*)_skyCompact->getCompactElem(_compact, C_STAND_UP + _compact->megaSet + _compact->dir * 4); + _compact->grafixProgId = *(uint16 *)_skyCompact->getCompactElem(_compact, C_STAND_UP + _compact->megaSet + _compact->dir * 4); _compact->grafixProgPos = 0; uint16 *standList = _skyCompact->getGrafixPtr(_compact); @@ -2158,8 +2158,8 @@ bool Logic::fnSetMegaSet(uint32 mega, uint32 setNo, uint32 c) { bool Logic::fnMoveItems(uint32 listNo, uint32 screenNo, uint32 c) { // Move a list of id's to another screen - uint16 *p = (uint16*)_skyCompact->fetchCpt(CPT_MOVE_LIST); - p = (uint16*)_skyCompact->fetchCpt(p[listNo]); + uint16 *p = (uint16 *)_skyCompact->fetchCpt(CPT_MOVE_LIST); + p = (uint16 *)_skyCompact->fetchCpt(p[listNo]); for (int i = 0; i < 2; i++) { if (!*p) return true; @@ -2528,7 +2528,7 @@ void Logic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32 bas animNum += target->megaSet / NEXT_MEGA_SET; animNum &= 0xFF; - uint16 *talkTable = (uint16*)_skyCompact->fetchCpt(CPT_TALK_TABLE_LIST); + uint16 *talkTable = (uint16 *)_skyCompact->fetchCpt(CPT_TALK_TABLE_LIST); target->grafixProgId = talkTable[animNum]; target->grafixProgPos = 0; uint16 *animPtr = _skyCompact->getGrafixPtr(target); diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp index 98f942889e..74a92c8f00 100644 --- a/engines/sky/mouse.cpp +++ b/engines/sky/mouse.cpp @@ -319,7 +319,7 @@ void Mouse::fnOpenCloseHand(bool open) { if (open) cursor++; - uint32 size = ((DataFileHeader*)_objectMouseData)->s_sp_size; + uint32 size = ((DataFileHeader *)_objectMouseData)->s_sp_size; uint8 *srcData; uint8 *destData; diff --git a/engines/sky/music/adlibchannel.cpp b/engines/sky/music/adlibchannel.cpp index 896b58aa22..99509554c7 100644 --- a/engines/sky/music/adlibchannel.cpp +++ b/engines/sky/music/adlibchannel.cpp @@ -49,32 +49,32 @@ AdLibChannel::AdLibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) { if (SkyEngine::_systemVars.gameVersion == 109) { //instrumentDataLoc = (_musicData[0x11D0] << 8) | _musicData[0x11CF]; - //_frequenceTable = (uint16*)(_musicData + 0x835); + //_frequenceTable = (uint16 *)(_musicData + 0x835); //_registerTable = _musicData + 0xE35; //_opOutputTable = _musicData + 0xE47; //_adlibRegMirror = _musicData + 0xF4A; instrumentDataLoc = READ_LE_UINT16(_musicData + 0x1204); - _frequenceTable = (uint16*)(_musicData + 0x868); + _frequenceTable = (uint16 *)(_musicData + 0x868); _registerTable = _musicData + 0xE68; _opOutputTable = _musicData + 0xE7A; _adlibRegMirror = _musicData + 0xF7D; } else if (SkyEngine::_systemVars.gameVersion == 267) { instrumentDataLoc = READ_LE_UINT16(_musicData + 0x11FB); - _frequenceTable = (uint16*)(_musicData + 0x7F4); + _frequenceTable = (uint16 *)(_musicData + 0x7F4); _registerTable = _musicData + 0xDF4; _opOutputTable = _musicData + 0xE06; _adlibRegMirror = _musicData + 0xF55; } else { instrumentDataLoc = READ_LE_UINT16(_musicData + 0x1205); - _frequenceTable = (uint16*)(_musicData + 0x7FE); + _frequenceTable = (uint16 *)(_musicData + 0x7FE); _registerTable = _musicData + 0xDFE; _opOutputTable = _musicData + 0xE10; _adlibRegMirror = _musicData + 0xF5F; } _instrumentMap = _musicData+instrumentDataLoc; - _instruments = (InstrumentStruct*)(_instrumentMap+0x80); + _instruments = (InstrumentStruct *)(_instrumentMap+0x80); } AdLibChannel::~AdLibChannel() { diff --git a/engines/sky/music/gmmusic.cpp b/engines/sky/music/gmmusic.cpp index 85240ea82e..84f6a654d0 100644 --- a/engines/sky/music/gmmusic.cpp +++ b/engines/sky/music/gmmusic.cpp @@ -31,7 +31,7 @@ namespace Sky { void GmMusic::passTimerFunc(void *param) { - ((GmMusic*)param)->timerCall(); + ((GmMusic *)param)->timerCall(); } GmMusic::GmMusic(MidiDriver *pMidiDrv, Audio::Mixer *pMixer, Disk *pDisk) : MusicBase(pMixer, pDisk) { diff --git a/engines/sky/music/mt32music.cpp b/engines/sky/music/mt32music.cpp index 18ebf123ff..a3fdd42713 100644 --- a/engines/sky/music/mt32music.cpp +++ b/engines/sky/music/mt32music.cpp @@ -31,7 +31,7 @@ namespace Sky { void MT32Music::passTimerFunc(void *param) { - ((MT32Music*)param)->timerCall(); + ((MT32Music *)param)->timerCall(); } MT32Music::MT32Music(MidiDriver *pMidiDrv, Audio::Mixer *pMixer, Disk *pDisk) : MusicBase(pMixer, pDisk) { diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp index 3e119b3b20..38a01116fe 100644 --- a/engines/sky/text.cpp +++ b/engines/sky/text.cpp @@ -136,7 +136,7 @@ void Text::getText(uint32 textNr) { //load text #"textNr" into textBuffer textNr &= 0x1F; if (blockNr) { - uint16 *blockPtr = (uint16*)(textDataPtr + 4); + uint16 *blockPtr = (uint16 *)(textDataPtr + 4); uint32 nr32MsgBlocks = blockNr >> 5; do { @@ -298,7 +298,7 @@ DisplayedText Text::displayText(char *textPtr, uint8 *dest, bool center, uint16 uint32 numBytes = (dtLineSize * numLines) + sizeof(DataFileHeader) + 4; if (!dest) - dest = (uint8*)malloc(numBytes); + dest = (uint8 *)malloc(numBytes); // clear text sprite buffer memset(dest + sizeof(DataFileHeader), 0, numBytes - sizeof(DataFileHeader)); diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp index 1bb08fd36f..40a4021a5c 100644 --- a/engines/sword2/music.cpp +++ b/engines/sword2/music.cpp @@ -115,7 +115,7 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, fh->idxLen = fh->file.readUint32LE(); fh->file.seek(entrySize * 4); - fh->idxTab = (uint32*)malloc(fh->idxLen * 3 * sizeof(uint32)); + fh->idxTab = (uint32 *)malloc(fh->idxLen * 3 * sizeof(uint32)); for (uint32 cnt = 0; cnt < fh->idxLen; cnt++) { fh->idxTab[cnt * 3 + 0] = fh->file.readUint32LE(); fh->idxTab[cnt * 3 + 1] = fh->file.readUint32LE(); diff --git a/engines/sword25/util/lua/luaconf.h b/engines/sword25/util/lua/luaconf.h index f5affe9fd7..38ff9e1320 100644 --- a/engines/sword25/util/lua/luaconf.h +++ b/engines/sword25/util/lua/luaconf.h @@ -643,7 +643,7 @@ union luai_Cast { double l_d; long l_l; }; ** CHANGE it if you have a way to implement it in your system. */ #define lua_popen(L,c,m) ((void)((void)c, m), \ - luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) + luaL_error(L, LUA_QL("popen") " not supported"), (FILE *)0) #define lua_pclose(L,file) ((void)((void)L, file), 0) /* diff --git a/engines/sword25/util/pluto/pluto.cpp b/engines/sword25/util/pluto/pluto.cpp index 957f5af795..d645e5ed2a 100644 --- a/engines/sword25/util/pluto/pluto.cpp +++ b/engines/sword25/util/pluto/pluto.cpp @@ -159,7 +159,7 @@ static int persistspecialobject(PersistInfo *pi, int defaction) lua_pushvalue(pi->L, -3); /* perms reftbl ... obj mt __persist obj */ #ifdef PLUTO_PASS_USERDATA_TO_PERSIST - lua_pushlightuserdata(pi->L, (void*)pi->writer); + lua_pushlightuserdata(pi->L, (void *)pi->writer); lua_pushlightuserdata(pi->L, pi->ud); /* perms reftbl ... obj mt __persist obj ud */ lua_call(pi->L, 3, 1); @@ -663,7 +663,7 @@ static void persist(PersistInfo *pi) } lua_pushvalue(pi->L, -1); /* perms reftbl ... obj obj */ - lua_pushlightuserdata(pi->L, (void*)(++(pi->counter))); + lua_pushlightuserdata(pi->L, (void *)(++(pi->counter))); /* perms reftbl ... obj obj ref */ lua_rawset(pi->L, 2); /* perms reftbl ... obj */ @@ -854,7 +854,7 @@ static void registerobject(int ref, UnpersistInfo *upi) { /* perms reftbl ... obj */ lua_checkstack(upi->L, 2); - lua_pushlightuserdata(upi->L, (void*)ref); + lua_pushlightuserdata(upi->L, (void *)ref); /* perms reftbl ... obj ref */ lua_pushvalue(upi->L, -2); /* perms reftbl ... obj ref obj */ @@ -989,7 +989,7 @@ static void unpersisttable(int ref, UnpersistInfo *upi) static UpVal *makeupval(lua_State *L, int stackpos) { UpVal *uv = pdep_new(L, UpVal); - pdep_link(L, (GCObject*)uv, LUA_TUPVAL); + pdep_link(L, (GCObject *)uv, LUA_TUPVAL); uv->tt = LUA_TUPVAL; uv->v = &uv->u.value; uv->u.l.prev = NULL; @@ -1025,8 +1025,8 @@ static Proto *makefakeproto(lua_State *L, lu_byte nups) static void boxupval_start(lua_State *L) { LClosure *lcl; - lcl = (LClosure*)pdep_newLclosure(L, 1, hvalue(&L->l_gt)); - pushclosure(L, (Closure*)lcl); + lcl = (LClosure *)pdep_newLclosure(L, 1, hvalue(&L->l_gt)); + pushclosure(L, (Closure *)lcl); /* ... func */ lcl->p = makefakeproto(L, 1); @@ -1053,7 +1053,7 @@ static void unboxupval(lua_State *L) LClosure *lcl; UpVal *uv; - lcl = (LClosure*)clvalue(getobject(L, -1)); + lcl = (LClosure *)clvalue(getobject(L, -1)); uv = lcl->upvals[0]; lua_pop(L, 1); /* ... */ @@ -1071,8 +1071,8 @@ static void unpersistfunction(int ref, UnpersistInfo *upi) verify(LIF(Z,read)(&upi->zio, &nupvalues, sizeof(lu_byte)) == 0); - lcl = (LClosure*)pdep_newLclosure(upi->L, nupvalues, hvalue(&upi->L->l_gt)); - pushclosure(upi->L, (Closure*)lcl); + lcl = (LClosure *)pdep_newLclosure(upi->L, nupvalues, hvalue(&upi->L->l_gt)); + pushclosure(upi->L, (Closure *)lcl); /* perms reftbl ... func */ /* Put *some* proto in the closure, before the GC can find it */ @@ -1393,9 +1393,9 @@ static void unpersistthread(int ref, UnpersistInfo *upi) verify(LIF(Z,read)(&upi->zio, &stackpos, sizeof(size_t)) == 0); uv->v = L2->stack + stackpos; - gcunlink(upi->L, (GCObject*)uv); + gcunlink(upi->L, (GCObject *)uv); uv->marked = luaC_white(g); - *nextslot = (GCObject*)uv; + *nextslot = (GCObject *)uv; nextslot = &uv->next; uv->u.l.prev = &G(L2)->uvhead; uv->u.l.next = G(L2)->uvhead.u.l.next; @@ -1482,7 +1482,7 @@ static int inreftable(lua_State *L, int ref) int res; lua_checkstack(L, 1); /* perms reftbl ... */ - lua_pushlightuserdata(L, (void*)ref); + lua_pushlightuserdata(L, (void *)ref); /* perms reftbl ... ref */ lua_gettable(L, 2); /* perms reftbl ... obj? */ @@ -1571,7 +1571,7 @@ static void unpersist(UnpersistInfo *upi) lua_pushnil(upi->L); /* perms reftbl ... nil */ } else { - lua_pushlightuserdata(upi->L, (void*)ref); + lua_pushlightuserdata(upi->L, (void *)ref); /* perms reftbl ... ref */ lua_gettable(upi->L, 2); /* perms reftbl ... obj? */ diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 1fce032633..0f662e22bd 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -169,7 +169,7 @@ struct SizeMD5 { }; typedef Common::HashMap<Common::String, SizeMD5, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> SizeMD5Map; typedef Common::HashMap<Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FileMap; -typedef Common::Array<const ADGameDescription*> ADGameDescList; +typedef Common::Array<const ADGameDescription *> ADGameDescList; /** * Fallback detection scans the list of Discworld 2 targets to see if it can detect an installation diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 545310185c..4f3cc36994 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -67,7 +67,7 @@ uint8* psxPJCRLEUnwinder(uint16 imageWidth, uint16 imageHeight, uint8 *srcIdx) { // Calculate needed index numbers, align width and height not next multiple of four imageWidth = (imageWidth % 4) ? ((imageWidth / 4) + 1) * 4 : imageWidth; imageHeight = (imageHeight % 4) ? ((imageHeight / 4) + 1) * 4 : imageHeight; - destinationBuffer = (uint8*)malloc((imageWidth * imageHeight) / 8); + destinationBuffer = (uint8 *)malloc((imageWidth * imageHeight) / 8); dstIdx = destinationBuffer; remainingBlocks = (imageWidth * imageHeight) / 16; diff --git a/engines/tinsel/heapmem.cpp b/engines/tinsel/heapmem.cpp index 026dc9457e..819493bda1 100644 --- a/engines/tinsel/heapmem.cpp +++ b/engines/tinsel/heapmem.cpp @@ -234,8 +234,8 @@ static MEM_NODE *MemoryAlloc(long size) { MEM_NODE *pHeap = &heapSentinel; #ifdef SCUMM_NEED_ALIGNMENT - const int alignPadding = sizeof(void*) - 1; - size = (size + alignPadding) & ~alignPadding; //round up to nearest multiple of sizeof(void*), this ensures the addresses that are returned are alignment-safe. + const int alignPadding = sizeof(void *) - 1; + size = (size + alignPadding) & ~alignPadding; //round up to nearest multiple of sizeof(void *), this ensures the addresses that are returned are alignment-safe. #endif // compact the heap to make up room for 'size' bytes, if necessary @@ -310,8 +310,8 @@ MEM_NODE *MemoryNoAlloc() { MEM_NODE *MemoryAllocFixed(long size) { #ifdef SCUMM_NEED_ALIGNMENT - const int alignPadding = sizeof(void*) - 1; - size = (size + alignPadding) & ~alignPadding; //round up to nearest multiple of sizeof(void*), this ensures the addresses that are returned are alignment-safe. + const int alignPadding = sizeof(void *) - 1; + size = (size + alignPadding) & ~alignPadding; //round up to nearest multiple of sizeof(void *), this ensures the addresses that are returned are alignment-safe. #endif // Search for a free entry in s_fixedMnodesList diff --git a/engines/toltecs/menu.cpp b/engines/toltecs/menu.cpp index 7e7349802d..172ec0a565 100644 --- a/engines/toltecs/menu.cpp +++ b/engines/toltecs/menu.cpp @@ -406,7 +406,7 @@ void MenuSystem::clickItem(ItemID id) { } void MenuSystem::restoreRect(int x, int y, int w, int h) { - byte *src = (byte*)_background->getBasePtr(x, y); + byte *src = (byte *)_background->getBasePtr(x, y); byte *dst = _vm->_screen->_frontScreen + x + y * 640; while (h--) { memcpy(dst, src, w); @@ -416,7 +416,7 @@ void MenuSystem::restoreRect(int x, int y, int w, int h) { } void MenuSystem::shadeRect(int x, int y, int w, int h, byte color1, byte color2) { - byte *src = (byte*)_background->getBasePtr(x, y); + byte *src = (byte *)_background->getBasePtr(x, y); for (int xc = 0; xc < w; xc++) { src[xc] = color2; src[xc + h * 640] = color1; diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp index 28021950a7..76d42ebf0a 100644 --- a/engines/toltecs/movie.cpp +++ b/engines/toltecs/movie.cpp @@ -215,7 +215,7 @@ void MoviePlayer::fetchAudioChunks() { byte chunkType = _vm->_arc->readByte(); uint32 chunkSize = _vm->_arc->readUint32LE(); if (chunkType == 4) { - byte *chunkBuffer = (byte*)malloc(chunkSize); + byte *chunkBuffer = (byte *)malloc(chunkSize); _vm->_arc->read(chunkBuffer, chunkSize); _audioStream->queueBuffer(chunkBuffer, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); chunkBuffer = NULL; diff --git a/engines/toltecs/resource.h b/engines/toltecs/resource.h index 7f4694f0f6..3fed2e11ca 100644 --- a/engines/toltecs/resource.h +++ b/engines/toltecs/resource.h @@ -71,7 +71,7 @@ public: void purgeCache(); protected: - typedef Common::HashMap<uint, Resource*> ResourceMap; + typedef Common::HashMap<uint, Resource *> ResourceMap; ToltecsEngine *_vm; diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp index d66ed18d8c..b781490b69 100644 --- a/engines/toltecs/screen.cpp +++ b/engines/toltecs/screen.cpp @@ -658,7 +658,7 @@ void Screen::drawSurface(int16 x, int16 y, Graphics::Surface *surface) { int16 skipX = 0; int16 width = surface->w; int16 height = surface->h; - byte *surfacePixels = (byte*)surface->getBasePtr(0, 0); + byte *surfacePixels = (byte *)surface->getBasePtr(0, 0); byte *frontScreen; // Not on screen, skip diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp index 107f4ea11e..9683831980 100644 --- a/engines/toltecs/script.cpp +++ b/engines/toltecs/script.cpp @@ -786,7 +786,7 @@ void ScriptInterpreter::sfGetRandomNumber() { } void ScriptInterpreter::sfDrawGuiTextMulti() { - _vm->_screen->drawGuiTextMulti((byte*)localPtr(arg16(3))); + _vm->_screen->drawGuiTextMulti((byte *)localPtr(arg16(3))); } void ScriptInterpreter::sfUpdateVerbLine() { @@ -907,11 +907,11 @@ void ScriptInterpreter::sfDrawGuiImage() { } void ScriptInterpreter::sfAddAnimatedSpriteNoLoop() { - _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte*)localPtr(0), (int16*)localPtr(arg16(9)), false, 2); + _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte *)localPtr(0), (int16 *)localPtr(arg16(9)), false, 2); } void ScriptInterpreter::sfAddAnimatedSprite() { - _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte*)localPtr(0), (int16*)localPtr(arg16(9)), true, 2); + _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte *)localPtr(0), (int16 *)localPtr(arg16(9)), true, 2); } void ScriptInterpreter::sfAddStaticSprite() { @@ -919,11 +919,11 @@ void ScriptInterpreter::sfAddStaticSprite() { } void ScriptInterpreter::sfAddAnimatedSpriteScaled() { - _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte*)localPtr(0), (int16*)localPtr(arg16(9)), true, 1); + _vm->_screen->addAnimatedSprite(arg16(5), arg16(3), arg16(7), (byte *)localPtr(0), (int16 *)localPtr(arg16(9)), true, 1); } void ScriptInterpreter::sfFindPath() { - _vm->_segmap->findPath((int16*)(getSlotData(arg16(13)) + arg16(11)), arg16(9), arg16(7), arg16(5), arg16(3)); + _vm->_segmap->findPath((int16 *)(getSlotData(arg16(13)) + arg16(11)), arg16(9), arg16(7), arg16(5), arg16(3)); } void ScriptInterpreter::sfWalk() { diff --git a/engines/toltecs/script.h b/engines/toltecs/script.h index 1a5a9c90ad..0c1898c525 100644 --- a/engines/toltecs/script.h +++ b/engines/toltecs/script.h @@ -77,7 +77,7 @@ protected: }; ToltecsEngine *_vm; - Common::Array<const ScriptFunction*> _scriptFuncs; + Common::Array<const ScriptFunction *> _scriptFuncs; Common::Array<const char *> _scriptFuncNames; byte *_stack; diff --git a/engines/toltecs/segmap.cpp b/engines/toltecs/segmap.cpp index 10e5f56096..f7d806c67b 100644 --- a/engines/toltecs/segmap.cpp +++ b/engines/toltecs/segmap.cpp @@ -269,7 +269,7 @@ struct LineData { }; void plotProc(int x, int y, int color, void *data) { - LineData *ld = (LineData*)data; + LineData *ld = (LineData *)data; ld->surf[x + y * ld->pitch] = color; } @@ -373,7 +373,7 @@ void SegmentMap::loadSegmapMaskRectSurface(byte *maskData, SegmapMaskRect &maskR maskRect.surface->create(maskRect.width, maskRect.height, Graphics::PixelFormat::createFormatCLUT8()); byte *backScreen = _vm->_screen->_backScreen + maskRect.x + (maskRect.y * _vm->_sceneWidth); - byte *dest = (byte*)maskRect.surface->getBasePtr(0, 0); + byte *dest = (byte *)maskRect.surface->getBasePtr(0, 0); for (int16 h = 0; h < maskRect.height; h++) { int16 w = maskRect.width; diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp index b9adfa7eeb..77822ab078 100644 --- a/engines/toon/audio.cpp +++ b/engines/toon/audio.cpp @@ -514,7 +514,7 @@ Common::SeekableReadStream *AudioStreamPackage::getStream(int32 id, bool ownMemo int32 size = 0; getInfo(id, &offset, &size); if (ownMemory) { - byte *memory = (byte*)malloc(size); + byte *memory = (byte *)malloc(size); _file->seek(offset); _file->read(memory, size); return new Common::MemoryReadStream(memory, size, DisposeAfterUse::YES); diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index 715bd33433..0e5189957b 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -997,7 +997,7 @@ bool Character::loadShadowAnimation(const Common::String &animName) { void Character::plotPath(Graphics::Surface& surface) { for (int i = 0; i < _currentPathNodeCount; i++) { - *(byte*)surface.getBasePtr(_currentPathX[i], _currentPathY[i]) = ( i < _currentPathNode); + *(byte *)surface.getBasePtr(_currentPathX[i], _currentPathY[i]) = ( i < _currentPathNode); } } diff --git a/engines/toon/script_func.h b/engines/toon/script_func.h index ef1cb59f47..e22c4b34fa 100644 --- a/engines/toon/script_func.h +++ b/engines/toon/script_func.h @@ -39,7 +39,7 @@ public: Common::Array<const OpcodeV2 *> _opcodes; ToonEngine *_vm; -#define SYSFUNC(x) int32 x(EMCState*) +#define SYSFUNC(x) int32 x(EMCState *) SYSFUNC(sys_Cmd_Dummy); SYSFUNC(sys_Cmd_Change_Actor_X_And_Y); SYSFUNC(sys_Cmd_Init_Talking_Character); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index d88d012759..c2ce426052 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -4107,7 +4107,8 @@ void SceneHandler::process(Event &event) { // Check for displaying right-click dialog if ((event.eventType == EVENT_BUTTON_DOWN) && (event.btnState == BTNSHIFT_RIGHT) && - g_globals->_player._uiEnabled) { + g_globals->_player._uiEnabled && + ((g_vm->getGameID() != GType_Ringworld2) || (R2_GLOBALS._sceneManager._sceneNumber != 1330))) { g_globals->_game->rightClick(); event.handled = true; diff --git a/engines/tsage/core.h b/engines/tsage/core.h index ef6d4735c0..45bb3506d5 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -373,6 +373,7 @@ public: bool loadPalette(int paletteNum); void loadPalette(const byte *pSrc, int start, int count); + void replace(const ScenePalette *src) { loadPalette(src->_palette, 0, 256); } void refresh(); void setPalette(int index, int count); void getEntry(int index, uint *r, uint *g, uint *b); diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 12add10c58..0c458f5c35 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -74,7 +74,6 @@ enum { class TSageMetaEngine : public AdvancedMetaEngine { public: TSageMetaEngine() : AdvancedMetaEngine(TsAGE::gameDescriptions, sizeof(TsAGE::tSageGameDescription), tSageGameTitles) { - _md5Bytes = 5000; _singleid = "tsage"; _guioptions = GUIO1(GUIO_NOSPEECH); } diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index 583cd8e15b..d538cbacbf 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -140,6 +140,8 @@ static const tSageGameDescription gameDescriptions[] = { GType_BlueForce, GF_CD | GF_ALT_REGIONS }, +#if 0 + // Blue Force Spanish doesn't yet work // Blue Force Spanish CD { { @@ -154,7 +156,7 @@ static const tSageGameDescription gameDescriptions[] = { GType_BlueForce, GF_CD | GF_ALT_REGIONS }, - +#endif // Return to Ringworld { { diff --git a/engines/tsage/events.h b/engines/tsage/events.h index 2917256382..cf2d1a34ed 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -87,16 +87,20 @@ enum CursorType { // Ringworld 2 objects R2_OPTO_DISK = 1, R2_READER = 2, R2_NEGATOR_GUN = 3, R2_STEPPING_DISKS = 4, - R2_ATTRACTOR_UNIT = 5, R2_SENSOR_PROBE = 6, - R2_SONIC_STUNNER = 7, R2_8 = 8, R2_9 = 9, R2_10 = 10, R2_11 = 11, R2_AEROSOL = 12, R2_13 = 13, - R2_OPTICAL_FIBRE = 14, R2_CLAMP = 15, R2_16 = 16, R2_17 = 17, R2_18 = 18, R2_19 = 19, - R2_REBREATHER_TANK = 20, R2_21 = 21, R2_22 = 22, R2_23 = 23, R2_24 = 24, R2_25 = 25, - R2_26 = 26, R2_27 = 27, R2_28 = 28, - R2_29 = 29, R2_30 = 30, R2_31 = 31, R2_32 = 32, R2_33 = 33, R2_34 = 34, R2_35 = 35, - R2_36 = 36, R2_37 = 37, R2_38 = 38, R2_39 = 39, R2_40 = 40, R2_41 = 41, R2_42 = 42, - R2_43 = 43, R2_44 = 44, R2_45 = 45, R2_46 = 46, R2_47 = 47, R2_48 = 48, R2_49 = 49, - R2_50 = 50, R2_51 = 51, R2_52 = 52, - R2_LAST_INVENT = 53, + R2_ATTRACTOR_UNIT = 5, R2_SENSOR_PROBE = 6, R2_SONIC_STUNNER = 7, + R2_CABLE_HARNESS = 8, R2_COM_SCANNER = 9, R2_SPENT_POWER_CAPSULE = 10, + R2_CHARGED_POWER_CAPSULE = 11, R2_AEROSOL = 12, R2_REMOTE_CONTROL = 13, + R2_OPTICAL_FIBRE = 14, R2_CLAMP = 15, R2_ATTRACTOR_CABLE_HARNESS = 16, + R2_FUEL_CELL = 17, R2_GYROSCOPE = 18, R2_AIRBAG = 19, R2_REBREATHER_TANK = 20, + R2_RESERVE_REBREATHER_TANK = 21, R2_GUIDANCE_MODULE = 22, R2_THRUSTER_VALVE = 23, + R2_BALLOON_BACKPACK = 24, R2_RADAR_MECHANISM = 25, R2_JOYSTICK = 26, + R2_IGNITOR = 27, R2_DIAGNOSTICS_DISPLAY = 28, R2_GLASS_DOME = 29, R2_WICK_LAMP = 30, + R2_SCRITH_KEY = 31, R2_TANNER_MASK = 32, R2_PURE_GRAIN_ALCOHOL = 33, R2_SAPPHIRE_BLUE = 34, + R2_ANCIENT_SCROLLS = 35, R2_FLUTE = 36, R2_GUNPOWDER = 37, R2_NONAME = 38, + R2_COM_SCANNER_2 = 39, R2_SUPERCONDUCTOR_WIRE = 40, R2_PILLOW = 41, R2_FOOD_TRAY = 42, + R2_LASER_HACKSAW = 43, R2_PHOTON_STUNNER = 44, R2_BATTERY = 45, R2_SOAKED_FACEMASK = 46, + R2_LIGHT_BULB = 47, R2_ALCOHOL_LAMP = 48, R2_ALCOHOL_LAMP_2 = 49, R2_ALCOHOL_LAMP_3 = 50, + R2_BROKEN_DISPLAY = 51, R2_TOOLBOX = 52, R2_LAST_INVENT = 53, // Ringworld 2 cursors R2CURSORS_START = 0x8000, EXITCURSOR_N = 0x8007, EXITCURSOR_S = 0x8008, EXITCURSOR_W = 0x8009, @@ -145,7 +149,7 @@ public: Common::EventType type() { return _event.type; } uint32 getFrameNumber() const { return _frameNumber; } void delay(int numFrames); - bool isInventoryIcon() const { return _currentCursor < 256; } + bool isInventoryIcon() const { return (_currentCursor >= 0) && (_currentCursor < 256); } void proc1() { warning("TODO: EventsClass::proc1"); } virtual void listenerSynchronize(Serializer &s); diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index 824f20e9b2..f6f870be20 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -135,7 +135,7 @@ uint16 BitReader::readToken() { /*-------------------------------------------------------------------------*/ TLib::TLib(MemoryManager &memManager, const Common::String &filename) : - _memoryManager(memManager) { + _filename(filename), _memoryManager(memManager) { // If the resource strings list isn't yet loaded, load them if (_resStrings.size() == 0) { @@ -158,25 +158,35 @@ TLib::~TLib() { _resStrings.clear(); } +/** + * Load a section index from the given position in the file + */ void TLib::loadSection(uint32 fileOffset) { _resources.clear(); _file.seek(fileOffset); _sections.fileOffset = fileOffset; - if (_file.readUint32BE() != 0x544D492D) + loadSection(_file, _resources); +} + +/** + * Inner logic for decoding a section index into a passed resource list object + */ +void TLib::loadSection(Common::File &f, ResourceList &resources) { + if (f.readUint32BE() != 0x544D492D) error("Data block is not valid Rlb data"); - /*uint8 unknown1 = */_file.readByte(); - uint16 numEntries = _file.readByte(); + /*uint8 unknown1 = */f.readByte(); + uint16 numEntries = f.readByte(); for (uint i = 0; i < numEntries; ++i) { - uint16 id = _file.readUint16LE(); - uint16 size = _file.readUint16LE(); - uint16 uncSize = _file.readUint16LE(); - uint8 sizeHi = _file.readByte(); - uint8 type = _file.readByte() >> 5; + uint16 id = f.readUint16LE(); + uint16 size = f.readUint16LE(); + uint16 uncSize = f.readUint16LE(); + uint8 sizeHi = f.readByte(); + uint8 type = f.readByte() >> 5; assert(type <= 1); - uint32 offset = _file.readUint32LE(); + uint32 offset = f.readUint32LE(); ResourceEntry re; re.id = id; @@ -185,7 +195,7 @@ void TLib::loadSection(uint32 fileOffset) { re.size = ((sizeHi & 0xF) << 16) | size; re.uncompressedSize = ((sizeHi & 0xF0) << 12) | uncSize; - _resources.push_back(re); + resources.push_back(re); } } @@ -443,6 +453,36 @@ bool TLib::getMessage(int resNum, int lineNum, Common::String &result, bool supp /*--------------------------------------------------------------------------*/ +/** + * Open up the main resource file and get an entry from the root section + */ +bool TLib::getSectionEntry(Common::File &f, ResourceType resType, int rlbNum, int resNum, + ResourceEntry &resEntry) { + // Try and open the resource file + if (!f.open(_filename)) + return false; + + // Load the root section index + ResourceList resList; + loadSection(f, resList); + + // Loop through the index for the desired entry + ResourceList::iterator iter; + for (iter = _resources.begin(); iter != _resources.end(); ++iter) { + ResourceEntry &re = *iter; + if (re.id == resNum) { + // Found it, so exit + resEntry = re; + return true; + } + } + + // No matching entry found + return false; +} + +/*--------------------------------------------------------------------------*/ + ResourceManager::~ResourceManager() { for (uint idx = 0; idx < _libList.size(); ++idx) delete _libList[idx]; diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h index 0410fa3f42..2b5561b184 100644 --- a/engines/tsage/resources.h +++ b/engines/tsage/resources.h @@ -145,10 +145,12 @@ private: MemoryManager &_memoryManager; private: Common::File _file; + Common::String _filename; ResourceList _resources; SectionList _sections; void loadSection(uint32 fileOffset); + void loadSection(Common::File &f, ResourceList &resources); void loadIndex(); public: TLib(MemoryManager &memManager, const Common::String &filename); @@ -159,6 +161,8 @@ public: bool getPalette(int paletteNum, byte *palData, uint *startNum, uint *numEntries); byte *getSubResource(int resNum, int rlbNum, int index, uint *size, bool suppressErrors = false); bool getMessage(int resNum, int lineNum, Common::String &result, bool suppressErrors = false); + + bool getSectionEntry(Common::File &f, ResourceType resType, int rlbNum, int resNum, ResourceEntry &resEntry); }; class ResourceManager { @@ -174,6 +178,7 @@ public: void getPalette(int paletteNum, byte *palData, uint *startNum, uint *numEntries, bool suppressErrors = false); byte *getSubResource(int resNum, int rlbNum, int index, uint *size, bool suppressErrors = false); Common::String getMessage(int resNum, int lineNum, bool suppressErrors = false); + TLib &first() { return **_libList.begin(); } }; diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 4f7578b1fa..89cf831088 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -143,7 +143,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { case 1800: return new Scene1800(); case 1850: - error("Missing scene %d from group 1", sceneNumber); + return new Scene1850(); case 1875: return new Scene1875(); case 1900: @@ -419,13 +419,13 @@ bool SceneExt::display(CursorType action, Event &event) { R2_GLOBALS._sound4.play(45); break; - case R2_9: - case R2_39: + case R2_COM_SCANNER: + case R2_COM_SCANNER_2: R2_GLOBALS._sound3.play(44); SceneItem::display2(2, action); R2_GLOBALS._sound3.stop(); break; - case R2_44: + case R2_PHOTON_STUNNER: R2_GLOBALS._sound3.play(99); SceneItem::display2(2, action); break; @@ -859,51 +859,51 @@ void Ringworld2InvObjectList::reset() { setObjectScene(R2_ATTRACTOR_UNIT, 400); setObjectScene(R2_SENSOR_PROBE, 400); setObjectScene(R2_SONIC_STUNNER, 500); - setObjectScene(R2_8, 700); - setObjectScene(R2_9, 800); - setObjectScene(R2_10, 100); - setObjectScene(R2_11, 400); + setObjectScene(R2_CABLE_HARNESS, 700); + setObjectScene(R2_COM_SCANNER, 800); + setObjectScene(R2_SPENT_POWER_CAPSULE, 100); + setObjectScene(R2_CHARGED_POWER_CAPSULE, 400); setObjectScene(R2_AEROSOL, 500); - setObjectScene(R2_13, 1550); + setObjectScene(R2_REMOTE_CONTROL, 1550); setObjectScene(R2_OPTICAL_FIBRE, 850); setObjectScene(R2_CLAMP, 850); - setObjectScene(R2_16, 0); - setObjectScene(R2_17, 1550); - setObjectScene(R2_18, 1550); - setObjectScene(R2_19, 1550); + setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 0); + setObjectScene(R2_FUEL_CELL, 1550); + setObjectScene(R2_GYROSCOPE, 1550); + setObjectScene(R2_AIRBAG, 1550); setObjectScene(R2_REBREATHER_TANK, 500); - setObjectScene(R2_21, 500); - setObjectScene(R2_22, 1550); - setObjectScene(R2_23, 1580); - setObjectScene(R2_24, 9999); - setObjectScene(R2_25, 1550); - setObjectScene(R2_26, 1550); - setObjectScene(R2_27, 1580); - setObjectScene(R2_28, 1550); - setObjectScene(R2_29, 2525); - setObjectScene(R2_30, 2440); - setObjectScene(R2_31, 2455); - setObjectScene(R2_32, 2535); - setObjectScene(R2_33, 2530); - setObjectScene(R2_34, 1950); - setObjectScene(R2_35, 1950); - setObjectScene(R2_36, 9999); - setObjectScene(R2_37, 2430); - setObjectScene(R2_38, 9999); - setObjectScene(R2_39, 2); - setObjectScene(R2_40, 9999); - setObjectScene(R2_41, 3150); - setObjectScene(R2_42, 0); - setObjectScene(R2_43, 3260); - setObjectScene(R2_44, 2); - setObjectScene(R2_45, 1550); - setObjectScene(R2_46, 0); - setObjectScene(R2_47, 3150); - setObjectScene(R2_48, 2435); - setObjectScene(R2_49, 2440); - setObjectScene(R2_50, 2435); - setObjectScene(R2_51, 1580); - setObjectScene(R2_52, 3260); + setObjectScene(R2_RESERVE_REBREATHER_TANK, 500); + setObjectScene(R2_GUIDANCE_MODULE, 1550); + setObjectScene(R2_THRUSTER_VALVE, 1580); + setObjectScene(R2_BALLOON_BACKPACK, 9999); + setObjectScene(R2_RADAR_MECHANISM, 1550); + setObjectScene(R2_JOYSTICK, 1550); + setObjectScene(R2_IGNITOR, 1580); + setObjectScene(R2_DIAGNOSTICS_DISPLAY, 1550); + setObjectScene(R2_GLASS_DOME, 2525); + setObjectScene(R2_WICK_LAMP, 2440); + setObjectScene(R2_SCRITH_KEY, 2455); + setObjectScene(R2_TANNER_MASK, 2535); + setObjectScene(R2_PURE_GRAIN_ALCOHOL, 2530); + setObjectScene(R2_SAPPHIRE_BLUE, 1950); + setObjectScene(R2_ANCIENT_SCROLLS, 1950); + setObjectScene(R2_FLUTE, 9999); + setObjectScene(R2_GUNPOWDER, 2430); + setObjectScene(R2_NONAME, 9999); + setObjectScene(R2_COM_SCANNER_2, 2); + setObjectScene(R2_SUPERCONDUCTOR_WIRE, 9999); + setObjectScene(R2_PILLOW, 3150); + setObjectScene(R2_FOOD_TRAY, 0); + setObjectScene(R2_LASER_HACKSAW, 3260); + setObjectScene(R2_PHOTON_STUNNER, 2); + setObjectScene(R2_BATTERY, 1550); + setObjectScene(R2_SOAKED_FACEMASK, 0); + setObjectScene(R2_LIGHT_BULB, 3150); + setObjectScene(R2_ALCOHOL_LAMP, 2435); + setObjectScene(R2_ALCOHOL_LAMP_2, 2440); + setObjectScene(R2_ALCOHOL_LAMP_3, 2435); + setObjectScene(R2_BROKEN_DISPLAY, 1580); + setObjectScene(R2_TOOLBOX, 3260); } void Ringworld2InvObjectList::setObjectScene(int objectNum, int sceneNumber) { @@ -1551,36 +1551,130 @@ void Scene1200::sub9DAD6(int indx) { /*--------------------------------------------------------------------------*/ -ActionObject::ActionObject(): EventHandler() { +AnimationPlayer::AnimationPlayer(): EventHandler() { + _endAction = NULL; + + _fieldA = NULL; + _field16 = NULL; + + _screenBounds = R2_GLOBALS._gfxManagerInstance._bounds; + _rect1 = R2_GLOBALS._gfxManagerInstance._bounds; + _field3C = 0; + _field3A = 1; + _field5A = 0; + _field58 = 0; _endAction = NULL; } -void ActionObject::synchronize(Serializer &s) { - EventHandler::synchronize(s); +AnimationPlayer::~AnimationPlayer() { + if (!method3()) + method4(); +} - SYNC_POINTER(_endAction); +void AnimationPlayer::synchronize(Serializer &s) { + EventHandler::synchronize(s); + warning("TODO AnimationPlayer::load"); } -void ActionObject::remove() { +void AnimationPlayer::remove() { if (_endAction) _endAction->signal(); _endAction = NULL; } -bool ActionObject::load(int rlbNum, Action *endAction) { - warning("TODO ActionOjbect::load"); - return true; +void AnimationPlayer::process(Event &event) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE) && + (_field3A)) { + _field90C = _field576; + } } -/*--------------------------------------------------------------------------*/ +void AnimationPlayer::dispatch() { + uint32 gameFrame = R2_GLOBALS._events.getFrameNumber(); + uint32 gameDiff = (gameFrame > _gameFrame) ? gameFrame - _gameFrame : _gameFrame - gameFrame; + + if (gameDiff >= _field910) { + drawFrame(_field904 % _field57C); + ++_field904; + _field90C = _field904 / _field57C; + + if (_field90C == _field90E) + method2(); + + _field908 = _field904; + _gameFrame = gameFrame; + } +} + +bool AnimationPlayer::load(int rlbNum, Action *endAction) { + ResourceEntry resEntry; + if (!g_resourceManager->first().getSectionEntry(_resourceFile, RES_IMAGE, rlbNum, 0, resEntry)) { + warning("Couldn't find resource index"); + // TODO: Complete animation loading + } + + _resourceFile.close(); + return false; +} + +void AnimationPlayer::drawFrame(int frameIndex) { + uint32 v = READ_LE_UINT32(_dataP); +warning("v = %d", v); +//TODO + + // End check + if (_field56 == 42) { + _screenBounds.expandPanes(); -void ActionObjectExt::synchronize(Serializer &s) { - ActionObject::synchronize(s); - s.syncAsSint16LE(_v1); + R2_GLOBALS._sceneObjects->draw(); + } else { + if (R2_GLOBALS._sceneManager._hasPalette) { + R2_GLOBALS._sceneManager._hasPalette = false; + R2_GLOBALS._scenePalette.refresh(); + } + } } +void AnimationPlayer::method2() { +} + +bool AnimationPlayer::method3() { + return (_field90C >= _field576); +} + +void AnimationPlayer::method4() { + if (_field38) { + switch (_field3C) { + case 0: + R2_GLOBALS._scenePalette.replace(&_palette); + changePane(); + R2_GLOBALS._sceneManager._hasPalette = true; + break; + case 2: + proc14(); + break; + default: + changePane(); + break; + } + } + +// TODO +} + +/*--------------------------------------------------------------------------*/ + +AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() { + _v = 0; + _field3A = 0; +} + +void AnimationPlayerExt::synchronize(Serializer &s) { + AnimationPlayer::synchronize(s); + s.syncAsSint16LE(_v); +} } // End of namespace Ringworld2 diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 925a3d6522..98fcaae981 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -325,29 +325,55 @@ public: virtual Common::String getClassName() { return "UnkObject1200"; } }; -class ActionObject: public EventHandler { +class AnimationPlayer: public EventHandler { public: - EventHandler *_endAction; + Common::File _resourceFile; + void *_fieldA; + void *_field16; + + byte *_dataP; Rect _rect1, _screenBounds; + int _field38; int _field3A, _field3C; int _field56; int _field58, _field5A; ScenePalette _palette; byte _palData[256 * 3]; + Action *_endAction; + int _field576; + int _field57C; + int _palStart, _palSize; + int _field904; + int _field908; + int _field90C; + int _field90E; + uint _field910; + uint32 _gameFrame; public: - ActionObject(); + AnimationPlayer(); + ~AnimationPlayer(); virtual void synchronize(Serializer &s); virtual void remove(); + virtual void process(Event &event); + virtual void dispatch(); + virtual void flipPane() {} + virtual void changePane() {} + virtual void proc14() {} bool load(int rlbNum, Action *endAction = NULL); - bool proc1() { return false; } - void proc2() {} + void drawFrame(int frameIndex); + void method2(); + bool method3(); + void method4(); + void method5() {} }; -class ActionObjectExt: public ActionObject { +class AnimationPlayerExt: public AnimationPlayer { +public: + int _v; public: - int _v1; + AnimationPlayerExt(); virtual void synchronize(Serializer &s); }; diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 2b2b5e71ef..dab9afb269 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -1499,25 +1499,25 @@ Scene180::Scene180(): SceneExt(), _webbsterSpeaker(27) { GfxFont font; font.setFontNumber(7); - _fontHeight = font.getHeight(); + _fontHeight = font.getHeight() + 1; _sceneMode = (R2_GLOBALS._sceneManager._previousScene == 205) ? 10 : 0; _gameTextSpeaker._displayMode = 9; - _stripManager.addSpeaker(&_gameTextSpeaker); - _stripManager.addSpeaker(&_webbsterSpeaker); - _stripManager.addSpeaker(&_tealSpeaker); - _stripManager.addSpeaker(&_dutyOfficerSpeaker); - - signal(); } void Scene180::postInit(SceneObjectList *OwnerList) { - SceneExt::postInit(); loadScene(9999); + SceneExt::postInit(); - R2_GLOBALS._player._uiEnabled = false; + R2_GLOBALS._uiElements._active = true; R2_GLOBALS._player.disableControl(); + _stripManager.addSpeaker(&_gameTextSpeaker); + _stripManager.addSpeaker(&_webbsterSpeaker); + _stripManager.addSpeaker(&_tealSpeaker); + _stripManager.addSpeaker(&_dutyOfficerSpeaker); + + signal(); } void Scene180::remove() { @@ -1547,7 +1547,7 @@ void Scene180::synchronize(Serializer &s) { void Scene180::signal() { R2_GLOBALS._playStream.stop(); - switch (_sceneMode) { + switch (_sceneMode++) { case 0: setFrameInc(6); break; @@ -1555,13 +1555,13 @@ void Scene180::signal() { case 1: _field412 = 1; R2_GLOBALS._sceneManager._hasPalette = true; - _actionObject._field3C = 2; - _actionObject._v1 = 1; - _actionObject._field56 = 1; + _animationPlayer._field3C = 2; + _animationPlayer._v = 1; + _animationPlayer._field56 = 1; R2_GLOBALS._scene180Mode = 1; - _actionObject.load(1, NULL); - R2_GLOBALS._scenePalette.loadPalette(_actionObject._palData, 0, 256); + _animationPlayer.load(1, NULL); + R2_GLOBALS._scenePalette.loadPalette(_animationPlayer._palData, 0, 256); R2_GLOBALS._sound1.play(1); break; @@ -1598,14 +1598,14 @@ void Scene180::signal() { break; case 5: - _actionObject._field3C = 2; - _actionObject._v1 = 1; - _actionObject._field56 = 1; + _animationPlayer._field3C = 2; + _animationPlayer._v = 1; + _animationPlayer._field56 = 1; R2_GLOBALS._scene180Mode = 2; - _actionObject.load(2); + _animationPlayer.load(2); _field412 = 1; - R2_GLOBALS._scenePalette.addFader(_actionObject._palData, 256, 6, NULL); + R2_GLOBALS._scenePalette.addFader(_animationPlayer._palData, 256, 6, NULL); R2_GLOBALS._sound1.play(2); break; @@ -1701,11 +1701,11 @@ void Scene180::signal() { case 29: _field412 = 1; - _actionObject._field3C = 0; - _actionObject._v1 = 1; - _actionObject._field56 = 42; + _animationPlayer._field3C = 0; + _animationPlayer._v = 1; + _animationPlayer._field56 = 42; R2_GLOBALS._scene180Mode = 3; - _actionObject.load(3); + _animationPlayer.load(3); break; case 31: @@ -1801,12 +1801,12 @@ void Scene180::signal() { break; case 40: - _actionObject._field3C = 2; - _actionObject._field56 = 1; + _animationPlayer._field3C = 2; + _animationPlayer._field56 = 1; R2_GLOBALS._scene180Mode = 4; - if (_actionObject.load(4)) { - _actionObject.dispatch(); - R2_GLOBALS._scenePalette.addFader(_actionObject._palData, 256, 8, this); + if (_animationPlayer.load(4)) { + _animationPlayer.dispatch(); + R2_GLOBALS._scenePalette.addFader(_animationPlayer._palData, 256, 8, this); } else { _sceneMode = 43; setFrameInc(1); @@ -1815,7 +1815,7 @@ void Scene180::signal() { case 41: _field412 = 1; - _actionObject._v1 = 1; + _animationPlayer._v = 1; break; case 42: @@ -1834,19 +1834,19 @@ void Scene180::signal() { break; case 45: - R2_GLOBALS._scenePalette.addFader(_actionObject._palData, 256, 28, this); + R2_GLOBALS._scenePalette.addFader(_animationPlayer._palData, 256, 28, this); break; case 48: _field412 = 1; - _actionObject._field3C = 2; - _actionObject._v1 = 1; - _actionObject._field56 = 1; + _animationPlayer._field3C = 2; + _animationPlayer._v = 1; + _animationPlayer._field56 = 1; R2_GLOBALS._scene180Mode = 15; - _actionObject.load(15, NULL); + _animationPlayer.load(15, NULL); R2_GLOBALS._sound1.play(9); - R2_GLOBALS._scenePalette.addFader(_actionObject._palData, 256, 6, NULL); + R2_GLOBALS._scenePalette.addFader(_animationPlayer._palData, 256, 6, NULL); break; case 49: @@ -1884,11 +1884,11 @@ void Scene180::process(Event &event) { void Scene180::dispatch() { if (_frameInc) { - uint32 frameNumber = R2_GLOBALS._events.getFrameNumber(); + uint32 gameFrame = R2_GLOBALS._events.getFrameNumber(); - if (frameNumber >= (uint32)_frameNumber) { - _frameInc = frameNumber - _frameNumber; - _frameNumber = frameNumber; + if (gameFrame >= (uint32)_frameNumber) { + _frameInc -= gameFrame - _frameNumber; + _frameNumber = gameFrame; if (_frameInc <= 0) { _frameInc = 0; @@ -1897,15 +1897,15 @@ void Scene180::dispatch() { } } - if (_actionObject._v1) { - if (_actionObject.proc1()) { - _actionObject._v1 = 0; - _actionObject.proc2(); - _actionObject.remove(); + if (_animationPlayer._v) { + if (_animationPlayer.method3()) { + _animationPlayer._v = 0; + _animationPlayer.method4(); + _animationPlayer.remove(); signal(); } else { - _actionObject.dispatch(); + _animationPlayer.dispatch(); } } @@ -4884,7 +4884,7 @@ bool Scene500::Object3::startAction(CursorType action, Event &event) { } return true; - case R2_21: + case R2_RESERVE_REBREATHER_TANK: SceneItem::display2(500, 53); return true; @@ -5442,7 +5442,7 @@ bool Scene600::Actor5::startAction(CursorType action, Event &event) { return true; } - if ((R2_GLOBALS.getFlag(9)) && (R2_INVENTORY.getObjectScene(R2_9) == 600)) + if ((R2_GLOBALS.getFlag(9)) && (R2_INVENTORY.getObjectScene(R2_COM_SCANNER) == 600)) SceneItem::display(600, 31, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); else { R2_GLOBALS._player.disableControl(); @@ -5457,7 +5457,7 @@ bool Scene600::Actor6::startAction(CursorType action, Event &event) { if ((action < CURSOR_WALK) && (action >= R2CURSORS_START)) { switch (action) { - case R2_9: + case R2_COM_SCANNER: if (R2_GLOBALS.getFlag(6)) { if (R2_GLOBALS.getFlag(8)) { SceneItem::display(600, 29, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); @@ -5828,7 +5828,7 @@ bool Scene700::Item12::startAction(CursorType action, Event &event) { Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_8: + case R2_CABLE_HARNESS: R2_GLOBALS._player.disableControl(); scene->_actor5.postInit(); scene->_actor5.setup(701, 3, 2); @@ -5837,7 +5837,7 @@ bool Scene700::Item12::startAction(CursorType action, Event &event) { scene->_actor5.hide(); scene->_sceneMode = 20; break; - case R2_16: + case R2_ATTRACTOR_CABLE_HARNESS: R2_GLOBALS._player.disableControl(); scene->_actor5.postInit(); scene->_actor5.setup(701, 2, 8); @@ -5908,7 +5908,7 @@ bool Scene700::Actor5::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: - switch (R2_INVENTORY.getObjectScene(R2_8)) { + switch (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS)) { case 0: if ((_strip == 2) && (_frame == 1)) { R2_GLOBALS._player.disableControl(); @@ -5937,7 +5937,7 @@ bool Scene700::Actor5::startAction(CursorType action, Event &event) { break; case R2_ATTRACTOR_UNIT: R2_GLOBALS._player.disableControl(); - if (R2_INVENTORY.getObjectScene(R2_8) == 700) { + if (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 700) { scene->_sceneMode = 706; scene->setAction(&scene->_sequenceManager, scene, 706, &R2_GLOBALS._player, &scene->_actor5, NULL); } else { @@ -6020,12 +6020,12 @@ void Scene700::postInit(SceneObjectList *OwnerList) { _actor9.setPosition(Common::Point(324, 53)); _actor9.setDetails(700, 33, -1, 35, 1, (SceneItem *) NULL); - if ((R2_INVENTORY.getObjectScene(R2_8) != 1) && (R2_INVENTORY.getObjectScene(R2_16) != 1)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) != 1) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 1)) { _actor5.postInit(); _actor5.fixPriority(10); - switch (R2_INVENTORY.getObjectScene(R2_16)) { + switch (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS)) { case 0: - switch (R2_INVENTORY.getObjectScene(R2_8)) { + switch (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS)) { case 0: _actor5.setup(701, 3, 2); _actor5.setPosition(Common::Point(243, 98)); @@ -6041,7 +6041,7 @@ void Scene700::postInit(SceneObjectList *OwnerList) { } break; case 700: - switch (R2_INVENTORY.getObjectScene(R2_8)) { + switch (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS)) { case 0: if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) _actor5.setup(701, 2, 1); @@ -6191,10 +6191,10 @@ void Scene700::signal() { R2_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); R2_GLOBALS._player._strip = 7; if (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_UNIT) == 0) { - R2_INVENTORY.setObjectScene(R2_16, 1); - R2_INVENTORY.setObjectScene(R2_8, 0); + R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 1); + R2_INVENTORY.setObjectScene(R2_CABLE_HARNESS, 0); } else { - R2_INVENTORY.setObjectScene(R2_8, 1); + R2_INVENTORY.setObjectScene(R2_CABLE_HARNESS, 1); } R2_GLOBALS._player.enableControl(); break; @@ -6219,7 +6219,7 @@ void Scene700::signal() { break; case 17: R2_INVENTORY.setObjectScene(R2_ATTRACTOR_UNIT, 0); - R2_INVENTORY.setObjectScene(R2_16, 700); + R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); R2_GLOBALS._player.setVisage(11); R2_GLOBALS._player.changeZoom(100); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); @@ -6228,7 +6228,7 @@ void Scene700::signal() { R2_GLOBALS._player.enableControl(); break; case 20: - R2_INVENTORY.setObjectScene(R2_8, 0); + R2_INVENTORY.setObjectScene(R2_CABLE_HARNESS, 0); R2_GLOBALS._player.enableControl(); break; case 21: @@ -6236,7 +6236,7 @@ void Scene700::signal() { if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) _actor5.animate(ANIM_MODE_6, NULL); - R2_INVENTORY.setObjectScene(R2_16, 700); + R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); R2_GLOBALS._player.enableControl(); break; case 701: @@ -6254,7 +6254,7 @@ void Scene700::signal() { if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) _actor5.animate(ANIM_MODE_6, NULL); R2_INVENTORY.setObjectScene(R2_ATTRACTOR_UNIT, 0); - R2_INVENTORY.setObjectScene(R2_16, 700); + R2_INVENTORY.setObjectScene(R2_ATTRACTOR_CABLE_HARNESS, 700); R2_GLOBALS._player.enableControl(); break; case 709: @@ -6462,7 +6462,7 @@ void Scene800::postInit(SceneObjectList *OwnerList) { _cabinet.setPosition(Common::Point(169, 79)); _cabinet.setDetails(800, 41, -1, -1, 1, (SceneItem *)NULL); - if (R2_INVENTORY.getObjectScene(R2_9) == 800) { + if (R2_INVENTORY.getObjectScene(R2_COM_SCANNER) == 800) { _comScanner.postInit(); _comScanner.setup(801, 2, 1); _comScanner.setPosition(Common::Point(174, 73)); @@ -6548,7 +6548,7 @@ void Scene800::signal() { case 811: R2_GLOBALS._player.enableControl(); _comScanner.remove(); - R2_INVENTORY.setObjectScene(R2_9, 1); + R2_INVENTORY.setObjectScene(R2_COM_SCANNER, 1); break; default: R2_GLOBALS._player.enableControl(); @@ -7152,7 +7152,7 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { scene->_aSound1.play(30); setup(900, 3, 11); R2_GLOBALS._v565E5 = 1; - if ((R2_INVENTORY.getObjectScene(R2_8) == 0) && (R2_INVENTORY.getObjectScene(R2_16 == 700)) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70) && (scene->_actor2._animateMode != ANIM_MODE_6)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS == 700)) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70) && (scene->_actor2._animateMode != ANIM_MODE_6)) { scene->_actor2.animate(ANIM_MODE_6, NULL); } else { if (((scene->_actor3._percent * 49) / 100) + scene->_actor3._position.x == scene->_actor2._position.x) { @@ -7172,9 +7172,9 @@ bool Scene900::Actor4::startAction(CursorType action, Event &event) { setup(900, 3, 9); R2_GLOBALS._v565E5 = 0; - if ((R2_INVENTORY.getObjectScene(R2_8) == 0) && (R2_INVENTORY.getObjectScene(R2_16) == 700) && (scene->_actor2._frame < 8) && (scene->_actor2._animateMode != ANIM_MODE_5)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (scene->_actor2._frame < 8) && (scene->_actor2._animateMode != ANIM_MODE_5)) { scene->_actor2.animate(ANIM_MODE_5, NULL); - } else if ((R2_INVENTORY.getObjectScene(R2_8) == 700) && (R2_INVENTORY.getObjectScene(R2_16) == 700) && (scene->_actor2._frame < 8)) { + } else if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 700) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (scene->_actor2._frame < 8)) { R2_GLOBALS._v565E7 = 0; if (scene->_actor2._animateMode != 5) { R2_GLOBALS._player.disableControl(); @@ -7288,13 +7288,13 @@ void Scene900::postInit(SceneObjectList *OwnerList) { _actor3._effect = 1; _actor3.setDetails(900, 6, -1, 8, 1, (SceneItem *) NULL); - if ((R2_INVENTORY.getObjectScene(R2_8) != 1) && (R2_INVENTORY.getObjectScene(R2_16) != 1)) { + if ((R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) != 1) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 1)) { _actor2.postInit(); _actor2.setPosition(Common::Point(0, 0)); _actor2.fixPriority(1); - if (R2_INVENTORY.getObjectScene(R2_8) == 0) { - if (R2_INVENTORY.getObjectScene(R2_16) != 700) { + if (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) { + if (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) != 700) { _actor2.setup(901, 3, 2); } else if ((R2_GLOBALS._v565E5 != 0) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) { _actor2.setup(901, 2, 1); @@ -7446,11 +7446,11 @@ void Scene900::dispatch() { } if (R2_GLOBALS._sceneObjects->contains(&_actor2)) { - if ((R2_GLOBALS._v565E5 != 0) && (R2_INVENTORY.getObjectScene(R2_8) == 0) && (R2_INVENTORY.getObjectScene(R2_16) == 700) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) { + if ((R2_GLOBALS._v565E5 != 0) && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (R2_GLOBALS._v565E1 == 20) && (R2_GLOBALS._v565E3 == 70)) { if ((_actor2._frame > 1) && (_actor2._animateMode != ANIM_MODE_6)) _actor2.animate(ANIM_MODE_6, NULL); } else { - if ((_actor2._frame < 8) && (_actor2._animateMode != ANIM_MODE_5) && (R2_GLOBALS._v565E7 == 0) && (R2_INVENTORY.getObjectScene(R2_8) == 0) && (R2_INVENTORY.getObjectScene(R2_16) == 700) && (_sceneMode != 4)) + if ((_actor2._frame < 8) && (_actor2._animateMode != ANIM_MODE_5) && (R2_GLOBALS._v565E7 == 0) && (R2_INVENTORY.getObjectScene(R2_CABLE_HARNESS) == 0) && (R2_INVENTORY.getObjectScene(R2_ATTRACTOR_CABLE_HARNESS) == 700) && (_sceneMode != 4)) _actor2.animate(ANIM_MODE_5, NULL); } } diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index f3c8b0bccf..d757080156 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -204,7 +204,7 @@ public: SceneActor _object1, _object2, _object3, _object4, _object5; ScenePalette _palette; SceneText _textList[20]; - ActionObjectExt _actionObject; + AnimationPlayerExt _animationPlayer; SequenceManager _sequenceManager; Action1 _action1; ASoundExt _sound1; @@ -287,7 +287,7 @@ private: int xMultiply, int yMultiply, int xCenter, int yCenter); void handleText(); public: - ActionObject _actionObject; + AnimationPlayer _animationPlayer; int _fontHeight; SceneText _textList[15]; Object *_objList1[3]; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index cf8d214d6b..23a9eb2590 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -279,7 +279,7 @@ bool Scene1100::Actor17::startAction(CursorType action, Event &event) { break; case R2_SONIC_STUNNER: // No break on purpose - case R2_44: + case R2_PHOTON_STUNNER: if (_visage == 1105) { R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._characterIndex == 1) { @@ -1634,7 +1634,7 @@ void Scene1337::unkObj1337_1::synchronize(Serializer &s) { } Scene1337::Scene1337() { - _fieldA30 = 0; + _autoplay = false; _field3E24 = 0; _field3E26 = 0; @@ -3846,7 +3846,7 @@ void Scene1337::process(Event &event) { if (event.btnState != BTNSHIFT_RIGHT) { subD183F(R2_GLOBALS._v5780E, 1); event.handled = true; - } else if (_unkFctPtr412 != NULL) { + } else if (_unkFctPtr412) { FunctionPtrType tmpFctPtr = _unkFctPtr412; _unkFctPtr412 = NULL; (this->*tmpFctPtr)(); @@ -3854,7 +3854,7 @@ void Scene1337::process(Event &event) { } } else if (event.eventType == EVENT_KEYPRESS) { if (event.kbd.keycode == Common::KEYCODE_SPACE) { - if (_unkFctPtr412 != NULL) { + if (_unkFctPtr412) { FunctionPtrType tmpFctPtr = _unkFctPtr412; _unkFctPtr412 = NULL; (this->*tmpFctPtr)(); @@ -3939,7 +3939,7 @@ void Scene1337::subC20F9() { break; } - if (_fieldA30 == 0) + if (!_autoplay) _unkFctPtr412 = &Scene1337::subC20E5; else subC20E5(); @@ -4436,8 +4436,11 @@ void Scene1337::subC2C2F() { for (int i = 0; i <= 3; i++) { if (tmpRandIndx != 3) { + // The variables 'i' and 'j' are not used in the inner code of the loop. + // It's understandable for 'i', which helps making sure that tmpVal is used properly, + // but it's suspect for j for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[j]._arr3[0]._field34 == 0) && (subC32B1(j, _arrunkObj1337[3]._arr1[randIndx]._field34))) { + if ((_arrunkObj1337[tmpRandIndx]._arr3[0]._field34 == 0) && (subC32B1(tmpRandIndx, _arrunkObj1337[3]._arr1[randIndx]._field34))) { tmpVal = j; } } @@ -4916,7 +4919,7 @@ void Scene1337::subPostInit() { _background1.setup2(9531, 1, 1, 249, 168, 155, 0); - _fieldA30 = 0; + _autoplay = false; _field424C = 0; _field424E = 0; } @@ -5668,9 +5671,10 @@ void Scene1337::subCF979() { for (int i = 0; i <= 3; i++) { if (subC27F9(_arrunkObj1337[0]._arr1[i]._field34) != -1) { + // The variable 'j' is not used in the inner code of the loop. It's suspect for (int j = 0; j <= 7; j++) { - if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[j]._field34))) { - subC3456(&_arrunkObj1337[0]._arr1[j], &_arrunkObj1337[2]._arr3[0]); + if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[i]._field34))) { + subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[2]._arr3[0]); found = true; } } @@ -6690,7 +6694,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { SceneItem::display(1550, 71, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); return true; break; - case R2_17: + case R2_FUEL_CELL: scene->_field412 = 1; if (_fieldA4 == 6) { R2_GLOBALS._player.disableControl(); @@ -6704,7 +6708,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_18: + case R2_GYROSCOPE: scene->_field412 = 1; if (_fieldA4 == 3) { R2_GLOBALS._player.disableControl(); @@ -6718,7 +6722,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_22: + case R2_GUIDANCE_MODULE: scene->_field412 = 1; if (_fieldA4 == 1) { R2_GLOBALS._player.disableControl(); @@ -6732,7 +6736,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_23: + case R2_THRUSTER_VALVE: scene->_field412 = 1; if (_fieldA4 == 4) { R2_GLOBALS._player.disableControl(); @@ -6743,7 +6747,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_25: + case R2_RADAR_MECHANISM: scene->_field412 = 1; if (_fieldA4 == 2) { R2_GLOBALS._player.disableControl(); @@ -6757,7 +6761,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_27: + case R2_IGNITOR: scene->_field412 = 1; if (_fieldA4 == 5) { R2_GLOBALS._player.disableControl(); @@ -6768,7 +6772,7 @@ bool Scene1550::UnkObj15502::startAction(CursorType action, Event &event) { } return SceneActor::startAction(action, event); break; - case R2_45: + case R2_BATTERY: scene->_field412 = 1; if (_fieldA4 == 7) { R2_GLOBALS._player.disableControl(); @@ -6794,37 +6798,37 @@ void Scene1550::UnkObj15502::subA5CDF(int strip) { setup(1517, _fieldA4, 1); switch (_fieldA4 - 1) { case 0: - if (R2_INVENTORY.getObjectScene(R2_22) == 0) + if (R2_INVENTORY.getObjectScene(R2_GUIDANCE_MODULE) == 0) setFrame(5); setPosition(Common::Point(287, 85)); break; case 1: - if (R2_INVENTORY.getObjectScene(R2_25) == 0) + if (R2_INVENTORY.getObjectScene(R2_RADAR_MECHANISM) == 0) setFrame(5); setPosition(Common::Point(248, 100)); break; case 2: - if (R2_INVENTORY.getObjectScene(R2_28) == 0) + if (R2_INVENTORY.getObjectScene(R2_DIAGNOSTICS_DISPLAY) == 0) setFrame(5); setPosition(Common::Point(217, 85)); break; case 3: - if (R2_INVENTORY.getObjectScene(R2_23)) + if (R2_INVENTORY.getObjectScene(R2_THRUSTER_VALVE)) setFrame(5); setPosition(Common::Point(161, 121)); break; case 4: - if (R2_INVENTORY.getObjectScene(R2_27)) + if (R2_INVENTORY.getObjectScene(R2_IGNITOR)) setFrame(5); setPosition(Common::Point(117, 121)); break; case 5: - if (R2_INVENTORY.getObjectScene(R2_17)) + if (R2_INVENTORY.getObjectScene(R2_FUEL_CELL)) setFrame(5); setPosition(Common::Point(111, 85)); break; case 6: - if (R2_INVENTORY.getObjectScene(R2_45)) + if (R2_INVENTORY.getObjectScene(R2_BATTERY)) setFrame(5); setPosition(Common::Point(95, 84)); break; @@ -7129,7 +7133,7 @@ bool Scene1550::Actor13::startAction(CursorType action, Event &event) { if (scene->_field415 != 2) return SceneActor::startAction(action, event); - if (R2_INVENTORY.getObjectScene(R2_45) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_BATTERY) == 1550) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1564; scene->setAction(&scene->_sequenceManager1, scene, 1564, &R2_GLOBALS._player, NULL); @@ -7141,7 +7145,7 @@ bool Scene1550::Actor13::startAction(CursorType action, Event &event) { if (scene->_field415 != 2) return SceneActor::startAction(action, event); - if (R2_INVENTORY.getObjectScene(R2_45) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_BATTERY) == 1550) { SceneItem::display(1550, 74, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); } else SceneItem::display(1550, 64, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); @@ -7184,7 +7188,7 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); if (R2_GLOBALS._sceneManager._previousScene == -1) - R2_GLOBALS.setFlag(R2_16); + R2_GLOBALS.setFlag(R2_ATTRACTOR_CABLE_HARNESS); if ((R2_GLOBALS._player._characterScene[1] != 1550) && (R2_GLOBALS._player._characterScene[1] != 1580)) { R2_GLOBALS._player._characterScene[1] = 1550; @@ -7477,7 +7481,7 @@ void Scene1550::signal() { case 1552: // No break on purpose case 1588: - R2_INVENTORY.setObjectScene(R2_19, R2_GLOBALS._player._characterIndex); + R2_INVENTORY.setObjectScene(R2_AIRBAG, R2_GLOBALS._player._characterIndex); _actor8.remove(); _field412 = 0; R2_GLOBALS._player.enableControl(); @@ -7492,7 +7496,7 @@ void Scene1550::signal() { case 1555: // No break on purpose case 1589: - R2_INVENTORY.setObjectScene(R2_18, R2_GLOBALS._player._characterIndex); + R2_INVENTORY.setObjectScene(R2_GYROSCOPE, R2_GLOBALS._player._characterIndex); _actor10.remove(); R2_GLOBALS._player.enableControl(); break; @@ -7516,7 +7520,7 @@ void Scene1550::signal() { _field415 = 2; break; case 1564: - R2_INVENTORY.setObjectScene(R2_45, 1); + R2_INVENTORY.setObjectScene(R2_BATTERY, 1); _sceneMode = 1565; setAction(&_sequenceManager1, this, 1565, &R2_GLOBALS._player, NULL); break; @@ -7529,7 +7533,7 @@ void Scene1550::signal() { case 1579: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_22, 0); + R2_INVENTORY.setObjectScene(R2_GUIDANCE_MODULE, 0); R2_GLOBALS._player.enableControl(); break; case 1570: @@ -7537,7 +7541,7 @@ void Scene1550::signal() { case 1580: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_25, 0); + R2_INVENTORY.setObjectScene(R2_RADAR_MECHANISM, 0); R2_GLOBALS._player.enableControl(); break; case 1571: @@ -7545,19 +7549,19 @@ void Scene1550::signal() { case 1581: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_18, 0); + R2_INVENTORY.setObjectScene(R2_GYROSCOPE, 0); R2_GLOBALS._player.enableControl(); break; case 1572: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_23, 0); + R2_INVENTORY.setObjectScene(R2_THRUSTER_VALVE, 0); R2_GLOBALS._player.enableControl(); break; case 1573: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_27, 0); + R2_INVENTORY.setObjectScene(R2_IGNITOR, 0); R2_GLOBALS._player.enableControl(); break; case 1574: @@ -7565,7 +7569,7 @@ void Scene1550::signal() { case 1582: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_17, 0); + R2_INVENTORY.setObjectScene(R2_FUEL_CELL, 0); R2_GLOBALS._player.enableControl(); break; case 1575: @@ -7573,7 +7577,7 @@ void Scene1550::signal() { case 1583: _field412 = 0; _actor1.remove(); - R2_INVENTORY.setObjectScene(R2_45, 0); + R2_INVENTORY.setObjectScene(R2_BATTERY, 0); R2_GLOBALS._player.enableControl(); break; case 1576: @@ -7598,14 +7602,14 @@ void Scene1550::signal() { case 1586: // No break on purpose case 1587: - R2_INVENTORY.setObjectScene(R2_28, R2_GLOBALS._player._characterIndex); + R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, R2_GLOBALS._player._characterIndex); _actor1.remove(); _field412 = 0; R2_GLOBALS._player.enableControl(); break; case 1592: _actor9.remove(); - R2_INVENTORY.setObjectScene(R2_26, 1); + R2_INVENTORY.setObjectScene(R2_JOYSTICK, 1); if (R2_GLOBALS._player._characterIndex == 1) { R2_GLOBALS._v565EC[2] = R2_GLOBALS._v565EC[1]; R2_GLOBALS._v565EC[4] = R2_GLOBALS._v565EC[3]; @@ -8393,7 +8397,7 @@ void Scene1550::subA2B2F() { R2_GLOBALS._walkRegions.enableRegion(k5A78D); R2_GLOBALS._walkRegions.enableRegion(k5A790); R2_GLOBALS._walkRegions.enableRegion(k5A791); - if (R2_INVENTORY.getObjectScene(R2_26) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_JOYSTICK) == 1550) { _actor9.postInit(); _actor9.setup(1562, 3, 1); _actor9.setPosition(Common::Point(150, 70)); @@ -8482,7 +8486,7 @@ void Scene1550::subA2B2F() { _actor1.setPosition(Common::Point(259, 133)); _actor1.fixPriority(105); _actor1.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); - if (R2_INVENTORY.getObjectScene(R2_18) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_GYROSCOPE) == 1550) { _actor10.postInit(); _actor10.setup(1550, 7, 2); _actor10.setPosition(Common::Point(227, 30)); @@ -8501,7 +8505,7 @@ void Scene1550::subA2B2F() { _actor1.setup(1550, 1, 3); _actor1.setPosition(Common::Point(76, 64)); _actor1.setDetails(1550, 9, -1, -1, 2, (SceneItem *) NULL); - if (R2_INVENTORY.getObjectScene(R2_28) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_DIAGNOSTICS_DISPLAY) == 1550) { _actor11.postInit(); _actor11.setup(1504, 4, 1); _actor11.setPosition(Common::Point(49, 35)); @@ -8510,7 +8514,7 @@ void Scene1550::subA2B2F() { _actor11.fixPriority(65); _actor11.setDetails(1550, 14, 15, 63, 2, (SceneItem *) NULL); } - if (R2_INVENTORY.getObjectScene(R2_19) == 1550) { + if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1550) { _actor8.postInit(); _actor8.setup(1550, 7, 1); _actor8.setPosition(Common::Point(45, 44)); @@ -9050,7 +9054,7 @@ void Scene1580::synchronize(Serializer &s) { bool Scene1580::Hotspot1::startAction(CursorType action, Event &event) { Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_26) { + if (action == R2_JOYSTICK) { R2_INVENTORY.setObjectScene(26, 1580); R2_GLOBALS._sceneItems.remove(&scene->_item1); scene->_actor2.postInit(); @@ -9069,7 +9073,7 @@ bool Scene1580::Hotspot1::startAction(CursorType action, Event &event) { bool Scene1580::Hotspot2::startAction(CursorType action, Event &event) { Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_28) { + if (action == R2_DIAGNOSTICS_DISPLAY) { R2_INVENTORY.setObjectScene(28, 1580); R2_GLOBALS._player.disableControl(); R2_GLOBALS._sceneItems.remove(&scene->_item2); @@ -9171,14 +9175,14 @@ bool Scene1580::Actor6::startAction(CursorType action, Event &event) { return true; } break; - case R2_9: + case R2_COM_SCANNER: scene->_sceneMode = 30; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); scene->_stripManager.start(529, scene); return true; break; - case R2_39: + case R2_COM_SCANNER_2: scene->_sceneMode = 30; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -9203,14 +9207,14 @@ bool Scene1580::Actor7::startAction(CursorType action, Event &event) { return true; } break; - case R2_9: + case R2_COM_SCANNER: scene->_sceneMode = 30; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); scene->_stripManager.start(529, scene); return true; break; - case R2_39: + case R2_COM_SCANNER_2: scene->_sceneMode = 30; R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -10442,7 +10446,7 @@ void Scene1800::synchronize(Serializer &s) { } bool Scene1800::Hotspot5::startAction(CursorType action, Event &event) { - if ((action != R2_9) && (action != R2_39)) + if ((action != R2_COM_SCANNER) && (action != R2_COM_SCANNER_2)) return false; Scene1800 *scene = (Scene1800 *)R2_GLOBALS._sceneManager._scene; @@ -10952,6 +10956,781 @@ void Scene1800::saveCharacter(int characterIndex) { } /*-------------------------------------------------------------------------- + * Scene 1850 - + * + *--------------------------------------------------------------------------*/ +Scene1850::Scene1850() { + warning("STUBBED: Scene1850()"); +} + +void Scene1850::synchronize(Serializer &s) { + warning("STUBBED: Scene1850::synchronize()"); +} + +bool Scene1850::Hotspot2::startAction(CursorType action, Event &event) { + if (action != CURSOR_USE) + return SceneHotspot::startAction(action, event); + + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + + R2_GLOBALS._player.disableControl(); + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + scene->_sceneMode = 1852; + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1871, &R2_GLOBALS._player, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1852, &R2_GLOBALS._player, NULL); + } else if (R2_GLOBALS.getFlag(30)) { + scene->_field41E = 1; + scene->_sceneMode = 1860; + + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1860, &R2_GLOBALS._player, &scene->_actor5, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1859, &R2_GLOBALS._player, &scene->_actor5, NULL); + + R2_GLOBALS.clearFlag(30); + } else { + scene->_sceneMode = 1853; + + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1872, &R2_GLOBALS._player, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1853, &R2_GLOBALS._player, NULL); + } + + return true; +} + +bool Scene1850::Actor5::startAction(CursorType action, Event &event) { + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + + switch (action) { + case CURSOR_USE: + if ((R2_GLOBALS._player._characterIndex != R2_SEEKER) || (R2_GLOBALS.getFlag(33)) || (R2_GLOBALS.getFlag(30))) + return SceneActor::startAction(action, event); + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 1857; + + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1858, &R2_GLOBALS._player, &scene->_actor5, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1857, &R2_GLOBALS._player, &scene->_actor5, NULL); + + R2_GLOBALS.setFlag(30); + return true; + break; + case CURSOR_LOOK: + if (R2_GLOBALS.getFlag(34)) + SceneItem::display(1850, 2, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + else + SceneItem::display(1850, 1, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + + return true; + break; + case R2_AIRBAG: + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + if (R2_GLOBALS.getFlag(70)) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 30; + + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + scene->_stripManager.start(558, scene); + + return true; + } else { + return SceneActor::startAction(action, event); + } + } else if (R2_GLOBALS.getFlag(30)) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 1875; + scene->_actor2.postInit(); + + if (R2_GLOBALS.getFlag(32)) + scene->setAction(&scene->_sequenceManager1, scene, 1876, &R2_GLOBALS._player, &scene->_actor2, NULL); + else + scene->setAction(&scene->_sequenceManager1, scene, 1875, &R2_GLOBALS._player, &scene->_actor2, NULL); + + return true; + } else if (R2_GLOBALS.getFlag(70)) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 30; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + scene->_stripManager.start(557, scene); + R2_GLOBALS.setFlag(69); + + return true; + } else { + return SceneActor::startAction(action, event); + } + break; + case R2_REBREATHER_TANK: + if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1850) { + if (R2_GLOBALS.getFlag(30)) + return SceneActor::startAction(action, event);; + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 1878; + scene->setAction(&scene->_sequenceManager1, scene, 1878, &R2_GLOBALS._player, &scene->_actor5, &scene->_actor2, NULL); + } + + return true; + break; + default: + return SceneActor::startAction(action, event); + break; + } +} + +bool Scene1850::Actor6::startAction(CursorType action, Event &event) { + if (action != CURSOR_USE) + return SceneHotspot::startAction(action, event); + + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + + if (R2_GLOBALS.getFlag(32)) { + SceneItem::display(3240, 4, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + return true; + } + + R2_GLOBALS._player.disableControl(); + if (scene->_field412 == 1851) + R2_GLOBALS._player._effect = 1; + + if (_position.x >= 160) + R2_GLOBALS.setFlag(29); + else + R2_GLOBALS.clearFlag(29); + + if ((R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { + if (_position.x >= 160) + scene->_field41E = 3; + else + scene->_field41E = 2; + + scene->_sceneMode = 1860; + + if (R2_GLOBALS.getFlag(32)) { + scene->setAction(&scene->_sequenceManager1, scene, 1860, &R2_GLOBALS._player, &scene->_actor5, NULL); + } else { + scene->setAction(&scene->_sequenceManager1, scene, 1859, &R2_GLOBALS._player, &scene->_actor5, NULL); + } + } else { + scene->_sceneMode = 11; + if (_position.x >= 160) { + scene->setAction(&scene->_sequenceManager1, scene, 1866, &R2_GLOBALS._player, &scene->_actor7, NULL); + } else { + scene->setAction(&scene->_sequenceManager1, scene, 1865, &R2_GLOBALS._player, &scene->_actor6, NULL); + } + } + + return true; +} + +bool Scene1850::Actor8::startAction(CursorType action, Event &event) { + if ((action != CURSOR_USE) || (_position.y != 120)) + return SceneHotspot::startAction(action, event); + + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 1881; + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + scene->setAction(&scene->_sequenceManager1, scene, 1881, &R2_GLOBALS._player, NULL); + } else { + scene->setAction(&scene->_sequenceManager1, scene, 1880, &R2_GLOBALS._player, NULL); + } + + return true; +} + +void Scene1850::postInit(SceneObjectList *OwnerList) { + loadScene(1850); + + if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] != 1850) + R2_GLOBALS.clearFlag(31); + + _palette1.loadPalette(0); + + if (R2_GLOBALS.getFlag(31)) { + _field412 = 1850; + g_globals->_scenePalette.loadPalette(1850); + } else { + _field412 = 1851; + g_globals->_scenePalette.loadPalette(1851); + } + + SceneExt::postInit(); + + if (R2_GLOBALS._sceneManager._previousScene == 3150) + R2_GLOBALS._sound1.play(116); + + _stripManager.addSpeaker(&_quinnSpeaker); + _stripManager.addSpeaker(&_seekerSpeaker); + + _field418 = 0; + _field41E = 0; + _field41A = Common::Point(0, 0); + + R2_GLOBALS._player._characterScene[1] = 1850; + R2_GLOBALS._player._characterScene[2] = 1850; + + _item2.setDetails(Rect(101, 56, 111, 63), 1850, 19, -1, -1, 1, NULL); + + _actor6.postInit(); + _actor6.setup(1850, 3, 1); + _actor6.setPosition(Common::Point(66, 102)); + _actor6.setDetails(1850, 22, -1, -1, 1, (SceneItem *) NULL); + + _actor7.postInit(); + _actor7.setup(1850, 2, 1); + _actor7.setPosition(Common::Point(253, 102)); + _actor7.setDetails(1850, 22, -1, -1, 1, (SceneItem *) NULL); + + R2_GLOBALS._walkRegions.enableRegion(1); + + _actor5.postInit(); + + if (R2_GLOBALS.getFlag(34)) { + R2_GLOBALS._walkRegions.enableRegion(2); + _actor5.setup(1851, 4, 3); + } else if (R2_GLOBALS.getFlag(30)) { + _actor5.setup(1851, 2, 2); + } else { + R2_GLOBALS._walkRegions.enableRegion(5); + if (R2_GLOBALS.getFlag(33)) { + R2_GLOBALS._walkRegions.enableRegion(2); + _actor5.setup(1851, 1, 3); + } else { + _actor5.setup(1851, 2, 1); + } + } + + _actor5.setPosition(Common::Point(219, 130)); + _actor5.fixPriority(114); + _actor5.setDetails(1850, -1, -1, -1, 1, (SceneItem *) NULL); + + R2_GLOBALS._player.postInit(); + + _actor1.postInit(); + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor1.setDetails(9002, 0, 4, 3, 1, (SceneItem *) NULL); + } else { + _actor1.setDetails(9001, 0, 5, 3, 1, (SceneItem *) NULL); + } + + if (R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] == 1850) { + R2_GLOBALS._player._effect = 6; + _actor1._effect = 6; + if (R2_GLOBALS.getFlag(31)) { + R2_GLOBALS._player._shade = 0; + _actor1._shade = 0; + } else { + R2_GLOBALS._player._shade = 6; + _actor1._shade = 6; + } + + if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1850) { + _actor2.postInit(); + if (R2_GLOBALS.getFlag(34)) { + _actor2.setup(1851, 4, 2); + _actor2.fixPriority(114); + } else { + _actor2.setup(1851, 4, 1); + } + + _actor2.setPosition(Common::Point(179, 113)); + + if ((_actor5._strip == 1) && (_actor5._frame == 3)){ + _actor2.hide(); + } + + _actor2.setDetails(1850, 6, -1, -1, 1, (SceneItem *) NULL); + } + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS.getFlag(32)) { + R2_GLOBALS._player.setVisage(1511); + _actor1.setVisage(1508); + + _actor3.postInit(); + _actor3.setup(1853, 3, 1); + _actor3.setPosition(Common::Point(122, 113)); + _actor3.fixPriority(114); + _actor3._effect = 6; + + // Totally useless test + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); + } else { + // And the associated dead code + _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); + } + + _actor4.postInit(); + _actor4.setup(1853, 3, 2); + _actor4.setPosition(Common::Point(139, 111)); + _actor4.fixPriority(114); + _actor4._effect = 6; + + // Still totally useless test + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor4.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL); + } else { + // Another piece of dead code + _actor4.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); + } + + if (R2_GLOBALS.getFlag(31)) { + _actor3._shade = 0; + _actor4._shade = 0; + } else { + _actor3._shade = 6; + _actor4._shade = 6; + } + } else { + R2_GLOBALS._player.setVisage(1500); + _actor1.setVisage(1505); + } + } else { // Not Quinn + if (R2_GLOBALS.getFlag(32)) { + R2_GLOBALS._player.setVisage(1508); + _actor1.setVisage(1511); + + _actor3.postInit(); + _actor3.setup(1853, 3, 1); + _actor3.setPosition(Common::Point(122, 113)); + _actor3.fixPriority(114); + _actor3._effect = 6; + + // Totally useless test + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + // Dead code + _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL); + } else { + _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL); + } + + _actor4.postInit(); + _actor4.setup(1853, 3, 2); + _actor4.setPosition(Common::Point(139, 111)); + _actor4.fixPriority(114); + _actor4._effect = 6; + + // Again, useless test + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + // and dead code + _actor4.setDetails(1850, 29, -1, -1, 1, (SceneItem *) NULL); + } else { + _actor4.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL); + } + + if (R2_GLOBALS.getFlag(31)) { + _actor3._shade = 0; + _actor4._shade = 0; + } else { + _actor3._shade = 6; + _actor4._shade = 6; + } + } else { + R2_GLOBALS._player.setVisage(1505); + _actor1.setVisage(1500); + } + } + + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.setStrip(3); + R2_GLOBALS._player.setPosition(Common::Point(80, 114)); + + _actor1.animate(ANIM_MODE_1, NULL); + _actor1.setObjectWrapper(new SceneObjectWrapper()); + _actor1.setStrip(3); + _actor1.setPosition(Common::Point(180, 96)); + + if (R2_GLOBALS.getFlag(30)) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor1.animate(ANIM_MODE_NONE, NULL); + _actor1.setObjectWrapper(NULL); + if (R2_GLOBALS.getFlag(32)) { + _actor1.setup(1854, 1, 3); + } else { + _actor1.setup(1854, 2, 3); + } + + _actor1.setPosition(Common::Point(164, 106)); + } else { + _actor1.animate(ANIM_MODE_NONE, NULL); + _actor1.setObjectWrapper(NULL); + if (R2_GLOBALS.getFlag(32)) { + R2_GLOBALS._player.setup(1854, 1, 3); + } else { + R2_GLOBALS._player.setup(1854, 2, 3); + } + + R2_GLOBALS._player.setPosition(Common::Point(164, 106)); + } + } + + R2_GLOBALS._player.enableControl(); + } else { // R2_GLOBALS._player._oldCharacterScene[R2_GLOBALS._player._characterIndex] != 1850 + R2_GLOBALS._player._effect = 1; + _actor1._effect = 1; + R2_GLOBALS._player.disableControl(); + _sceneMode = 10; + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS.getFlag(29)) { + setAction(&_sequenceManager1, this, 1863, &R2_GLOBALS._player, &_actor1, &_actor7, NULL); + } else { + setAction(&_sequenceManager1, this, 1861, &R2_GLOBALS._player, &_actor1, &_actor6, NULL); + } + } else { + if (R2_GLOBALS.getFlag(29)) { + setAction(&_sequenceManager1, this, 1864, &R2_GLOBALS._player, &_actor1, &_actor7, NULL); + } else { + setAction(&_sequenceManager1, this, 1862, &R2_GLOBALS._player, &_actor1, &_actor6, NULL); + } + } + } + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + _actor1._moveDiff = Common::Point(5, 3); + } else { + R2_GLOBALS._player._moveDiff = Common::Point(5, 3); + _actor1._moveDiff = Common::Point(3, 2); + } + + _actor8.postInit(); + _actor8.setup(1850, 1, 1); + + if (R2_GLOBALS.getFlag(62)) { + _actor8.setPosition(Common::Point(159, 120)); + } else { + _actor8.setPosition(Common::Point(159, 184)); + } + + _actor8.fixPriority(113); + + if (R2_GLOBALS.getFlag(34)) { + _actor8.setDetails(1850, 25, -1, -1, 4, &_actor5); + } else { + _actor8.setDetails(1850, 25, -1, -1, 2, (SceneItem *) NULL); + } + + if (!R2_GLOBALS.getFlag(62)) { + _actor8.hide(); + } + + _item1.setDetails(Rect(0, 0, 320, 200), 1850, 16, -1, -1, 1, NULL); + + R2_GLOBALS._player._oldCharacterScene[1] = 1850; + R2_GLOBALS._player._oldCharacterScene[2] = 1850; +} + +void Scene1850::remove() { + g_globals->_scenePalette.loadPalette(0); + + R2_GLOBALS._scenePalette._palette[771] = 255; + R2_GLOBALS._scenePalette._palette[772] = 255; + R2_GLOBALS._scenePalette._palette[773] = 255; + + SceneExt::remove(); +} + +void Scene1850::signal() { + switch (_sceneMode) { + case 10: + R2_GLOBALS._player._effect = 6; + R2_GLOBALS._player._shade = 6; + + _actor1._effect = 6; + _actor1._shade = 6; + + R2_GLOBALS._walkRegions.enableRegion(5); + + if (R2_GLOBALS.getFlag(68)) { + R2_GLOBALS._player.enableControl(); + } else { + R2_GLOBALS.setFlag(68); + _sceneMode = 20; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(554, this); + } + break; + case 11: + R2_GLOBALS.clearFlag(30); + R2_GLOBALS._sceneManager.changeScene(1800); + break; + case 15: + _sceneMode = 16; + break; + case 16: + _sceneMode = 1870; + setAction(&_sequenceManager1, this, 1870, &R2_GLOBALS._player, &_actor1, &_actor3, &_actor4, NULL); + break; + case 20: + R2_GLOBALS._player.enableControl(CURSOR_TALK); + break; + case 21: + R2_GLOBALS._player.disableControl(); + _sceneMode = 1877; + setAction(&_sequenceManager1, this, 1877, &R2_GLOBALS._player, &_actor1, &_actor5, NULL); + break; + case 30: + R2_GLOBALS._player.disableControl(); + _sceneMode = 1882; + setAction(&_sequenceManager1, this, 1882, &R2_GLOBALS._player, NULL); + break; + case 1852: + // No break on purpose: + case 1853: + if (_field412 == 1851) { + R2_GLOBALS.setFlag(31); + _palette1.loadPalette(1850); + _field412 = 1850; + } else { + R2_GLOBALS.clearFlag(31); + _palette1.loadPalette(1851); + _field412 = 1851; + } + + _field418 = 1; + if (R2_GLOBALS.getFlag(30)) { + _actor8.setAction(&_sequenceManager2, NULL, 1867, &_actor8, NULL); + } else if (R2_GLOBALS.getFlag(34)) { + if (R2_GLOBALS.getFlag(62)) { + R2_GLOBALS.clearFlag(62); + _actor8.setAction(&_sequenceManager2, this, 1851, &_actor8, NULL); + } else { + R2_GLOBALS.setFlag(62); + _actor8.setAction(&_sequenceManager2, this, 1850, &_actor8, NULL); + } + } else if (R2_GLOBALS.getFlag(33)) { + R2_GLOBALS.setFlag(62); + R2_GLOBALS.setFlag(34); + R2_GLOBALS._walkRegions.enableRegion(2); + + _actor2.postInit(); + _actor2.setDetails(1850, 6, -1, -1, 5, &_actor5); + + _sceneMode = 1879; + + _actor8.setAction(&_sequenceManager2, this, 1879, &_actor5, &_actor8, &_actor2, NULL); + } else { + _actor8.setAction(&_sequenceManager2, NULL, 1867, &_actor8, NULL); + } + + if (R2_GLOBALS.getFlag(34)) + R2_GLOBALS._scenePalette.addFader(_palette1._palette, 256, 5, NULL); + else + R2_GLOBALS._scenePalette.addFader(_palette1._palette, 256, 5, this); + + if (_field412 == 1851) + _field416 = -20; + else + _field416 = 20; + + _field414 = 20; + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (_sceneMode == 1879) + _sceneMode = 1854; + + if (R2_GLOBALS.getFlag(32)) { + setAction(&_sequenceManager1, NULL, 1873, &R2_GLOBALS._player, NULL); + } else { + setAction(&_sequenceManager1, NULL, 1854, &R2_GLOBALS._player, NULL); + } + } else { + if (_sceneMode == 1879) + _sceneMode = 1855; + + if (R2_GLOBALS.getFlag(32)) { + setAction(&_sequenceManager1, NULL, 1874, &R2_GLOBALS._player, NULL); + } else { + setAction(&_sequenceManager1, NULL, 1855, &R2_GLOBALS._player, NULL); + } + } + break; + case 1857: + if (R2_GLOBALS.getFlag(69)) { + R2_GLOBALS._player.enableControl(); + R2_GLOBALS._player._canWalk = false; + } else { + _sceneMode = 1858; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(555, this); + R2_GLOBALS.setFlag(69); + } + break; + case 1858: + R2_GLOBALS._player.disableControl(); + _sceneMode = 1859; + setAction(&_sequenceManager1, this, 1859, &R2_GLOBALS._player, &_actor5, NULL); + R2_GLOBALS.clearFlag(30); + break; + case 1859: + R2_GLOBALS.setFlag(70); + _sceneMode = 20; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(575, this); + break; + case 1860: + if (_field41A.x != 0) { + R2_GLOBALS._player.enableControl(); + + PlayerMover *mover = new PlayerMover(); + R2_GLOBALS._player.addMover(mover, &_field41A, this); + + _field41A = Common::Point(0, 0); + } + + switch (_field41E) { + case 1: + _sceneMode = 1853; + if (R2_GLOBALS.getFlag(32)) { + setAction(&_sequenceManager1, this, 1872, &R2_GLOBALS._player, NULL); + } else { + setAction(&_sequenceManager1, this, 1853, &R2_GLOBALS._player, NULL); + } + break; + case 2: + _sceneMode = 11; + setAction(&_sequenceManager1, this, 1865, &R2_GLOBALS._player, &_actor6, NULL); + break; + case 3: + warning("_field41E == 3"); + _sceneMode = 11; + setAction(&_sequenceManager1, this, 1866, &R2_GLOBALS._player, &_actor7, NULL); + break; + default: + break; + } + + _field41E = 0; + break; + case 1870: + R2_GLOBALS._walkRegions.enableRegion(5); + R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1); + R2_GLOBALS.setFlag(32); + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + break; + case 1875: + R2_INVENTORY.setObjectScene(R2_AIRBAG, 1850); + _sceneMode = 21; + R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); + _stripManager.start(561, this); + break; + case 1877: + _actor3.postInit(); + _actor3._effect = 6; + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor3.setDetails(1850, 28, -1, -1, 2, (SceneItem *)NULL); + } else { + _actor3.setDetails(1850, 30, -1, -1, 2, (SceneItem *)NULL); + } + + _actor4.postInit(); + _actor4._effect = 6; + + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + _actor4.setDetails(1850, 29, -1, -1, 2, (SceneItem *)NULL); + } else { + _actor4.setDetails(1850, 28, -1, -1, 2, (SceneItem *)NULL); + } + + if (R2_GLOBALS.getFlag(31)) { + _actor3._shade = 0; + _actor4._shade = 0; + } else { + _actor3._shade = 6; + _actor4._shade = 6; + } + + R2_GLOBALS.clearFlag(30); + _sceneMode = 15; + setAction(&_sequenceManager1, this, 1869, &R2_GLOBALS._player, &_actor3, NULL); + setAction(&_sequenceManager2, this, 1868, &_actor1, &_actor4, NULL); + break; + case 1878: + R2_INVENTORY.setObjectScene(R2_REBREATHER_TANK, 1850); + R2_GLOBALS.setFlag(33); + R2_GLOBALS._walkRegions.enableRegion(2); + R2_GLOBALS._player.enableControl(); + break; + case 1879: + R2_GLOBALS._player.enableControl(); + break; + case 1881: + R2_GLOBALS._sceneManager.changeScene(1875); + break; + case 1882: + R2_INVENTORY.setObjectScene(R2_AIRBAG, 1); + R2_GLOBALS._player.enableControl(); + break; + default: + R2_GLOBALS._player.enableControl(); + break; + } +} + +void Scene1850::process(Event &event) { + if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_ARROW) + && (R2_GLOBALS._player._characterIndex == R2_SEEKER) && (R2_GLOBALS.getFlag(30))) { + _field41A = event.mousePos; + R2_GLOBALS._player.disableControl(); + _sceneMode = 1860; + if (R2_GLOBALS.getFlag(32)) { + setAction(&_sequenceManager1, this, 1860, &R2_GLOBALS._player, &_actor5, NULL); + } else { + setAction(&_sequenceManager1, this, 1859, &R2_GLOBALS._player, &_actor5, NULL); + } + R2_GLOBALS.clearFlag(32); + event.handled = true; + } + + Scene::process(event); +} + +void Scene1850::dispatch() { + if (_field418 != 0) { + _field414--; + if (_field414 == 0) + _field418 = 0; + + if (_field416 >= 0) { + R2_GLOBALS._player._shade = (_field414 * 6) / _field416; + } else { + R2_GLOBALS._player._shade = ((_field414 * 6) / _field416) + 6; + } + R2_GLOBALS._player._flags |= OBJFLAG_PANES; + + _actor1._shade = R2_GLOBALS._player._shade; + _actor1._flags |= OBJFLAG_PANES; + + _actor3._shade = R2_GLOBALS._player._shade; + _actor3._flags |= OBJFLAG_PANES; + + _actor4._shade = R2_GLOBALS._player._shade; + _actor4._flags |= OBJFLAG_PANES; + } + + if (R2_GLOBALS.getFlag(32)) { + _actor3.setPosition(Common::Point(_actor8._position.x - 37, _actor8._position.y - 71)); + _actor4.setPosition(Common::Point(_actor8._position.x - 20, _actor8._position.y - 73)); + } + + if (R2_INVENTORY.getObjectScene(R2_AIRBAG) == 1850) { + _actor2.setPosition(Common::Point(_actor8._position.x + 20, _actor8._position.y - 71)); + } + + Scene::dispatch(); +} + +/*-------------------------------------------------------------------------- * Scene 1875 - * *--------------------------------------------------------------------------*/ @@ -11231,10 +12010,10 @@ void Scene1900::postInit(SceneObjectList *OwnerList) { _stripManager.setFontNumber(3); _stripManager.addSpeaker(&_seekerSpeaker); - _exit1.setDetails(Rect(0, 105, 14, 145), R2_9, 2000); + _exit1.setDetails(Rect(0, 105, 14, 145), R2_COM_SCANNER, 2000); _exit1.setDest(Common::Point(14, 135)); - _exit2.setDetails(Rect(305, 105, 320, 145), R2_10, 2000); + _exit2.setDetails(Rect(305, 105, 320, 145), R2_SPENT_POWER_CAPSULE, 2000); _exit2.setDest(Common::Point(315, 135)); R2_GLOBALS._player.postInit(); @@ -11752,7 +12531,7 @@ bool Scene1945::Hotspot3::startAction(CursorType action, Event &event) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_37: + case R2_GUNPOWDER: R2_GLOBALS._player.disableControl(); scene->_sceneMode = 0; if ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) @@ -11817,7 +12596,7 @@ bool Scene1945::Hotspot4::startAction(CursorType action, Event &event) { } bool Scene1945::Actor3::startAction(CursorType action, Event &event) { - if ((action == R2_50) && (action == R2_49)) { + if ((action == R2_ALCOHOL_LAMP_3) && (action == R2_ALCOHOL_LAMP_2)) { Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; scene->_fieldEAE = action; @@ -11981,7 +12760,7 @@ void Scene1945::signal() { } return; case 1942: - R2_INVENTORY.setObjectScene(R2_37, 0); + R2_INVENTORY.setObjectScene(R2_GUNPOWDER, 0); _actor3.setDetails(1945, 15, -1, -1, 2, (SceneItem *) NULL); R2_GLOBALS.setFlag(42); break; @@ -12239,7 +13018,7 @@ bool Scene1950::Hotspot2::startAction(CursorType action, Event &event) { } bool Scene1950::Actor2::startAction(CursorType action, Event &event) { - if (action != R2_31) + if (action != R2_SCRITH_KEY) return SceneActor::startAction(action, event); Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; @@ -12416,7 +13195,7 @@ void Scene1950::Actor8::signal() { bool Scene1950::Actor8::startAction(CursorType action, Event &event) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - if ((R2_GLOBALS._v56613[(scene->_field41C - 1) * 4] == 0) || (action != R2_44)) + if ((R2_GLOBALS._v56613[(scene->_field41C - 1) * 4] == 0) || (action != R2_PHOTON_STUNNER)) return SceneActor::startAction(action, event); R2_GLOBALS._player.disableControl(); @@ -13826,7 +14605,7 @@ void Scene1950::signal() { void Scene1950::process(Event &event) { if ( (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._player._uiEnabled) - && (R2_GLOBALS._events.getCursor() == R2_47) + && (R2_GLOBALS._events.getCursor() == R2_LIGHT_BULB) && (R2_GLOBALS._player._bounds.contains(event.mousePos)) && (R2_INVENTORY.getObjectScene(31) == 0)) { event.handled = true; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 4c412dbcb0..5906030c5f 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -263,7 +263,7 @@ public: ASound _aSound1; ASound _aSound2; BackgroundSceneObject _background1; - int _fieldA30; + bool _autoplay; unkObj1337_1 _arrunkObj1337[4]; SceneItem _item1; SceneObject _object1; @@ -879,6 +879,58 @@ public: virtual void saveCharacter(int characterIndex); }; +class Scene1850 : public SceneExt { + class Hotspot2 : public NamedHotspot { + public: + virtual bool startAction(CursorType action, Event &event); + }; + + class Actor5 : public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Actor6 : public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class Actor8 : public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + +public: + int _field412; + int _field414; + int _field416; + int _field418; + Common::Point _field41A; + int _field41E; + ScenePalette _palette1; + SpeakerQuinn _quinnSpeaker; + SpeakerSeeker _seekerSpeaker; + NamedHotspot _item1; + Hotspot2 _item2; + SceneActor _actor1; + SceneActor _actor2; + SceneActor _actor3; + SceneActor _actor4; + Actor5 _actor5; + Actor6 _actor6; + Actor6 _actor7; + Actor8 _actor8; + SequenceManager _sequenceManager1; + SequenceManager _sequenceManager2; + + Scene1850(); + void synchronize(Serializer &s); + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void remove(); + virtual void signal(); + virtual void process(Event &event); + virtual void dispatch(); +}; + class Scene1875 : public SceneExt { class Actor1875 : public SceneActor { public: diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index 3cc541493d..5567519046 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1269,13 +1269,13 @@ void Scene2400::signal() { bool Scene2425::Item1::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_37) && (!R2_GLOBALS.getFlag(84))) { + if ((action == R2_GUNPOWDER) && (!R2_GLOBALS.getFlag(84))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2426; scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_actor1, NULL); R2_GLOBALS.setFlag(84); return true; - } else if (action == R2_37) { + } else if (action == R2_GUNPOWDER) { R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); return NamedHotspot::startAction(R2_STEPPING_DISKS, event); @@ -1286,13 +1286,13 @@ bool Scene2425::Item1::startAction(CursorType action, Event &event) { bool Scene2425::Item2::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_37) && (R2_GLOBALS.getFlag(84))) { + if ((action == R2_GUNPOWDER) && (R2_GLOBALS.getFlag(84))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2427; scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_actor1, NULL); R2_GLOBALS.clearFlag(84); return true; - } else if (action == R2_37) { + } else if (action == R2_GUNPOWDER) { R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); R2_GLOBALS._player.enableControl(R2_STEPPING_DISKS); return NamedHotspot::startAction(R2_STEPPING_DISKS, event); @@ -1303,7 +1303,7 @@ bool Scene2425::Item2::startAction(CursorType action, Event &event) { bool Scene2425::Item3::startAction(CursorType action, Event &event) { Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if (action != R2_37) + if (action != R2_GUNPOWDER) return NamedHotspot::startAction(action, event); else { R2_GLOBALS._player.disableControl(); @@ -1320,7 +1320,7 @@ bool Scene2425::Item3::startAction(CursorType action, Event &event) { } bool Scene2425::Item4::startAction(CursorType action, Event &event) { - if (action != R2_37) + if (action != R2_GUNPOWDER) return NamedHotspot::startAction(action, event); else { R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); @@ -1332,19 +1332,19 @@ bool Scene2425::Item4::startAction(CursorType action, Event &event) { bool Scene2425::Actor1::startAction(CursorType action, Event &event) { if (action == R2_STEPPING_DISKS) { if (R2_GLOBALS._player._characterIndex == 2) { - R2_GLOBALS._events.setCursor(R2_37); + R2_GLOBALS._events.setCursor(R2_GUNPOWDER); return true; } else { return SceneActor::startAction(action, event); } - } else if (R2_GLOBALS._events.getCursor() == R2_37) + } else if (R2_GLOBALS._events.getCursor() == R2_GUNPOWDER) return false; else return SceneActor::startAction(action, event); } bool Scene2425::Actor2::startAction(CursorType action, Event &event) { - if (action != R2_37) + if (action != R2_GUNPOWDER) return SceneActor::startAction(action, event); else { R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); @@ -1601,12 +1601,12 @@ void Scene2430::signal() { break; case 2430: _actor2.remove(); - R2_INVENTORY.setObjectScene(R2_37, 2); + R2_INVENTORY.setObjectScene(R2_GUNPOWDER, 2); R2_GLOBALS._player.enableControl(); break; case 2435: _actor3.remove(); - R2_INVENTORY.setObjectScene(R2_50, 2); + R2_INVENTORY.setObjectScene(R2_ALCOHOL_LAMP_3, 2); R2_GLOBALS._player.enableControl(); break; default: @@ -1627,18 +1627,18 @@ bool Scene2435::Actor2::startAction(CursorType action, Event &event) { Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_34: + case R2_SAPPHIRE_BLUE: R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS.setFlag(82); scene->_stripManager.start(603, scene); return true; - case R2_35: + case R2_ANCIENT_SCROLLS: R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS.setFlag(82); scene->_stripManager.start(602, scene); - R2_INVENTORY.setObjectScene(R2_35, 2000); + R2_INVENTORY.setObjectScene(R2_ANCIENT_SCROLLS, 2000); return true; case CURSOR_TALK: R2_GLOBALS._player.disableControl(); @@ -1647,7 +1647,7 @@ bool Scene2435::Actor2::startAction(CursorType action, Event &event) { if ((R2_GLOBALS._player._characterIndex == 1) || (R2_GLOBALS.getFlag(82))) { scene->_stripManager.start(605, scene); return true; - } else if (R2_INVENTORY.getObjectScene(R2_35) == 2) { + } else if (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2) { scene->_stripManager.start(601, scene); return true; } else { @@ -2204,7 +2204,7 @@ void Scene2450::signal() { bool Scene2455::Actor1::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_29) { + if (action == R2_GLASS_DOME) { if ((R2_INVENTORY.getObjectScene(49) == 2455) || (R2_INVENTORY.getObjectScene(50) == 2455)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2458; @@ -2224,7 +2224,7 @@ bool Scene2455::Actor2::startAction(CursorType action, Event &event) { Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_49: + case R2_ALCOHOL_LAMP_2: if (R2_INVENTORY.getObjectScene(50) != 2455) { R2_GLOBALS._player.disableControl(); scene->_actor1.postInit(); @@ -2236,7 +2236,7 @@ bool Scene2455::Actor2::startAction(CursorType action, Event &event) { return true; } break; - case R2_50: + case R2_ALCOHOL_LAMP_3: if (R2_INVENTORY.getObjectScene(49) != 2455) { R2_GLOBALS._player.disableControl(); scene->_actor1.postInit(); @@ -3513,7 +3513,7 @@ void Scene2700::signal() { } void Scene2700::process(Event &event) { if ((R2_GLOBALS._player._canWalk) && (event.eventType == EVENT_BUTTON_DOWN)) { - if (R2_GLOBALS._events.getCursor() == R2_36) { + if (R2_GLOBALS._events.getCursor() == R2_FLUTE) { if (R2_GLOBALS._player._bounds.contains(event.mousePos)) { _sceneMode = 10; _field414 = 2710; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 99bcf3df44..2b97cba8e9 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -385,7 +385,7 @@ bool Scene3150::Item5::startAction(CursorType action, Event &event) { scene->_sceneMode = 3154; scene->setAction(&scene->_sequenceManager, scene, 3154, &R2_GLOBALS._player, &scene->_actor3, NULL); return true; - case R2_40: + case R2_SUPERCONDUCTOR_WIRE: if ((R2_INVENTORY.getObjectScene(47) != 3150) && (R2_GLOBALS.getFlag(75))) { R2_GLOBALS._player.disableControl(); scene->_actor3.postInit(); @@ -407,7 +407,7 @@ bool Scene3150::Item6::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; switch (action) { - case R2_41: + case R2_PILLOW: R2_GLOBALS._player.disableControl(); scene->_actor4.postInit(); scene->_actor4._effect = 6; @@ -416,7 +416,7 @@ bool Scene3150::Item6::startAction(CursorType action, Event &event) { scene->_sceneMode = 3158; scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_actor4, NULL); return true; - case R2_42: + case R2_FOOD_TRAY: if ((R2_INVENTORY.getObjectScene(47) != 3150) && (R2_INVENTORY.getObjectScene(40) == 3150) && (R2_GLOBALS.getFlag(75))) { scene->_actor5.postInit(); scene->_actor5._effect = 6; @@ -447,7 +447,7 @@ bool Scene3150::Actor4::startAction(CursorType action, Event &event) { scene->_sceneMode = 3151; scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_actor4, NULL); return true; - case R2_42: + case R2_FOOD_TRAY: return false; default: return SceneActor::startAction(action, event); @@ -498,7 +498,7 @@ bool Scene3150::Actor6::startAction(CursorType action, Event &event) { bool Scene3150::Actor7::startAction(CursorType action, Event &event) { Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_43) && (!R2_GLOBALS.getFlag(80))) { + if ((action == R2_LASER_HACKSAW) && (!R2_GLOBALS.getFlag(80))) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3160; scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_actor7, NULL); @@ -4325,7 +4325,7 @@ bool Scene3600::Actor13::startAction(CursorType action, Event &event) { return true; case R2_SONIC_STUNNER: // No break on purpose - case R2_44: + case R2_PHOTON_STUNNER: if (action == R2_SONIC_STUNNER) R2_GLOBALS._sound3.play(43); else diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp index 428bf8c038..ca9fddc6ce 100644 --- a/engines/tsage/user_interface.cpp +++ b/engines/tsage/user_interface.cpp @@ -82,7 +82,7 @@ void UIQuestion::showDescription(CursorType cursor) { } break; case GType_Ringworld2: - if ((cursor == R2_9) || (cursor == R2_39)) { + if ((cursor == R2_COM_SCANNER) || (cursor == R2_COM_SCANNER_2)) { // Show communicator warning("TODO: Communicator"); } else { |