From 89bbc9c292ea3dd91ed1660cd8f775c4b4fad0f0 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 6 Jan 2013 21:52:28 +0200 Subject: [PATCH] DRASCULA: Fix shadowing warnings (thanks LordHoto), and rename some variables --- engines/drascula/animation.cpp | 16 ++++++++-------- engines/drascula/drascula.cpp | 12 ++++++------ engines/drascula/drascula.h | 2 +- engines/drascula/interface.cpp | 4 ++-- engines/drascula/objects.cpp | 4 ++-- engines/drascula/rooms.cpp | 8 ++++---- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index 53cba9a7a4a..7009752365d 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -862,14 +862,14 @@ void DrasculaEngine::animation_23_2() { int animX, animY; // Animation offsets - without earplugs - int x1[] = {1, 38, 75, 112, 75, 112, 75, 112, 149, 112, 149, 112, 149, 186, 223, 260, - 1, 38, 75, 112, 149, 112, 149, 112, 149, 112, 149, 186, 223, 260, 260, 260, 260, 223}; - int y1[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76, 76, 76, 1, 1, 1, 1}; + int johnFrameX[] = {1, 38, 75, 112, 75, 112, 75, 112, 149, 112, 149, 112, 149, 186, 223, 260, + 1, 38, 75, 112, 149, 112, 149, 112, 149, 112, 149, 186, 223, 260, 260, 260, 260, 223}; + int johnFrameY[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 76, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 76, 76, 1, 1, 1, 1}; // Animation offsets - with earplugs - int x2[] = {1, 35, 69, 103, 137, 171, 205, 239, 273, 1, 35, 69, 103, 137}; - int y2[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 73, 73, 73, 73, 73}; + int john2FrameX[] = {1, 35, 69, 103, 137, 171, 205, 239, 273, 1, 35, 69, 103, 137}; + int john2FrameY[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 73, 73, 73, 73, 73}; loadPic("an24.alg", frontSurface); @@ -922,9 +922,9 @@ void DrasculaEngine::animation_23_2() { for (int n = 0; n < maxN; n++) { copyRect(p_x, p_y, p_x, p_y, animX, animY, bgSurface, screenSurface); if (flags[29] == 0) - copyRect(x1[n], y1[n], p_x, p_y, animX, animY, backSurface, screenSurface); + copyRect(johnFrameX[n], johnFrameY[n], p_x, p_y, animX, animY, backSurface, screenSurface); else - copyRect(x2[n], y2[n], p_x, p_y, animX, animY, backSurface, screenSurface); + copyRect(john2FrameX[n], john2FrameY[n], p_x, p_y, animX, animY, backSurface, screenSurface); updateRefresh(); updateScreen(p_x, p_y, p_x, p_y, animX, animY, screenSurface); updateEvents(); diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 7733a0fd6bc..804881cf9a9 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -670,8 +670,8 @@ bool DrasculaEngine::verify1() { removeObject(); else { for (l = 0; l < numRoomObjs; l++) { - if (mouseX >= x1[l] && mouseY >= y1[l] - && mouseX <= x2[l] && mouseY <= y2[l] && doBreak == 0) { + if (mouseX >= _objectX1[l] && mouseY >= _objectY1[l] + && mouseX <= _objectX2[l] && mouseY <= _objectY2[l] && doBreak == 0) { if (exitRoom(l)) return true; if (doBreak == 1) @@ -684,8 +684,8 @@ bool DrasculaEngine::verify1() { doBreak = 1; for (l = 0; l < numRoomObjs; l++) { - if (mouseX > x1[l] && mouseY > y1[l] - && mouseX < x2[l] && mouseY < y2[l] && doBreak == 0) { + if (mouseX > _objectX1[l] && mouseY > _objectY1[l] + && mouseX < _objectX2[l] && mouseY < _objectY2[l] && doBreak == 0) { roomX = roomObjX[l]; roomY = roomObjY[l]; trackFinal = trackObj[l]; @@ -718,8 +718,8 @@ bool DrasculaEngine::verify2() { return true; } else { for (l = 0; l < numRoomObjs; l++) { - if (mouseX > x1[l] && mouseY > y1[l] - && mouseX < x2[l] && mouseY < y2[l] && visible[l] == 1) { + if (mouseX > _objectX1[l] && mouseY > _objectY1[l] + && mouseX < _objectX2[l] && mouseY < _objectY2[l] && visible[l] == 1) { trackFinal = trackObj[l]; walkToObject = 1; gotoObject(roomObjX[l], roomObjY[l]); diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 3259fa63bc0..e547503bee0 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -417,7 +417,7 @@ public: int inventoryObjects[43]; char _targetSurface[40][20]; int _destX[40], _destY[40], trackCharacter_alkeva[40], roomExits[40]; - int x1[40], y1[40], x2[40], y2[40]; + int _objectX1[40], _objectY1[40], _objectX2[40], _objectY2[40]; int takeObject, pickedObject; bool _subtitlesDisabled; bool _menuBar, _menuScreen, _hasName; diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp index b116562e7d7..70212db9e85 100644 --- a/engines/drascula/interface.cpp +++ b/engines/drascula/interface.cpp @@ -167,8 +167,8 @@ void DrasculaEngine::showMap() { _hasName = false; for (int l = 0; l < numRoomObjs; l++) { - if (mouseX > x1[l] && mouseY > y1[l] - && mouseX < x2[l] && mouseY < y2[l] + if (mouseX > _objectX1[l] && mouseY > _objectY1[l] + && mouseX < _objectX2[l] && mouseY < _objectY2[l] && visible[l] == 1) { strcpy(textName, objName[l]); _hasName = true; diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp index 07b8464de4a..f9f68c33170 100644 --- a/engines/drascula/objects.cpp +++ b/engines/drascula/objects.cpp @@ -100,8 +100,8 @@ void DrasculaEngine::checkObjects() { int l, veo = 0; for (l = 0; l < numRoomObjs; l++) { - if (mouseX > x1[l] && mouseY > y1[l] - && mouseX < x2[l] && mouseY < y2[l] + if (mouseX > _objectX1[l] && mouseY > _objectY1[l] + && mouseX < _objectX2[l] && mouseY < _objectY2[l] && visible[l] == 1 && isDoor[l] == 0) { strcpy(textName, objName[l]); _hasName = true; diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index ffac20acc82..9f707eaa078 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -1712,10 +1712,10 @@ void DrasculaEngine::enterRoom(int roomIndex) { for (l = 0; l < numRoomObjs; l++) { p.parseInt(objectNum[l]); p.parseString(objName[l]); - p.parseInt(x1[l]); - p.parseInt(y1[l]); - p.parseInt(x2[l]); - p.parseInt(y2[l]); + p.parseInt(_objectX1[l]); + p.parseInt(_objectY1[l]); + p.parseInt(_objectX2[l]); + p.parseInt(_objectY2[l]); p.parseInt(roomObjX[l]); p.parseInt(roomObjY[l]); p.parseInt(trackObj[l]);