[Scummvm-cvs-logs] CVS: scummvm/sword1 control.cpp,1.4,1.5 menu.cpp,1.9,1.10 objectman.cpp,1.3,1.4 router.cpp,1.7,1.8 screen.cpp,1.25,1.26 sound.cpp,1.13,1.14 text.cpp,1.5,1.6
Nicolas Bacca
arisme at users.sourceforge.net
Mon Dec 22 17:00:07 CET 2003
Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1:/tmp/cvs-serv21239
Modified Files:
control.cpp menu.cpp objectman.cpp router.cpp screen.cpp
sound.cpp text.cpp
Log Message:
Microsoft Compilers : Which part of the standard do you want to break today ?
Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/control.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- control.cpp 20 Dec 2003 21:56:48 -0000 1.4
+++ control.cpp 23 Dec 2003 00:59:18 -0000 1.5
@@ -531,6 +531,7 @@
// I can hardly believe this is all it takes for loading and saving...
void SwordControl::saveGameToFile(uint8 slot) {
char fName[15];
+ uint16 cnt;
sprintf(fName, "SAVEGAME.%03d", slot);
uint16 liveBuf[TOTAL_SECTIONS];
SaveFileManager *mgr = _system->get_savefile_manager();
@@ -540,7 +541,7 @@
error("unable to create file %s", fName);
_objMan->saveLiveList(liveBuf);
- for (uint16 cnt = 0; cnt < TOTAL_SECTIONS; cnt++)
+ for (cnt = 0; cnt < TOTAL_SECTIONS; cnt++)
outf->writeUint16LE(liveBuf[cnt]);
BsObject *cpt = _objMan->fetchObject(PLAYER);
@@ -550,19 +551,20 @@
SwordLogic::_scriptVars[CHANGE_STANCE] = STAND;
SwordLogic::_scriptVars[CHANGE_PLACE] = cpt->o_place;
- for (uint16 cnt = 0; cnt < NUM_SCRIPT_VARS; cnt++)
+ for (cnt = 0; cnt < NUM_SCRIPT_VARS; cnt++)
outf->writeUint32LE(SwordLogic::_scriptVars[cnt]);
uint32 playerSize = (sizeof(BsObject) - 12000) / 4;
uint32 *playerRaw = (uint32*)cpt;
- for (uint32 cnt = 0; cnt < playerSize; cnt++)
- outf->writeUint32LE(playerRaw[cnt]);
+ for (uint32 cnt2 = 0; cnt2 < playerSize; cnt2++)
+ outf->writeUint32LE(playerRaw[cnt2]);
delete outf;
delete mgr;
}
void SwordControl::restoreGameFromFile(uint8 slot) {
char fName[15];
+ uint16 cnt;
sprintf(fName, "SAVEGAME.%03d", slot);
SaveFileManager *mgr = _system->get_savefile_manager();
SaveFile *inf;
@@ -579,15 +581,15 @@
uint32 *scriptBuf = (uint32*)(_restoreBuf + 2 * TOTAL_SECTIONS);
uint32 *playerBuf = (uint32*)(_restoreBuf + 2 * TOTAL_SECTIONS + 4 * NUM_SCRIPT_VARS);
- for (uint16 cnt = 0; cnt < TOTAL_SECTIONS; cnt++)
+ for (cnt = 0; cnt < TOTAL_SECTIONS; cnt++)
liveBuf[cnt] = inf->readUint16LE();
- for (uint16 cnt = 0; cnt < NUM_SCRIPT_VARS; cnt++)
+ for (cnt = 0; cnt < NUM_SCRIPT_VARS; cnt++)
scriptBuf[cnt] = inf->readUint32LE();
uint32 playerSize = (sizeof(BsObject) - 12000) / 4;
- for (uint32 cnt = 0; cnt < playerSize; cnt++)
- playerBuf[cnt] = inf->readUint32LE();
+ for (uint32 cnt2 = 0; cnt2 < playerSize; cnt2++)
+ playerBuf[cnt2] = inf->readUint32LE();
delete inf;
delete mgr;
@@ -604,7 +606,7 @@
uint32 playerSize = (sizeof(BsObject) - 12000) / 4;
uint32 *playerRaw = (uint32*)_objMan->fetchObject(PLAYER);
BsObject *cpt = _objMan->fetchObject(PLAYER);
- for (uint32 cnt = 0; cnt < playerSize; cnt++) {
+ for (uint32 cnt2 = 0; cnt2 < playerSize; cnt2++) {
*playerRaw = *(uint32*)bufPos;
playerRaw++;
bufPos += 4;
Index: menu.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/menu.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- menu.cpp 22 Dec 2003 17:38:49 -0000 1.9
+++ menu.cpp 23 Dec 2003 00:59:18 -0000 1.10
@@ -87,15 +87,16 @@
}
SwordMenu::SwordMenu(SwordScreen *pScreen, SwordMouse *pMouse) {
+ uint8 cnt;
_screen = pScreen;
_mouse = pMouse;
_subjectBarStatus = MENU_CLOSED;
_objectBarStatus = MENU_CLOSED;
_fadeSubject = 0;
_fadeObject = 0;
- for (uint8 cnt = 0; cnt < TOTAL_subjects; cnt++)
+ for (cnt = 0; cnt < TOTAL_subjects; cnt++)
_subjects[cnt] = NULL;
- for (uint8 cnt = 0; cnt < TOTAL_pockets; cnt++)
+ for (cnt = 0; cnt < TOTAL_pockets; cnt++)
_objects[cnt] = NULL;
_inMenu = 0;
}
@@ -170,12 +171,13 @@
}
void SwordMenu::buildSubjects(void) {
- for (uint8 cnt = 0; cnt < 16; cnt++)
+ uint8 cnt;
+ for (cnt = 0; cnt < 16; cnt++)
if (_subjects[cnt]) {
delete _subjects[cnt];
_subjects[cnt] = NULL;
}
- for (uint8 cnt = 0; cnt < SwordLogic::_scriptVars[IN_SUBJECT]; cnt++) {
+ for (cnt = 0; cnt < SwordLogic::_scriptVars[IN_SUBJECT]; cnt++) {
uint32 res = _subjectList[(_subjectBar[cnt] & 65535) - BASE_SUBJECT].subjectRes;
uint32 frame = _subjectList[(_subjectBar[cnt] & 65535) - BASE_SUBJECT].frameNo;
_subjects[cnt] = new SwordMenuIcon(MENU_BOT, cnt, res, frame, _screen);
Index: objectman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/objectman.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- objectman.cpp 20 Dec 2003 09:12:54 -0000 1.3
+++ objectman.cpp 23 Dec 2003 00:59:18 -0000 1.4
@@ -32,7 +32,8 @@
}
void ObjectMan::initialize(void) {
- for (uint16 cnt = 0; cnt < TOTAL_SECTIONS; cnt++)
+ uint16 cnt;
+ for (cnt = 0; cnt < TOTAL_SECTIONS; cnt++)
_liveList[cnt] = 0; // we don't need to close the files here. When this routine is
// called, the memory was flushed() anyways, so these resources
// already *are* closed.
@@ -40,7 +41,7 @@
_liveList[128] = _liveList[129] = _liveList[130] = _liveList[131] = _liveList[133] =
_liveList[134] = _liveList[145] = _liveList[146] = _liveList[TEXT_sect] = 1;
- for (uint16 cnt = 0; cnt < TOTAL_SECTIONS; cnt++) {
+ for (cnt = 0; cnt < TOTAL_SECTIONS; cnt++) {
if (_liveList[cnt])
_cptData[cnt] = (uint8*)_resMan->cptResOpen(_objectList[cnt]) + sizeof(Header);
else
Index: router.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/router.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- router.cpp 19 Dec 2003 14:16:31 -0000 1.7
+++ router.cpp 23 Dec 2003 00:59:18 -0000 1.8
@@ -2314,6 +2314,9 @@
int32 walkGridResourceId;
BsObject *floorObject;
+ int32 cnt;
+ uint32 cntu;
+
// load in floor grid for current mega
@@ -2356,7 +2359,7 @@
/*memmove(&bars[0],fPolygrid,nbars*sizeof(BarData));
fPolygrid += nbars*sizeof(BarData);//move pointer to start of node data*/
- for (int32 cnt = 0; cnt < nbars; cnt++) {
+ for (cnt = 0; cnt < nbars; cnt++) {
bars[cnt].x1 = READ_LE_UINT16(fPolygrid); fPolygrid += 2;
bars[cnt].y1 = READ_LE_UINT16(fPolygrid); fPolygrid += 2;
bars[cnt].x2 = READ_LE_UINT16(fPolygrid); fPolygrid += 2;
@@ -2378,7 +2381,7 @@
j ++;
}
while(j < nnodes);//array starts at 0*/
- for (int32 cnt = 1; cnt < nnodes; cnt++) {
+ for (cnt = 1; cnt < nnodes; cnt++) {
node[cnt].x = READ_LE_UINT16(fPolygrid); fPolygrid += 2;
node[cnt].y = READ_LE_UINT16(fPolygrid); fPolygrid += 2;
}
@@ -2433,11 +2436,11 @@
nTurnFrames = fMegaWalkData[1];
fMegaWalkData += 2;
- for (int32 cnt = 0; cnt < NO_DIRECTIONS * (nWalkFrames + 1 + nTurnFrames); cnt++) {
+ for (cnt = 0; cnt < NO_DIRECTIONS * (nWalkFrames + 1 + nTurnFrames); cnt++) {
_dx[cnt] = (int32)READ_LE_UINT32(fMegaWalkData);
fMegaWalkData += 4;
}
- for (int32 cnt = 0; cnt < NO_DIRECTIONS * (nWalkFrames + 1 + nTurnFrames); cnt++) {
+ for (cnt = 0; cnt < NO_DIRECTIONS * (nWalkFrames + 1 + nTurnFrames); cnt++) {
_dy[cnt] = (int32)READ_LE_UINT32(fMegaWalkData);
fMegaWalkData += 4;
}
@@ -2446,12 +2449,12 @@
memmove(&_dy[0],fMegaWalkData,NO_DIRECTIONS*(nWalkFrames+1+nTurnFrames)*sizeof(int32));
fMegaWalkData += NO_DIRECTIONS*(nWalkFrames+1+nTurnFrames)*sizeof(int32);*/
- for (uint32 cnt = 0; cnt < NO_DIRECTIONS; cnt++) {
- modX[cnt] = (int32)READ_LE_UINT32(fMegaWalkData);
+ for (cntu = 0; cntu < NO_DIRECTIONS; cntu++) {
+ modX[cntu] = (int32)READ_LE_UINT32(fMegaWalkData);
fMegaWalkData += 4;
}
- for (uint32 cnt = 0; cnt < NO_DIRECTIONS; cnt++) {
- modY[cnt] = (int32)READ_LE_UINT32(fMegaWalkData);
+ for (cntu = 0; cntu < NO_DIRECTIONS; cntu++) {
+ modY[cntu] = (int32)READ_LE_UINT32(fMegaWalkData);
fMegaWalkData += 4;
}
/*memmove(&modX[0],fMegaWalkData,NO_DIRECTIONS*sizeof(int32));
Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- screen.cpp 22 Dec 2003 23:38:23 -0000 1.25
+++ screen.cpp 23 Dec 2003 00:59:18 -0000 1.26
@@ -221,6 +221,7 @@
}
void SwordScreen::newScreen(uint32 screen) {
+ uint8 cnt;
// set sizes and scrolling, initialize/load screengrid, force screen refresh
_currentScreen = screen;
_scrnSizeX = _roomDefTable[screen].sizeX;
@@ -243,13 +244,13 @@
_screenBuf = (uint8*)malloc(_scrnSizeX * _scrnSizeY);
_screenGrid = (uint8*)malloc(_gridSizeX * _gridSizeY);
memset(_screenGrid, 0x80, _gridSizeX * _gridSizeY); // force refresh
- for (uint8 cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers; cnt++) {
+ for (cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers; cnt++) {
// open and lock all resources, will be closed in quitScreen()
_layerBlocks[cnt] = (uint8*)_resMan->openFetchRes(_roomDefTable[_currentScreen].layers[cnt]);
if (cnt > 0)
_layerBlocks[cnt] += sizeof(Header);
}
- for (uint8 cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers - 1; cnt++) {
+ for (cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers - 1; cnt++) {
// there's no grid for the background layer, so it's totalLayers - 1
_layerGrid[cnt] = (uint16*)_resMan->openFetchRes(_roomDefTable[_currentScreen].grids[cnt]);
_layerGrid[cnt] += 14;
@@ -265,9 +266,10 @@
}
void SwordScreen::quitScreen(void) {
- for (uint8 cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers; cnt++)
+ uint8 cnt;
+ for (cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers; cnt++)
_resMan->resClose(_roomDefTable[_currentScreen].layers[cnt]);
- for (uint8 cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers - 1; cnt++)
+ for (cnt = 0; cnt < _roomDefTable[_currentScreen].totalLayers - 1; cnt++)
_resMan->resClose(_roomDefTable[_currentScreen].grids[cnt]);
if (_roomDefTable[_currentScreen].parallax[0])
_resMan->resClose(_roomDefTable[_currentScreen].parallax[0]);
@@ -276,6 +278,7 @@
}
void SwordScreen::draw(void) {
+ uint8 cnt;
if (_currentScreen == 54) {
// rm54 has a BACKGROUND parallax layer in parallax[0]
if (_parallax[0])
@@ -292,15 +295,15 @@
} else
memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY);
- for (uint8 cnt = 0; cnt < _backLength; cnt++)
+ for (cnt = 0; cnt < _backLength; cnt++)
processImage(_backList[cnt]);
- for (uint8 cnt = 0; cnt < _sortLength - 1; cnt++)
+ for (cnt = 0; cnt < _sortLength - 1; cnt++)
for (uint8 sCnt = 0; sCnt < _sortLength - 1; sCnt++)
if (_sortList[sCnt].y > _sortList[sCnt + 1].y) {
SWAP(_sortList[sCnt], _sortList[sCnt + 1]);
}
- for (uint8 cnt = 0; cnt < _sortLength; cnt++)
+ for (cnt = 0; cnt < _sortLength; cnt++)
processImage(_sortList[cnt].id);
if ((_currentScreen != 54) && _parallax[0])
@@ -308,7 +311,7 @@
if (_parallax[1])
renderParallax(_parallax[1]);
- for (uint8 cnt = 0; cnt < _foreLength; cnt++)
+ for (cnt = 0; cnt < _foreLength; cnt++)
processImage(_foreList[cnt]);
_backLength = _sortLength = _foreLength = 0;
@@ -543,7 +546,8 @@
uint32 oldRow = 0;
uint8 *destPos = dest;
- for (uint16 lnCnt = 0; lnCnt < resHeight; lnCnt++) {
+ uint16 lnCnt;
+ for (lnCnt = 0; lnCnt < resHeight; lnCnt++) {
while (oldRow < (newRow >> 8)) {
oldRow++;
src += width;
@@ -554,7 +558,7 @@
newRow += step;
}
// scaled, now stipple shadows if there are any
- for (uint16 lnCnt = 0; lnCnt < resHeight; lnCnt++) {
+ for (lnCnt = 0; lnCnt < resHeight; lnCnt++) {
uint16 xCnt = lnCnt & 1;
destPos = dest + lnCnt * resWidth + (lnCnt & 1);
while (xCnt < resWidth) {
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sound.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- sound.cpp 21 Dec 2003 17:16:07 -0000 1.13
+++ sound.cpp 23 Dec 2003 00:59:18 -0000 1.14
@@ -73,16 +73,16 @@
break;
}
// now process the queue
- for (uint8 cnt = 0; cnt < _endOfQueue; cnt++) {
- if (_fxQueue[cnt].delay > 0) {
- _fxQueue[cnt].delay--;
- if (_fxQueue[cnt].delay == 0)
- playSample(&_fxQueue[cnt]);
+ for (uint8 cnt2 = 0; cnt2 < _endOfQueue; cnt2++) {
+ if (_fxQueue[cnt2].delay > 0) {
+ _fxQueue[cnt2].delay--;
+ if (_fxQueue[cnt2].delay == 0)
+ playSample(&_fxQueue[cnt2]);
} else {
- if (!_fxQueue[cnt].handle) { // sound finished
- _resMan->resClose(_fxList[_fxQueue[cnt].id].sampleId);
- if (cnt != _endOfQueue-1)
- _fxQueue[cnt] = _fxQueue[_endOfQueue - 1];
+ if (!_fxQueue[cnt2].handle) { // sound finished
+ _resMan->resClose(_fxList[_fxQueue[cnt2].id].sampleId);
+ if (cnt2 != _endOfQueue-1)
+ _fxQueue[cnt2] = _fxQueue[_endOfQueue - 1];
_endOfQueue--;
}
}
Index: text.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/text.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- text.cpp 20 Dec 2003 09:12:54 -0000 1.5
+++ text.cpp 23 Dec 2003 00:59:18 -0000 1.6
@@ -76,7 +76,8 @@
uint16 numLines = analyzeSentence(text, maxWidth, lines);
uint16 sprWidth = 0;
- for (uint16 lineCnt = 0; lineCnt < numLines; lineCnt++)
+ uint16 lineCnt;
+ for (lineCnt = 0; lineCnt < numLines; lineCnt++)
if (lines[lineCnt].width > sprWidth)
sprWidth = lines[lineCnt].width;
uint16 sprHeight = _charHeight * numLines;
@@ -93,7 +94,7 @@
uint8 *linePtr = ((uint8*)_textBlocks[slot]) + sizeof(FrameHeader);
memset(linePtr, NO_COL, sprSize);
- for (uint16 lineCnt = 0; lineCnt < numLines; lineCnt++) {
+ for (lineCnt = 0; lineCnt < numLines; lineCnt++) {
uint8 *sprPtr = linePtr + (sprWidth - lines[lineCnt].width) / 2; // center the text
for (uint16 pos = 0; pos < lines[lineCnt].length; pos++)
sprPtr += copyChar(*text++, sprPtr, sprWidth, pen) - OVERLAP;
More information about the Scummvm-git-logs
mailing list