[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.67,1.68 camera.cpp,2.2,2.3 gfx.cpp,2.125,2.126
Max Horn
fingolfin at users.sourceforge.net
Thu May 29 19:02:03 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv25960
Modified Files:
akos.cpp camera.cpp gfx.cpp
Log Message:
cleanup; removed last horizontal bound check from updateDirtyRect -> now all the various 'offscreen actor redraw' problems should be fixed (at least I can't reproduce them in COMI anymore), while The Dig should still work just fine (at least it does in my test cases)
Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- akos.cpp 30 May 2003 00:41:58 -0000 1.67
+++ akos.cpp 30 May 2003 02:01:44 -0000 1.68
@@ -729,7 +729,7 @@
byte AkosRenderer::codec5(int xmoveCur, int ymoveCur) {
- int32 clip_left, clip_right, clip_top, clip_bottom, maxw, maxh, tmp_x, tmp_y;
+ int32 clip_left, clip_right, clip_top, clip_bottom, maxw, maxh;
if (!_mirror) {
clip_left = (_actorX - xmoveCur - _width) + 1;
@@ -737,35 +737,32 @@
clip_left = _actorX + xmoveCur - 1;
}
- clip_right = (clip_left + _width) - 1;
clip_top = _actorY + ymoveCur;
+ clip_right = (clip_left + _width) - 1;
clip_bottom = (clip_top + _height) - 1;
maxw = _outwidth - 1;
maxh = _outheight - 1;
- if (clip_left < 0) {
- clip_left = 0;
- }
+ _vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
- tmp_x = clip_right - maxw;
- if (tmp_x > 0) {
- clip_right -= tmp_x;
+ if (clip_top < 0) {
+ clip_top = 0;
}
- tmp_y = clip_top;
- if (tmp_y < 0) {
- clip_top -= tmp_y;
+ if (clip_bottom > maxh) {
+ clip_bottom = maxh;
}
- tmp_y = clip_bottom - maxh;
- if (tmp_y > 0) {
- clip_bottom -= tmp_y;
+ if (clip_left < 0) {
+ clip_left = 0;
}
- if ((clip_right <= clip_left) || (clip_top >= clip_bottom))
- return 1;
+ if (clip_right > maxw) {
+ clip_right = maxw;
+ }
- _vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
+ if ((clip_left >= clip_right) || (clip_top >= clip_bottom))
+ return 0;
if (_draw_top > clip_top)
_draw_top = clip_top;
@@ -1010,64 +1007,52 @@
}
byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) {
- int32 clip_left;
-
+ int32 clip_left, clip_right, clip_top, clip_bottom, maxw, maxh;
+ int32 skip_x, skip_y, cur_x, cur_y;
+ const byte transparency = (_vm->_features & GF_HUMONGOUS) ? 0 : 255;
+
if(!_mirror) {
clip_left = (_actorX - xmoveCur - _width) + 1;
} else {
clip_left = _actorX + xmoveCur;
}
- int32 clip_top = ymoveCur + _actorY;
- int32 clip_right = (clip_left + _width) - 1;
- int32 clip_bottom = (clip_top + _height) - 1;
- int32 skip_x = 0;
- int32 skip_y = 0;
- int32 cur_x = _width - 1;
- int32 cur_y = _height - 1;
- int32 maxw = _outwidth - 1;
- int32 maxh = _outheight - 1;
- int32 tmp_x, tmp_y;
- byte transparency = (_vm->_features & GF_HUMONGOUS) ? 0 : 255;
+ clip_top = ymoveCur + _actorY;
+ clip_right = (clip_left + _width) - 1;
+ clip_bottom = (clip_top + _height) - 1;
+ maxw = _outwidth - 1;
+ maxh = _outheight - 1;
-/*
- tmp_x = clip_left;
- if(tmp_x < 0) {
- tmp_x = -tmp_x;
- clip_left -= tmp_x;
- skip_x = tmp_x;
- }
-*/
+ skip_x = 0;
+ skip_y = 0;
+ cur_x = _width - 1;
+ cur_y = _height - 1;
+
+ _vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
- // Modified by ludde
if (clip_left < 0) {
skip_x = -clip_left;
clip_left = 0;
}
- tmp_x = clip_right - maxw;
- if(tmp_x > 0) {
- cur_x -= tmp_x;
- clip_right -= tmp_x;
+ if(clip_right > maxw) {
+ cur_x -= clip_right - maxw;
+ clip_right = maxw;
}
- tmp_y = clip_top;
- if(tmp_y < 0) {
- skip_y -= tmp_y;
- clip_top -= tmp_y;
+ if(clip_top < 0) {
+ skip_y -= clip_top;
+ clip_top = 0;
}
- tmp_y = clip_bottom - maxh;
- if(tmp_y > 0) {
- cur_y -= tmp_y;
- clip_bottom -= tmp_y;
+ if(clip_bottom > maxh) {
+ cur_y -= clip_bottom - maxh;
+ clip_bottom = maxh;
}
if ((clip_left >= clip_right) || (clip_top >= clip_bottom))
return 0;
- _vm->updateDirtyRect(0, clip_left, clip_right + 1, clip_top, clip_bottom + 1, _dirty_id);
-
if (_draw_top > clip_top)
_draw_top = clip_top;
if (_draw_bottom < clip_bottom)
@@ -1092,18 +1077,18 @@
width_unk = clip_left;
}
- tmp_y = cur_y - skip_y;
- if(tmp_y < 0) {
- tmp_y = -tmp_y;
- }
+ int32 out_height;
- int32 out_height = tmp_y + 1;
+ out_height = cur_y - skip_y;
+ if (out_height < 0) {
+ out_height = -out_height;
+ }
+ out_height++;
cur_x -= skip_x;
if(cur_x < 0) {
cur_x = -cur_x;
}
-
cur_x++;
int32 numskip_before = skip_x + (skip_y * _width);
Index: camera.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/camera.cpp,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -d -r2.2 -r2.3
--- camera.cpp 29 May 2003 23:44:23 -0000 2.2
+++ camera.cpp 30 May 2003 02:01:44 -0000 2.3
@@ -320,15 +320,13 @@
}
}
- _screenStartStrip = (camera._cur.x - (_screenWidth / 2)) >> 3;
+ _screenStartStrip = camera._cur.x / 8 - gdi._numStrips / 2;
_screenEndStrip = _screenStartStrip + gdi._numStrips - 1;
_screenTop = camera._cur.y - (_screenHeight / 2);
if (_features & GF_AFTER_V7) {
-
_screenLeft = camera._cur.x - (_screenWidth / 2);
} else {
-
_screenLeft = _screenStartStrip << 3;
}
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.125
retrieving revision 2.126
diff -u -d -r2.125 -r2.126
--- gfx.cpp 30 May 2003 01:37:50 -0000 2.125
+++ gfx.cpp 30 May 2003 02:01:45 -0000 2.126
@@ -285,7 +285,9 @@
VirtScreen *vs = &virtscr[virt];
int lp, rp;
- if (top > vs->height || right < 0 || bottom < 0)
+ if (left > right || top > bottom)
+ return;
+ if (top > vs->height || bottom < 0)
return;
if (top < 0)
More information about the Scummvm-git-logs
mailing list