Browse Source

Dont draw fat pixels outside of spritesheet

main
neauoire 5 years ago
parent
commit
76ffdd7c7a
  1. 7
      nasu.c

7
nasu.c

@ -303,9 +303,10 @@ redraw(Uint32 *dst)
drawui(dst);
for(y = 0; y < VER; ++y)
for(x = 0; x < HOR; ++x)
if(BIGPIXEL)
drawbigchr(dst, x, y, getchr(x + brush.vx, y + brush.vy));
else
if(BIGPIXEL) {
if(x + brush.vx < HOR * 8 && y + brush.vy < VER * 8)
drawbigchr(dst, x, y, getchr(x + brush.vx, y + brush.vy));
} else
drawchr(dst, x, y, x + y * HOR);
SDL_UpdateTexture(gTexture, NULL, dst, WIDTH * sizeof(Uint32));
SDL_RenderClear(gRenderer);

Loading…
Cancel
Save