aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio/decoders/xa.cpp4
-rw-r--r--audio/mods/protracker.cpp2
-rw-r--r--engines/draci/game.cpp2
-rw-r--r--engines/draci/game.h2
-rw-r--r--engines/draci/sound.cpp4
-rw-r--r--engines/gob/detection/detection.cpp2
-rw-r--r--engines/gob/game.cpp2
-rw-r--r--engines/gob/goblin.cpp12
-rw-r--r--engines/gob/inter_v2.cpp16
-rw-r--r--engines/gob/sound/soundmixer.cpp4
-rw-r--r--engines/gob/surface.cpp2
-rw-r--r--engines/gob/util.cpp2
-rw-r--r--engines/kyra/sequences_hof.cpp2
-rw-r--r--engines/kyra/sound_lol.cpp2
-rw-r--r--engines/kyra/sound_towns.cpp4
-rw-r--r--engines/lure/hotspots.cpp10
-rw-r--r--engines/lure/res_struct.h4
-rw-r--r--engines/lure/surface.cpp2
-rw-r--r--engines/mads/nebular/game_nebular.cpp2
-rw-r--r--engines/mortevielle/dialogs.cpp2
-rw-r--r--engines/mortevielle/utils.cpp4
-rw-r--r--engines/prince/prince.h4
-rw-r--r--engines/saga/shorten.cpp2
-rw-r--r--engines/scumm/gfx.cpp2
-rw-r--r--engines/scumm/palette.cpp6
-rw-r--r--engines/scumm/players/player_v1.cpp4
-rw-r--r--engines/scumm/players/player_v2.cpp4
-rw-r--r--engines/scumm/players/player_v2base.cpp4
-rw-r--r--engines/sludge/function.cpp2
-rw-r--r--engines/testbed/testsuite.cpp2
-rw-r--r--engines/titanic/star_control/viewport.cpp2
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp2
-rw-r--r--engines/wintermute/ad/ad_actor.cpp2
-rw-r--r--graphics/macgui/mactext.cpp8
-rw-r--r--graphics/transparent_surface.cpp4
35 files changed, 67 insertions, 67 deletions
diff --git a/audio/decoders/xa.cpp b/audio/decoders/xa.cpp
index b18673411b..15a7439abf 100644
--- a/audio/decoders/xa.cpp
+++ b/audio/decoders/xa.cpp
@@ -83,7 +83,7 @@ int XAStream::readBuffer(int16 *buffer, const int numSamples) {
_samples[i] = _samples[i] + _s1 * s_xaDataTable[_predictor][0] + _s2 * s_xaDataTable[_predictor][1];
_s2 = _s1;
_s1 = _samples[i];
- int16 d = (int) (_samples[i] + 0.5);
+ int16 d = (int)(_samples[i] + 0.5);
buffer[samplesDecoded] = d;
samplesDecoded++;
_samplesRemaining--;
@@ -129,7 +129,7 @@ int XAStream::readBuffer(int16 *buffer, const int numSamples) {
_samples[i] = _samples[i] + _s1 * s_xaDataTable[_predictor][0] + _s2 * s_xaDataTable[_predictor][1];
_s2 = _s1;
_s1 = _samples[i];
- int16 d = (int) (_samples[i] + 0.5);
+ int16 d = (int)(_samples[i] + 0.5);
buffer[samplesDecoded] = d;
samplesDecoded++;
}
diff --git a/audio/mods/protracker.cpp b/audio/mods/protracker.cpp
index d486f02e89..2838b58d61 100644
--- a/audio/mods/protracker.cpp
+++ b/audio/mods/protracker.cpp
@@ -328,7 +328,7 @@ void ProtrackerStream::updateRow() {
_speed = exy;
} else {
_bpm = exy;
- setInterruptFreq((int) (getRate() / (_bpm * 0.4)));
+ setInterruptFreq((int)(getRate() / (_bpm * 0.4)));
}
break;
default:
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index af57b1eb37..f82ef395f3 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -135,7 +135,7 @@ Game::Game(DraciEngine *vm) : _vm(vm), _walkingState(vm) {
}
_dialogueVars = new int[curOffset];
- memset(_dialogueVars, 0, sizeof (int) * curOffset);
+ memset(_dialogueVars, 0, sizeof(int) * curOffset);
// Read in game info
file = initArchive->getFile(3);
diff --git a/engines/draci/game.h b/engines/draci/game.h
index 1e3cca9b9d..95a21da505 100644
--- a/engines/draci/game.h
+++ b/engines/draci/game.h
@@ -257,7 +257,7 @@ public:
int getItemStatus(int itemID) const { return _itemStatus[itemID]; }
void setItemStatus(int itemID, int status) { _itemStatus[itemID] = status; }
- GameItem *getItem(int id) { return id >= 0 && id < (int) _info._numItems ? &_items[id] : NULL; }
+ GameItem *getItem(int id) { return id >= 0 && id < (int)_info._numItems ? &_items[id] : NULL; }
GameItem *getCurrentItem() const { return _currentItem; }
void setCurrentItem(GameItem *item) { _currentItem = item; }
int getPreviousItemPosition() const { return _previousItemPosition; }
diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp
index cbc9eb983d..953e1355ff 100644
--- a/engines/draci/sound.cpp
+++ b/engines/draci/sound.cpp
@@ -151,7 +151,7 @@ void LegacySoundArchive::clearCache() {
*/
SoundSample *LegacySoundArchive::getSample(int i, uint freq) {
// Check whether requested file exists
- if (i < 0 || i >= (int) _sampleCount) {
+ if (i < 0 || i >= (int)_sampleCount) {
return NULL;
}
@@ -230,7 +230,7 @@ void ZipSoundArchive::clearCache() {
}
SoundSample *ZipSoundArchive::getSample(int i, uint freq) {
- if (i < 0 || i >= (int) _sampleCount) {
+ if (i < 0 || i >= (int)_sampleCount) {
return NULL;
}
debugCN(2, kDraciArchiverDebugLevel, "Accessing sample %d.%s from archive %s (format %d@%d, capacity %d): ",
diff --git a/engines/gob/detection/detection.cpp b/engines/gob/detection/detection.cpp
index 864a701aa6..70fea401f2 100644
--- a/engines/gob/detection/detection.cpp
+++ b/engines/gob/detection/detection.cpp
@@ -151,7 +151,7 @@ const Gob::GOBGameDescription *GobMetaEngine::detectOnceUponATime(const Common::
if ((gameType == Gob::kOnceUponATimeInvalid) || (platform == Gob::kOnceUponATimePlatformInvalid)) {
warning("GobMetaEngine::detectOnceUponATime(): Detection failed (%d, %d)",
- (int) gameType, (int) platform);
+ (int)gameType, (int)platform);
return 0;
}
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index d8e39e6c38..86fb207379 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -796,7 +796,7 @@ int16 Game::checkKeys(int16 *pMouseX, int16 *pMouseY,
if (_vm->_mult->_multData && _vm->_inter->_variables &&
(VAR(58) != 0)) {
- if (_vm->_mult->_multData->frameStart != (int) VAR(58) - 1)
+ if (_vm->_mult->_multData->frameStart != (int)VAR(58) - 1)
_vm->_mult->_multData->frameStart++;
else
_vm->_mult->_multData->frameStart = 0;
diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp
index 5f697d21fb..058e73b514 100644
--- a/engines/gob/goblin.cpp
+++ b/engines/gob/goblin.cpp
@@ -724,8 +724,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) {
}
}
- _pressedMapX = CLIP((int) _pressedMapX, 0, _vm->_map->getMapWidth() - 1);
- _pressedMapY = CLIP((int) _pressedMapY, 0, _vm->_map->getMapHeight() - 1);
+ _pressedMapX = CLIP((int)_pressedMapX, 0, _vm->_map->getMapWidth() - 1);
+ _pressedMapY = CLIP((int)_pressedMapY, 0, _vm->_map->getMapHeight() - 1);
}
void Goblin::adjustTarget() {
@@ -745,8 +745,8 @@ void Goblin::adjustTarget() {
_pressedMapX++;
}
}
- _pressedMapX = CLIP((int) _pressedMapX, 0, _vm->_map->getMapWidth() - 1);
- _pressedMapY = CLIP((int) _pressedMapY, 0, _vm->_map->getMapHeight() - 1);
+ _pressedMapX = CLIP((int)_pressedMapX, 0, _vm->_map->getMapWidth() - 1);
+ _pressedMapY = CLIP((int)_pressedMapY, 0, _vm->_map->getMapHeight() - 1);
}
void Goblin::targetDummyItem(Gob_Object *gobDesc) {
@@ -896,8 +896,8 @@ void Goblin::targetItem() {
}
}
}
- _pressedMapX = CLIP((int) _pressedMapX, 0, _vm->_map->getMapWidth() - 1);
- _pressedMapY = CLIP((int) _pressedMapY, 0, _vm->_map->getMapHeight() - 1);
+ _pressedMapX = CLIP((int)_pressedMapX, 0, _vm->_map->getMapWidth() - 1);
+ _pressedMapY = CLIP((int)_pressedMapY, 0, _vm->_map->getMapHeight() - 1);
}
void Goblin::moveFindItem(int16 posX, int16 posY) {
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 1e8eddeef0..d61b1c94d1 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -872,13 +872,13 @@ void Inter_v2::o2_scroll() {
int16 curX;
int16 curY;
- startX = CLIP((int) _vm->_game->_script->readValExpr(), 0,
+ startX = CLIP((int)_vm->_game->_script->readValExpr(), 0,
_vm->_video->_surfWidth - _vm->_width);
- startY = CLIP((int) _vm->_game->_script->readValExpr(), 0,
+ startY = CLIP((int)_vm->_game->_script->readValExpr(), 0,
_vm->_video->_surfHeight - _vm->_height);
- endX = CLIP((int) _vm->_game->_script->readValExpr(), 0,
+ endX = CLIP((int)_vm->_game->_script->readValExpr(), 0,
_vm->_video->_surfWidth - _vm->_width);
- endY = CLIP((int) _vm->_game->_script->readValExpr(), 0,
+ endY = CLIP((int)_vm->_game->_script->readValExpr(), 0,
_vm->_video->_surfHeight - _vm->_height);
stepX = _vm->_game->_script->readValExpr();
stepY = _vm->_game->_script->readValExpr();
@@ -886,10 +886,10 @@ void Inter_v2::o2_scroll() {
curX = startX;
curY = startY;
while (!_vm->shouldQuit() && ((curX != endX) || (curY != endY))) {
- curX = stepX > 0 ? MIN(curX + stepX, (int) endX) :
- MAX(curX + stepX, (int) endX);
- curY = stepY > 0 ? MIN(curY + stepY, (int) endY) :
- MAX(curY + stepY, (int) endY);
+ curX = stepX > 0 ? MIN(curX + stepX, (int)endX) :
+ MAX(curX + stepX, (int)endX);
+ curY = stepY > 0 ? MIN(curY + stepY, (int)endY) :
+ MAX(curY + stepY, (int)endY);
_vm->_draw->_scrollOffsetX = curX;
_vm->_draw->_scrollOffsetY = curY;
diff --git a/engines/gob/sound/soundmixer.cpp b/engines/gob/sound/soundmixer.cpp
index b5c26898ba..ef073e564b 100644
--- a/engines/gob/sound/soundmixer.cpp
+++ b/engines/gob/sound/soundmixer.cpp
@@ -86,7 +86,7 @@ void SoundMixer::stop(int16 fadeLength) {
_fade = true;
_fadeVol = 65536;
- _fadeSamples = (int) (fadeLength * (((double) _rate) / 10.0));
+ _fadeSamples = (int)(fadeLength * (((double) _rate) / 10.0));
_fadeVolStep = MAX((int32) 1, (int32) (65536 / _fadeSamples));
_curFadeSamples = 0;
}
@@ -133,7 +133,7 @@ void SoundMixer::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency,
} else {
_fade = true;
_fadeVol = 0;
- _fadeSamples = (int) (fadeLength * (((double) _rate) / 10.0));
+ _fadeSamples = (int)(fadeLength * (((double) _rate) / 10.0));
_fadeVolStep = - MAX((int32) 1, (int32) (65536 / _fadeSamples));
}
}
diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp
index ed83e8255c..a2c5614962 100644
--- a/engines/gob/surface.cpp
+++ b/engines/gob/surface.cpp
@@ -766,7 +766,7 @@ bool Surface::loadImage(Common::SeekableReadStream &stream, ImageType type) {
return loadJPEG(stream);
default:
- warning("Surface::loadImage(): Unknown image type: %d", (int) type);
+ warning("Surface::loadImage(): Unknown image type: %d", (int)type);
return false;
}
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 6bb4274421..8ca8e03b9b 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -496,7 +496,7 @@ void Util::setScrollOffset(int16 x, int16 y) {
void Util::insertStr(const char *str1, char *str2, int16 pos) {
int len1 = strlen(str1);
int len2 = strlen(str2);
- int from = MIN((int) pos, len2);
+ int from = MIN((int)pos, len2);
for (int i = len2; i >= from; i--)
str2[len1 + i] = str2[i];
diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp
index 7ee1ad7e4b..fc7a5239cc 100644
--- a/engines/kyra/sequences_hof.cpp
+++ b/engines/kyra/sequences_hof.cpp
@@ -385,7 +385,7 @@ SeqPlayer_HOF::SeqPlayer_HOF(KyraEngine_v1 *vm, Screen_v2 *screen, OSystem *syst
_sequenceStrings = _vm->staticres()->loadStrings(k2SeqplayStrings, tempSize);
uint8 multiplier = (_vm->gameFlags().platform == Common::kPlatformFMTowns || _vm->gameFlags().platform == Common::kPlatformPC98) ? 12 : 8;
for (int i = 0; i < MIN(33, tempSize); i++)
- _textDuration[i] = (int) strlen(_sequenceStrings[i]) * multiplier;
+ _textDuration[i] = (int)strlen(_sequenceStrings[i]) * multiplier;
if (_sequenceSoundList) {
for (int i = 0; i < _sequenceSoundListSize; i++) {
diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp
index 6e7551ed0e..51239bc444 100644
--- a/engines/kyra/sound_lol.cpp
+++ b/engines/kyra/sound_lol.cpp
@@ -38,7 +38,7 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) {
if (speaker < 65) {
if (_characters[speaker].flags & 1)
- speaker = (int) _characters[speaker].name[0];
+ speaker = (int)_characters[speaker].name[0];
else
speaker = 0;
}
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index 646f908b94..e1c9bc5324 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -601,8 +601,8 @@ void SoundTownsPC98_v2::playTrack(uint8 track) {
int trackNum = -1;
if (_vm->gameFlags().platform == Common::kPlatformFMTowns) {
for (uint i = 0; i < res()->cdaTableSize; i++) {
- if (track == (uint8) READ_LE_UINT16(&res()->cdaTable[i * 2])) {
- trackNum = (int) READ_LE_UINT16(&res()->cdaTable[i * 2 + 1]) - 1;
+ if (track == (uint8)READ_LE_UINT16(&res()->cdaTable[i * 2])) {
+ trackNum = (int)READ_LE_UINT16(&res()->cdaTable[i * 2 + 1]) - 1;
break;
}
}
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index b0b1830201..7513575bd4 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -509,7 +509,7 @@ void Hotspot::endAction() {
_voiceCtr = 0;
setActionCtr(0);
if (_hotspotId == PLAYER_ID)
- room.setCursorState((CursorState) ((int) room.cursorState() & 2));
+ room.setCursorState((CursorState) ((int)room.cursorState() & 2));
if (currentActions().top().hasSupportData()) {
CharacterScheduleEntry *rec = currentActions().top().supportData().next();
@@ -704,7 +704,7 @@ bool Hotspot::walkingStep() {
++_pathFinder.stepCtr();
} else {
warning("Hotspot %xh dir frame not found: currentFrame=%d, dir=%s",
- _hotspotId, frameNumber(), directionList[(int) _pathFinder.top().direction()]);
+ _hotspotId, frameNumber(), directionList[(int)_pathFinder.top().direction()]);
}
return false;
@@ -2781,7 +2781,7 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) {
assert(newEntry);
// Increment the blocked state
- h.setBlockedState((BlockedState) ((int) h.blockedState() + 1));
+ h.setBlockedState((BlockedState) ((int)h.blockedState() + 1));
if (!h.blockedFlag()) {
// Not already handling blocked, so add a new dummy action so that the new
// action set below will not replace the existing one
@@ -3095,7 +3095,7 @@ void HotspotTickHandlers::playerAnimHandler(Hotspot &h) {
h.tempDest().position.x = h.destX();
h.tempDest().position.y = h.destY();
h.tempDest().counter = 1;
- h.setBlockedState((BlockedState) ((int) h.blockedState() + 1));
+ h.setBlockedState((BlockedState) ((int)h.blockedState() + 1));
h.setRandomDest();
return;
}
@@ -4703,7 +4703,7 @@ void Support::characterChangeRoom(Hotspot &h, uint16 roomNumber,
h.tempDest().counter = 1;
Room::getReference().setCursorState(CS_BUMPED);
h.setActionCtr(0);
- h.setBlockedState((BlockedState) ((int) h.blockedState() + 1));
+ h.setBlockedState((BlockedState) ((int)h.blockedState() + 1));
h.setDestHotspot(0);
h.setRandomDest();
p.roomNumber = 0;
diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h
index a8a5e5aca8..bf22a4a5ac 100644
--- a/engines/lure/res_struct.h
+++ b/engines/lure/res_struct.h
@@ -861,8 +861,8 @@ public:
const char *getString(int index) {
return _entries[index].c_str();
}
- const char *getString(Action action) { return getString((int) action - 1); }
- const char *getString(StringEnum sEnum) { return getString((int) sEnum); }
+ const char *getString(Action action) { return getString((int)action - 1); }
+ const char *getString(StringEnum sEnum) { return getString((int)sEnum); }
void setString(Action action, const Common::String &s) { _entries[(int)action - 1] = s; }
};
diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp
index 7cbef0fe85..e9de795670 100644
--- a/engines/lure/surface.cpp
+++ b/engines/lure/surface.cpp
@@ -420,7 +420,7 @@ void Surface::wordWrap(char *text, uint16 width, char **&lines, uint8 &numLines)
wordEnd = strchr(wordStart, '\0') - 1;
}
- int wordBytes = (int) (wordEnd - s + 1);
+ int wordBytes = (int)(wordEnd - s + 1);
uint16 wordSize = (wordBytes == 0) ? 0 : textWidth(s, wordBytes);
if (gDebugLevel >= ERROR_DETAILED) {
char wordBuffer[MAX_DESC_SIZE];
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 99402748b8..459831fac1 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -888,7 +888,7 @@ void GameNebular::step() {
else
++_globals[kTimebombTimer];
- _globals[kTimebombClock] = (int) _scene._frameStartTime;
+ _globals[kTimebombClock] = (int)_scene._frameStartTime;
}
}
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 9df66846d2..ff1e026e9b 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -320,7 +320,7 @@ bool DialogManager::showKnowledgeCheck() {
int prevChoice = 1;
for (int j = firstOption; j <= lastOption; ++j, ++prevChoice) {
tmpStr = _vm->getString(j);
- if ((int) tmpStr.size() > maxLength)
+ if ((int)tmpStr.size() > maxLength)
maxLength = tmpStr.size();
_vm->_text->displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
choiceArray[prevChoice] = tmpStr;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 651bd5bf57..4ad8a8e4b3 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2491,7 +2491,7 @@ int MortevielleEngine::getAnimOffset(int frameNum, int animNum) {
*/
void MortevielleEngine::displayTextInDescriptionBar(int x, int y, int nb, int mesgId) {
Common::String tmpStr = getString(mesgId);
- if ((y == 182) && ((int) tmpStr.size() > nb))
+ if ((y == 182) && ((int)tmpStr.size() > nb))
y = 176;
_text->displayStr(tmpStr, x, y, nb, 20, _textColor);
}
@@ -2504,7 +2504,7 @@ void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
if ((mesgId > 499) && (mesgId < 563)) {
Common::String tmpStr = getString(mesgId - 501 + kInventoryStringIndex);
- if ((int) tmpStr.size() > ((58 + (kResolutionScaler - 1) * 37) << 1))
+ if ((int)tmpStr.size() > ((58 + (kResolutionScaler - 1) * 37) << 1))
_largestClearScreen = true;
else
_largestClearScreen = false;
diff --git a/engines/prince/prince.h b/engines/prince/prince.h
index e0b9490c37..9048bd5e81 100644
--- a/engines/prince/prince.h
+++ b/engines/prince/prince.h
@@ -184,7 +184,7 @@ struct Anim {
case kAnimX:
return _x;
default:
- error("getAnimData() - Wrong offset type: %d", (int) offset);
+ error("getAnimData() - Wrong offset type: %d", (int)offset);
}
}
@@ -192,7 +192,7 @@ struct Anim {
if (offset == kAnimX) {
_x = value;
} else {
- error("setAnimData() - Wrong offset: %d, value: %d", (int) offset, value);
+ error("setAnimData() - Wrong offset: %d, value: %d", (int)offset, value);
}
}
};
diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp
index db67d510bc..e230476edd 100644
--- a/engines/saga/shorten.cpp
+++ b/engines/saga/shorten.cpp
@@ -250,7 +250,7 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
// Get block size
if (version > 0) {
- blockSize = gReader->getUint32((int) (log((double) DEFAULT_BLOCK_SIZE) / M_LN2));
+ blockSize = gReader->getUint32((int)(log((double) DEFAULT_BLOCK_SIZE) / M_LN2));
maxLPC = gReader->getUint32(2);
mean = gReader->getUint32(0);
uint32 skipBytes = gReader->getUint32(1);
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 48818b8abf..f35c1e52fc 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -1808,7 +1808,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
// It was added as a kind of hack to fix some corner cases, but it compares
// the room width to the virtual screen width; but the former should always
// be bigger than the latter (except for MM NES, maybe)... strange
- int limit = MAX(_vm->_roomWidth, (int) vs->w) / 8 - x;
+ int limit = MAX(_vm->_roomWidth, (int)vs->w) / 8 - x;
if (limit > numstrip)
limit = numstrip;
if (limit > _numStrips - sx)
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 5275f1e942..aeb40df003 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -878,9 +878,9 @@ void ScummEngine::setShadowPalette(int redScale, int greenScale, int blueScale,
}
for (i = start; i < end; i++) {
- int r = (int) ((pal[0] >> 2) * redScale) >> 8;
- int g = (int) ((pal[1] >> 2) * greenScale) >> 8;
- int b = (int) ((pal[2] >> 2) * blueScale) >> 8;
+ int r = (int)((pal[0] >> 2) * redScale) >> 8;
+ int g = (int)((pal[1] >> 2) * greenScale) >> 8;
+ int b = (int)((pal[2] >> 2) * blueScale) >> 8;
pal += 3;
uint8 bestitem = 0;
diff --git a/engines/scumm/players/player_v1.cpp b/engines/scumm/players/player_v1.cpp
index 041f556120..b65c8a4d56 100644
--- a/engines/scumm/players/player_v1.cpp
+++ b/engines/scumm/players/player_v1.cpp
@@ -416,7 +416,7 @@ void Player_V1::nextPCjrCmd() {
switch (_channels[i].hull_counter) {
case 1:
_channels[i].volume -= _channels[i].attack;
- if ((int) _channels[i].volume <= 0) {
+ if ((int)_channels[i].volume <= 0) {
_channels[i].volume = 0;
_channels[i].hull_counter++;
}
@@ -432,7 +432,7 @@ void Player_V1::nextPCjrCmd() {
if (--_channels[i].sustctr < 0) {
_channels[i].sustctr = _channels[i].sustain_2;
_channels[i].volume += _channels[i].sustain_1;
- if ((int) _channels[i].volume >= 15) {
+ if ((int)_channels[i].volume >= 15) {
_channels[i].volume = 15;
_channels[i].hull_counter++;
}
diff --git a/engines/scumm/players/player_v2.cpp b/engines/scumm/players/player_v2.cpp
index c7ebd8abff..b58be8d881 100644
--- a/engines/scumm/players/player_v2.cpp
+++ b/engines/scumm/players/player_v2.cpp
@@ -85,7 +85,7 @@ void Player_V2::setMusicVolume (int vol) {
if (out > 0xffff)
_volumetable[i] = 0xffff;
else
- _volumetable[i] = (int) out;
+ _volumetable[i] = (int)out;
out /= 1.258925412; /* = 10 ^ (2/20) = 2dB */
}
@@ -191,7 +191,7 @@ int Player_V2::readBuffer(int16 *data, const int numSamples) {
void Player_V2::lowPassFilter(int16 *sample, uint len) {
for (uint i = 0; i < len; i++) {
- _level = (int) (_level * _decay
+ _level = (int)(_level * _decay
+ sample[0] * (0x10000 - _decay)) >> 16;
sample[0] = sample[1] = _level;
sample += 2;
diff --git a/engines/scumm/players/player_v2base.cpp b/engines/scumm/players/player_v2base.cpp
index 8df4afc198..7d3dab7935 100644
--- a/engines/scumm/players/player_v2base.cpp
+++ b/engines/scumm/players/player_v2base.cpp
@@ -602,8 +602,8 @@ void Player_V2Base::next_freqs(ChannelInfo *channel) {
channel->d.freqmod_offset -= channel->d.freqmod_modulo;
channel->d.freq =
- (int) (freqmod_table[channel->d.freqmod_table + (channel->d.freqmod_offset >> 4)])
- * (int) channel->d.freqmod_multiplier / 256
+ (int)(freqmod_table[channel->d.freqmod_table + (channel->d.freqmod_offset >> 4)])
+ * (int)channel->d.freqmod_multiplier / 256
+ channel->d.base_freq;
debug(9, "Freq: %d/%d, %d/%d/%d*%d %d",
diff --git a/engines/sludge/function.cpp b/engines/sludge/function.cpp
index 553e59d76c..7b4ab1553d 100644
--- a/engines/sludge/function.cpp
+++ b/engines/sludge/function.cpp
@@ -661,7 +661,7 @@ int startNewFunctionNum(uint funcNum, uint numParamsExpected,
loadFunctionCode(newFunc);
- if (newFunc->numArgs != (int) numParamsExpected)
+ if (newFunc->numArgs != (int)numParamsExpected)
return fatal("Wrong number of parameters!");
if (newFunc->numArgs > newFunc->numLocals)
return fatal("More arguments than local Variable space!");
diff --git a/engines/testbed/testsuite.cpp b/engines/testbed/testsuite.cpp
index 853f1288b3..2804dfab99 100644
--- a/engines/testbed/testsuite.cpp
+++ b/engines/testbed/testsuite.cpp
@@ -244,7 +244,7 @@ void Testsuite::updateStats(const char *prefix, const char *info, uint testNum,
byte *buffer = new byte[lRect * wRect];
memset(buffer, 0, sizeof(byte) * lRect * wRect);
- int wShaded = (int) (wRect * (((float)testNum) / numTests));
+ int wShaded = (int)(wRect * (((float)testNum) / numTests));
// draw the boundary
memset(buffer, barColor, sizeof(byte) * wRect);
diff --git a/engines/titanic/star_control/viewport.cpp b/engines/titanic/star_control/viewport.cpp
index b6482dad46..dcd8d787be 100644
--- a/engines/titanic/star_control/viewport.cpp
+++ b/engines/titanic/star_control/viewport.cpp
@@ -109,7 +109,7 @@ void CViewport::save(SimpleFile *file, int indent) {
file->writeFloatLine(_centerYAngleDegrees, indent);
file->writeFloatLine(_centerZAngleDegrees, indent);
file->writeNumberLine(_width | (_height << 16), indent);
- int field24 = (int) _starColor;
+ int field24 = (int)_starColor;
file->writeNumberLine(field24, indent);
for (int idx = 0; idx < 2; ++idx)
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 79e8963b58..92a64ca9c1 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -1474,7 +1474,7 @@ void Scene1500::dispatch() {
if (_sceneMode > 10) {
float yDiff = sqrt((float) (_smallShip._position.x * _smallShip._position.x) + (_smallShip._position.y * _smallShip._position.y));
if (yDiff > 6)
- _smallShip.setPosition(_smallShip._position, (int) yDiff);
+ _smallShip.setPosition(_smallShip._position, (int)yDiff);
}
Scene::dispatch();
diff --git a/engines/wintermute/ad/ad_actor.cpp b/engines/wintermute/ad/ad_actor.cpp
index 4661d3bca0..fdef2e170d 100644
--- a/engines/wintermute/ad/ad_actor.cpp
+++ b/engines/wintermute/ad/ad_actor.cpp
@@ -878,7 +878,7 @@ void AdActor::getNextStep() {
maxStepX--;
}
- if (((AdGame *)_gameRef)->_scene->isBlockedAt((int)_pFX, (int) _pFY, true, this)) {
+ if (((AdGame *)_gameRef)->_scene->isBlockedAt((int)_pFX, (int)_pFY, true, this)) {
if (_pFCount == 0) {
_state = _nextState;
_nextState = STATE_READY;
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 58017d9c45..366a79ba33 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -514,11 +514,11 @@ Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int
if (formatted)
res += _textLines[i].chunks[chunk].toString();
- if (endCol >= (int) _textLines[i].chunks[chunk].text.size())
+ if (endCol >= (int)_textLines[i].chunks[chunk].text.size())
res += _textLines[i].chunks[chunk].text;
else
res += Common::String(_textLines[i].chunks[chunk].text.c_str(), endCol);
- } else if ((int) _textLines[i].chunks[chunk].text.size() > startCol) {
+ } else if ((int)_textLines[i].chunks[chunk].text.size() > startCol) {
if (formatted)
res += _textLines[i].chunks[chunk].toString();
@@ -538,7 +538,7 @@ Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int
res += _textLines[i].chunks[chunk].toString();
res += _textLines[i].chunks[chunk].text;
- } else if ((int) _textLines[i].chunks[chunk].text.size() > startCol) {
+ } else if ((int)_textLines[i].chunks[chunk].text.size() > startCol) {
if (formatted)
res += _textLines[i].chunks[chunk].toString();
@@ -556,7 +556,7 @@ Common::String MacText::getTextChunk(int startRow, int startCol, int endRow, int
if (formatted)
res += _textLines[i].chunks[chunk].toString();
- if (endCol >= (int) _textLines[i].chunks[chunk].text.size())
+ if (endCol >= (int)_textLines[i].chunks[chunk].text.size())
res += _textLines[i].chunks[chunk].text;
else
res += Common::String(_textLines[i].chunks[chunk].text.c_str(), endCol);
diff --git a/graphics/transparent_surface.cpp b/graphics/transparent_surface.cpp
index 2a6fa7bfdf..02611aa60f 100644
--- a/graphics/transparent_surface.cpp
+++ b/graphics/transparent_surface.cpp
@@ -913,8 +913,8 @@ TransparentSurface *TransparentSurface::scaleT(uint16 newWidth, uint16 newHeight
*/
int spixelw = (srcW - 1);
int spixelh = (srcH - 1);
- int sx = (int) (65536.0f * (float) spixelw / (float) (dstW - 1));
- int sy = (int) (65536.0f * (float) spixelh / (float) (dstH - 1));
+ int sx = (int)(65536.0f * (float) spixelw / (float) (dstW - 1));
+ int sy = (int)(65536.0f * (float) spixelh / (float) (dstH - 1));
/* Maximum scaled source size */
int ssx = (srcW << 16) - 1;