From: <ave...@us...> - 2003-11-30 21:05:37
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1:/tmp/cvs-serv31601 Modified Files: TileOverlay.cpp Log Message: Fix: Fixed TileOverlay.cpp in case of small maps Index: TileOverlay.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/TileOverlay.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TileOverlay.cpp 27 Nov 2003 22:04:40 -0000 1.5 --- TileOverlay.cpp 30 Nov 2003 21:05:33 -0000 1.6 *************** *** 56,67 **** vp.w = viewport.w; vp.h = viewport.h; ! if(vp.x < 0) ! vp.x = 0; ! else if((vp.x+vp.w) > w*64) vp.x = (w*64 - vp.w); ! if(vp.y < 0) ! vp.y = 0; ! else if((vp.y+vp.h) > h*64) vp.y = (h*64 - vp.h); vid->SetViewport(vp.x, vp.y); int sx = vp.x / 64; --- 56,67 ---- vp.w = viewport.w; vp.h = viewport.h; ! if((vp.x+vp.w) > w*64) vp.x = (w*64 - vp.w); ! if(vp.x < 0) ! vp.x=0; ! if((vp.y+vp.h) > h*64) vp.y = (h*64 - vp.h); + if(vp.y < 0) + vp.y=0; vid->SetViewport(vp.x, vp.y); int sx = vp.x / 64; *************** *** 69,74 **** int dx = (int)ceil((vp.x+vp.w) / 64.0); int dy = (int)ceil((vp.y+vp.h) / 64.0); ! for(int y = sy; y < dy; y++) { ! for(int x = sx; x < dx; x++) { Tile * tile = tiles[(y*w)+x]; if(tile->anim[tile->tileIndex]) --- 69,74 ---- int dx = (int)ceil((vp.x+vp.w) / 64.0); int dy = (int)ceil((vp.y+vp.h) / 64.0); ! for(int y = sy; y < dy && y<h; y++) { ! for(int x = sx; x < dx && x<w; x++) { Tile * tile = tiles[(y*w)+x]; if(tile->anim[tile->tileIndex]) |