[Scummvm-cvs-logs] CVS: scummvm/saga isomap.cpp,1.29,1.30
Andrew Kurushin
h00ligan at users.sourceforge.net
Fri Feb 11 13:00:27 CET 2005
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26724
Modified Files:
isomap.cpp
Log Message:
- fix min->MIN
- implemented horizontal tile cliping
Index: isomap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/isomap.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- isomap.cpp 11 Feb 2005 20:43:47 -0000 1.29
+++ isomap.cpp 11 Feb 2005 20:59:29 -0000 1.30
@@ -393,7 +393,7 @@
Point drawPoint;
int height;
int widthCount = 0;
- int row, col, lowBound;
+ int row, col, count, lowBound;
int bgRunCount;
int fgRunCount;
@@ -403,13 +403,11 @@
}
- /* temporary x clip */
- if (point.x < 0) {
+ if (point.x + SAGA_ISOTILE_WIDTH < _tileClip.left) {
return;
}
- /* temporary x clip */
- if (point.x >= _tileClip.right - 32) {
+ if (point.x - SAGA_ISOTILE_WIDTH >= _tileClip.right) {
return;
}
@@ -430,7 +428,7 @@
}
readPointer = tilePointer;
- lowBound = min(drawPoint.y + height, _tileClip.bottom);
+ lowBound = MIN((int)(drawPoint.y + height), (int)_tileClip.bottom);
for (row = drawPoint.y; row < lowBound; row++) {
widthCount = 0;
if (row >= _tileClip.top) {
@@ -448,12 +446,18 @@
fgRunCount = *readPointer++;
widthCount += fgRunCount;
-
- while(fgRunCount-- > 0) {
- *drawPointer++ = *readPointer++;
+ count = 0;
+ while ((col < _tileClip.left) && (count < fgRunCount)) {
+ count++;
+ col++;
}
-// readPointer += fgRunCount;
-// drawPointer += fgRunCount;
+ while ((col < _tileClip.right) && (count < fgRunCount)) {
+ drawPointer[count] = readPointer[count];
+ count++;
+ col++;
+ }
+ readPointer += fgRunCount;
+ drawPointer += fgRunCount;
}
} else {
for (;;) {
More information about the Scummvm-git-logs
mailing list