← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/save_minimap into lp:widelands

 

SirVer has proposed merging lp:~widelands-dev/widelands/save_minimap into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/save_minimap/+merge/242567

Saves a minimap into the folder of the map. This is a step towards removing the software renderer.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/save_minimap into lp:widelands.
=== added file 'maps/Atoll.wmf/minimap.png'
Binary files maps/Atoll.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Atoll.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Calvisson.wmf/minimap.png'
Binary files maps/Calvisson.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Calvisson.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Checkmate.wmf/minimap.png'
Binary files maps/Checkmate.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Checkmate.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Comet Island.wmf/minimap.png'
Binary files maps/Comet Island.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Comet Island.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Crater.wmf/minimap.png'
Binary files maps/Crater.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Crater.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Crossing the horizon.wmf/minimap.png'
Binary files maps/Crossing the horizon.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Crossing the horizon.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Desert Tournament.wmf/minimap.png'
Binary files maps/Desert Tournament.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Desert Tournament.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Dry Riverbed.wmf/minimap.png'
Binary files maps/Dry Riverbed.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Dry Riverbed.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Elven Forests.wmf/minimap.png'
Binary files maps/Elven Forests.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Elven Forests.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Fellowships.wmf/minimap.png'
Binary files maps/Fellowships.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Fellowships.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Finlakes.wmf/minimap.png'
Binary files maps/Finlakes.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Finlakes.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Firegames.wmf/minimap.png'
Binary files maps/Firegames.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Firegames.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Four Castles.wmf/minimap.png'
Binary files maps/Four Castles.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Four Castles.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Four Mountains.wmf/minimap.png'
Binary files maps/Four Mountains.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Four Mountains.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Glacier Lake.wmf/minimap.png'
Binary files maps/Glacier Lake.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Glacier Lake.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Golden Peninsula.wmf/minimap.png'
Binary files maps/Golden Peninsula.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Golden Peninsula.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Ice wars.wmf/minimap.png'
Binary files maps/Ice wars.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Ice wars.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Impact.wmf/minimap.png'
Binary files maps/Impact.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Impact.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Islands at war.wmf/minimap.png'
Binary files maps/Islands at war.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Islands at war.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Kings and Queens.wmf/minimap.png'
Binary files maps/Kings and Queens.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Kings and Queens.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Lake of tranquility.wmf/minimap.png'
Binary files maps/Lake of tranquility.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Lake of tranquility.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Last Bastion.wmf/minimap.png'
Binary files maps/Last Bastion.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Last Bastion.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Long, long way.wmf/minimap.png'
Binary files maps/Long, long way.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Long, long way.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/MP Scenarios/Island Hopping.wmf/minimap.png'
Binary files maps/MP Scenarios/Island Hopping.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/MP Scenarios/Island Hopping.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/MP Scenarios/Smugglers.wmf/minimap.png'
Binary files maps/MP Scenarios/Smugglers.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/MP Scenarios/Smugglers.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Mystical Maze.wmf/minimap.png'
Binary files maps/Mystical Maze.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Mystical Maze.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Plateau.wmf/minimap.png'
Binary files maps/Plateau.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Plateau.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Rendez-Vous.wmf/minimap.png'
Binary files maps/Rendez-Vous.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Rendez-Vous.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/River Explorers.wmf/minimap.png'
Binary files maps/River Explorers.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/River Explorers.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Riverlands.wmf/minimap.png'
Binary files maps/Riverlands.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Riverlands.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Sun of fire.wmf/minimap.png'
Binary files maps/Sun of fire.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Sun of fire.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Swamp Island.wmf/minimap.png'
Binary files maps/Swamp Island.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Swamp Island.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Swamp Monks.wmf/minimap.png'
Binary files maps/Swamp Monks.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Swamp Monks.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/The Far North.wmf/minimap.png'
Binary files maps/The Far North.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/The Far North.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/The Nile.wmf/minimap.png'
Binary files maps/The Nile.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/The Nile.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/The Oasis Triangle.wmf/minimap.png'
Binary files maps/The Oasis Triangle.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/The Oasis Triangle.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/The Thaw.wmf/minimap.png'
Binary files maps/The Thaw.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/The Thaw.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/The big lake.wmf/minimap.png'
Binary files maps/The big lake.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/The big lake.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/The long way.wmf/minimap.png'
Binary files maps/The long way.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/The long way.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/The pass through the mountains.wmf/minimap.png'
Binary files maps/The pass through the mountains.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/The pass through the mountains.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Three Warriors.wmf/minimap.png'
Binary files maps/Three Warriors.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Three Warriors.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Together we're strong.wmf/minimap.png'
Binary files maps/Together we're strong.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Together we're strong.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Trident of Fire.wmf/minimap.png'
Binary files maps/Trident of Fire.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Trident of Fire.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Twin Lagoons.wmf/minimap.png'
Binary files maps/Twin Lagoons.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Twin Lagoons.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Twinkling Waves.wmf/minimap.png'
Binary files maps/Twinkling Waves.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Twinkling Waves.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Two frontiers.wmf/minimap.png'
Binary files maps/Two frontiers.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Two frontiers.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Volcanic Winter.wmf/minimap.png'
Binary files maps/Volcanic Winter.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Volcanic Winter.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/War of the Valleys.wmf/minimap.png'
Binary files maps/War of the Valleys.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/War of the Valleys.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== added file 'maps/Wisent Valley.wmf/minimap.png'
Binary files maps/Wisent Valley.wmf/minimap.png	1970-01-01 00:00:00 +0000 and maps/Wisent Valley.wmf/minimap.png	2014-11-22 15:40:05 +0000 differ
=== modified file 'src/map_io/CMakeLists.txt'
--- src/map_io/CMakeLists.txt	2014-10-13 15:04:50 +0000
+++ src/map_io/CMakeLists.txt	2014-11-22 15:40:05 +0000
@@ -94,6 +94,7 @@
     build_info
     economy
     graphic
+    graphic_image_io
     graphic_surface
     helper
     io_fileread

=== modified file 'src/map_io/map_saver.cc'
--- src/map_io/map_saver.cc	2014-09-20 09:37:47 +0000
+++ src/map_io/map_saver.cc	2014-11-22 15:40:05 +0000
@@ -19,10 +19,16 @@
 
 #include "map_io/map_saver.h"
 
+#include <memory>
+
 #include "base/log.h"
 #include "base/scoped_timer.h"
 #include "base/wexception.h"
+#include "graphic/image_io.h"
+#include "graphic/minimap_renderer.h"
+#include "graphic/surface.h"
 #include "io/filesystem/filesystem.h"
+#include "io/filewrite.h"
 #include "logic/editor_game_base.h"
 #include "logic/map.h"
 #include "logic/player.h"
@@ -208,6 +214,15 @@
 #ifndef NDEBUG
 	m_mos->detect_unsaved_objects();
 #endif
+
+	// Write minimap
+	{
+		std::unique_ptr<Surface> minimap(
+		   draw_minimap(m_egbase, nullptr, Point(0, 0), MiniMapLayer::Terrain));
+		FileWrite fw;
+		save_surface_to_png(minimap.get(), &fw);
+		fw.write(m_fs, "minimap.png");
+	}
 }
 
 }


Follow ups