[Scummvm-cvs-logs] SF.net SVN: scummvm: [32423] scummvm/trunk/engines/drascula
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat May 31 12:24:45 CEST 2008
Revision: 32423
http://scummvm.svn.sourceforge.net/scummvm/?rev=32423&view=rev
Author: thebluegr
Date: 2008-05-31 03:24:45 -0700 (Sat, 31 May 2008)
Log Message:
-----------
Cleanup
Modified Paths:
--------------
scummvm/trunk/engines/drascula/drascula.cpp
scummvm/trunk/engines/drascula/drascula.h
Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp 2008-05-31 10:01:13 UTC (rev 32422)
+++ scummvm/trunk/engines/drascula/drascula.cpp 2008-05-31 10:24:45 UTC (rev 32423)
@@ -1669,20 +1669,14 @@
for (int i = 0; i < 320; i++) {
tempLine[i] = (int)(sin(coeff2) * 16);
coeff2 += 0.02f;
- if (tempLine[i] < 0)
- tempLine[i] += 200;
- if (tempLine[i] > 199)
- tempLine[i] -= 200;
+ tempLine[i] = checkWrapY(tempLine[i]);
}
coeff2 = coeff;
for (int i = 0; i < 200; i++) {
tempRow[i] = (int)(sin(coeff2) * 16);
coeff2 += 0.02f;
- if (tempRow[i] < 0)
- tempRow[i] += 320;
- if (tempRow[i] > 319)
- tempRow[i] -= 320;
+ tempRow[i] = checkWrapX(tempRow[i]);
}
if (++count2 > 199)
@@ -1693,30 +1687,18 @@
for (int i = 0; i < 200; i++) {
for (int j = 0; j < 320; j++) {
x1_ = j + tempRow[i];
- if (x1_ < 0)
- x1_ += 320;
- if (x1_ > 319)
- x1_ -= 319;
+ x1_ = checkWrapX(x1_);
y1_ = i + count2;
- if (y1_ < 0)
- y1_ += 200;
- if (y1_ > 199)
- y1_ -= 200;
+ y1_ = checkWrapY(y1_);
off1 = 320 * y1_ + x1_;
x1_ = j + count;
- if (x1_ < 0)
- x1_ += 320;
- if (x1_ > 319)
- x1_ -= 320;
+ x1_ = checkWrapX(x1_);
y1_ = i + tempLine[j];
- if (y1_ < 0)
- y1_ += 200;
- if (y1_ > 199)
- y1_ -= 200;
+ y1_ = checkWrapY(y1_);
off2 = 320 * y1_ + x1_;
VGA[320 * i + j] = ghost[drawSurface1[off2] + (copia[off1] << 8)];
Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h 2008-05-31 10:01:13 UTC (rev 32422)
+++ scummvm/trunk/engines/drascula/drascula.h 2008-05-31 10:24:45 UTC (rev 32423)
@@ -193,6 +193,16 @@
int height, byte *src, byte *dest);
void copyRectClip(int *Array, byte *src, byte *dest);
void updateScreen(int xorg, int yorg, int xdes, int ydes, int width, int height, byte *buffer);
+ int checkWrapX(int x) {
+ if (x < 0) x += 320;
+ if (x > 319) x -= 320;
+ return x;
+ }
+ int checkWrapY(int y) {
+ if (y < 0) y += 200;
+ if (y > 199) y -= 200;
+ return y;
+ }
DacPalette256 gamePalette;
DacPalette256 palHare;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list