diff options
author | Travis Howell | 2006-02-23 11:05:58 +0000 |
---|---|---|
committer | Travis Howell | 2006-02-23 11:05:58 +0000 |
commit | 26e0d95ef46c68794d8706c870e8a958b625cf4c (patch) | |
tree | e8570e7a2ac876ba3f75f7b4f5e09add1f8bdaf2 /engines | |
parent | c9d6277d27160bda4738be60d78c4e381a271dcb (diff) | |
download | scummvm-rg350-26e0d95ef46c68794d8706c870e8a958b625cf4c.tar.gz scummvm-rg350-26e0d95ef46c68794d8706c870e8a958b625cf4c.tar.bz2 scummvm-rg350-26e0d95ef46c68794d8706c870e8a958b625cf4c.zip |
Fix a few compile warnings.
svn-id: r20826
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cine/object.cpp | 14 | ||||
-rw-r--r-- | engines/cine/script.cpp | 51 | ||||
-rw-r--r-- | engines/cine/various.cpp | 16 |
3 files changed, 34 insertions, 47 deletions
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp index 606484ea33..38ed864455 100644 --- a/engines/cine/object.cpp +++ b/engines/cine/object.cpp @@ -212,11 +212,9 @@ void setupObject(uint8 objIdx, uint16 param1, uint16 param2, uint16 param3, uint } void subObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) { - ASSERT(objIdx <= NUM_MAX_OBJECT); - paramIdx--; - ASSERT(paramIdx >= 0 && paramIdx <= 5); + ASSERT(paramIdx <= 5); switch (paramIdx) { case 0: @@ -257,11 +255,9 @@ void subObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) { } void addObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) { - ASSERT(objIdx <= NUM_MAX_OBJECT); - paramIdx--; - ASSERT(paramIdx >= 0 && paramIdx <= 5); + ASSERT(paramIdx <= 5); switch (paramIdx) { case 0: @@ -302,11 +298,9 @@ void addObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) { } void modifyObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) { - ASSERT(objIdx <= NUM_MAX_OBJECT); - paramIdx--; - ASSERT(paramIdx >= 0 && paramIdx <= 5); + ASSERT(paramIdx <= 5); switch (paramIdx) { case 0: @@ -450,7 +444,7 @@ int16 getObjectParam(uint16 objIdx, uint16 paramIdx) { paramIdx--; - ASSERT(paramIdx >= 0 && paramIdx <= 5); + ASSERT(paramIdx <= 5); switch (paramIdx) { case 0: diff --git a/engines/cine/script.cpp b/engines/cine/script.cpp index 386adfd82f..7e21ac0efe 100644 --- a/engines/cine/script.cpp +++ b/engines/cine/script.cpp @@ -428,18 +428,18 @@ uint16 computeScriptStackFromScript(byte *scriptPtr, uint16 currentPosition, (uint16) scriptSize, labelIdx, currentPosition); } -void palRotate(uint8 var1, uint8 var2, uint8 var3) { +void palRotate(uint8 a, uint8 b, uint8 c) { int16 i; uint16 currentColor; - if (var3 == 1) { - currentColor = c_palette[var2]; + if (c == 1) { + currentColor = c_palette[b]; - for (i = var2; i > var1; i--) { + for (i = b; i > a; i--) { c_palette[i] = c_palette[i - 1]; } - c_palette[var1] = currentColor; + c_palette[a] = currentColor; } } @@ -606,18 +606,18 @@ int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneI return 0; } -uint16 compareVars(int16 var1, int16 var2) { +uint16 compareVars(int16 a, int16 b) { uint16 flag = 0; - if (var1 == var2) { + if (a == b) { flag |= 1; } - if (var1 > var2) { + if (a > b) { flag |= 2; } - if (var1 < var2) { + if (a < b) { flag |= 4; } @@ -1241,7 +1241,6 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { varIdx, value); ASSERT(varIdx < 50); - ASSERT(value < 256); scriptElement->compareResult = compareVars(scriptElement-> @@ -1440,7 +1439,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { labelIdx); ASSERT(scriptElement->stack[labelIdx] != - 0xFFFF); + -1); currentPosition = scriptElement->stack[labelIdx]; @@ -1459,7 +1458,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { DEBUG_SCRIPT(currentLine, "if(>) goto %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = scriptElement->stack[labelIdx]; } else { @@ -1482,7 +1481,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { DEBUG_SCRIPT(currentLine, "if(>=) goto %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = scriptElement->stack[labelIdx]; } else { @@ -1506,7 +1505,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { DEBUG_SCRIPT(currentLine, "if(<) goto %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = scriptElement->stack[labelIdx]; } else { @@ -1529,7 +1528,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { DEBUG_SCRIPT(currentLine, "if(<=) goto %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = scriptElement->stack[labelIdx]; } else { @@ -1552,7 +1551,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { DEBUG_SCRIPT(currentLine, "if(==) goto %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = scriptElement->stack[labelIdx]; } else { @@ -1575,7 +1574,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { DEBUG_SCRIPT(currentLine, "if(!=) goto %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = scriptElement->stack[labelIdx]; } else { @@ -1605,7 +1604,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { "loop(var[%]) goto %d (continue)", varIdx, labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = scriptElement->stack[labelIdx]; } else { @@ -2390,7 +2389,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { "if(>) goto nearest %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = computeScriptStackFromScript (scriptElement->scriptPtr, @@ -2419,7 +2418,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { "if(>=) goto nearest %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = computeScriptStackFromScript (scriptElement->scriptPtr, @@ -2448,7 +2447,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { "if(<) goto nearest %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = computeScriptStackFromScript (scriptElement->scriptPtr, @@ -2477,7 +2476,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { "if(<=) goto nearest %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = computeScriptStackFromScript (scriptElement->scriptPtr, @@ -2505,7 +2504,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { "if(==) goto nearest %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = computeScriptStackFromScript (scriptElement->scriptPtr, @@ -2533,7 +2532,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { "if(!=) goto nearest %d (true)", labelIdx); ASSERT(scriptElement-> - stack[labelIdx] != 0xFFFF); + stack[labelIdx] != -1); currentPosition = computeScriptStackFromScript (scriptElement->scriptPtr, @@ -2645,7 +2644,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { DEBUG_SCRIPT(currentLine, "useBg(%d)", temp); - ASSERT(temp >= 0 && temp <= 8); + ASSERT(temp <= 8); if (additionalBgTable[temp]) { currentAdditionalBgIdx = temp; @@ -2665,7 +2664,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 param) { DEBUG_SCRIPT(currentLine, "useBgScroll(%d)", temp); - ASSERT(temp >= 0 && temp <= 8); + ASSERT(temp <= 8); if (additionalBgTable[temp]) { currentAdditionalBgIdx2 = temp; diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index e677dbd036..0a9fd4db75 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -1345,7 +1345,7 @@ void makeCommandLine(void) { } else { if (playerCommand == 2) { getMouseData(mouseUpdateStatus, &dummyU16, &x, &y); - processInventory(x, y + 8); + //processInventory(x, y + 8); playerCommand = -1; commandVar1 = 0; strcpy(commandBuffer, ""); @@ -2657,9 +2657,7 @@ void drawOverlays(void) { int16 x; int16 y; - ASSERT(currentOverlay->objIdx >= 0 - && currentOverlay->objIdx <= - NUM_MAX_OBJECT); + ASSERT(currentOverlay->objIdx <= NUM_MAX_OBJECT); objPtr = &objectTable[currentOverlay->objIdx]; @@ -2755,9 +2753,7 @@ void drawOverlays(void) { int16 x; int16 y; - ASSERT(currentOverlay->objIdx >= 0 - && currentOverlay->objIdx <= - NUM_MAX_OBJECT); + ASSERT(currentOverlay->objIdx <= NUM_MAX_OBJECT); objPtr = &objectTable[currentOverlay->objIdx]; @@ -2794,9 +2790,7 @@ void drawOverlays(void) { var5 = currentOverlay->x; - ASSERT(currentOverlay->objIdx >= 0 - && currentOverlay->objIdx <= - NUM_MAX_OBJECT); + ASSERT(currentOverlay->objIdx <= NUM_MAX_OBJECT); objPtr = &objectTable[currentOverlay->objIdx]; @@ -2804,7 +2798,7 @@ void drawOverlays(void) { y = objPtr->y; if (objPtr->frame >= 0) { - if (var5 >= 0 && var5 <= 8) { + if (var5 <= 8) { if (additionalBgTable[var5]) { if (animDataTable [objPtr->frame]. |