Skip to content

Commit

Permalink
CRUISE: Fix CppCheck warnings in gfxModule
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jun 6, 2014
1 parent ec0d6b9 commit 23abf27
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions engines/cruise/gfxModule.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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))) {
Expand All @@ -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) {
Expand Down

0 comments on commit 23abf27

Please sign in to comment.