20 #include "town.h" |
20 #include "town.h" |
21 #include "signs.h" |
21 #include "signs.h" |
22 #include "waypoint.h" |
22 #include "waypoint.h" |
23 #include "variables.h" |
23 #include "variables.h" |
24 #include "train.h" |
24 #include "train.h" |
|
25 #include "table/station_air.h" |
25 |
26 |
26 #define VIEWPORT_DRAW_MEM (65536 * 2) |
27 #define VIEWPORT_DRAW_MEM (65536 * 2) |
27 |
28 |
28 // XXX - maximum viewports is maximum windows - 2 (main toolbar + status bar) |
29 // XXX - maximum viewports is maximum windows - 2 (main toolbar + status bar) |
29 static ViewPort _viewports[25 - 2]; |
30 static ViewPort _viewports[25 - 2]; |
657 |
658 |
658 // Inside the inner area? |
659 // Inside the inner area? |
659 if (IS_INSIDE_1D(ti->x, _thd.pos.x, _thd.size.x) && |
660 if (IS_INSIDE_1D(ti->x, _thd.pos.x, _thd.size.x) && |
660 IS_INSIDE_1D(ti->y, _thd.pos.y, _thd.size.y)) { |
661 IS_INSIDE_1D(ti->y, _thd.pos.y, _thd.size.y)) { |
661 if (_thd.drawstyle & HT_RECT) { |
662 if (_thd.drawstyle & HT_RECT) { |
662 image = SPR_SELECT_TILE + _tileh_to_sprite[ti->tileh]; |
663 if ((_thd.airport_template) && |
663 DrawSelectionSprite(image, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE, ti); |
664 ((byte)(_airport_sections[_thd.airport][((ti->x - _thd.pos.x) / TILE_SIZE ) + ((ti->y - _thd.pos.y) / TILE_SIZE * _thd.size.x / TILE_SIZE)]) != 255)) { |
|
665 image = SPR_SELECT_TILE + _tileh_to_sprite[ti->tileh]; |
|
666 DrawSelectionSprite(image, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE, ti); |
|
667 } else if (!_thd.airport_template) { |
|
668 image = SPR_SELECT_TILE + _tileh_to_sprite[ti->tileh]; |
|
669 DrawSelectionSprite(image, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE, ti); |
|
670 } |
664 } else if (_thd.drawstyle & HT_POINT) { |
671 } else if (_thd.drawstyle & HT_POINT) { |
665 // Figure out the Z coordinate for the single dot. |
672 // Figure out the Z coordinate for the single dot. |
666 byte z = ti->z; |
673 byte z = ti->z; |
667 if (ti->tileh & SLOPE_N) { |
674 if (ti->tileh & SLOPE_N) { |
668 z += TILE_HEIGHT; |
675 z += TILE_HEIGHT; |