248 Commits

Author SHA1 Message Date
Ignacio R. Morelle
57ae45387a New Year copyright update 2015-01-01 19:07:35 -03:00
Chris Beck
b6e12ebf76 fixup more includes 2014-11-11 13:32:03 -05:00
Chris Beck
ab62d9c75e split off terrain data caches from the gamemap object
This commit splits some of the functionality of the gamemap object
into a new class, the "terrain_type_data" object. This class is
intended to hold a record of known terrains and the terrain code ->
terrain type map. It handles merging in new terrain definitions,
and it is shared between map objects. It is also cached by the game
config manager, so that we only recalculate this data when we
change configs.

There is in fact a *semantic* change going on here, which is that
when a scenario introduces a new terrain type by merging, this gets
added to the global cache. The alternative is to make a copy of the
global cache, only for the this scenario, as soon as we have to
dirty the cache. However since I didn't see any downside to putting
the merged terrains together and carrying them across scenarios,
I opted not to do that here.
2014-11-07 22:34:31 -05:00
Chris Beck
656870ca64 move parse_location_range to map:: object
This function required the use of resources::game_map, so properly
should be a method of game_map. This will help us to make sure that
such functions work when using either the editor or the play
controller, or the replay controller, and generally improve
encapsulation.
2014-06-11 14:50:07 -04:00
Chris Beck
c5838b9513 inline the definition map_location::null_location
If we decided it was worth it to inline map_location ==, then
surely this is also worth it to inline null_location, as the
compiler may be able to reduce tests for == null location to
"x == ... && y == ...", without having to move to a different
compilation unit.
2014-05-20 10:42:13 -04:00
Chris Beck
c73b5945d9 add static const members ZERO, default_dirs, of map_location
Replace local constants appearing elsewhere with these.
The definitions are inlined.
2014-05-20 04:49:12 -04:00
fendrin
e0186e9f69 No longer write the map_data header anymore.
Like discussed at the FOSDEM, those embedded WML attributes are not used
anymore.
2014-03-15 17:25:50 +01:00
Ignacio R. Morelle
a4f47a63c7 New Year copyright update 2014-01-01 02:08:52 -03:00
Eric S. Raymond
043c4f9fd3 Remove $Id$ cookies. 2013-03-26 21:41:37 -04:00
Fabian Müller
427974e046 Add a trailing newline to saved map files. 2013-03-24 07:11:04 +00:00
J. Tyne
e066bac97e Pass the t_translation::t_terrain struct by (const) reference instead of value. 2013-02-12 23:16:43 +00:00
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
J. Tyne
b12e67291f Have on_board_with_border() detect a newly initialized tiles_ as empty.
(It gets initialized to a size 1 vector for some reason.)
2012-09-05 23:53:55 +00:00
Fabian Müller
84b8dbafd2 Brings back the old map format. 2012-08-24 18:49:30 +00:00
J. Tyne
1364d77914 Skip some unneeded processing when a parameter is the null location. 2012-08-23 03:51:35 +00:00
J. Tyne
592e1fff6e Simplify a conditional. 2012-08-21 22:52:17 +00:00
Mark de Wever
2a5f0e1b62 Don't use string::c_str() to create a string.
Issue found by cppcheck.
2012-03-10 13:29:36 +00:00
Fabian Müller
177b197a5e Removed extra quoting for map strings. 2012-02-23 20:58:10 +00:00
Fabian Müller
a8aa81f338 Now realy introduced the new map format. 2012-02-23 02:39:58 +00:00
Anonymissimus
8888752389 disable the size check I added (workaround for regression found by Ivanovic) 2012-01-20 14:02:12 +00:00
Anonymissimus
242605e006 replace translatable blargh error message with untranslatable blargh one 2012-01-17 22:59:47 +00:00
Anonymissimus
7c2f93d060 Require loaded maps to have at least 1 (non-border) hex (bug #19018)
(This new translatable string is only visible/useful for wml authors,
and we have lots on untranslated wml error messages anyway; also
they really don't need to be translatable)
2012-01-17 22:28:08 +00:00
Anonymissimus
06238ae4fd Set total_width, *height to 0 in case of an empty map.
Seems like an oversight from the times when there was no border.
2012-01-17 22:27:38 +00:00
Anonymissimus
d75e320e5a Introduce parameter allow_invalid in gamemap::read (fix for bug #19018) 2012-01-17 22:26:33 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Mark de Wever
ffe42f4ca1 Fix a compilation issue in c++0x mode.
Adds extra constructors to the coordinate class to avoid narrowing
conversions, which are no longer allowed in c++0x.
2011-09-26 20:27:09 +00:00
Iurii Chernyi
ecc1782c03 Fixed bug #17150: fix naming conflict with OpenBSD macro by renaming 2011-08-11 23:30:38 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Ignacio R. Morelle
c7c4e0d5d0 Fix the lack of whitespace after a comma in a string 2010-10-22 21:11:48 +00:00
Ignacio R. Morelle
b83b8deed2 Fix insertion of gratuitous whitespace with non-aliased terrain combinations 2010-10-22 21:10:40 +00:00
Ignacio R. Morelle
4620c4b784 const is good 2010-10-18 02:03:15 +00:00
Ignacio R. Morelle
76ee36d721 Fix duplicate terrain names NAME/NAME in editor caused by t_string's...
...design -- polishes 2010-10-18T00:44:43Z!shadowm@wesnoth.org.
2010-10-18 02:01:34 +00:00
Ignacio R. Morelle
e30195e1a6 Verbose terrain names can be specified using terrain.editor_name...
...to be displayed in the editor as "<verbose name>/<common name>
(<underlying>)" (bug #16450)
2010-10-18 00:44:43 +00:00
Ignacio R. Morelle
44c0c283d7 Replace "Illegal character in map" with "Illegal tile in map" 2010-10-18 00:43:52 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Alexander van Gessel
be1db44f10 Rename incorrect_map_format_exception to incorrect_map_format_error 2010-08-03 15:58:46 +01:00
Mark de Wever
a99c78e0d8 Update doxygen comment.
The filename after the @file comment is optional (spotted by alink).
2010-07-26 21:32:18 +00:00
Guillaume Melquiond
1376bd1e9d Avoided costly roundtrip through strings. 2010-06-02 19:20:45 +00:00
Mark de Wever
eff514d4aa Remove a MSVC 6.0 work-around. 2010-04-02 12:12:57 +00:00
Mark de Wever
13b70e57d9 Revert 2010-01-26T06:34:20Z!esr@thyrsus.com for map.cpp, only adds an #include. 2010-01-26 20:33:20 +00:00
Eric S. Raymond
75925deb82 Merge of fendrin's new teleport and tunnel code.
The changes are guarded by the C++ and WML conditional symbol
"EXPERIMENTAL".

The experimental flag is temporarily defaulted off, so those patches
should have no effect on people doing ordinary builds. This may change
once fendrin has the tunnel code fixed and polished.
2010-01-26 06:34:20 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Mark de Wever
4145e09e1f Remove an unneeded include. 2009-11-27 23:00:48 +00:00
Iurii Chernyi
cbd72b6656 revert part of 2009-04-14T20:17:41Z!esr@thyrsus.com
change 'terrain_type' attribute in [rule] back to 'terrain', as it
should be, according to the documentation. This fixes bug #14197
2009-09-01 20:20:30 +00:00
Ali El Gariani
0984328cb0 Move some simple common map_location functions from pathutils.hpp...
...to map_location.hpp where they more clearly belongs. Allow to
simplify some includes.
2009-08-31 12:59:22 +00:00
Gunter Labes
4556655a06 made GUI map error messages more useful 2009-07-02 10:18:18 +00:00
Guillaume Melquiond
789736ac91 Removed specialized domains from log.hpp,
...so that adding a new domain no longer forces to recompile the whole
game.
2009-04-24 23:18:31 +00:00
Eric S. Raymond
89bd5dff5a Terrain types can now have description attributes.
If present, these override the name attribute for the "outside"
portion of the human-readable terrain description, e.g.  the part not
in parentheses.

The main use for this is editor palette tooltips; they now say, for
example, "Summer Deciduous Forest (Forest)".  I've also wired things
so that the normal in-game terrain report uses description rather than
name when it's available, as a demonstration (that's the diff to
generate.report.cpp) but it might be that level of detail is not
actually desirable in the game itself.
2009-04-15 07:55:31 +00:00
Eric S. Raymond
25e9e53cb6 Change the terrain definition tag from [terrain] to [terrain_type].
This is paraallel to the change from [unit] to [unit_type], and for
similar reasons - reduces ambiguity, enables better WML sanity
checking.
2009-04-14 20:17:41 +00:00
Guillaume Melquiond
336f24157d Removed config::child_list from map.cpp. 2009-03-20 07:07:20 +00:00