[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.125,1.126 costume.cpp,1.130,1.131
Travis Howell
kirben at users.sourceforge.net
Fri Jun 25 01:11:13 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18493/scumm
Modified Files:
akos.cpp costume.cpp
Log Message:
Minor cleanup
Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- akos.cpp 25 Jun 2004 06:10:13 -0000 1.125
+++ akos.cpp 25 Jun 2004 08:10:26 -0000 1.126
@@ -582,8 +582,7 @@
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 @@
} 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 @@
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 @@
}
}
+
if (skip)
skip--;
@@ -711,11 +710,10 @@
cur_x = _outwidth - 1;
} else {
skip = -1 - rect.left;
- if (skip <= 0) {
+ if (skip <= 0)
drawFlag = 2;
- } else {
+ else
v1.skip_width -= skip;
- }
}
}
Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- costume.cpp 6 Apr 2004 01:06:54 -0000 1.130
+++ costume.cpp 25 Jun 2004 08:10:34 -0000 1.131
@@ -70,9 +70,8 @@
#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 @@
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 @@
}
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 @@
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 @@
rect.left = v1.x - _width;
rect.right = v1.x;
}
+
rect.top = v1.y;
rect.bottom = rect.top + _height;
+
}
v1.skip_width = _width;
More information about the Scummvm-git-logs
mailing list