mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
LAB: Use int in for loops, instead of uint16
This commit is contained in:
parent
b3a19cf75e
commit
29d85c8d50
@ -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) {
|
||||
|
@ -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)) +
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user