aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-11-14 22:20:34 +0000
committerTorbjörn Andersson2008-11-14 22:20:34 +0000
commit7d3e9b3d35d05dfd19fc3edcdc8c03c6cee7aa35 (patch)
tree8d89a88221ccf80d11360108c276b694dfdf5c67
parent5a0556f09ca89886fda55d333745a672ea14e022 (diff)
downloadscummvm-rg350-7d3e9b3d35d05dfd19fc3edcdc8c03c6cee7aa35.tar.gz
scummvm-rg350-7d3e9b3d35d05dfd19fc3edcdc8c03c6cee7aa35.tar.bz2
scummvm-rg350-7d3e9b3d35d05dfd19fc3edcdc8c03c6cee7aa35.zip
Oops, my last commit introduced some warnings.
svn-id: r35063
-rw-r--r--engines/igor/igor.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index a3dbb57a52..d9055fa4f7 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -1301,28 +1301,27 @@ void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
void IgorEngine::drawInventory(int start, int mode) {
loadData(IMG_InventoryPanel, _inventoryPanelBuffer);
loadData(IMG_Objects, _inventoryImagesBuffer);
+ int y, i;
int end = start + 6;
- if (start <= end) {
- int x = 1;
- for (int y = start; y != end; ++y) {
- if (_inventoryInfo[y - 1] == 0) {
- for (int i = 1; i <= 30; ++i) {
- memset(_inventoryPanelBuffer + x * 40 - 20 + (i - 1) * 320, 0, 40);
- }
- } else {
- for (int i = 1; i <= 30; ++i) {
- int img = _inventoryInfo[y - 1];
- assert(img >= 1);
- memcpy(_inventoryPanelBuffer + x * 40 - 20 + i * 320 - 321, _inventoryImagesBuffer + (i - 1) * 40 + (_inventoryImages[img - 1] - 1) * 1200, 40);
- }
+ int x = 1;
+ for (y = start; y != end; ++y) {
+ if (_inventoryInfo[y - 1] == 0) {
+ for (i = 1; i <= 30; ++i) {
+ memset(_inventoryPanelBuffer + x * 40 - 20 + (i - 1) * 320, 0, 40);
+ }
+ } else {
+ for (i = 1; i <= 30; ++i) {
+ int img = _inventoryInfo[y - 1];
+ assert(img >= 1);
+ memcpy(_inventoryPanelBuffer + x * 40 - 20 + i * 320 - 321, _inventoryImagesBuffer + (i - 1) * 40 + (_inventoryImages[img - 1] - 1) * 1200, 40);
}
- ++x;
}
+ ++x;
}
if (_inventoryInfo[72] == 1) {
// 'hide' scroll up
- for (int y = 5; y <= 11; ++y) {
- for (int x = 4; x <= 12; ++x) {
+ for (y = 5; y <= 11; ++y) {
+ for (x = 4; x <= 12; ++x) {
uint8 *p = _inventoryPanelBuffer + y * 320 + x - 321;
if (*p == 0xF2) {
*p = 0xF3;
@@ -1334,8 +1333,8 @@ void IgorEngine::drawInventory(int start, int mode) {
}
if (_inventoryInfo[73] <= _inventoryInfo[72] + 6 || _inventoryInfo[72] >= _inventoryInfo[73] - 6) {
// 'hide' scroll down
- for (int y = 19; y <= 25; ++y) {
- for (int x = 4; x <= 12; ++x) {
+ for (y = 19; y <= 25; ++y) {
+ for (x = 4; x <= 12; ++x) {
uint8 *p = _inventoryPanelBuffer + y * 320 + x - 321;
if (*p == 0xF2) {
*p = 0xF3;
@@ -1351,8 +1350,8 @@ void IgorEngine::drawInventory(int start, int mode) {
_scrollInventory = false;
break;
case 1:
- for (int y = 0; y <= 11; ++y) {
- for (int x = 0; x <= 14; ++x) {
+ for (y = 0; y <= 11; ++y) {
+ for (x = 0; x <= 14; ++x) {
uint8 *p = _screenVGA + x + y * 320 + 59520;
if ((*p & 0x80) != 0) {
*p += 8;
@@ -1369,8 +1368,8 @@ void IgorEngine::drawInventory(int start, int mode) {
_scrollInventory = true;
break;
case 2:
- for (int y = 0; y <= 11; ++y) {
- for (int x = 0; x <= 14; ++x) {
+ for (y = 0; y <= 11; ++y) {
+ for (x = 0; x <= 14; ++x) {
uint8 *p = _screenVGA + x + y * 320 + 55040;
if ((*p & 0x80) != 0) {
*p += 8;