aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorStrangerke2014-06-06 23:18:47 +0200
committerStrangerke2014-06-06 23:18:47 +0200
commit3c1c080c3a236ca9aac40d7f04f82b57ec879cbe (patch)
tree5025288665b5972ed54bd8cb021795627869762d /engines/cruise
parent3dcfa95b44ec47c6eff1de03f946e2ac20bed29e (diff)
downloadscummvm-rg350-3c1c080c3a236ca9aac40d7f04f82b57ec879cbe.tar.gz
scummvm-rg350-3c1c080c3a236ca9aac40d7f04f82b57ec879cbe.tar.bz2
scummvm-rg350-3c1c080c3a236ca9aac40d7f04f82b57ec879cbe.zip
CRUISE: Fix some more CppCheck warnings
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/mainDraw.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index 0e39740822..31fafbb641 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -479,10 +479,7 @@ void buildSegment() {
// swap again ?
SWAP(X1, X2);
- int patchAdd = 2;
-
int dy = Y2 - Y1;
-
if (dy == 0) {
// hline
int16* ptr = (Y1 - ydep) * 2 + XMIN_XMAX + 1;
@@ -503,6 +500,8 @@ void buildSegment() {
ptr[1] = SI;
}
} else {
+ int patchAdd = 2;
+
if (dy < 0) {
dy = -dy;
patchAdd = -2;
@@ -721,7 +720,6 @@ void buildPolyModel(int positionX, int positionY, int scale, char *pMask, char *
int startX = 0; // first X in model
int startY = 0; // first Y in model
int x = 0; // current X
- int y = 0; // current Y
int offsetXinModel = 0; // offset of the X value in the model
int offsetYinModel = 0; // offset of the Y value in the model
unsigned char *dataPointer = (unsigned char *)dataPtr;
@@ -761,9 +759,8 @@ void buildPolyModel(int positionX, int positionY, int scale, char *pMask, char *
startY >>= 1;
}
- if (m_flipLeftRight) {
+ if (m_flipLeftRight)
startX = -startX;
- }
/*
* NOTE:
@@ -796,7 +793,7 @@ void buildPolyModel(int positionX, int positionY, int scale, char *pMask, char *
ptrPoly_1_Buf++;
offsetXinModel = x;
- y = *(dataPointer) - m_first_Y;
+ int y = *(dataPointer) - m_first_Y;
dataPointer++;
if (m_useSmallScale) {
y >>= 1;
@@ -881,7 +878,6 @@ bool findPoly(char* dataPtr, int positionX, int positionY, int scale, int mouseX
int startX = 0; // first X in model
int startY = 0; // first Y in model
int x = 0; // current X
- int y = 0; // current Y
int offsetXinModel = 0; // offset of the X value in the model
int offsetYinModel = 0; // offset of the Y value in the model
unsigned char *dataPointer = (unsigned char *)dataPtr;
@@ -955,11 +951,11 @@ bool findPoly(char* dataPtr, int positionX, int positionY, int scale, int mouseX
ptrPoly_1_Buf++;
offsetXinModel = x;
- y = *(dataPointer) - m_first_Y;
+ int y = *(dataPointer) - m_first_Y;
dataPointer++;
- if (m_useSmallScale) {
+ if (m_useSmallScale)
y >>= 1;
- }
+
ptrPoly_1_Buf[0] = -(offsetYinModel - y);
ptrPoly_1_Buf++;
offsetYinModel = y;
@@ -1150,10 +1146,6 @@ void drawMessage(const gfxEntryStruct *pGfxPtr, int globalX, int globalY, int wi
// this is used for font only
if (pGfxPtr) {
- uint8 *initialOuput;
- uint8 *output;
- int xp, yp;
- int x, y;
const uint8 *ptr = pGfxPtr->imagePtr;
int height = pGfxPtr->height;
@@ -1172,14 +1164,14 @@ void drawMessage(const gfxEntryStruct *pGfxPtr, int globalX, int globalY, int wi
gfxModuleData_addDirtyRect(Common::Rect(globalX, globalY, globalX + width, globalY + height));
- initialOuput = ouputPtr + (globalY * 320) + globalX;
+ uint8 *initialOuput = ouputPtr + (globalY * 320) + globalX;
- for (yp = 0; yp < height; yp++) {
- output = initialOuput + 320 * yp;
- y = globalY + yp;
+ for (int yp = 0; yp < height; yp++) {
+ uint8 *output = initialOuput + 320 * yp;
+ int y = globalY + yp;
- for (xp = 0; xp < pGfxPtr->width; xp++) {
- x = globalX + xp;
+ for (int xp = 0; xp < pGfxPtr->width; xp++) {
+ int x = globalX + xp;
uint8 color = *(ptr++);
if (color) {