diff options
author | Strangerke | 2014-10-10 20:13:26 +0200 |
---|---|---|
committer | Strangerke | 2014-10-10 20:13:26 +0200 |
commit | f553a48329d1fc2fbea8c10ff37d7e51467d1e0b (patch) | |
tree | a2677605d9f123933a9dd3560377794e027f091a /engines | |
parent | f52d3fa84b1ce9f75a602b0d88e40d0a60cc6f97 (diff) | |
download | scummvm-rg350-f553a48329d1fc2fbea8c10ff37d7e51467d1e0b.tar.gz scummvm-rg350-f553a48329d1fc2fbea8c10ff37d7e51467d1e0b.tar.bz2 scummvm-rg350-f553a48329d1fc2fbea8c10ff37d7e51467d1e0b.zip |
PRINCE: Reduce the scope of several variables in Hero
Diffstat (limited to 'engines')
-rw-r--r-- | engines/prince/hero.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp index 8c13c6d1f9..06fba25ba9 100644 --- a/engines/prince/hero.cpp +++ b/engines/prince/hero.cpp @@ -109,9 +109,9 @@ uint16 Hero::getData(AttrId dataId) { } int Hero::getScaledValue(int size) { - int newSize = 0; int16 initScaleValue = _vm->_scaleValue; if (_vm->_scaleValue != 10000) { + int newSize = 0; for (int i = 0; i < size; i++) { initScaleValue -= 100; if (initScaleValue >= 0) { @@ -271,10 +271,6 @@ void Hero::showHeroShadow(Graphics::Surface *screen, DrawNode *drawNode) { // linear_loop for (int i = 0; i < heroSurfaceHeight; i++) { - int shadSkipX = 0; - int ctLoop = 0; - int sprModulo = 0; - int j; //retry_line: for (j = heroSurfaceHeight - i; j > 0; j--) { @@ -296,10 +292,14 @@ void Hero::showHeroShadow(Graphics::Surface *screen, DrawNode *drawNode) { break; } - bool skipLineFlag = false; //line_y_ok if (shadLastY != shadPosY && shadPosY >= 0 && shadPosY < 480 && shadPosX < 640) { shadLastY = shadPosY; + bool skipLineFlag = false; + int shadSkipX = 0; + int ctLoop = 0; + int sprModulo = 0; + if (shadPosX < 0) { shadSkipX = -1 * shadPosX; if (heroSurfaceWidth > shadSkipX) { @@ -746,17 +746,15 @@ void Hero::showHero() { } } - int x, y, dir; - if (_state == kHeroStateMove || _state == kHeroStateRun) { //go_for_it: while (1) { if (_currCoords != nullptr) { if (READ_LE_UINT32(_currCoords) != 0xFFFFFFFF) { - x = READ_LE_UINT16(_currCoords); - y = READ_LE_UINT16(_currCoords + 2); + int x = READ_LE_UINT16(_currCoords); + int y = READ_LE_UINT16(_currCoords + 2); _currCoords += 4; - dir = *_currDirTab; + int dir = *_currDirTab; _currDirTab++; if (_lastDirection != dir) { _phase = 0; |