209 Commits

Author SHA1 Message Date
Ali El Gariani
4af4a8c46c Improve random start of animation
This fix a rare synchronization in the top half-hexes and prevent
unwanted synchronization between different rules. Also needed for
future plans.
2010-07-11 04:28:07 +00:00
Ali El Gariani
ec3b37f005 Fix _off^_usr not using the tile_image of theme. 2010-07-08 19:59:59 +00:00
Ali El Gariani
5dde705c6d Remove redundant data 2010-07-08 19:59:56 +00:00
Ali El Gariani
177462555d simplify code of terrain_builder::apply_rule 2010-07-08 19:59:53 +00:00
Ali El Gariani
6bed95903c Simplify a bit animated terrain parsing 2010-07-08 19:59:50 +00:00
Alexander van Gessel
9e7f2cff6d Fix a deprecation warning and add a note about its future removal 2010-07-06 14:40:30 +01:00
Ali El Gariani
1b6fc9391b Fix small error in previous commit and...
...restore WML warning about missing png extension
2010-06-27 17:30:48 +00:00
Ali El Gariani
c2f75aba4e Improve precaching of terrain images existence...
...by also skipping any image cache record.

This reduces the index numbers used.

Also temporary disable a log::wml_error about missing ".png" extension
2010-06-27 17:07:11 +00:00
Alexander van Gessel
7247971f52 Revert all changes to rebuild_terrain(),
...the images used in there aren't actual terrain tiles. (this fixes
the drawing-preview)
2010-06-19 03:52:54 +01:00
Alexander van Gessel
28d3deea68 Add support for image path functions in terrain graphics 2010-06-19 03:20:55 +01:00
Alexander van Gessel
32980eda73 Move the appending of '.png' to image paths...
...from C++ to the terrain BUILDER macros
2010-06-18 16:28:14 +01:00
Guillaume Melquiond
f00f669215 Avoided costly roundtrip through strings. 2010-06-02 20:35:58 +00:00
Guillaume Melquiond
76c34a23d3 Modified WML attributes so that they are stored with...
...smaller effective types when they are not translatable.

This patch considerably reduces the memory footprint of WML and speeds it up.

It should not change any WML behavior, except for a few corner cases
detailled below:

- "off" is no longer a synonym for "no" (it wasn't used anyway),

- _"42" is no longer an integer,

- untranslatable "true" and "false" are stored as booleans, hence
  displayed as "yes" and "no",

- "042" is now understood as octal notation (hence 34) rather than decimal,

- hexadecimal notation "0x42" is now recognized.
2010-05-24 08:01:31 +00:00
Jérémy Rosen
8c40e72fa2 forgot some commits when merging water animation branch:
...random start for animations
2010-04-02 14:27:36 +00:00
Mark de Wever
81fdd34b06 Use empty() instead of comparing size() with 0.
Issue found by cppcheck.
2010-03-30 21:56:48 +00:00
Jérémy Rosen
e2ec3b6939 fix multiple flags not working in [terrain_graphics]...
(they worked in [tile])
2010-01-31 12:47:38 +00:00
Mark de Wever
819bf9a4a9 Pre instead of post increment a variable.
Issue found by cppcheck.
2010-01-03 18:44:26 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Ali El Gariani
19cd668ede simplify a bit some includes 2009-12-04 23:42:16 +00:00
Ali El Gariani
d12566c446 use lexical_cast_default 2009-12-04 07:06:34 +00:00
Ali El Gariani
fde533b6b1 Stop uselessly storing precedence into each rule
(already stored in the main containing structure)
2009-12-04 06:01:02 +00:00
Ali El Gariani
e3b61579f0 Cache the parsing of global terrain rules during same campaign/MP.
This shorten the "Initializing display" phase (except the first, of
course).
2009-12-04 05:40:44 +00:00
Mark de Wever
29ae8bf5de Remove an unneeded include. 2009-11-27 23:00:41 +00:00
Mark de Wever
f69eb543ff Post instead of pre increment a variable.
Issue found by cppcheck.
2009-10-02 19:27:28 +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
Guillaume Melquiond
2d18809f8b Cleaned code by removing useless pointers and duplication. 2009-04-04 17:50:42 +00:00
Guillaume Melquiond
6aa4e3d88b Removed config::get_children. 2009-03-20 07:07:53 +00:00
Tomasz Śniatowski
4a66260942 fix a compile error on gcc caused by a recent commit 2009-02-21 23:39:05 +01:00
Tomasz Śniatowski
689622660a use vector.swap(vector()) instead of vector.resize()...
...in terrain_builder cache when the map size changes to avoid a
leak-like behavior when a very large map is replaced by a small one
2009-02-21 23:07:03 +01:00
Mark de Wever
973a0a7d5c Remove trailing whitespace. 2009-01-01 10:28:26 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Tomasz Śniatowski
1589d8713c editor2 MDI feature - have more than one map open in the editor...
...with fast switching between them. Can be disabled in the editor
settings. Also changed:

* the display class now holds a pointer to the map instead of a
  reference, a pointer can be changed which permits the entire MDI
  behavior. Related bits were also changed in terrain_builder.

* mouse_handler_base no longer holds a reference to the map

* the map labels class does not hold a gamemap reference, as it can
  use the display object to access the map. Also clearing all labels
  was exposed as a public member function.

* used scoped_ptrs and forward declarations to avoid having to include
  map_label.hpp and terrain_builder.hpp in display.hpp, this reduces
  build dependencies quite a bit.

* made get_action_state use the menu index to allow a dynamic menu to
  have checkboxes. This entire chunk of code needs a rewrite.
2008-11-21 15:42:34 +01:00
Eric S. Raymond
9223460daa Remove unused headers. 2008-11-09 04:35:13 +00:00
Tomasz Śniatowski
01e504ede6 remove some map.hpp dependencies,
...also separated viewpoint and map_exception classes from map.hpp
into separate headers (no cpp files)
2008-10-17 17:53:08 +01:00
Tomasz Śniatowski
c54a538139 Refactor gamemap::location -- rename to map_location,
...move into separate cpp/hpp pair. The code under src/ was modified
mainly using a global search-and-replace. This change allows reducing
code dependencies and gets rid of inner-class confusion (parts of the
code had to use "location" when referring to gamemap::location, it is
now consistent across the codebase.)
2008-10-15 17:38:51 +01:00
Mark de Wever
42ba967d5d MSVC 6 cleanup.
Now that MSVC 6 is no longer supported start to remove some helper code
to work around problems in that compiler. The first step is to comment
out the code and replace it with new helper code that uses the standard.
The second step is to remove the helper code and fix all callers.

Patch 3/3 for step 2: Remove push_back and fix it's callers.
2008-08-24 16:12:22 +00:00
Mark de Wever
81c6a850ab MSVC 6 cleanup.
Now that MSVC 6 is no longer supported start to remove some helper code
to work around problems in that compiler. The first step is to comment
out the code and replace it with new helper code that uses the standard.
The second step is to remove the helper code and fix all callers.

Patch 2/3 for step 2: Remove minimum and maximum and fix all callers.
2008-08-24 16:12:13 +00:00
Ali El Gariani
c081ffa50b Better quick fix than the previous commit...
...(fixing "../scenery/something.png" in terrain-wml). Now support any
"terrain/../directory" and so "/items" too.  Thanks Shadow_Master for
the idea.
2008-07-27 00:56:14 +00:00
Ali El Gariani
02aea45e24 Quickfix to broken use of "../scenery/something.png" in terrain-wml rules
now any images in "scenery/" works too
2008-07-26 23:05:20 +00:00
Tomasz Śniatowski
a5c09d3e19 Fix terrain rendering bug
remove operator overloading for clarity, reintroduce old location
adition as legacy_sum and similar functions, change new location
addition to vector_sum. The old functions are used where the old
operators were used.
2008-07-26 21:04:40 +01:00
Tomasz Śniatowski
c048b0595b add a reload_map member function...
...that allows the display object to stay in sync when the map
dimensions have changed
2008-07-19 22:07:30 +01:00
Mark de Wever
e3d9b6636c Update doxygen comment style. 2008-06-24 05:59:54 +00:00
Mark de Wever
6dcf0be3dc Remove some unneeded includes of array.hpp and move it to where really needed. 2008-06-23 20:26:44 +00:00
Ali El Gariani
5ac1cab529 Optimization of the first "Initializing display" phase (when caching)
Since the terrain builder need to check the existence of a lot of
images, check once all the "terrain" directories and cache which files
exists, instead of searching each file in each directory.
2008-06-07 04:57:00 +00:00
Moritz Göbelbecker
1f9b17b954 Add support for centering multihex terrain images...
...using the center=(x,y) attribute.
2008-04-28 16:54:29 +00:00
Ali El Gariani
b9ff50c5cc Fix some bugs with the undocumented location-specific terrain rules:
- x and y values were shifted by 1

- other [tile] requirements were ignored
2008-04-28 16:25:23 +00:00
Moritz Göbelbecker
f88efeb810 Add support for overlay terrains.
Converted bridges to use the new feature.
2008-04-04 18:43:57 +00:00
Eric S. Raymond
9e2e1829f7 Code cleanup. Fix a type-conversion warning in the display code,
...banish 'letter' for terrain codes in favor of 'tcode'.
2008-02-20 00:16:11 +00:00
Ali El Gariani
de5671f759 Also use the improved noise function for the terrain builder engine.
The old one had some patterns (this is why it was improved for road
placing) Thanks to SynErr to notice it and remind me to port the
change there too (I will probably move both usages in one function,
just need to find a place)
2008-02-17 04:32:26 +00:00
Mark de Wever
001af46e6e Updated all headers to 2008. 2008-02-16 08:47:16 +00:00