forked from mirror/OpenTTD
(svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
-Codechange: Wrap all transparency settings in accessors, hiding the implementation -Change: Clicking "transparent building" menu will toggle Houses And Trees only. The other options can be used in the transparency gui. Initial patch by Smatz (FS#1349), with some rework by BigBB and your humble servant.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "roadveh.h"
|
||||
#include "vehicle_gui.h"
|
||||
#include "blitter/factory.hpp"
|
||||
#include "transparency.h"
|
||||
|
||||
#define VIEWPORT_DRAW_MEM (65536 * 2)
|
||||
|
||||
@@ -1483,10 +1484,10 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, const StringSpriteToDraw *ss
|
||||
|
||||
/* Draw the rectangle if 'tranparent station signs' is off,
|
||||
* or if we are drawing a general text sign (STR_2806) */
|
||||
if (!HASBIT(_transparent_opt, TO_SIGNS) || ss->string == STR_2806) {
|
||||
if (!IsTransparencySet(TO_SIGNS) || ss->string == STR_2806) {
|
||||
DrawFrameRect(
|
||||
x, y, x + w, bottom, ss->color,
|
||||
HASBIT(_transparent_opt, TO_SIGNS) ? FR_TRANSPARENT : FR_NONE
|
||||
IsTransparencySet(TO_SIGNS) ? FR_TRANSPARENT : FR_NONE
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1495,7 +1496,7 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, const StringSpriteToDraw *ss
|
||||
SetDParam(1, ss->params[1]);
|
||||
/* if we didn't draw a rectangle, or if transparant building is on,
|
||||
* draw the text in the color the rectangle would have */
|
||||
if (HASBIT(_transparent_opt, TO_SIGNS) && ss->string != STR_2806 && ss->width != 0) {
|
||||
if (IsTransparencySet(TO_SIGNS) && ss->string != STR_2806 && ss->width != 0) {
|
||||
/* Real colors need the IS_PALETTE_COLOR flag
|
||||
* otherwise colors from _string_colormap are assumed. */
|
||||
colour = _colour_gradient[ss->color][6] | IS_PALETTE_COLOR;
|
||||
|
Reference in New Issue
Block a user