Dont draw fat pixels outside of spritesheet
1 files changed, 4 insertions(+), 3 deletions(-) M nasu.c
M nasu.c => nasu.c +4 -3
@@ 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);