JANITORIAL: Cleanup (mostly whitespace)

svn-id: r53161
This commit is contained in:
Torbjörn Andersson 2010-10-12 04:19:58 +00:00
parent 8388e0dfea
commit 54b2a8c98d
35 changed files with 127 additions and 126 deletions

View File

@ -435,7 +435,8 @@ const ADGameDescription *AgiMetaEngine::fallbackDetect(const Common::FSList &fsl
// If there's game last edit date in the *.wag file, add it to extra
if (wagGameLastEdit != NULL) {
if (!_extra.empty() ) _extra += " ";
if (!_extra.empty())
_extra += " ";
_extra += wagGameLastEdit->getData();
debug(3, "Agi::fallbackDetector: Game's last edit date (%s) from WAG file", wagGameLastEdit->getData());
}

View File

@ -1516,7 +1516,7 @@ void Hotspots::evaluate() {
int16 duration = _vm->_game->_script->peekByte(1);
byte leaveWindowIndex = 0;
if ( _vm->getGameType() == kGameTypeFascination )
if (_vm->getGameType() == kGameTypeFascination)
leaveWindowIndex = _vm->_game->_script->peekByte(2);
byte hotspotIndex1 = _vm->_game->_script->peekByte(3);
@ -1642,7 +1642,7 @@ int16 Hotspots::findCursor(uint16 x, uint16 y) const {
int16 deltax = 0;
int16 deltay = 0;
if ( _vm->getGameType() == kGameTypeFascination )
if (_vm->getGameType() == kGameTypeFascination)
cursor = curWindow(deltax, deltay);
if (cursor == 0) {
@ -2106,7 +2106,7 @@ void Hotspots::fillRect(uint16 x, uint16 y, uint16 width, uint16 height, uint16
_vm->_draw->_spriteBottom = height;
_vm->_draw->_backColor = color;
_vm->_draw->spriteOperation(DRAW_FILLRECT | 0x10 );
_vm->_draw->spriteOperation(DRAW_FILLRECT | 0x10);
}
void Hotspots::printText(uint16 x, uint16 y, const char *str, uint16 fontIndex, uint16 color) const {

View File

@ -65,7 +65,7 @@ Scenery::Scenery(GobEngine *vm) : _vm(vm) {
_pCaptureCounter = 0;
for (int i = 0; i < 70; i++ ) {
for (int i = 0; i < 70; i++) {
_staticPictToSprite[i] = 0;
_animPictToSprite[i] = 0;
}

View File

@ -514,7 +514,7 @@ void FileExpanderSource::advSrcBitsBy1() {
_key >>= 1;
if (!--_bitsLeft) {
if (_dataPtr < _endofBuffer)
_key = ((*_dataPtr++) << 8 ) | (_key & 0xff);
_key = ((*_dataPtr++) << 8) | (_key & 0xff);
_bitsLeft = 8;
}
}

View File

@ -787,7 +787,7 @@ void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPag
}
if (y2 < 0) {
if (y2 <= -h )
if (y2 <= -h)
return;
h += y2;
y1 -= y2;

View File

@ -637,7 +637,7 @@ void Screen_LoL::copyRegionSpecial(int page1, int w1, int h1, int x1, int y1, in
d++;
}
for (int ii = (i & 1) ^ 1; ii < ibw_2; ii += 2 ) {
for (int ii = (i & 1) ^ 1; ii < ibw_2; ii += 2) {
*d = *s;
d += 2;
s += 2;

View File

@ -259,7 +259,7 @@ int TIMInterpreter::exec(TIM *tim, bool loop) {
if (cur.ip) {
cur.ip += cur.ip[0];
cur.lastTime = cur.nextTime;
cur.nextTime += (cur.ip[1] ) * _vm->tickLength();
cur.nextTime += cur.ip[1] * _vm->tickLength();
}
}
}

View File

@ -71,7 +71,7 @@ void Sprites::setupSceneAnims() {
if (_anims[i].script != 0) {
data = _anims[i].script;
assert( READ_LE_UINT16(data) == 0xFF86 );
assert(READ_LE_UINT16(data) == 0xFF86);
data += 4;
_anims[i].disable = READ_LE_UINT16(data) != 0;
@ -509,7 +509,7 @@ void Sprites::loadDat(const char *filename, SceneExits &exits) {
}
void Sprites::freeSceneShapes() {
for (int i = 0; i < ARRAYSIZE(_sceneShapes); i++ ) {
for (int i = 0; i < ARRAYSIZE(_sceneShapes); i++) {
delete[] _sceneShapes[i];
_sceneShapes[i] = 0;
}

View File

@ -878,7 +878,7 @@ void KyraEngine_LoK::loadItems() {
_shapes[323] = 0;
for (shape = 1; shape < 6; shape++ )
for (shape = 1; shape < 6; shape++)
_shapes[323 + shape] = _screen->encodeShape((shape - 1) * 32, 0, 32, 17, 0);
for (shape = 330; shape <= 334; shape++)

View File

@ -544,7 +544,7 @@ void KyraEngine_HoF::processDialogue(int dlgOffset, int vocH, int csEntry) {
}
objectChat((const char *)_unkBuf500Bytes, 0, vocHi, vocLo);
} else {
if (activeTimSequence != nextTimSequence ) {
if (activeTimSequence != nextTimSequence) {
if (activeTimSequence > -1) {
deinitTalkObject(activeTimSequence);
activeTimSequence = -1;

View File

@ -88,7 +88,7 @@ void PathWalker_NS::correctPathPoint(Common::Point &to) {
} while ((top > 0) && !IS_PATH_CLEAR(to.x, top));
do {
bottom++;
} while ((bottom < maxY) && !IS_PATH_CLEAR(to.x, bottom) );
} while ((bottom < maxY) && !IS_PATH_CLEAR(to.x, bottom));
top = (top == 0) ? 1000 : to.y - top;
bottom = (bottom == maxY) ? 1000 : bottom - to.y;

View File

@ -283,7 +283,7 @@ void Cutaway::limitBob(CutawayObject &object) {
}
BobSlot *bob =
_vm->graphics()->bob( _vm->logic()->findBob(object.objectNumber) );
_vm->graphics()->bob(_vm->logic()->findBob(object.objectNumber));
if (!bob) {
warning("Failed to find bob");
@ -667,7 +667,7 @@ const byte *Cutaway::handleAnimation(const byte *ptr, CutawayObject &object) {
// Only flip if we are not moving or it is not a person object
if (!(objAnim[i].object > 0 && objAnim[i].object < 4) ||
!(objAnim[i].mx || objAnim[i].my) )
!(objAnim[i].mx || objAnim[i].my))
bob->xflip = objAnim[i].flip;
// Add frame alteration
@ -1235,7 +1235,7 @@ void Cutaway::handleText(
}
BobSlot *bob =
_vm->graphics()->bob( _vm->logic()->findBob(ABS(object.objectNumber)) );
_vm->graphics()->bob(_vm->logic()->findBob(ABS(object.objectNumber)));
_vm->graphics()->setBobText(bob, sentence, x, object.bobStartY, object.specialMove, flags);

View File

@ -551,11 +551,11 @@ bool Talk::speak(const char *sentence, Person *person, const char *voiceFilePref
return personWalking;
}
if (0 == strcmp(person->name, "FAYE-H" ) ||
if (0 == strcmp(person->name, "FAYE-H") ||
0 == strcmp(person->name, "FRANK-H") ||
0 == strcmp(person->name, "AZURA-H") ||
0 == strcmp(person->name, "X3_RITA") ||
(0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == FAYE_HEAD ) ||
(0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == FAYE_HEAD) ||
(0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == AZURA_HEAD) ||
(0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == FRANK_HEAD))
_talkHead = true;

View File

@ -451,8 +451,8 @@ public:
void cmdActorWalkTo(int argc, const char **argv);
bool validActorId(uint16 id) { return (id == ID_PROTAG) || ((id >= objectIndexToId(kGameObjectActor, 0)) && (id < objectIndexToId(kGameObjectActor, _actorsCount))); }
int actorIdToIndex(uint16 id) { return (id == ID_PROTAG ) ? 0 : objectIdToIndex(id); }
uint16 actorIndexToId(int index) { return (index == 0 ) ? ID_PROTAG : objectIndexToId(kGameObjectActor, index); }
int actorIdToIndex(uint16 id) { return (id == ID_PROTAG) ? 0 : objectIdToIndex(id); }
uint16 actorIndexToId(int index) { return (index == 0) ? ID_PROTAG : objectIndexToId(kGameObjectActor, index); }
ActorData *getActor(uint16 actorId);
ActorData *getFirstActor() { return _actors[0]; }

View File

@ -1398,7 +1398,7 @@ void Interface::setSave(PanelButton *panelButton) {
char *fileName;
switch (panelButton->id) {
case kTextSave:
if (_textInputStringLength == 0 ) {
if (_textInputStringLength == 0) {
break;
}
if (!_vm->isSaveListFull() && (_optionSaveFileTitleNumber == 0)) {
@ -2166,43 +2166,43 @@ void Interface::drawButtonBox(const Rect& rect, ButtonKind kind, bool down) {
byte solidColor;
byte odl, our, idl, iur;
switch (kind ) {
case kSlider:
cornerColor = 0x8b;
frameColor = _vm->KnownColor2ColorId(kKnownColorBlack);
fillColor = kITEColorLightBlue96;
odl = kITEColorDarkBlue8a;
our = kITEColorLightBlue92;
idl = 0x89;
iur = 0x94;
solidColor = down ? kITEColorLightBlue94 : kITEColorLightBlue96;
break;
case kEdit:
if (_vm->getGameId() == GID_ITE) {
cornerColor = frameColor = fillColor = kITEColorLightBlue96;
our = kITEColorDarkBlue8a;
odl = kITEColorLightBlue94;
solidColor = down ? kITEColorBlue : kITEColorDarkGrey0C;
} else {
cornerColor = frameColor = fillColor = _vm->KnownColor2ColorId(kKnownColorBlack);
our = odl = solidColor = _vm->KnownColor2ColorId(kKnownColorBlack);
}
iur = 0x97;
idl = 0x95;
break;
default:
cornerColor = 0x8b;
frameColor = _vm->KnownColor2ColorId(kKnownColorBlack);
solidColor = fillColor = kITEColorLightBlue96;
odl = kITEColorDarkBlue8a;
our = kITEColorLightBlue94;
idl = 0x97;
iur = 0x95;
if (down) {
SWAP(odl, our);
SWAP(idl, iur);
}
break;
switch (kind) {
case kSlider:
cornerColor = 0x8b;
frameColor = _vm->KnownColor2ColorId(kKnownColorBlack);
fillColor = kITEColorLightBlue96;
odl = kITEColorDarkBlue8a;
our = kITEColorLightBlue92;
idl = 0x89;
iur = 0x94;
solidColor = down ? kITEColorLightBlue94 : kITEColorLightBlue96;
break;
case kEdit:
if (_vm->getGameId() == GID_ITE) {
cornerColor = frameColor = fillColor = kITEColorLightBlue96;
our = kITEColorDarkBlue8a;
odl = kITEColorLightBlue94;
solidColor = down ? kITEColorBlue : kITEColorDarkGrey0C;
} else {
cornerColor = frameColor = fillColor = _vm->KnownColor2ColorId(kKnownColorBlack);
our = odl = solidColor = _vm->KnownColor2ColorId(kKnownColorBlack);
}
iur = 0x97;
idl = 0x95;
break;
default:
cornerColor = 0x8b;
frameColor = _vm->KnownColor2ColorId(kKnownColorBlack);
solidColor = fillColor = kITEColorLightBlue96;
odl = kITEColorDarkBlue8a;
our = kITEColorLightBlue94;
idl = 0x97;
iur = 0x95;
if (down) {
SWAP(odl, our);
SWAP(idl, iur);
}
break;
}
int x = rect.left;

View File

@ -303,8 +303,8 @@ void IsoMap::adjustScroll(bool jump) {
_viewScroll.x = maxScrollPos.x;
}
} else {
_viewScroll.y = smoothSlide( _viewScroll.y, minScrollPos.y, maxScrollPos.y );
_viewScroll.x = smoothSlide( _viewScroll.x, minScrollPos.x, maxScrollPos.x );
_viewScroll.y = smoothSlide(_viewScroll.y, minScrollPos.y, maxScrollPos.y);
_viewScroll.x = smoothSlide(_viewScroll.x, minScrollPos.x, maxScrollPos.x);
}
if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
@ -429,7 +429,7 @@ void IsoMap::drawTiles(const Location *location) {
workAreaWidth = _vm->getDisplayInfo().width + 128;
workAreaHeight = _vm->_scene->getHeight() + 128 + 80;
for (u1 = u0, v1 = v0; metaTileY.y < workAreaHeight; u1--, v1-- ) {
for (u1 = u0, v1 = v0; metaTileY.y < workAreaHeight; u1--, v1--) {
metaTileX = metaTileY;
for (u2 = u1, v2 = v1; metaTileX.x < workAreaWidth; u2++, v2--, metaTileX.x += 256) {
@ -611,7 +611,7 @@ void IsoMap::drawSpritePlatform(uint16 platformIndex, const Point &point, const
for (u = SAGA_PLATFORM_W - 1,
copyLocation.u() = location.u() - ((SAGA_PLATFORM_W - 1) << 4);
u >= 0 && s.x + 32 > _tileClip.left && s.y - SAGA_MAX_TILE_H < _tileClip.bottom;
u--, copyLocation.u() += 16, s.x -= 16, s.y += 8 ) {
u--, copyLocation.u() += 16, s.x -= 16, s.y += 8) {
if (s.x < _tileClip.right && s.y > _tileClip.top) {
tileIndex = tilePlatform->tiles[u][v];
@ -663,7 +663,7 @@ void IsoMap::drawPlatform(uint16 platformIndex, const Point &point, int16 absU,
for (u = SAGA_PLATFORM_W - 1;
u >= 0 && s.x + 32 > _tileClip.left && s.y - SAGA_MAX_TILE_H < _tileClip.bottom;
u--, s.x -= 16, s.y += 8 ) {
u--, s.x -= 16, s.y += 8) {
if (s.x < _tileClip.right && s.y > _tileClip.top) {
tileIndex = tilePlatform->tiles[u][v];
@ -955,7 +955,7 @@ void IsoMap::pushPoint(int16 u, int16 v, uint16 cost, uint16 direction) {
}
}
if (mid < _queueCount ) {
if (mid < _queueCount) {
memmove(tilePoint + 1, tilePoint, (_queueCount - mid) * sizeof (*tilePoint));
}
_queueCount++;
@ -1211,7 +1211,7 @@ void IsoMap::placeOnTileMap(const Location &start, Location &result, int16 dista
for (dir = 0; dir < 8; dir++) {
terrainMask = terraComp[dir];
if (terrainMask & SAGA_IMPASSABLE ) {
if (terrainMask & SAGA_IMPASSABLE) {
continue;
}
@ -1352,11 +1352,11 @@ void IsoMap::findDragonTilePath(ActorData* actor,const Location &start, const Lo
continue;
}
tile = getTile(u1, v1, _platformHeight );
tile = getTile(u1, v1, _platformHeight);
if (tile != NULL) {
mask = tile->terrainMask;
if (((mask != 0) && (tile->GetFGDAttr() >= kTerrBlock)) ||
((mask != 0xFFFF) && (tile->GetBGDAttr() >= kTerrBlock)) ) {
((mask != 0xFFFF) && (tile->GetBGDAttr() >= kTerrBlock))) {
pcell->visited = 1;
}
} else {
@ -1453,7 +1453,7 @@ void IsoMap::findDragonTilePath(ActorData* actor,const Location &start, const Lo
actor->_walkStepsCount = i;
if (i) {
actor->setTileDirectionsSize(i, false);
memcpy(actor->_tileDirections, res, i );
memcpy(actor->_tileDirections, res, i);
}
}
@ -1586,7 +1586,7 @@ void IsoMap::findTilePath(ActorData* actor, const Location &start, const Locatio
actor->_walkStepsCount = i;
if (i) {
actor->setTileDirectionsSize(i, false);
memcpy(actor->_tileDirections, res, i );
memcpy(actor->_tileDirections, res, i);
}
}

View File

@ -459,9 +459,9 @@ void Puzzle::solicitHint() {
_vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this);
_vm->_interface->converseClear();
_vm->_interface->converseAddText(optionsStr[_lang][kROAccept], 0, 1, 0, 0 );
_vm->_interface->converseAddText(optionsStr[_lang][kRODecline], 0, 2, 0, 0 );
_vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0, 0 );
_vm->_interface->converseAddText(optionsStr[_lang][kROAccept], 0, 1, 0, 0);
_vm->_interface->converseAddText(optionsStr[_lang][kRODecline], 0, 2, 0, 0);
_vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0, 0);
_vm->_interface->converseDisplayText();
break;

View File

@ -1315,7 +1315,7 @@ void Script::setVerb(int verb) {
// engine did it, but it appears to work.
_pointerObject = ID_NOTHING;
setLeftButtonVerb( verb );
setLeftButtonVerb(verb);
showVerb();
}
@ -1549,7 +1549,7 @@ void Script::playfieldClick(const Point& mousePoint, bool leftButton) {
}
if (_pointerObject != ID_NOTHING) {
hitObject( leftButton );
hitObject(leftButton);
} else {
_pendingObject[0] = ID_NOTHING;
_pendingObject[1] = ID_NOTHING;
@ -1618,7 +1618,7 @@ void Script::playfieldClick(const Point& mousePoint, bool leftButton) {
_vm->_actor->actorWalkTo(ID_PROTAG, pickLocation);
} else {
if (_pendingVerb == getVerbType(kVerbLookAt)) {
if (objectTypeId(_pendingObject[0]) != kGameObjectActor ) {
if (objectTypeId(_pendingObject[0]) != kGameObjectActor) {
_vm->_actor->actorWalkTo(ID_PROTAG, pickLocation);
} else {
doVerb();

View File

@ -1134,7 +1134,7 @@ bool Console::cmdRestoreGame(int argc, const char **argv) {
}
bool Console::cmdRestartGame(int argc, const char **argv) {
_engine->_gamestate->abortScriptProcessing = kAbortRestartGame;;
_engine->_gamestate->abortScriptProcessing = kAbortRestartGame;
return Cmd_Exit(0, 0);
}

View File

@ -845,7 +845,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 104;//turning left
frame += 1;
} while (frame < lastCount );
} while (frame < lastCount);
}
if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) {
// turn at the end of the current walk
@ -853,7 +853,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 200; //was 60 now 116
frame += 1;
} while (frame < lastCount );
} while (frame < lastCount);
}
lastDir = currentDir;
}
@ -1272,7 +1272,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 104;//turning left
frame += 1;
} while (frame < lastCount );
} while (frame < lastCount);
}
if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) {
// turn at the end of the current walk
@ -1280,7 +1280,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 200; //was 60 now 116
frame += 1;
} while (frame < lastCount );
} while (frame < lastCount);
}
}
// all turns checked
@ -1305,7 +1305,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 278;//stopping right
frame += 1;
} while (frame < lastCount );
} while (frame < lastCount);
walkAnim[stepCount].frame = 308;
walkAnim[stepCount].step = 7;
walkAnim[stepCount].dir = currentDir;
@ -1316,7 +1316,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 279;//stopping right
frame += 1;
} while (frame < lastCount );
} while (frame < lastCount);
walkAnim[stepCount].frame = 315;
walkAnim[stepCount].step = 7;
walkAnim[stepCount].dir = currentDir;
@ -1332,7 +1332,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 244;//stopping left
frame += 1;
} while (frame < lastCount );
} while (frame < lastCount);
walkAnim[stepCount].frame = 322;
walkAnim[stepCount].step = 7;
walkAnim[stepCount].dir = currentDir;
@ -1343,7 +1343,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) {
do {
walkAnim[frame].frame += 245;//stopping left
frame += 1;
} while (frame < lastCount );
} while (frame < lastCount);
walkAnim[stepCount].frame = 329;
walkAnim[stepCount].step = 7;
walkAnim[stepCount].dir = currentDir;
@ -2097,9 +2097,9 @@ int whatTarget(int32 startX, int32 startY, int32 destX, int32 destY) {
int signY = (deltaY > 0);
int slope;
if ((ABS(deltaY) * DIAGONALX ) < (ABS(deltaX) * DIAGONALY / 2))
if ((ABS(deltaY) * DIAGONALX) < (ABS(deltaX) * DIAGONALY / 2))
slope = 0;// its flat
else if ((ABS(deltaY) * DIAGONALX / 2) > (ABS(deltaX) * DIAGONALY ) )
else if ((ABS(deltaY) * DIAGONALX / 2) > (ABS(deltaX) * DIAGONALY))
slope = 2;// its vertical
else
slope = 1;// its diagonal

View File

@ -366,7 +366,7 @@ void Screen::draw() {
if (_currentScreen == 54) {
// rm54 has a BACKGROUND parallax layer in parallax[0]
if (_parallax[0] && !SwordEngine::isPsx() ) //Avoid drawing this parallax on PSX edition, it gets occluded by background
if (_parallax[0] && !SwordEngine::isPsx()) //Avoid drawing this parallax on PSX edition, it gets occluded by background
renderParallax(_parallax[0]);
uint8 *src = _layerBlocks[0];
uint8 *dest = _screenBuf;
@ -539,7 +539,7 @@ void Screen::processImage(uint32 id) {
|| (compact->o_resource == LVSFLY) || (!(compact->o_resource == GEORGE_MEGA) && (sprSizeX < 260))))
drawSprite(sprData + incr, spriteX, spriteY, sprSizeX, sprSizeY, sprPitch);
else if (((sprSizeX >= 260) && (sprSizeX < 450)) || ((compact->o_resource == GMWRITH) && (sprSizeX < 515)) // a psx shrinked sprite (1/2 width)
|| ((compact->o_resource == GMPOWER) && (sprSizeX < 515)) ) // some needs to be hardcoded, headers don't give useful infos
|| ((compact->o_resource == GMPOWER) && (sprSizeX < 515))) // some needs to be hardcoded, headers don't give useful infos
drawPsxHalfShrinkedSprite(sprData + incr, spriteX, spriteY, sprSizeX / 2, sprSizeY, sprPitch / 2);
else if (sprSizeX >= 450) // A PSX double shrinked sprite (1/3 width)
drawPsxFullShrinkedSprite(sprData + incr, spriteX, spriteY, sprSizeX / 3, sprSizeY, sprPitch / 3);
@ -1187,7 +1187,7 @@ void Screen::spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *pSprWidth, u
gridW *= 2; // and masking problems when sprites are stretched in width
uint16 bottomSprPos = (*pSprY + (*pSprHeight) * 2); //Position of bottom line of sprite
if ( bottomSprPos > _scrnSizeY ) { //Check that resized psx sprite isn't drawn outside of screen boundaries
if (bottomSprPos > _scrnSizeY) { //Check that resized psx sprite isn't drawn outside of screen boundaries
uint16 outScreen = bottomSprPos - _scrnSizeY;
*pSprHeight -= (outScreen % 2) ? (outScreen + 1) / 2 : outScreen / 2;
}

View File

@ -49,7 +49,7 @@ Text::Text(ObjectMan *pObjMan, ResMan *pResMan, bool czechVersion) {
_fontId = (czechVersion) ? CZECH_GAME_FONT : GAME_FONT;
_font = (uint8*)_resMan->openFetchRes(_fontId);
_joinWidth = charWidth( SPACE ) - 2 * OVERLAP;
_joinWidth = charWidth(SPACE) - 2 * OVERLAP;
_charHeight = _resMan->getUint16(_resMan->fetchFrame(_font, 0)->height); // all chars have the same height
for (int i = 0; i < MAX_TEXT_OBS; i++)
_textBlocks[i] = NULL;
@ -145,12 +145,12 @@ uint16 Text::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) {
// (with a separating space character - also overlapped)
uint16 spaceNeeded = _joinWidth + wordWidth;
if (line[lineNo].width + spaceNeeded <= maxWidth ) {
if (line[lineNo].width + spaceNeeded <= maxWidth) {
line[lineNo].width += spaceNeeded;
line[lineNo].length += 1 + wordLength; // NB. space+word characters
} else { // put word (without separating SPACE) at start of next line
lineNo++;
assert( lineNo < MAX_LINES );
assert(lineNo < MAX_LINES);
line[lineNo].width = wordWidth;
line[lineNo].length = wordLength;
}

View File

@ -341,7 +341,7 @@ void Mouse::systemMenuMouse() {
if ((icon_list[hit] == OPTIONS_ICON || icon_list[hit] == QUIT_ICON
|| icon_list[hit] == SAVE_ICON || icon_list[hit] == RESTORE_ICON
|| icon_list[hit] == RESTART_ICON ) && Sword2Engine::isPsx() )
|| icon_list[hit] == RESTART_ICON) && Sword2Engine::isPsx())
return;
// No save when dead

View File

@ -158,7 +158,7 @@ void Animation::drawFrame(Graphics::Surface &surface, int32 frame, int32 xx, int
int32 destPitch = surface.pitch;
uint8 *srcRow = _frames[frame]._data;
uint8 *curRow = (uint8 *)surface.pixels + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1) ;
uint8 *curRow = (uint8 *)surface.pixels + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1);
for (int32 y = 0; y < rectY; y++) {
uint8 *cur = curRow;
uint8 *c = srcRow + y * (_frames[frame]._x2 - _frames[frame]._x1);
@ -344,20 +344,20 @@ void Animation::drawFrameOnPicture(int32 frame, int32 xx, int32 yy) {
return;
if (rectX + xx + _x1 + _frames[frame]._x1 >= pic->getWidth())
rectX = pic->getWidth() - xx - _x1 - _frames[frame]._x1 ;
rectX = pic->getWidth() - xx - _x1 - _frames[frame]._x1;
if (rectX < 0)
return;
if (rectY + yy + _y1 + _frames[frame]._y1 >= pic->getHeight())
rectY = pic->getHeight() - yy - _y1 - _frames[frame]._y1 ;
rectY = pic->getHeight() - yy - _y1 - _frames[frame]._y1;
if (rectY < 0)
return;
int32 destPitch = pic->getWidth();
uint8 *c = _frames[frame]._data;
uint8 *curRow = (uint8 *)pic->getDataPtr() + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1) ;
uint8 *curRow = (uint8 *)pic->getDataPtr() + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1);
for (int32 y = 0; y < rectY; y++) {
unsigned char *cur = curRow;
for (int32 x = 0; x < rectX; x++) {
@ -477,7 +477,7 @@ void AnimationInstance::setPosition(int32 x, int32 y, int32 z, bool relative) {
_y = y;
_z = z;
} else {
_x = x - _animation->_x1 ;
_x = x - _animation->_x1;
_y = y - _animation->_y1;
_z = z;
}
@ -547,7 +547,7 @@ void AnimationInstance::setX(int32 x, bool relative) {
if (relative || !_animation)
_x = x;
else
_x = x - _animation->_x1 ;
_x = x - _animation->_x1;
}
void AnimationInstance::setY(int32 y, bool relative) {
@ -555,7 +555,7 @@ void AnimationInstance::setY(int32 y, bool relative) {
if (relative || !_animation)
_y = y;
else
_y = y - _animation->_y1 ;
_y = y - _animation->_y1;
}
void AnimationInstance::setZ(int32 z, bool relative) {
@ -572,15 +572,15 @@ int32 AnimationInstance::getLayerZ() const {
}
int32 AnimationInstance::getX2() const {
return _x + _animation->_x1 ;
return _x + _animation->_x1;
}
int32 AnimationInstance::getY2() const {
return _y + _animation->_y1 ;
return _y + _animation->_y1;
}
int32 AnimationInstance::getZ2() const {
return _z ;
return _z;
}
void AnimationInstance::save(Common::WriteStream *stream) {
@ -659,7 +659,7 @@ void AnimationManager::removeInstance(AnimationInstance *instance) {
void AnimationManager::removeAllInstances(AnimationInstanceType type) {
debugC(1, kDebugAnim, "removeInstance(type)");
for (int32 i = (int32)_instances.size(); i >= 0 ; i--) {
for (int32 i = (int32)_instances.size(); i >= 0; i--) {
if (_instances[i]->getType() & type)
_instances.remove_at(i);
}

View File

@ -117,7 +117,7 @@ void AudioManager::playVoice(int32 id, bool genericVoice) {
_channels[2]->stop(false);
}
Common::SeekableReadStream *stream ;
Common::SeekableReadStream *stream;
if (genericVoice)
stream = _audioPacks[0]->getStream(id);
else
@ -132,7 +132,7 @@ void AudioManager::playSFX(int32 id, int32 volume , bool genericSFX) {
debugC(4, kDebugAudio, "playSFX(%d, %d)", id, (genericSFX) ? 1 : 0);
// find a free SFX channel
Common::SeekableReadStream *stream ;
Common::SeekableReadStream *stream;
if (genericSFX)
stream = _audioPacks[2]->getStream(id, true);
@ -288,7 +288,7 @@ bool AudioStreamInstance::readPacket() {
void AudioStreamInstance::decodeADPCM(uint8 *comp, int16 *dest, int32 packetSize) {
debugC(5, kDebugAudio, "decodeADPCM(comp, dest, %d)", packetSize);
int32 numSamples = 2 * packetSize ;
int32 numSamples = 2 * packetSize;
int32 v18 = _lastADPCMval1;
int32 v19 = _lastADPCMval2;
for (int32 i = 0; i < numSamples; i++) {

View File

@ -80,7 +80,7 @@ int32 CharacterFlux::fixFacingForAnimation(int32 originalFacing, int32 animation
int32 v6 = 1 << originalFacing;
int32 facingMask = 0;
do {
if ( v6 & animFacingFlag) {
if (v6 & animFacingFlag) {
facingMask = v6;
} else if (v5 & animFacingFlag) {
facingMask = v5;
@ -91,9 +91,9 @@ int32 CharacterFlux::fixFacingForAnimation(int32 originalFacing, int32 animation
while (!facingMask);
int32 finalFacing = 0;
for (finalFacing = 0; ; ++finalFacing ) {
for (finalFacing = 0; ; ++finalFacing) {
facingMask >>= 1;
if ( !facingMask )
if (!facingMask)
break;
}

View File

@ -65,7 +65,7 @@ int32 Hotspots::FindBasedOnCorner(int32 x, int32 y) {
if (_items[i].getMode() == -1)
return _items[i].getRef();
return i ;
return i;
}
}
}

View File

@ -99,7 +99,7 @@ int32 PathFindingHeap::pop(int32 *x, int32 *y, int32 *weight) {
int32 lT = 1;
while (1) {
lT = lMin << 1 ;
lT = lMin << 1;
if (lT <= _count) {
if (lT < _count) {
if (_data[lT + 1]._weight < _data[lT]._weight)
@ -169,7 +169,7 @@ int32 PathFinding::findClosestWalkingPoint(int32 xx, int32 yy, int32 *fxx, int32
origY = yy;
for (int y = 0; y < _height; y++) {
for (int x = 0; x < _width ; x++) {
for (int x = 0; x < _width; x++) {
if (isWalkable(x, y)) {
int32 ndist = (x - xx) * (x - xx) + (y - yy) * (y - yy);
int32 ndist2 = (x - origX) * (x - origX) + (y - origY) * (y - origY);

View File

@ -161,7 +161,7 @@ void Picture::drawMask(Graphics::Surface &surface, int32 x, int32 y, int32 dx, i
int32 destPitch = surface.pitch;
int32 srcPitch = _width;
uint8 *c = _data + _width * dy + dx ;
uint8 *c = _data + _width * dy + dx;
uint8 *curRow = (uint8 *)surface.pixels + y * destPitch + x;
for (int32 yy = 0; yy < ry; yy++) {
@ -190,14 +190,14 @@ void Picture::draw(Graphics::Surface &surface, int32 x, int32 y, int32 dx, int32
int32 destPitch = surface.pitch;
int32 srcPitch = _width;
uint8 *c = _data + _width * dy + dx ;
uint8 *c = _data + _width * dy + dx;
uint8 *curRow = (uint8 *)surface.pixels + y * destPitch + x;
for (int32 yy = 0; yy < ry; yy++) {
uint8 *curSrc = c;
uint8 *cur = curRow;
for (int32 xx = 0; xx < rx; xx++) {
*cur = *curSrc ;
*cur = *curSrc;
curSrc++;
cur++;
}

View File

@ -122,7 +122,7 @@ Common::SeekableReadStream *PakFile::createReadStream(Common::String fileName) {
debugC(1, kDebugResource, "createReadStream(%s)", fileName.c_str());
int32 offset = 0;
int32 size = 0 ;
int32 size = 0;
for (uint32 i = 0; i < _numFiles; i++) {
if (fileName.compareToIgnoreCase(_files[i]._name) == 0) {
size = _files[i]._size;

View File

@ -86,7 +86,7 @@ void ToonEngine::init() {
_currentTextLine = 0;
_currentTextLineId = -1;
_currentTextLineX = 0;
_currentTextLineY = 0 ;
_currentTextLineY = 0;
_currentTextLineCharacterId = 0;
_saveBufferStream = new Common::MemoryWriteStreamDynamic();

View File

@ -255,7 +255,7 @@ void VectorRendererSpec<PixelType>::
fillSurface() {
byte *ptr = (byte *)_activeSurface->getBasePtr(0, 0);
int h = _activeSurface->h ;
int h = _activeSurface->h;
int pitch = _activeSurface->pitch;
if (Base::_fillMode == kFillBackground) {

View File

@ -144,7 +144,7 @@ Graphics::DrawStep *ThemeParser::defaultDrawStep() {
Graphics::DrawStep *ThemeParser::newDrawStep() {
assert(_defaultStepGlobal);
Graphics::DrawStep *step = 0 ; //new DrawStep;
Graphics::DrawStep *step = 0; //new DrawStep;
if (_defaultStepLocal) {
step = new Graphics::DrawStep(*_defaultStepLocal);

View File

@ -140,7 +140,7 @@ public:
bool seek(const Timestamp &where);
Timestamp getLength() const { return _length; }
bool isStreamDecoderReady() const { return getStreamDecoderState() == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ; }
bool isStreamDecoderReady() const { return getStreamDecoderState() == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; }
protected:
uint getChannels() const { return MIN<uint>(_streaminfo.channels, MAX_OUTPUT_CHANNELS); }
@ -553,7 +553,7 @@ void FLACStream::convertBuffersGeneric(SampleType* bufDestination, const FLAC__i
for (; numSamples > 0; numSamples -= numChannels) {
for (uint i = 0; i < numChannels; ++i)
*bufDestination++ = static_cast<SampleType>(*(inChannels[i]++) >> kPower) ;
*bufDestination++ = static_cast<SampleType>(*(inChannels[i]++) >> kPower);
}
} else {
for (; numSamples > 0; numSamples -= numChannels) {

View File

@ -694,7 +694,7 @@ static int OPLOpenTable(void) {
return 0;
}
/* make total level table */
for (t = 0; t < EG_ENT - 1 ; t++) {
for (t = 0; t < EG_ENT - 1; t++) {
rate = ((1 << TL_BITS) - 1) / pow(10.0, EG_STEP * t / 20); /* dB -> voltage */
TL_TABLE[ t] = (int)rate;
TL_TABLE[TL_MAX + t] = -TL_TABLE[t];
@ -1082,10 +1082,10 @@ void OPLResetChip(FM_OPL *OPL) {
for (i = 0xff; i >= 0x20; i--)
OPLWriteReg(OPL,i,0);
/* reset OPerator parameter */
for (c = 0; c < OPL->max_ch ;c++ ) {
for (c = 0; c < OPL->max_ch; c++) {
OPL_CH *CH = &OPL->P_CH[c];
/* OPL->P_CH[c].PAN = OPN_CENTER; */
for (s = 0; s < 2; s++ ) {
for (s = 0; s < 2; s++) {
/* wave table */
CH->SLOT[s].wavetable = &SIN_TABLE[0];
/* CH->SLOT[s].evm = ENV_MOD_RR; */