diff options
author | Strangerke | 2019-08-25 00:25:30 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:35 +0200 |
commit | b29317c0b0f9d90b7f8f85eb682b2621d78656fb (patch) | |
tree | 88ac8d962b96762936cae820840948aa7d20f36a /engines/hdb/hdb.cpp | |
parent | 36c2b15ab92ba84e4de0353b2622272606491684 (diff) | |
download | scummvm-rg350-b29317c0b0f9d90b7f8f85eb682b2621d78656fb.tar.gz scummvm-rg350-b29317c0b0f9d90b7f8f85eb682b2621d78656fb.tar.bz2 scummvm-rg350-b29317c0b0f9d90b7f8f85eb682b2621d78656fb.zip |
HDB: Janitorial - Fix some code formatting
Diffstat (limited to 'engines/hdb/hdb.cpp')
-rw-r--r-- | engines/hdb/hdb.cpp | 60 |
1 files changed, 42 insertions, 18 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index 62e2ec8d67..557c8bac75 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -715,11 +715,20 @@ void HDBGame::useEntity(AIEntity *e) { // Diverters are very special - don't mess with their direction & state! if (e->type == AI_DIVERTER) { switch (e->dir2) { - case DIR_DOWN: e->state = STATE_DIVERTER_BL; break; - case DIR_UP: e->state = STATE_DIVERTER_BR; break; - case DIR_LEFT: e->state = STATE_DIVERTER_TL; break; - case DIR_RIGHT: e->state = STATE_DIVERTER_TR; break; - case DIR_NONE: break; + case DIR_DOWN: + e->state = STATE_DIVERTER_BL; + break; + case DIR_UP: + e->state = STATE_DIVERTER_BR; + break; + case DIR_LEFT: + e->state = STATE_DIVERTER_TL; + break; + case DIR_RIGHT: + e->state = STATE_DIVERTER_TR; + break; + case DIR_NONE: + break; } } @@ -737,11 +746,24 @@ void HDBGame::useEntity(AIEntity *e) { // need to set the state AFTER the SetEntityGoal! switch (p->dir) { - case DIR_UP: p->state = STATE_PUSHUP; p->drawYOff = -10; break; - case DIR_DOWN: p->state = STATE_PUSHDOWN; p->drawYOff = 9; break; - case DIR_LEFT: p->state = STATE_PUSHLEFT; p->drawXOff = -10; break; - case DIR_RIGHT: p->state = STATE_PUSHRIGHT; p->drawXOff = 10; break; - case DIR_NONE: break; + case DIR_UP: + p->state = STATE_PUSHUP; + p->drawYOff = -10; + break; + case DIR_DOWN: + p->state = STATE_PUSHDOWN; + p->drawYOff = 9; + break; + case DIR_LEFT: + p->state = STATE_PUSHLEFT; + p->drawXOff = -10; + break; + case DIR_RIGHT: + p->state = STATE_PUSHRIGHT; + p->drawXOff = 10; + break; + case DIR_NONE: + break; } // if player is running, keep speed slow since we're pushing @@ -752,17 +774,21 @@ void HDBGame::useEntity(AIEntity *e) { switch (e->type) { case AI_CRATE: - g_hdb->_sound->playSound(SND_CRATE_SLIDE); break; + g_hdb->_sound->playSound(SND_CRATE_SLIDE); + break; case AI_LIGHTBARREL: case AI_FROGSTATUE: case AI_ICE_BLOCK: - g_hdb->_sound->playSound(SND_LIGHT_SLIDE); break; + g_hdb->_sound->playSound(SND_LIGHT_SLIDE); + break; case AI_HEAVYBARREL: case AI_MAGIC_EGG: case AI_BOOMBARREL: - g_hdb->_sound->playSound(SND_HEAVY_SLIDE); break; + g_hdb->_sound->playSound(SND_HEAVY_SLIDE); + break; case AI_DIVERTER: - g_hdb->_sound->playSound(SND_PUSH_DIVERTER); break; + g_hdb->_sound->playSound(SND_PUSH_DIVERTER); + break; default: break; } @@ -875,9 +901,8 @@ void HDBGame::setInMapName(const char *name) { Common::Error HDBGame::run() { // Initialize System - if (!_systemInit) { + if (!_systemInit) init(); - } // Initializes Graphics initGraphics(_screenWidth, _screenHeight, &_format); @@ -1056,9 +1081,8 @@ Common::Error HDBGame::run() { uint32 frameTime = curTime - lastTime; uint32 frameCap = 1000 / kGameFPS; - if (frameTime < frameCap) { + if (frameTime < frameCap) g_system->delayMillis(frameCap - frameTime); - } lastTime = g_system->getMillis(); } |