diff options
-rw-r--r-- | engines/cruise/function.cpp | 40 | ||||
-rw-r--r-- | engines/cruise/gfxModule.cpp | 14 | ||||
-rw-r--r-- | engines/cruise/linker.cpp | 8 | ||||
-rw-r--r-- | engines/cruise/menu.cpp | 3 | ||||
-rw-r--r-- | engines/cruise/object.cpp | 12 | ||||
-rw-r--r-- | engines/cruise/perso.cpp | 15 |
6 files changed, 48 insertions, 44 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index a026bbe0c1..8833efc280 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -196,13 +196,22 @@ int16 Op_Random() { int16 Op_PlayFX() { int volume = popVar(); + +#if 0 int speed = popVar(); - /*int channelNum = */popVar(); + int channelNum = popVar(); +#else + popVar(); + popVar(); +#endif + int sampleNum = popVar(); if ((sampleNum >= 0) && (sampleNum < NUM_FILE_ENTRIES) && (filesDatabase[sampleNum].subData.ptr)) { +#if 0 if (speed == -1) speed = filesDatabase[sampleNum].subData.transparency; +#endif _vm->sound().playSound(filesDatabase[sampleNum].subData.ptr, filesDatabase[sampleNum].width, volume); @@ -213,13 +222,23 @@ int16 Op_PlayFX() { int16 Op_LoopFX() { int volume = popVar(); + +#if 0 int speed = popVar(); - /*int channelNum = */popVar(); + int channelNum = popVar(); +#else + popVar(); + popVar(); +#endif + int sampleNum = popVar(); if ((sampleNum >= 0) && (sampleNum < NUM_FILE_ENTRIES) && (filesDatabase[sampleNum].subData.ptr)) { + +#if 0 if (speed == -1) speed = filesDatabase[sampleNum].subData.transparency; +#endif _vm->sound().playSound(filesDatabase[sampleNum].subData.ptr, filesDatabase[sampleNum].width, volume); @@ -552,15 +571,13 @@ int16 Op_LoadFrame() { } int16 Op_LoadAbs() { - int slot; - char name[36] = ""; - char *ptr; int result = 0; - ptr = (char *) popPtr(); - slot = popVar(); + char *ptr = (char *) popPtr(); + int slot = popVar(); if ((slot >= 0) && (slot < NUM_FILE_ENTRIES)) { + char name[36] = ""; Common::strlcpy(name, ptr, sizeof(name)); strToUpper(name); @@ -1360,12 +1377,11 @@ int16 Op_RestoreSong() { } int16 Op_SongSize() { - int size, oldSize; - + int oldSize; if (_vm->sound().songLoaded()) { oldSize = _vm->sound().numOrders(); - size = popVar(); + int size = popVar(); if ((size >= 1) && (size < 128)) _vm->sound().setNumOrders(size); } else @@ -1495,8 +1511,6 @@ int16 Op_Itoa() { int nbp = popVar(); int param[160]; char txt[40]; - char format[30]; - char nbf[20]; for (int i = nbp - 1; i >= 0; i--) param[i] = popVar(); @@ -1507,6 +1521,8 @@ int16 Op_Itoa() { if (!nbp) sprintf(txt, "%d", val); else { + char format[30]; + char nbf[20]; strcpy(format, "%"); sprintf(nbf, "%d", param[0]); strcat(format, nbf); diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index e3e7a2d510..9fd94d7ea6 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -121,12 +121,10 @@ void gfxModuleData_setPalColor(int idx, int r, int g, int b) { } void gfxModuleData_setPalEntries(const byte *ptr, int start, int num) { - int R, G, B, i; - - for (i = start; i < start + num; i++) { - R = *(ptr++); - G = *(ptr++); - B = *(ptr++); + for (int i = start; i < start + num; i++) { + int R = *(ptr++); + int G = *(ptr++); + int B = *(ptr++); lpalette[i].R = R; lpalette[i].G = G; @@ -339,7 +337,6 @@ void resetBitmap(uint8 *dataPtr, int32 dataSize) { */ void switchBackground(const byte *newBg) { const byte *bg = gfxModuleData.pPage00; - int sliceXStart, sliceXEnd; // If both the upper corners are different, presume it's a full screen change if ((*newBg != *bg) && (*(newBg + 319) != *(bg + 319))) { @@ -352,7 +349,8 @@ void switchBackground(const byte *newBg) { */ for (int yp = 0; yp < 200; ++yp) { - sliceXStart = -1; sliceXEnd = -1; + int sliceXStart = -1; + int sliceXEnd = -1; for (int xp = 0; xp < 320; ++xp, ++bg, ++newBg) { if (*bg != *newBg) { if (sliceXStart == -1) { diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp index 7768e05585..9786de775f 100644 --- a/engines/cruise/linker.cpp +++ b/engines/cruise/linker.cpp @@ -129,8 +129,6 @@ int updateScriptImport(int ovlIdx) { // do it for the 2 first string types do { - int i = 0; - if (param == 0) { var_32 = numData3; } else { @@ -138,16 +136,16 @@ int updateScriptImport(int ovlIdx) { } if (var_32) { + int i = 0; do { importScriptStruct *ptrImportData; const char *ptrImportName; uint8 *ptrData; - if (param == 0) { + if (param == 0) pScript = getOvlData3Entry(ovlIdx, i); - } else { + else pScript = scriptFunc1Sub2(ovlIdx, i); - } ptrImportData = (importScriptStruct *)(pScript->dataPtr + pScript->offsetToImportData); // import data ptrImportName = (const char*)(pScript->dataPtr + pScript->offsetToImportName); // import name diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index 8f162ee1ad..0a497202e2 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -233,7 +233,6 @@ static void handleSaveLoad(bool saveFlag) { } int playerMenu(int menuX, int menuY) { - int retourMenu; //int restartGame = 0; if (playerMenuEnabled && displayOn) { @@ -277,7 +276,7 @@ int playerMenu(int menuX, int menuY) { addSelectableMenuEntry(0, 6, menuTable[0], 1, -1, _vm->langString(ID_RESTART)); addSelectableMenuEntry(0, 7, menuTable[0], 1, -1, _vm->langString(ID_QUIT)); - retourMenu = processMenu(menuTable[0]); + int retourMenu = processMenu(menuTable[0]); freeMenu(menuTable[0]); menuTable[0] = NULL; diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp index 3e61ff4d7d..664627b9a4 100644 --- a/engines/cruise/object.cpp +++ b/engines/cruise/object.cpp @@ -116,14 +116,10 @@ int16 getMultipleObjectParam(int16 overlayIdx, int16 objectIdx, objectParamsQuer } void setObjectPosition(int16 ovlIdx, int16 objIdx, int16 param3, int16 param4) { - objDataStruct *ptr; - objectParams *ptr2; - - ptr = getObjectDataFromOverlay(ovlIdx, objIdx); - - if (!ptr) { + objDataStruct *ptr = getObjectDataFromOverlay(ovlIdx, objIdx); + if (!ptr) return; - } + //overlayTable[param1].ovlData switch (ptr->_class) { @@ -138,7 +134,7 @@ void setObjectPosition(int16 ovlIdx, int16 objIdx, int16 param3, int16 param4) { case UNIQUE: return; case VARIABLE: { - ptr2 = &overlayTable[ovlIdx].ovlData->arrayObjVar[ptr->_varTableIdx]; + objectParams *ptr2 = &overlayTable[ovlIdx].ovlData->arrayObjVar[ptr->_varTableIdx]; switch (param3) { case 0: { // x diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp index 3a599bca22..66c9718b95 100644 --- a/engines/cruise/perso.cpp +++ b/engines/cruise/perso.cpp @@ -172,23 +172,20 @@ void processActorWalk(MovementEntry &resx_y, int16 *inc_droite, int16 *inc_droit int16 *inc_chemin, point* cor_joueur, int16 solution0[NUM_NODES + 3][2], int16 *inc_jo1, int16 *inc_jo2, int16 *dir_perso, int16 *inc_jo0, int16 num) { - int x1, x2, y1, y2; - int i, u; - - u = 0; + int u = 0; inc_jo = *inc_jo0; - i = *inc_chemin; + int i = *inc_chemin; if (!*inc_droite) { - x1 = solution0[i][0]; - y1 = solution0[i][1]; + int x1 = solution0[i][0]; + int y1 = solution0[i][1]; i++; if (solution0[i][0] != -1) { do { if (solution0[i][0] != -2) { - x2 = solution0[i][0]; - y2 = solution0[i][1]; + int x2 = solution0[i][0]; + int y2 = solution0[i][1]; if ((x1 == x2) && (y1 == y2)) { resx_y.x = -1; resx_y.y = -1; |