| 1108 | } |
| 1109 | |
| 1110 | static void paintAimScreen(df::building_siegeenginest *bld, df::coord view, df::coord2d ltop, df::coord2d size) |
| 1111 | { |
| 1112 | auto engine = find_engine(bld, true); |
| 1113 | CHECK_NULL_POINTER(engine); |
| 1114 | |
| 1115 | for (int x = 0; x < size.x; x++) |
| 1116 | { |
| 1117 | for (int y = 0; y < size.y; y++) |
| 1118 | { |
| 1119 | df::coord tile_pos = view + df::coord(x,y,0); |
| 1120 | if (is_in_range(engine->building_rect, tile_pos)) |
| 1121 | continue; |
| 1122 | |
| 1123 | Pen cur_tile = Screen::readTile(ltop.x+x, ltop.y+y, true); |
| 1124 | if (!cur_tile.valid()) |
| 1125 | continue; |
| 1126 | |
| 1127 | int color = COLOR_YELLOW; |
| 1128 | |
| 1129 | switch (calcTileStatus(engine, tile_pos)) |
| 1130 | { |
| 1131 | case TARGET_OK: |
| 1132 | color = COLOR_GREEN; |
| 1133 | break; |
| 1134 | case TARGET_RANGE: |
| 1135 | color = COLOR_CYAN; |
| 1136 | break; |
| 1137 | case TARGET_BLOCKED: |
| 1138 | color = COLOR_RED; |
| 1139 | break; |
| 1140 | case TARGET_SEMIBLOCKED: |
| 1141 | color = COLOR_BROWN; |
| 1142 | break; |
| 1143 | } |
| 1144 | |
| 1145 | if (cur_tile.fg && cur_tile.ch != ' ') |
| 1146 | { |
| 1147 | cur_tile.fg = color; |
| 1148 | cur_tile.bg = 0; |
| 1149 | } |
| 1150 | else |
| 1151 | { |
| 1152 | cur_tile.fg = 0; |
| 1153 | cur_tile.bg = color; |
| 1154 | } |
| 1155 | |
| 1156 | cur_tile.bold = engine->onTarget(tile_pos); |
| 1157 | |
| 1158 | if (cur_tile.tile) |
| 1159 | cur_tile.tile_mode = Pen::CharColor; |
| 1160 | |
| 1161 | Screen::paintTile(cur_tile, ltop.x+x, ltop.y+y, true); |
| 1162 | } |
| 1163 | } |
| 1164 | } |
| 1165 | |
| 1166 | /* |
| 1167 | * Unit tracking |
nothing calls this directly
no test coverage detected