From 47a2c28b6ed314a8099f1b9eabf63fd4c3fcafea Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Wed, 31 Oct 2007 20:02:38 +0000 Subject: - minor changes to detection code - reverted gameState.counter type to int16 - cleanup/removed deadcode svn-id: r29344 --- engines/igor/parts/part_13.cpp | 6 +++--- engines/igor/parts/part_15.cpp | 16 ++++++++-------- engines/igor/parts/part_36.cpp | 20 ++++++++++---------- engines/igor/parts/part_85.cpp | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'engines/igor/parts') diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp index e33cc69918..0aafdcbbec 100644 --- a/engines/igor/parts/part_13.cpp +++ b/engines/igor/parts/part_13.cpp @@ -137,15 +137,15 @@ void IgorEngine::PART_13_ACTION_101_103() { void IgorEngine::PART_13_ACTION_104() { _walkDataCurrentIndex = 0; _walkCurrentFrame = 1; - for (_gameState.counter[1] = 9; _gameState.counter[1] >= 0; --_gameState.counter[1]) { - if (_gameState.counter[1] == 9) { + for (int i = 9; i >= 0; --i) { + if (i == 9) { _walkCurrentFrame = 0; } _walkData[0].setPos(189, 143, 3, _walkCurrentFrame); WalkData::setNextFrame(3, _walkCurrentFrame); _walkData[0].clipSkipX = 1; _walkData[0].clipWidth = 13; - _walkData[0].scaleWidth = 13 + _gameState.counter[1]; + _walkData[0].scaleWidth = 13 + i; _walkData[0].xPosChanged = 1; _walkData[0].dxPos = 0; _walkData[0].yPosChanged = 1; diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp index 411fc73821..6ad73509d4 100644 --- a/engines/igor/parts/part_15.cpp +++ b/engines/igor/parts/part_15.cpp @@ -424,20 +424,20 @@ void IgorEngine::PART_15_HELPER_5() { void IgorEngine::PART_15_HELPER_6(int frame) { _roomCursorOn = false; - for (_gameState.counter[1] = 0; _gameState.counter[1] <= 17; ++_gameState.counter[1]) { - for (_gameState.counter[2] = 0; _gameState.counter[2] <= 52; ++_gameState.counter[2]) { - int offset = (_gameState.counter[1] + 23) * 320 + _gameState.counter[2] + 18; + for (int i = 0; i <= 17; ++i) { + for (int j = 0; j <= 52; ++j) { + int offset = (i + 23) * 320 + j + 18; uint8 color = _screenVGA[offset]; if (color < 0xF0 || color > 0xF1) { - color = _animFramesBuffer[0x4B8C + frame * 954 + _gameState.counter[1] * 53 + _gameState.counter[2]]; + color = _animFramesBuffer[0x4B8C + frame * 954 + i * 53 + j]; } - _screenTempLayer[_gameState.counter[1] * 100 + _gameState.counter[2]] = color; + _screenTempLayer[i * 100 + j] = color; } } int offset = 7378; - for (_gameState.counter[1] = 0; _gameState.counter[1] <= 17; ++_gameState.counter[1]) { - memcpy(_screenVGA + _gameState.counter[1] * 320 + offset, _screenTempLayer + _gameState.counter[1] * 100, 53); - memcpy(_screenLayer1 + _gameState.counter[1] * 320 + offset, _animFramesBuffer + 0x4B8C + frame * 954 + _gameState.counter[1] * 53, 53); + for (int i = 0; i <= 17; ++i) { + memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 53); + memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0x4B8C + frame * 954 + i * 53, 53); } if (_gameState.dialogueTextRunning) { memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize); diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp index 9510ac6ae5..1973bf9101 100644 --- a/engines/igor/parts/part_36.cpp +++ b/engines/igor/parts/part_36.cpp @@ -77,28 +77,28 @@ void IgorEngine::PART_36_EXEC_ACTION(int action) { } void IgorEngine::PART_36_ACTION_102() { - for (_gameState.counter[0] = 1; _gameState.counter[0] >= 0; --_gameState.counter[0]) { - for (_gameState.counter[1] = 0; _gameState.counter[1] <= 48; ++_gameState.counter[1]) { - for (_gameState.counter[2] = 0; _gameState.counter[2] <= 33; ++_gameState.counter[2]) { - uint8 color = _animFramesBuffer[14 + _gameState.counter[0] * 1666 + _gameState.counter[1] * 34 + _gameState.counter[2]]; - int offset = (_gameState.counter[1] + 74) * 320 + _gameState.counter[2] + 70; + for (int i = 1; i >= 0; --i) { + for (int j = 0; j <= 48; ++j) { + for (int k = 0; k <= 33; ++k) { + uint8 color = _animFramesBuffer[14 + i * 1666 + j * 34 + k]; + int offset = (j + 74) * 320 + k + 70; if (color < 192 || color > 207) { - _screenTempLayer[100 * _gameState.counter[1] + _gameState.counter[2]] = color; + _screenTempLayer[100 * j + k] = color; continue; } RoomObjectArea *roa = &_roomObjectAreasTable[_screenLayer2[offset]]; if (roa->y1Lum > 0) { - _screenTempLayer[100 * _gameState.counter[1] + _gameState.counter[2]] = _screenLayer1[offset]; + _screenTempLayer[100 * j + k] = _screenLayer1[offset]; } else { if (roa->y2Lum > 0) { color -= roa->deltaLum; } - _screenTempLayer[100 * _gameState.counter[1] + _gameState.counter[2]] = color; + _screenTempLayer[100 * j + k] = color; } } } - for (_gameState.counter[1] = 0; _gameState.counter[1] <= 48; ++_gameState.counter[1]) { - memcpy(_screenVGA + _gameState.counter[1] * 320 + 23750, _screenTempLayer + _gameState.counter[1] * 100, 34); + for (int j = 0; j <= 48; ++j) { + memcpy(_screenVGA + j * 320 + 23750, _screenTempLayer + j * 100, 34); } waitForTimer(45); } diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp index 495ffbd7a7..26c6129e5c 100644 --- a/engines/igor/parts/part_85.cpp +++ b/engines/igor/parts/part_85.cpp @@ -181,7 +181,7 @@ void IgorEngine::PART_85() { if (_inputVars[kInputEscape]) goto PART_85_EXIT; PART_85_HELPER_1(0x74CA, 0xA6C4, 1, 6, 32); if (_inputVars[kInputEscape]) goto PART_85_EXIT; - for (_gameState.counter[4] = 0; _gameState.counter[4] != 200; ++_gameState.counter[4]) { + for (int i = 0; i != 200; ++i) { PART_85_UPDATE_ROOM_BACKGROUND(); if (_inputVars[kInputEscape]) goto PART_85_EXIT; waitForTimer(); -- cgit v1.2.3