aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-23 21:44:48 +0200
committerWillem Jan Palenstijn2015-12-23 21:43:17 +0100
commit29d85c8d50967df907f2a12e87ad78abfa707be4 (patch)
treedccd17f6d9f9329aaa3423d41b0f07bc2805ea74
parentb3a19cf75ed30ddbb60fd05223efe6a26087834d (diff)
downloadscummvm-rg350-29d85c8d50967df907f2a12e87ad78abfa707be4.tar.gz
scummvm-rg350-29d85c8d50967df907f2a12e87ad78abfa707be4.tar.bz2
scummvm-rg350-29d85c8d50967df907f2a12e87ad78abfa707be4.zip
LAB: Use int in for loops, instead of uint16
-rw-r--r--engines/lab/console.cpp2
-rw-r--r--engines/lab/dispman.cpp32
-rw-r--r--engines/lab/engine.cpp6
-rw-r--r--engines/lab/eventman.cpp4
-rw-r--r--engines/lab/intro.cpp14
-rw-r--r--engines/lab/lab.cpp2
-rw-r--r--engines/lab/map.cpp10
-rw-r--r--engines/lab/processroom.cpp2
-rw-r--r--engines/lab/resource.cpp6
-rw-r--r--engines/lab/savegame.cpp8
-rw-r--r--engines/lab/special.cpp2
-rw-r--r--engines/lab/tilepuzzle.cpp4
-rw-r--r--engines/lab/utils.cpp2
13 files changed, 47 insertions, 47 deletions
diff --git a/engines/lab/console.cpp b/engines/lab/console.cpp
index 84f936568e..0a6167951d 100644
--- a/engines/lab/console.cpp
+++ b/engines/lab/console.cpp
@@ -107,7 +107,7 @@ bool Console::Cmd_FindAction(int argc, const char **argv) {
int param2 = (argc > 3) ? atoi(argv[3]) : -1;
int param3 = (argc > 4) ? atoi(argv[4]) : -1;
- for (uint16 i = 1; i <= _vm->_manyRooms; i++) {
+ for (int i = 1; i <= _vm->_manyRooms; i++) {
_vm->_resource->readViews(i);
for (RuleList::iterator rule = _vm->_rooms[i]._rules->begin(); rule != _vm->_rooms[i]._rules->end(); ++rule) {
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index cbf7575ff2..49818bf1f7 100644
--- a/engines/lab/dispman.cpp
+++ b/engines/lab/dispman.cpp
@@ -79,7 +79,7 @@ void DisplayMan::loadBackPict(const Common::String fileName, uint16 *highPal) {
_vm->_anim->_noPalChange = true;
readPict(fileName);
- for (uint16 i = 0; i < 16; i++) {
+ for (int i = 0; i < 16; i++) {
highPal[i] = ((_vm->_anim->_diffPalette[i * 3] >> 2) << 8) +
((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
((_vm->_anim->_diffPalette[i * 3 + 2] >> 2));
@@ -354,7 +354,7 @@ void DisplayMan::setUpScreens() {
// TODO: The CONTROL file is not present in the Amiga version
Common::File *controlFile = _vm->_resource->openDataFile("P:Control");
- for (uint16 i = 0; i < 20; i++)
+ for (int i = 0; i < 20; i++)
_vm->_moveImages[i] = new Image(controlFile, _vm);
delete controlFile;
@@ -377,10 +377,10 @@ void DisplayMan::setUpScreens() {
// TODO: The INV file is not present in the Amiga version
Common::File *invFile = _vm->_resource->openDataFile("P:Inv");
if (_vm->getPlatform() == Common::kPlatformWindows) {
- for (uint16 imgIdx = 0; imgIdx < 10; imgIdx++)
+ for (int imgIdx = 0; imgIdx < 10; imgIdx++)
_vm->_invImages[imgIdx] = new Image(invFile, _vm);
} else {
- for (uint16 imgIdx = 0; imgIdx < 6; imgIdx++)
+ for (int imgIdx = 0; imgIdx < 6; imgIdx++)
_vm->_invImages[imgIdx] = new Image(invFile, _vm);
}
invButtonList->push_back(e->createButton( 24, y, 0, 'm', invImages[0], invImages[1]));
@@ -475,7 +475,7 @@ void DisplayMan::setAmigaPal(uint16 *pal, uint16 numColors) {
if (numColors > 16)
numColors = 16;
- for (uint16 i = 0; i < numColors; i++) {
+ for (int i = 0; i < numColors; i++) {
vgaPal[vgaIdx++] = (byte)(((pal[i] & 0xf00) >> 8) << 2);
vgaPal[vgaIdx++] = (byte)(((pal[i] & 0x0f0) >> 4) << 2);
vgaPal[vgaIdx++] = (byte)(((pal[i] & 0x00f)) << 2);
@@ -556,7 +556,7 @@ uint16 DisplayMan::textLength(TextFont *font, const Common::String text) {
if (font) {
int numChars = text.size();
- for (uint16 i = 0; i < numChars; i++) {
+ for (int i = 0; i < numChars; i++) {
length += font->_widths[(byte)text[i]];
}
}
@@ -572,7 +572,7 @@ void DisplayMan::drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const
byte *vgaTop = getCurrentDrawingBuffer();
int numChars = text.size();
- for (uint16 i = 0; i < numChars; i++) {
+ for (int i = 0; i < numChars; i++) {
uint32 realOffset = (_screenWidth * y) + x;
uint16 curPage = realOffset / _screenBytesPerPage;
uint32 segmentOffset = realOffset - (curPage * _screenBytesPerPage);
@@ -585,12 +585,12 @@ void DisplayMan::drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const
byte *vgaTemp = vgaCur;
byte *vgaTempLine = vgaCur;
- for (uint16 rows = 0; rows < tf->_height; rows++) {
+ for (int rows = 0; rows < tf->_height; rows++) {
int32 templeft = leftInSegment;
vgaTemp = vgaTempLine;
- for (uint16 cols = 0; cols < bwidth; cols++) {
+ for (int cols = 0; cols < bwidth; cols++) {
uint16 data = *cdata++;
if (data && (templeft >= 8)) {
@@ -605,7 +605,7 @@ void DisplayMan::drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const
uint16 mask = 0x80;
templeft = leftInSegment;
- for (uint16 counterb = 0; counterb < 8; counterb++) {
+ for (int counterb = 0; counterb < 8; counterb++) {
if (templeft <= 0) {
curPage++;
vgaTemp = (byte *)(vgaTop - templeft);
@@ -785,8 +785,8 @@ void DisplayMan::doTransWipe(CloseDataPtr *closePtrList, const Common::String fi
uint16 linesDone = 0;
- for (uint16 j = 0; j < 2; j++) {
- for (uint16 i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ for (int i = 0; i < 2; i++) {
uint16 curY = i * 2;
while (curY < lastY) {
@@ -830,8 +830,8 @@ void DisplayMan::doTransWipe(CloseDataPtr *closePtrList, const Common::String fi
imDest._height = _screenHeight;
imDest._imageData = getCurrentDrawingBuffer();
- for (uint16 j = 0; j < 2; j++) {
- for (uint16 i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ for (int i = 0; i < 2; i++) {
uint16 curY = i * 2;
while (curY < lastY) {
@@ -987,8 +987,8 @@ uint16 DisplayMan::fadeNumOut(uint16 num, uint16 res, uint16 counter) {
void DisplayMan::fade(bool fadeIn, uint16 res) {
uint16 newPal[16];
- for (uint16 i = 0; i < 16; i++) {
- for (uint16 palIdx = 0; palIdx < 16; palIdx++) {
+ for (int i = 0; i < 16; i++) {
+ for (int palIdx = 0; palIdx < 16; palIdx++) {
if (fadeIn)
newPal[palIdx] = (0x00F & fadeNumIn(0x00F & _fadePalette[palIdx], 0x00F & res, i)) +
(0x0F0 & fadeNumIn(0x0F0 & _fadePalette[palIdx], 0x0F0 & res, i)) +
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index f50a3b7c77..87380c3c4f 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -144,12 +144,12 @@ void LabEngine::drawRoomMessage(uint16 curInv, CloseDataPtr closePtr) {
}
void LabEngine::freeScreens() {
- for (uint16 i = 0; i < 20; i++) {
+ for (int i = 0; i < 20; i++) {
delete _moveImages[i];
_moveImages[i] = nullptr;
}
- for (uint16 imgIdx = 0; imgIdx < 10; imgIdx++) {
+ for (int imgIdx = 0; imgIdx < 10; imgIdx++) {
delete _invImages[imgIdx];
_invImages[imgIdx] = nullptr;
}
@@ -550,7 +550,7 @@ void LabEngine::showLab2Teaser() {
_graphics->blackAllScreen();
_graphics->readPict("P:End/L2In.1");
- for (uint16 i = 0; i < 120; i++) {
+ for (int i = 0; i < 120; i++) {
updateMusicAndEvents();
waitTOF();
}
diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp
index 6e8b08e39f..4947991b87 100644
--- a/engines/lab/eventman.cpp
+++ b/engines/lab/eventman.cpp
@@ -72,7 +72,7 @@ Button *EventManager::checkButtonHit(ButtonList *buttonList, Common::Point pos)
button->_altImage->drawImage(button->_x, button->_y);
mouseShow();
- for (uint16 i = 0; i < 3; i++)
+ for (int i = 0; i < 3; i++)
_vm->waitTOF();
mouseHide();
@@ -133,7 +133,7 @@ void EventManager::updateMouse() {
_hitButton->_altImage->drawImage(_hitButton->_x, _hitButton->_y);
mouseShow();
- for (uint16 i = 0; i < 3; i++)
+ for (int i = 0; i < 3; i++)
_vm->waitTOF();
mouseHide();
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
index de76c0cbb5..e918987d31 100644
--- a/engines/lab/intro.cpp
+++ b/engines/lab/intro.cpp
@@ -195,7 +195,7 @@ void Intro::musicDelay() {
if (_quitIntro)
return;
- for (uint16 i = 0; i < 20; i++) {
+ for (int i = 0; i < 20; i++) {
_vm->updateMusicAndEvents();
_vm->waitTOF();
_vm->waitTOF();
@@ -235,7 +235,7 @@ void Intro::introSequence() {
} else if (_vm->getPlatform() == Common::kPlatformWindows) {
nReadPict("WYRMKEEP");
// Wait 4 seconds
- for (uint16 i = 0; i < 4 * 1000 / 10; i++) {
+ for (int i = 0; i < 4 * 1000 / 10; i++) {
introEatMessages();
if (_quitIntro)
break;
@@ -259,7 +259,7 @@ void Intro::introSequence() {
_vm->_graphics->_fadePalette = palette;
- for (uint16 i = 0; i < 16; i++) {
+ for (int i = 0; i < 16; i++) {
if (_quitIntro)
break;
@@ -278,7 +278,7 @@ void Intro::introSequence() {
_vm->updateMusicAndEvents();
uint16 temp = palette[2];
- for (uint16 i = 2; i < 15; i++)
+ for (int i = 2; i < 15; i++)
palette[i] = palette[i + 1];
palette[15] = temp;
@@ -321,7 +321,7 @@ void Intro::introSequence() {
nReadPict("Intro.1");
_vm->_anim->_noPalChange = false;
- for (uint16 i = 0; i < 16; i++) {
+ for (int i = 0; i < 16; i++) {
palette[i] = ((_vm->_anim->_diffPalette[i * 3] >> 2) << 8) +
((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
(_vm->_anim->_diffPalette[i * 3 + 2] >> 2);
@@ -365,8 +365,8 @@ void Intro::introSequence() {
doPictText("i.11", msgFont, false);
if (!_quitIntro)
- for (uint16 i = 0; i < 50; i++) {
- for (uint16 idx = (8 * 3); idx < (255 * 3); idx++)
+ for (int i = 0; i < 50; i++) {
+ for (int idx = (8 * 3); idx < (255 * 3); idx++)
_vm->_anim->_diffPalette[idx] = 255 - _vm->_anim->_diffPalette[idx];
_vm->updateMusicAndEvents();
diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp
index 5d545d93c0..a1fd4f5c94 100644
--- a/engines/lab/lab.cpp
+++ b/engines/lab/lab.cpp
@@ -139,7 +139,7 @@ LabEngine::~LabEngine() {
DebugMan.clearAllDebugChannels();
freeMapData();
- for (uint16 i = 1; i <= _manyRooms; i++)
+ for (int i = 1; i <= _manyRooms; i++)
_resource->freeViews(i);
delete[] _rooms;
delete[] _inventory;
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index b9f5703131..e06fefdd92 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -299,7 +299,7 @@ void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) {
}
bool LabEngine::floorVisited(uint16 floorNum) {
- for (uint16 i = 0; i < _maxRooms; i++) {
+ for (int i = 0; i < _maxRooms; i++) {
if ((_maps[i]._pageNumber == floorNum) && _roomsFound->in(i) && _maps[i]._x)
return true;
}
@@ -311,7 +311,7 @@ uint16 LabEngine::getUpperFloor(uint16 floorNum) {
if ((floorNum == kFloorCarnival) || (floorNum == kFloorNone))
return kFloorNone;
- for (uint16 i = floorNum; i < kFloorCarnival; i++)
+ for (int i = floorNum; i < kFloorCarnival; i++)
if (floorVisited(i + 1))
return i + 1;
@@ -322,7 +322,7 @@ uint16 LabEngine::getLowerFloor(uint16 floorNum) {
if ((floorNum == kFloorLower) || (floorNum == kFloorNone))
return kFloorNone;
- for (uint16 i = floorNum; i > kFloorLower; i--)
+ for (int i = floorNum; i > kFloorLower; i--)
if (floorVisited(i - 1))
return i - 1;
@@ -341,7 +341,7 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad
_imgMap->drawImage(0, 0);
_event->drawButtonList(&_mapButtonList);
- for (uint16 i = 1; i <= _maxRooms; i++) {
+ for (int i = 1; i <= _maxRooms; i++) {
if ((_maps[i]._pageNumber == floorNum) && _roomsFound->in(i) && _maps[i]._x) {
drawRoomMap(i, (bool)(i == curRoom));
updateMusicAndEvents();
@@ -499,7 +499,7 @@ void LabEngine::processMap(uint16 curRoom) {
uint16 oldMsg = curMsg;
Common::Rect curCoords;
- for (uint16 i = 1; i <= _maxRooms; i++) {
+ for (int i = 1; i <= _maxRooms; i++) {
curCoords = roomCoords(i);
if ((_maps[i]._pageNumber == curFloor)
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
index 0d60724e27..ad8db8499f 100644
--- a/engines/lab/processroom.cpp
+++ b/engines/lab/processroom.cpp
@@ -443,7 +443,7 @@ void LabEngine::doActions(Action *actionList, CloseDataPtr *closePtrList) {
_anim->_doBlack = (_closeDataPtr != nullptr);
else if (actionList->_param1 == 5) {
// inverse the palette
- for (uint16 idx = (8 * 3); idx < (255 * 3); idx++)
+ for (int idx = (8 * 3); idx < (255 * 3); idx++)
_anim->_diffPalette[idx] = 255 - _anim->_diffPalette[idx];
waitTOF();
diff --git a/engines/lab/resource.cpp b/engines/lab/resource.cpp
index 3fcf7acd6d..b9239a2068 100644
--- a/engines/lab/resource.cpp
+++ b/engines/lab/resource.cpp
@@ -102,7 +102,7 @@ void Resource::readRoomData(const Common::String fileName) {
_vm->_rooms = new RoomData[_vm->_manyRooms + 1];
memset(_vm->_rooms, 0, (_vm->_manyRooms + 1) * sizeof(RoomData));
- for (uint16 i = 1; i <= _vm->_manyRooms; i++) {
+ for (int i = 1; i <= _vm->_manyRooms; i++) {
RoomData *curRoom = &_vm->_rooms[i];
curRoom->_doors[NORTH] = dataFile->readUint16LE();
curRoom->_doors[SOUTH] = dataFile->readUint16LE();
@@ -127,7 +127,7 @@ InventoryData *Resource::readInventory(const Common::String fileName) {
_vm->_numInv = dataFile->readUint16LE();
InventoryData *inventory = new InventoryData[_vm->_numInv + 1];
- for (uint16 i = 1; i <= _vm->_numInv; i++) {
+ for (int i = 1; i <= _vm->_numInv; i++) {
inventory[i]._quantity = dataFile->readUint16LE();
inventory[i]._name = readString(dataFile);
inventory[i]._bitmapName = readString(dataFile);
@@ -159,7 +159,7 @@ void Resource::freeViews(uint16 roomNum) {
if (!_vm->_rooms)
return;
- for (uint16 i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
freeView(_vm->_rooms[roomNum]._view[i]);
freeRule(_vm->_rooms[roomNum]._rules);
diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp
index 8ee8b1a689..f70d73b75c 100644
--- a/engines/lab/savegame.cpp
+++ b/engines/lab/savegame.cpp
@@ -174,17 +174,17 @@ bool LabEngine::loadGame(int slot) {
setQuarters(file->readUint16LE());
// Conditions
- for (uint16 i = 0; i < _conditions->_lastElement / (8 * 2); i++)
+ for (int i = 0; i < _conditions->_lastElement / (8 * 2); i++)
_conditions->_array[i] = file->readUint16LE();
// Rooms found
- for (uint16 i = 0; i < _roomsFound->_lastElement / (8 * 2); i++)
+ for (int i = 0; i < _roomsFound->_lastElement / (8 * 2); i++)
_roomsFound->_array[i] = file->readUint16LE();
_tilePuzzle->load(file);
// Breadcrumbs
- for (uint16 i = 0; i < 128; i++) {
+ for (int i = 0; i < 128; i++) {
_breadCrumbs[i]._roomNum = file->readUint16LE();
_breadCrumbs[i]._direction = file->readUint16LE();
}
@@ -192,7 +192,7 @@ bool LabEngine::loadGame(int slot) {
_droppingCrumbs = (_breadCrumbs[0]._roomNum != 0);
_followingCrumbs = false;
- for (uint16 i = 0; i < 128; i++) {
+ for (int i = 0; i < 128; i++) {
if (_breadCrumbs[i]._roomNum == 0)
break;
_numCrumbs = i;
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 7615c2d073..649c725102 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -319,7 +319,7 @@ void LabEngine::drawMonText(char *text, TextFont *monitorFont, Common::Rect text
_graphics->setPen(0);
_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, textRect.bottom);
- for (uint16 i = 0; i < numlines; i++)
+ for (int i = 0; i < numlines; i++)
_monitorButton->drawImage(0, i * _monitorButtonHeight);
} else if (isinteractive) {
_graphics->setPen(0);
diff --git a/engines/lab/tilepuzzle.cpp b/engines/lab/tilepuzzle.cpp
index 4b5fb093b0..d39612d49a 100644
--- a/engines/lab/tilepuzzle.cpp
+++ b/engines/lab/tilepuzzle.cpp
@@ -315,7 +315,7 @@ void TilePuzzle::changeCombination(uint16 number) {
byte *buffer = new byte[_tiles[1]->_width * _tiles[1]->_height * 2];
- for (uint16 i = 1; i <= (_numberImages[combnum]->_height / 2); i++) {
+ for (int i = 1; i <= (_numberImages[combnum]->_height / 2); i++) {
if (_vm->_isHiRes) {
if (i & 1)
_vm->waitTOF();
@@ -362,7 +362,7 @@ void TilePuzzle::showCombination(const Common::String filename) {
Common::File *numFile = _vm->_resource->openDataFile("P:Numbers");
- for (uint16 CurBit = 0; CurBit < 10; CurBit++)
+ for (int CurBit = 0; CurBit < 10; CurBit++)
_numberImages[CurBit] = new Image(numFile, _vm);
delete numFile;
diff --git a/engines/lab/utils.cpp b/engines/lab/utils.cpp
index aeb76e6605..a1409d231b 100644
--- a/engines/lab/utils.cpp
+++ b/engines/lab/utils.cpp
@@ -206,7 +206,7 @@ void Utils::verticalRunLengthDecode(byte *dest, Common::File *sourceFile, uint16
int16 count;
byte *top = dest;
- for (uint16 i = 0; i < _dataBytesPerRow; i++) {
+ for (int i = 0; i < _dataBytesPerRow; i++) {
dest = top;
dest += i;