~rabbits/nasu

29d5d6f6e727781bb9316c276f2c1f56388ba5e0 — neauoire 2 years ago a53266a
Added guide toggle button
2 files changed, 11 insertions(+), 5 deletions(-)

M example.chr
M nasu.c
M example.chr => example.chr +0 -0
M nasu.c => nasu.c +11 -5
@@ 33,19 33,22 @@ Brush brush;

Uint32 theme[] = {
	0x000000,
	0x72DEC2,
	0xFFFFFF,
	0x444444,
	0x111111};
	0x72DEC2,
	0x666666,
	0x222222};

Uint8 icons[7][8] = {
Uint8 icons[][8] = {
	{0x38, 0x7c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x00},
	{0x38, 0x44, 0x82, 0x82, 0x82, 0x44, 0x38, 0x00},
	{0x02, 0x02, 0x04, 0x38, 0x40, 0x80, 0x80, 0x00},
	{0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00},
	{0xaa, 0x54, 0xaa, 0x54, 0xaa, 0x54, 0xaa, 0x00},
	{0x38, 0x7c, 0xee, 0xd6, 0xee, 0x7c, 0x38, 0x00},
	{0x44, 0xba, 0x44, 0x44, 0x44, 0xba, 0x44, 0x00}};
	{0x44, 0xba, 0x44, 0x44, 0x44, 0xba, 0x44, 0x00},
	{0x00, 0x00, 0x00, 0x82, 0x44, 0x38, 0x00, 0x00}, /* eye open */
	{0x00, 0x38, 0x44, 0x92, 0x28, 0x10, 0x00, 0x00}  /* eye closed */
};

Uint8 chrbuf[SZ];
SDL_Window *gWindow;


@@ 255,6 258,8 @@ drawui(Uint32 *dst)
	drawicon(dst, 6 * 8, bottom, icons[4], brush.mode == 2 ? 1 : 2);
	drawicon(dst, 7 * 8, bottom, icons[5], brush.mode == 3 ? 1 : 2);
	drawicon(dst, 8 * 8, bottom, icons[6], brush.mode == 4 ? 1 : 2);

	drawicon(dst, 10 * 8, bottom, icons[GUIDES ? 8 : 7], GUIDES ? 1 : 2);
}

void


@@ 400,6 405,7 @@ selectoption(int option)
	case 6: setmode(&brush, 2); break;
	case 7: setmode(&brush, 3); break;
	case 8: setmode(&brush, 4); break;
	case 10: setguides(!GUIDES); break;
	}
}