~rabbits/nasu

76ffdd7c7a2ed7c0d00da68f3f2cc9878d556b18 — neauoire 2 years ago 9c0fd19
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);