aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-06-06 22:45:14 +0200
committerStrangerke2014-06-06 22:45:14 +0200
commit23abf274a7a2f3de00d1e203b3675785af3184d1 (patch)
tree4de03923ce815779b0f62992645b440f737e201e
parentec0d6b916ddc2dd5bd232a2909b4a035eea4a4c8 (diff)
downloadscummvm-rg350-23abf274a7a2f3de00d1e203b3675785af3184d1.tar.gz
scummvm-rg350-23abf274a7a2f3de00d1e203b3675785af3184d1.tar.bz2
scummvm-rg350-23abf274a7a2f3de00d1e203b3675785af3184d1.zip
CRUISE: Fix CppCheck warnings in gfxModule
-rw-r--r--engines/cruise/gfxModule.cpp14
1 files changed, 6 insertions, 8 deletions
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) {