From 34d5f929ac2c3b3e61a5bb48968a07c62e25f3ec Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 9 Nov 2015 21:40:18 +0100 Subject: MADS: Remove useless casts in per-game logic --- engines/mads/nebular/game_nebular.cpp | 18 +++++++++--------- engines/mads/phantom/game_phantom.cpp | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 578af51f54..1976bcb928 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -824,7 +824,7 @@ void GameNebular::unhandledAction() { void GameNebular::step() { if (_player._visible && _player._stepEnabled && !_player._moving && (_player._facing == _player._turnToFacing)) { - if (_scene._frameStartTime >= *((uint32 *)&_globals[kWalkerTiming])) { + if (_scene._frameStartTime >= (uint32)_globals[kWalkerTiming]) { if (!_player._stopWalkerIndex) { int randomVal = _vm->getRandomNumber(29999); if (_globals[kSexOfRex] == REX_MALE) { @@ -873,19 +873,19 @@ void GameNebular::step() { } } - *((uint32 *)&_globals[kWalkerTiming]) += 6; + _globals[kWalkerTiming] += 6; } } // Below is countdown to set the timebomb off in room 604 if (_globals[kTimebombStatus] == TIMEBOMB_ACTIVATED) { - int diff = _scene._frameStartTime - *((uint32 *)&_globals[kTimebombClock]); - if ((diff >= 0) && (diff <= 60)) { - *((uint32 *)&_globals[kTimebombTimer]) += diff; - } else { - ++*((uint32 *)&_globals[kTimebombTimer]); - } - *((uint32 *)&_globals[kTimebombClock]) = _scene._frameStartTime; + int diff = _scene._frameStartTime - _globals[kTimebombClock]; + if ((diff >= 0) && (diff <= 60)) + _globals[kTimebombTimer] += diff; + else + ++_globals[kTimebombTimer]; + + _globals[kTimebombClock] = (int) _scene._frameStartTime; } } diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp index 414b4b1bc3..9ed8d24c9b 100644 --- a/engines/mads/phantom/game_phantom.cpp +++ b/engines/mads/phantom/game_phantom.cpp @@ -744,11 +744,11 @@ void GamePhantom::step() { if (_player._visible && !_globals[kStopWalkerDisabled] && (_player._stepEnabled || (_vm->_gameConv->_running >= 0)) && !_player._moving && (_player._facing == _player._turnToFacing) - && (_scene._frameStartTime >= *((uint32 *)&_globals[kWalkerTiming]))) { + && (_scene._frameStartTime >= (uint32)_globals[kWalkerTiming])) { if (!_player._stopWalkerIndex) stopWalker(); - *((uint32 *)&_globals[kWalkerTiming]) += 6; + _globals[kWalkerTiming] += 6; } } @@ -797,7 +797,7 @@ void GamePhantom::stopWalkerBasic() { _player.addWalker(0, 0); _player.addWalker(0, 0); } else if (rndVal < 500) - *((uint32 *)&_globals[kWalkerTiming]) = _scene._frameStartTime; + _globals[kWalkerTiming] = (int)_scene._frameStartTime; break; case FACING_NORTH: -- cgit v1.2.3