X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_sp%2FDDScrollBuffer.c;h=e8bd2fbce26221c29eb956408a597d7c962dd3d4;hb=76c6cf34f934b80bcd42ed1f0940c6c56ac1c209;hp=80cddf0d7e745c733bec2879a954f0b29e3ba20a;hpb=97fb6c2a140f361991541bcf5a5c1e5d18deaf74;p=rocksndiamonds.git diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 80cddf0d..e8bd2fbc 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -227,7 +227,7 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) int py = 2 * TILEY + (mScrollY - mScrollY_last) % TILEY; int sx, sy, sxsize, sysize; -#if 1 +#if 0 printf("::: %d, %d / %d, %d / %ld, %ld (%ld, %ld) / %d, %d\n", MurphyScreenXPos, MurphyScreenYPos, ScreenScrollXPos, ScreenScrollYPos, @@ -246,39 +246,16 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) sx = SX + (full_xsize < xsize ? (xsize - full_xsize) / 2 : 0); sy = SY + (full_ysize < ysize ? (ysize - full_ysize) / 2 : 0); + /* scroll correction for even number of visible tiles (half tile shifted) */ + px += game_sp.scroll_xoffset; + py += game_sp.scroll_yoffset; + #if 1 -#if 1 - { - px += game_sp.scroll_xoffset; - py += game_sp.scroll_yoffset; - } -#else - if (1) - { - px += TILEX / 2; - py += TILEY / 2; - } -#endif -#else -#if 1 - if (0 && !menBorder) + if (ExplosionShakeMurphy != 0) { - if (mScrollX < ScrollMinX + TILEX / 2) - px += ScrollMinX + TILEX / 2 - mScrollX; - else if (mScrollX > ScrollMaxX - TILEX / 2) - px -= mScrollX - (ScrollMaxX - TILEX / 2); - if (mScrollY < ScrollMinY + TILEY / 2) - py += ScrollMinY + TILEY / 2 - mScrollY; - else if (mScrollY > ScrollMaxY - TILEY / 2) - py -= mScrollY - (ScrollMaxY - TILEY / 2); + px += TILEX / 2 - GetSimpleRandom(TILEX + 1); + py += TILEY / 2 - GetSimpleRandom(TILEX + 1); } -#else - if (!menBorder) - { - px += TILEX / 2; - py += TILEY / 2; - } -#endif #endif BlitBitmap(bitmap_db_field_sp, target_bitmap, px, py, sxsize, sysize, sx, sy);