From eed601cc22a98bd19cd795d4c7a561c542e5ea6a Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Sat, 1 Jan 2005 07:45:53 +0000 Subject: [PATCH] shrink the grey-out code a bit --- src/tuxpaint.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index ec08957b8..b64de83db 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -7690,24 +7690,26 @@ static void draw_toolbar(void) if (i < NUM_TOOLS) { + SDL_Surface *button_color; + SDL_Surface *button_body; if (i == cur_tool) { - SDL_BlitSurface(img_btn_down, NULL, screen, &dest); - SDL_BlitSurface(img_black, NULL, img_tools[i], NULL); - SDL_BlitSurface(img_black, NULL, img_tool_names[i], NULL); + button_body = img_btn_down; + button_color = img_black; } else if (tool_avail[i]) { - SDL_BlitSurface(img_btn_up, NULL, screen, &dest); - SDL_BlitSurface(img_black, NULL, img_tools[i], NULL); - SDL_BlitSurface(img_black, NULL, img_tool_names[i], NULL); + button_body = img_btn_up; + button_color = img_black; } else { - SDL_BlitSurface(img_btn_off, NULL, screen, &dest); - SDL_BlitSurface(img_grey, NULL, img_tools[i], NULL); - SDL_BlitSurface(img_grey, NULL, img_tool_names[i], NULL); + button_body = img_btn_off; + button_color = img_grey; } + SDL_BlitSurface(button_body, NULL, screen, &dest); + SDL_BlitSurface(button_color, NULL, img_tools[i], NULL); + SDL_BlitSurface(button_color, NULL, img_tool_names[i], NULL); dest.x = ((i % 2) * 48) + 4; dest.y = ((i / 2) * 48) + 40 + 4;