@@ -41,21 +41,44 @@ void building_bandstand::static_params::planer_setup_preview_graphics(build_plan
41
41
}
42
42
43
43
void building_bandstand::static_params::planer_ghost_preview (build_planner &planer, painter &ctx, tile2i start, tile2i end, vec2i pixel) const {
44
- int can_build = 0 ;
45
-
46
- int size = building_impl::params (type).building_size ;
47
44
int orientation = 0 ;
48
45
49
- can_build = map_orientation_for_venue_with_map_orientation (end, e_venue_mode_bandstand, &orientation);
46
+ int can_build = map_orientation_for_venue_with_map_orientation (end, e_venue_mode_bandstand, &orientation);
50
47
// TODO: proper correct for map orientation (for now, just use a different orientation)
51
48
orientation = abs (orientation + (8 - city_view_orientation ())) % 8 ;
52
49
53
50
if (can_build != 1 ) { // no can place
54
- for (int i = 0 ; i < size * size ; i++) {
51
+ for (int i = 0 ; i < building_size * building_size ; i++) {
55
52
planer.draw_flat_tile (ctx, pixel + VIEW_OFFSETS[i], COLOR_MASK_RED);
56
53
}
57
54
} else { // can place (theoretically)
58
- building_bandstand::ghost_preview (ctx, end, pixel, orientation);
55
+ int square_id = bandstand_m.anim [animkeys ().square ].first_img ();
56
+ for (int i = 0 ; i < building_size * building_size; i++) {
57
+ ImageDraw::isometric (ctx, square_id + i, pixel + vec2i{ ((i % building_size) - (i / building_size)) * 30 , ((i % building_size) + (i / building_size)) * 15 }, COLOR_MASK_GREEN);
58
+ }
59
+
60
+ switch (orientation / 2 ) {
61
+ case 0 :
62
+ planer.draw_building_ghost (ctx, bandstand_m.stand_sn_n , pixel, COLOR_MASK_GREEN);
63
+ planer.draw_building_ghost (ctx, bandstand_m.stand_sn_s , pixel + vec2i{ -30 , 15 }, COLOR_MASK_GREEN);
64
+ planer.draw_building_ghost (ctx, bandstand_m.booth , pixel + vec2i{ 60 , 30 }, COLOR_MASK_GREEN);
65
+ break ;
66
+ case 1 :
67
+ planer.draw_building_ghost (ctx, bandstand_m.stand_we_w , pixel + vec2i{ 30 , 15 }, COLOR_MASK_GREEN);
68
+ planer.draw_building_ghost (ctx, bandstand_m.stand_we_e , pixel + vec2i{ 60 , 30 }, COLOR_MASK_GREEN);
69
+ planer.draw_building_ghost (ctx, bandstand_m.booth , pixel + vec2i{ 0 , 60 }, COLOR_MASK_GREEN);
70
+ break ;
71
+ case 2 :
72
+ planer.draw_building_ghost (ctx, bandstand_m.stand_sn_n , pixel + vec2i{ -30 , 15 }, COLOR_MASK_GREEN);
73
+ planer.draw_building_ghost (ctx, bandstand_m.stand_sn_s , pixel + vec2i{ -60 , 30 }, COLOR_MASK_GREEN);
74
+ planer.draw_building_ghost (ctx, bandstand_m.booth , pixel + vec2i{ 0 , 60 }, COLOR_MASK_GREEN);
75
+ break ;
76
+ case 3 :
77
+ planer.draw_building_ghost (ctx, bandstand_m.stand_we_w , pixel, COLOR_MASK_GREEN);
78
+ planer.draw_building_ghost (ctx, bandstand_m.stand_we_e , pixel + vec2i{ 30 , 15 }, COLOR_MASK_GREEN);
79
+ planer.draw_building_ghost (ctx, bandstand_m.booth , pixel + vec2i{ -60 , 30 }, COLOR_MASK_GREEN);
80
+ break ;
81
+ }
59
82
}
60
83
}
61
84
@@ -234,34 +257,3 @@ bool building_bandstand::draw_ornaments_and_animations_height(painter &ctx, vec2
234
257
235
258
return false ;
236
259
}
237
-
238
- void building_bandstand::ghost_preview (painter &ctx, tile2i tile, vec2i pixel, int orientation) {
239
- int size = bandstand_m.building_size ;
240
- int square_id = bandstand_m.anim [animkeys ().square ].first_img ();
241
- for (int i = 0 ; i < size * size; i++) {
242
- ImageDraw::isometric (ctx, square_id + i, pixel + vec2i{((i % size) - (i / size)) * 30 , ((i % size) + (i / size)) * 15 }, COLOR_MASK_GREEN);
243
- }
244
-
245
- switch (orientation / 2 ) {
246
- case 0 :
247
- build_planner::draw_building_ghost (ctx, bandstand_m.stand_sn_n , pixel, COLOR_MASK_GREEN);
248
- build_planner::draw_building_ghost (ctx, bandstand_m.stand_sn_s , pixel + vec2i{-30 , 15 }, COLOR_MASK_GREEN);
249
- build_planner::draw_building_ghost (ctx, bandstand_m.booth , pixel + vec2i{60 , 30 }, COLOR_MASK_GREEN);
250
- break ;
251
- case 1 :
252
- build_planner::draw_building_ghost (ctx, bandstand_m.stand_we_w , pixel + vec2i{30 , 15 }, COLOR_MASK_GREEN);
253
- build_planner::draw_building_ghost (ctx, bandstand_m.stand_we_e , pixel + vec2i{60 , 30 }, COLOR_MASK_GREEN);
254
- build_planner::draw_building_ghost (ctx, bandstand_m.booth , pixel + vec2i{0 , 60 }, COLOR_MASK_GREEN);
255
- break ;
256
- case 2 :
257
- build_planner::draw_building_ghost (ctx, bandstand_m.stand_sn_n , pixel + vec2i{-30 , 15 }, COLOR_MASK_GREEN);
258
- build_planner::draw_building_ghost (ctx, bandstand_m.stand_sn_s , pixel + vec2i{-60 , 30 }, COLOR_MASK_GREEN);
259
- build_planner::draw_building_ghost (ctx, bandstand_m.booth , pixel + vec2i{0 , 60 }, COLOR_MASK_GREEN);
260
- break ;
261
- case 3 :
262
- build_planner::draw_building_ghost (ctx, bandstand_m.stand_we_w , pixel, COLOR_MASK_GREEN);
263
- build_planner::draw_building_ghost (ctx, bandstand_m.stand_we_e , pixel + vec2i{30 , 15 }, COLOR_MASK_GREEN);
264
- build_planner::draw_building_ghost (ctx, bandstand_m.booth , pixel + vec2i{-60 , 30 }, COLOR_MASK_GREEN);
265
- break ;
266
- }
267
- }
0 commit comments