311
311
const float scale = 1.f / given_map_view->view().zoom;
312
const auto blit_overlay = [dst, f, scale](const Image* pic, const Vector2i& hotspot) {
313
dst->blitrect_scale(Rectf(f->rendertarget_pixel - hotspot.cast<float>() * scale,
314
pic->width() * scale, pic->height() * scale),
315
pic, Recti(0, 0, pic->width(), pic->height()), 1.f,
316
BlendMode::UseAlpha);
319
313
// Add road building overlays if applicable.
320
314
if (f->vision > 0) {
341
335
const auto it = work_area_overlays.find(f->fcoords);
342
336
if (it != work_area_overlays.end()) {
343
blit_overlay(it->second, Vector2i(it->second->width() / 2, it->second->height() / 2));
337
blit_field_overlay(dst, *f, it->second,
338
Vector2i(it->second->width() / 2, it->second->height() / 2), scale);
349
344
if (buildhelp()) {
350
345
const auto* overlay = get_buildhelp_overlay(plr.get_buildcaps(f->fcoords));
351
346
if (overlay != nullptr) {
352
blit_overlay(overlay->pic, overlay->hotspot);
347
blit_field_overlay(dst, *f, overlay->pic, overlay->hotspot, scale);
356
351
// Blit the selection marker.
357
352
if (f->fcoords == get_sel_pos().node) {
358
353
const Image* pic = get_sel_picture();
359
blit_overlay(pic, Vector2i(pic->width() / 2, pic->height() / 2));
354
blit_field_overlay(dst, *f, pic, Vector2i(pic->width() / 2, pic->height() / 2), scale);
362
357
// Draw road building slopes.
364
359
const auto it = road_building.steepness_indicators.find(f->fcoords);
365
360
if (it != road_building.steepness_indicators.end()) {
367
it->second, Vector2i(it->second->width() / 2, it->second->height() / 2));
361
blit_field_overlay(dst, *f, it->second,
362
Vector2i(it->second->width() / 2, it->second->height() / 2),