diff options
author | Travis Howell | 2004-06-25 08:10:34 +0000 |
---|---|---|
committer | Travis Howell | 2004-06-25 08:10:34 +0000 |
commit | ae10ed243c658b3e0ecfc6fb70969caffddc6d3e (patch) | |
tree | 6e174a13bf2a0376b47932e041af7a00d994bc0a | |
parent | 0db578ac11eb451bda64eedd05bff07a0d7ae0b4 (diff) | |
download | scummvm-rg350-ae10ed243c658b3e0ecfc6fb70969caffddc6d3e.tar.gz scummvm-rg350-ae10ed243c658b3e0ecfc6fb70969caffddc6d3e.tar.bz2 scummvm-rg350-ae10ed243c658b3e0ecfc6fb70969caffddc6d3e.zip |
Minor cleanup
svn-id: r14037
-rw-r--r-- | scumm/akos.cpp | 14 | ||||
-rw-r--r-- | scumm/costume.cpp | 39 |
2 files changed, 30 insertions, 23 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index b91c75688f..d88d348e69 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -582,8 +582,7 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { if (_mirror) { /* Adjust X position */ - startScaleIndexX = 0x180 - xmoveCur; - j = startScaleIndexX; + startScaleIndexX = j = 0x180 - xmoveCur; for (i = 0; i < xmoveCur; i++) { if (v1.scaletable[j++] < _scaleX) cur_x -= v1.scaleXstep; @@ -603,8 +602,7 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { } else { /* No mirror */ /* Adjust X position */ - startScaleIndexX = 0x180 + xmoveCur; - j = startScaleIndexX; + startScaleIndexX = j = 0x180 + xmoveCur; for (i = 0; i < xmoveCur; i++) { if (v1.scaletable[j--] < _scaleX) cur_x += v1.scaleXstep; @@ -613,7 +611,7 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { rect.left = rect.right = cur_x; j = startScaleIndexX; - for (i = 0, skip = 0; i < _width; i++) { + for (i = 0; i < _width; i++) { if (rect.left >= _outwidth) { startScaleIndexX = j; skip++; @@ -623,6 +621,7 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { } } + if (skip) skip--; @@ -711,11 +710,10 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { cur_x = _outwidth - 1; } else { skip = -1 - rect.left; - if (skip <= 0) { + if (skip <= 0) drawFlag = 2; - } else { + else v1.skip_width -= skip; - } } } diff --git a/scumm/costume.cpp b/scumm/costume.cpp index e76974d421..72e3b70c90 100644 --- a/scumm/costume.cpp +++ b/scumm/costume.cpp @@ -70,9 +70,8 @@ const byte cost_scaleTable[256] = { #endif byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { - int i, skip; + int i, skip = 0; byte drawFlag = 1; - uint scal; bool use_scaling; byte startScaleIndexX; byte newAmiCost; @@ -112,9 +111,9 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { use_scaling = (_scaleX != 0xFF) || (_scaleY != 0xFF); - skip = 0; - if (use_scaling) { + + /* Scale direction */ v1.scaleXstep = -1; if (xmoveCur < 0) { xmoveCur = -xmoveCur; @@ -122,42 +121,47 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { } if (_mirror) { + /* Adjust X position */ startScaleIndexX = _scaleIndexX = 128 - xmoveCur; for (i = 0; i < xmoveCur; i++) { if (cost_scaleTable[_scaleIndexX++] < _scaleX) v1.x -= v1.scaleXstep; } + rect.right = rect.left = v1.x; + _scaleIndexX = startScaleIndexX; for (i = 0; i < _width; i++) { if (rect.right < 0) { skip++; startScaleIndexX = _scaleIndexX; } - scal = cost_scaleTable[_scaleIndexX++]; - if (scal < _scaleX) + if (cost_scaleTable[_scaleIndexX++] < _scaleX) rect.right++; } } else { + /* No mirror */ + /* Adjust X position */ startScaleIndexX = _scaleIndexX = xmoveCur + 128; for (i = 0; i < xmoveCur; i++) { - scal = cost_scaleTable[_scaleIndexX--]; - if (scal < _scaleX) + if (cost_scaleTable[_scaleIndexX--] < _scaleX) v1.x += v1.scaleXstep; } + rect.right = rect.left = v1.x; + _scaleIndexX = startScaleIndexX; for (i = 0; i < _width; i++) { if (rect.left >= _outwidth) { - skip++; startScaleIndexX = _scaleIndexX; + skip++; } - scal = cost_scaleTable[_scaleIndexX--]; - if (scal < _scaleX) + if (cost_scaleTable[_scaleIndexX--] < _scaleX) rect.left--; } } _scaleIndexX = startScaleIndexX; + if (skip) skip--; @@ -166,25 +170,28 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { ymoveCur = -ymoveCur; step = 1; } + _scaleIndexY = 128 - ymoveCur; for (i = 0; i < ymoveCur; i++) { - scal = cost_scaleTable[_scaleIndexY++]; - if (scal < _scaleY) + if (cost_scaleTable[_scaleIndexY++] < _scaleY) v1.y -= step; } + rect.top = rect.bottom = v1.y; _scaleIndexY = 128 - ymoveCur; for (i = 0; i < _height; i++) { - scal = cost_scaleTable[_scaleIndexY++]; - if (scal < _scaleY) + if (cost_scaleTable[_scaleIndexY++] < _scaleY) rect.bottom++; } + _scaleIndexY = 128 - ymoveCur; } else { if (!_mirror) xmoveCur = -xmoveCur; + v1.x += xmoveCur; v1.y += ymoveCur; + if (_mirror) { rect.left = v1.x; rect.right = v1.x + _width; @@ -192,8 +199,10 @@ byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { rect.left = v1.x - _width; rect.right = v1.x; } + rect.top = v1.y; rect.bottom = rect.top + _height; + } v1.skip_width = _width; |