forked from mirror/OpenTTD
(svn r2736) -Codechange: De-mystified GfxDrawFillRect a bit, and used enums from table/sprites.h. You can now change the number of bits used for sprites and switches in the SpriteSetup enum and the rest should work automagically. Can be used to increase the number of active sprites to 2^19 in case there are no colortables (recolor sprites) in any newgrf. We should possibly move the the colortables to an own list, but how to detect them in a newgrf.
This commit is contained in:
10
widget.c
10
widget.c
@@ -285,7 +285,7 @@ void DrawWindowWidgets(Window *w)
|
||||
|
||||
// draw "shaded" background
|
||||
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c2);
|
||||
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c1 | 0x8000);
|
||||
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c1 | PALETTE_MODIFIER_GREYOUT);
|
||||
|
||||
// draw shaded lines
|
||||
GfxFillRect(r.left+2, r.top+10, r.left+2, r.bottom-10, c1);
|
||||
@@ -317,7 +317,7 @@ void DrawWindowWidgets(Window *w)
|
||||
|
||||
// draw "shaded" background
|
||||
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c2);
|
||||
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c1 | 0x8000);
|
||||
GfxFillRect(r.left, r.top+10, r.right, r.bottom-10, c1 | PALETTE_MODIFIER_GREYOUT);
|
||||
|
||||
// draw shaded lines
|
||||
GfxFillRect(r.left+2, r.top+10, r.left+2, r.bottom-10, c1);
|
||||
@@ -350,7 +350,7 @@ void DrawWindowWidgets(Window *w)
|
||||
|
||||
// draw "shaded" background
|
||||
GfxFillRect(r.left+10, r.top, r.right-10, r.bottom, c2);
|
||||
GfxFillRect(r.left+10, r.top, r.right-10, r.bottom, c1 | 0x8000);
|
||||
GfxFillRect(r.left+10, r.top, r.right-10, r.bottom, c1 | PALETTE_MODIFIER_GREYOUT);
|
||||
|
||||
// draw shaded lines
|
||||
GfxFillRect(r.left+10, r.top+2, r.right-10, r.top+2, c1);
|
||||
@@ -426,7 +426,7 @@ void DrawWindowWidgets(Window *w)
|
||||
DrawStringCentered( (r.left+r.right+1)>>1, r.top+2, wi->unkA, 0x84);
|
||||
draw_default:;
|
||||
if (cur_disabled & 1) {
|
||||
GfxFillRect(r.left+1, r.top+1, r.right-1, r.bottom-1, _color_list[wi->color&0xF].unk2 | 0x8000);
|
||||
GfxFillRect(r.left+1, r.top+1, r.right-1, r.bottom-1, _color_list[wi->color&0xF].unk2 | PALETTE_MODIFIER_GREYOUT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -503,7 +503,7 @@ static void DropdownMenuWndProc(Window *w, WindowEvent *e)
|
||||
DrawString(x+2, y, _dropdown_items[i], sel==0 ? 12 : 16);
|
||||
|
||||
if (HASBIT(_dropdown_disabled, i) && !_dropdown_disabled_items) {
|
||||
GfxFillRect(x, y, x+w->width-3, y + 9, 0x8000 +
|
||||
GfxFillRect(x, y, x+w->width-3, y + 9, PALETTE_MODIFIER_GREYOUT |
|
||||
_color_list[_dropdown_menu_widgets[0].color].window_color_bga);
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user