X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame_sp%2FDDSpriteBuffer.c;h=872ded6f1a27b736c23d074c79b8520ba0109cbe;hb=df8f020b9c0aad57e1f2e790c771550232fb6ce8;hp=00e49d7ac02f62aaaac59c05e3445c853382f57a;hpb=ed873d89bc59f4e641134f9019ce216234b9f38f;p=rocksndiamonds.git diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 00e49d7a..872ded6f 100644 --- a/src/game_sp/DDSpriteBuffer.c +++ b/src/game_sp/DDSpriteBuffer.c @@ -179,10 +179,12 @@ static void Blt(int pX, int pY, int SpriteX, int SpriteY) #if 1 - int sx1 = mScrollX_last - 2 * TILEX; - int sy1 = mScrollY_last - 2 * TILEY; - int sx2 = mScrollX_last + SXSIZE + 1 * TILEX; - int sy2 = mScrollY_last + SYSIZE + 1 * TILEY; + int scx = (mScrollX_last < 0 ? 0 : mScrollX_last); + int scy = (mScrollY_last < 0 ? 0 : mScrollY_last); + int sx1 = scx - 2 * TILEX; + int sy1 = scy - 2 * TILEY; + int sx2 = scx + SXSIZE + 1 * TILEX; + int sy2 = scy + SYSIZE + 1 * TILEY; int sx = pX - sx1; int sy = pY - sy1;