shrink the grey-out code a bit
This commit is contained in:
parent
4a1a704ca0
commit
eed601cc22
1 changed files with 11 additions and 9 deletions
|
|
@ -7690,24 +7690,26 @@ static void draw_toolbar(void)
|
||||||
|
|
||||||
if (i < NUM_TOOLS)
|
if (i < NUM_TOOLS)
|
||||||
{
|
{
|
||||||
|
SDL_Surface *button_color;
|
||||||
|
SDL_Surface *button_body;
|
||||||
if (i == cur_tool)
|
if (i == cur_tool)
|
||||||
{
|
{
|
||||||
SDL_BlitSurface(img_btn_down, NULL, screen, &dest);
|
button_body = img_btn_down;
|
||||||
SDL_BlitSurface(img_black, NULL, img_tools[i], NULL);
|
button_color = img_black;
|
||||||
SDL_BlitSurface(img_black, NULL, img_tool_names[i], NULL);
|
|
||||||
}
|
}
|
||||||
else if (tool_avail[i])
|
else if (tool_avail[i])
|
||||||
{
|
{
|
||||||
SDL_BlitSurface(img_btn_up, NULL, screen, &dest);
|
button_body = img_btn_up;
|
||||||
SDL_BlitSurface(img_black, NULL, img_tools[i], NULL);
|
button_color = img_black;
|
||||||
SDL_BlitSurface(img_black, NULL, img_tool_names[i], NULL);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SDL_BlitSurface(img_btn_off, NULL, screen, &dest);
|
button_body = img_btn_off;
|
||||||
SDL_BlitSurface(img_grey, NULL, img_tools[i], NULL);
|
button_color = img_grey;
|
||||||
SDL_BlitSurface(img_grey, NULL, img_tool_names[i], NULL);
|
|
||||||
}
|
}
|
||||||
|
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.x = ((i % 2) * 48) + 4;
|
||||||
dest.y = ((i / 2) * 48) + 40 + 4;
|
dest.y = ((i / 2) * 48) + 40 + 4;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue