The Battle for Wesnoth  1.17.23+dev
minimap.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2023
3  by David White <dave@whitevine.net>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
18 #include <cstddef>
19 #include <map>
20 
21 class gamemap;
22 class surface;
23 class team;
24 class unit_map;
25 struct map_location;
26 
27 namespace image {
28  /**
29  * function to create the minimap for a given map
30  * the surface returned must be freed by the user
31  */
32  surface getMinimap(int w, int h, const gamemap &map_, const team *vm = nullptr, const std::map<map_location,unsigned int> *reach_map = nullptr, bool ignore_terrain_disabled = false);
33 
34 /**
35  * Renders the minimap to the screen.
36  */
37 void render_minimap(unsigned dst_w,
38  unsigned dst_h,
39  const gamemap& map,
40  const team* vw = nullptr,
41  const unit_map* units = nullptr,
42  const std::map<map_location, unsigned int>* reach_map = nullptr,
43  bool ignore_terrain_disabled = false);
44 }
Encapsulates the map of the game.
Definition: map.hpp:172
This class stores all the data for a single 'side' (in game nomenclature).
Definition: team.hpp:76
Container associating units to locations.
Definition: map.hpp:99
int w
Functions to load and save images from/to disk.
void render_minimap(unsigned dst_w, unsigned dst_h, const gamemap &map, const team *vw, const unit_map *units, const std::map< map_location, unsigned int > *reach_map, bool ignore_terrain_disabled)
Renders the minimap to the screen.
Definition: minimap.cpp:293
surface getMinimap(int w, int h, const gamemap &map, const team *vw, const std::map< map_location, unsigned int > *reach_map, bool ignore_terrain_disabled)
function to create the minimap for a given map the surface returned must be freed by the user
Definition: minimap.cpp:43
Encapsulates the map of the game.
Definition: location.hpp:38
#define h