src/viewport.cpp
changeset 8345 6caa3fdb972c
parent 8320 6ffad7a5d242
child 8384 cda01fb6ec2a
equal deleted inserted replaced
8344:b8b77e2e11c9 8345:6caa3fdb972c
    24 #include "variables.h"
    24 #include "variables.h"
    25 #include "train.h"
    25 #include "train.h"
    26 #include "roadveh.h"
    26 #include "roadveh.h"
    27 #include "vehicle_gui.h"
    27 #include "vehicle_gui.h"
    28 #include "blitter/factory.hpp"
    28 #include "blitter/factory.hpp"
       
    29 #include "transparency.h"
    29 
    30 
    30 #define VIEWPORT_DRAW_MEM (65536 * 2)
    31 #define VIEWPORT_DRAW_MEM (65536 * 2)
    31 
    32 
    32 ZoomLevel _saved_scrollpos_zoom;
    33 ZoomLevel _saved_scrollpos_zoom;
    33 
    34 
  1481 				w -= 3;
  1482 				w -= 3;
  1482 			}
  1483 			}
  1483 
  1484 
  1484 		/* Draw the rectangle if 'tranparent station signs' is off,
  1485 		/* Draw the rectangle if 'tranparent station signs' is off,
  1485 		 * or if we are drawing a general text sign (STR_2806) */
  1486 		 * or if we are drawing a general text sign (STR_2806) */
  1486 			if (!HASBIT(_transparent_opt, TO_SIGNS) || ss->string == STR_2806) {
  1487 			if (!IsTransparencySet(TO_SIGNS) || ss->string == STR_2806) {
  1487 				DrawFrameRect(
  1488 				DrawFrameRect(
  1488 					x, y, x + w, bottom, ss->color,
  1489 					x, y, x + w, bottom, ss->color,
  1489 					HASBIT(_transparent_opt, TO_SIGNS) ? FR_TRANSPARENT : FR_NONE
  1490 					IsTransparencySet(TO_SIGNS) ? FR_TRANSPARENT : FR_NONE
  1490 				);
  1491 				);
  1491 			}
  1492 			}
  1492 		}
  1493 		}
  1493 
  1494 
  1494 		SetDParam(0, ss->params[0]);
  1495 		SetDParam(0, ss->params[0]);
  1495 		SetDParam(1, ss->params[1]);
  1496 		SetDParam(1, ss->params[1]);
  1496 		/* if we didn't draw a rectangle, or if transparant building is on,
  1497 		/* if we didn't draw a rectangle, or if transparant building is on,
  1497 		 * draw the text in the color the rectangle would have */
  1498 		 * draw the text in the color the rectangle would have */
  1498 		if (HASBIT(_transparent_opt, TO_SIGNS) && ss->string != STR_2806 && ss->width != 0) {
  1499 		if (IsTransparencySet(TO_SIGNS) && ss->string != STR_2806 && ss->width != 0) {
  1499 			/* Real colors need the IS_PALETTE_COLOR flag
  1500 			/* Real colors need the IS_PALETTE_COLOR flag
  1500 			 * otherwise colors from _string_colormap are assumed. */
  1501 			 * otherwise colors from _string_colormap are assumed. */
  1501 			colour = _colour_gradient[ss->color][6] | IS_PALETTE_COLOR;
  1502 			colour = _colour_gradient[ss->color][6] | IS_PALETTE_COLOR;
  1502 		} else {
  1503 		} else {
  1503 			colour = TC_BLACK;
  1504 			colour = TC_BLACK;