+}
+
+void Minimap::setAngle(f32 angle)
+{
+ m_angle = angle;
+}
+
+void Minimap::blitMinimapPixelsToImageRadar(video::IImage *map_image)
+{
+ video::SColor c(240, 0, 0, 0);
+ for (s16 x = 0; x < data->map_size; x++)
+ for (s16 z = 0; z < data->map_size; z++) {
+ MinimapPixel *mmpixel = &data->minimap_scan[x + z * data->map_size];
+
+ if (mmpixel->air_count > 0)
+ c.setGreen(core::clamp(core::round32(32 + mmpixel->air_count * 8), 0, 255));
+ else
+ c.setGreen(0);
+
+ map_image->setPixel(x, data->map_size - z - 1, c);
+ }
+}
+
+void Minimap::blitMinimapPixelsToImageSurface(
+ video::IImage *map_image, video::IImage *heightmap_image)
+{
+ // This variable creation/destruction has a 1% cost on rendering minimap
+ video::SColor tilecolor;
+ for (s16 x = 0; x < data->map_size; x++)
+ for (s16 z = 0; z < data->map_size; z++) {
+ MinimapPixel *mmpixel = &data->minimap_scan[x + z * data->map_size];
+
+ const ContentFeatures &f = m_ndef->get(mmpixel->n);
+ const TileDef *tile = &f.tiledef[0];
+
+ // Color of the 0th tile (mostly this is the topmost)
+ if(tile->has_color)
+ tilecolor = tile->color;
+ else
+ mmpixel->n.getColor(f, &tilecolor);
+
+ tilecolor.setRed(tilecolor.getRed() * f.minimap_color.getRed() / 255);
+ tilecolor.setGreen(tilecolor.getGreen() * f.minimap_color.getGreen() / 255);
+ tilecolor.setBlue(tilecolor.getBlue() * f.minimap_color.getBlue() / 255);
+ tilecolor.setAlpha(240);
+
+ map_image->setPixel(x, data->map_size - z - 1, tilecolor);
+
+ u32 h = mmpixel->height;
+ heightmap_image->setPixel(x,data->map_size - z - 1,
+ video::SColor(255, h, h, h));