[Scummvm-cvs-logs] CVS: scummvm/saga isomap.cpp,1.30,1.31
Andrew Kurushin
h00ligan at users.sourceforge.net
Fri Feb 11 14:21:40 CET 2005
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26253
Modified Files:
isomap.cpp
Log Message:
- smooth iso scroll
Index: isomap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/isomap.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- isomap.cpp 11 Feb 2005 20:59:29 -0000 1.30
+++ isomap.cpp 11 Feb 2005 22:18:37 -0000 1.31
@@ -42,7 +42,7 @@
_multiCount = 0;
_viewScroll.x = (128 - 8) * 16;
_viewScroll.x = (128 - 8) * 16 - 64;
- _viewDiff = 20;
+ _viewDiff = 1;
}
void IsoMap::loadImages(const byte *resourcePointer, size_t resourceLength) {
@@ -211,6 +211,7 @@
void IsoMap::drawTiles(SURFACE *ds) {
Point view1;
+ Point fineScroll;
Point metaTileY;
Point metaTileX;
int16 u0, v0,
@@ -224,14 +225,17 @@
_tileScroll.x = _viewScroll.x >> 4;
_tileScroll.y = _viewScroll.y >> 4;
+ fineScroll.x = _viewScroll.x & 0xf;
+ fineScroll.y = _viewScroll.y & 0xf;
+
view1.x = _tileScroll.x - (8 * SAGA_TILEMAP_W);
view1.y = (8 * SAGA_TILEMAP_W) - _tileScroll.y;
u0 = ((view1.y + 64) * 2 + view1.x) >> 4;
v0 = ((view1.y + 64) * 2 - view1.x) >> 4;
- metaTileY.x = (u0 - v0) * 128 - view1.x * 16;
- metaTileY.y = view1.y * 16 - (u0 + v0) * 64;
+ metaTileY.x = (u0 - v0) * 128 - (view1.x * 16 + fineScroll.x);
+ metaTileY.y = (view1.y * 16 - fineScroll.y) - (u0 + v0) * 64;
workAreaWidth = _vm->getDisplayWidth() + 128;
workAreaHeight = _vm->getDisplayInfo().sceneHeight + 128 + 80;
@@ -452,6 +456,8 @@
col++;
}
while ((col < _tileClip.right) && (count < fgRunCount)) {
+ assert((uint)ds->pixels <= (uint)(drawPointer + count));
+ assert(((uint)ds->pixels + (ds->pitch * _vm->getDisplayWidth())) > (uint)(drawPointer + count));
drawPointer[count] = readPointer[count];
count++;
col++;
More information about the Scummvm-git-logs
mailing list