209 Commits

Author SHA1 Message Date
Fabian Müller
520fafcfb9 Editor overhaul.
Changed how the terrain group/palettes work.

Added the map label placement tool.
2012-02-28 10:31:13 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Ali El Gariani
7ca44f7ac6 Big optimization of terrain rendering by removing all empty images.
This make screen update (zooming, ToD changes, etc) several times
faster, gain some fps (esp. for complex map), optimize some animated
terrains (stop refreshing empty parts) and spare some memory
(sometimes, not clear yet)

Also remove the noise in :layers.

Note: This is an improved version of 2010-10-06T16:07:43Z!alinkmaze@gmail.com from the OGL branch
2011-12-17 15:07:07 +00:00
Alexander van Gessel
81e0a2007f Revert token t_token commits from 2011-09-08T19:15:40Z!thonsew@yahoo.com on. 2011-10-10 03:43:29 +01:00
Thonsew
88b5546118 Attempt to fix static de-initialization problems.
Some compilers are calling destructors for static objects before other
static objects use them in their destructors.  This patch initializes
static t_interned objects with new and intentionally doesn't call
delete in order to guarrantee their existence throughout the static
de-initialization phase.  It creates a new function
generate_safe_static_const_t_interned for this purpose.  It might
address bug #18666, although I can not duplicate the crash with gcc on
fedora 15.
2011-09-20 21:21:31 +00:00
Thonsew
cdb129508d Fix implicit static cast...
...of config::attribute_value & to tstring & or t_token reference
causes crashes.  Some compilers were generating a temporary object and
binding a reference to the temporary when creating an implicit cast to
an attribute value.  I removed the implicit cast and replaced all (I
think) instances of the implicit cast with explicit 2 step operation.
This fixes bugs like bug #18663, bug #18684
2011-09-20 21:20:54 +00:00
Mark de Wever
24c055cd44 Strip trailing whitespace. 2011-09-10 11:52:18 +00:00
Sergey Popov
f1eda25fd4 Converted remaining z_emptys to function calls.
This finally fixes startup segfault with my version of gcc.
2011-09-09 11:05:52 +00:00
Thonsew
1a5810656b [[t_token optimizations]]
1. Updated terrain_builder to use t_token in place of std::string to
facilitate fast copying, hashing and comparison

2. Added utils::parenthetical_split_token, a cached parenthetical
version of the string version

3. Made the lru_cache faster for the cache miss case.
2011-09-08 19:17:55 +00:00
Thonsew
7e99017fa4 Updated image.cpp to
1. Use t_token in place of std:string to save on string construction

2. Use boost::unordered_map in place of std::map as per todo by silene
2011-09-08 19:17:41 +00:00
Mark de Wever
aefb3fc249 Fix doxygen warnings. 2011-06-30 21:16:28 +00:00
Mark de Wever
b7a5056a4a Remove deprecated code and minor cleanup. 2011-04-09 16:00:16 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Mark de Wever
d64fc62f54 Remove unneeded includes. 2010-12-05 18:09:45 +00:00
Ignacio R. Morelle
d6a3de1938 Apply patch #2213 by stikonas, using file #11274 2010-11-21 01:56:29 +00:00
Ali El Gariani
ae642a5553 Allow to disable random animation shift in animated terrains.
Use a new key random_start (default = yes) in
[terrain_graphics][image]
2010-10-23 17:07:58 +00:00
Ali El Gariani
b60fa998a3 Use 100 as default for terrain probability as specified in wiki.
This spare a lot of calls to the RNG because c++ code used -1 as 'no
probability'(=100%), but WML macros use 100
2010-09-02 22:24:58 +00:00
Ali El Gariani
f4fd1eeaca Much more stable terrain variation randomization (fix bug #16612)
Hash the image name, so the only thing now affecting it is images
rename and change in the hash function (which still need some
polishing).
2010-09-02 19:26:56 +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
Ali El Gariani
a4fa8eb499 Fixing variation only applied on the first frame of animated terrains
(this should animate water transitions)
2010-08-27 20:48:16 +00:00
Ali El Gariani
dfe444a6bc Optimization of cache rebuild
(>4x faster, for both cache building and "building terrain rules")

by introducing a new method for terrain variations, which stop relying
on the WML preprocessor.

Still WiP. WML syntax is not final, and thus also WML macros and WML
parsing (not optimized yet)
2010-08-23 04:21:47 +00:00
Ali El Gariani
44ed14f86d Remove the WiP probability in [variant], since a better way is needed 2010-08-23 04:21:41 +00:00
Guillaume Melquiond
b8d6286dbd Factorized and generalized the loadscreen progress counter.
The bar should now accurately reflect the loading time, and therefore
regularly progress.

The magic values are automatically generated in the 'loadscreen' log
domain and can be copy-pasted in the code if the current ones become
off.
2010-08-10 12:08:24 +00:00
Guillaume Melquiond
4ecf20cf9d Avoided creation of temporary animations. 2010-08-09 09:03:03 +00:00
Guillaume Melquiond
abe279f034 Merged precedence into building rules,
...so as to avoid a useless copy/destruction at insertion time.
2010-08-09 06:39:49 +00:00
Guillaume Melquiond
5049fdf19a Performed all the substitution of rotation tokens (@R0-5) in one single pass.
This patch speeds up the creation of terrain rules by 40%.
2010-08-08 21:05:23 +00:00
Guillaume Melquiond
d4d9145fb9 Avoided querying twice the same attributes. 2010-08-08 13:30:12 +00:00
Guillaume Melquiond
52eebbefa1 Optimized further the building of rotated rules.
This brings the speed up of the previous commits up to 90%.
2010-08-08 09:33:41 +00:00
Guillaume Melquiond
b069193054 Optimized further the building of rotated rules.
This brings the speed up of the previous commit up to 70%.
2010-08-08 09:16:54 +00:00
Guillaume Melquiond
1d44536ab4 Improved scenario start time by speeding up terrain rule build by 30%. 2010-08-08 08:40:52 +00:00
Ali El Gariani
9d0ab833c2 Also display a warning for missing .png...
...when terrain images are not in terrain/ (like ../scenery/fire1 in
UtBS)
2010-07-28 18:39:51 +00: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
Ali El Gariani
fb08e4b502 Fix typo in 2010-07-08T19:59:50Z!alinkmaze@gmail.com breaking image path modidification. 2010-07-25 18:16:19 +00:00
Ali El Gariani
3815cfe628 New key 'set_no_flag' in [tile] which combines 'set_flag' and 'no_flag'...
...because most of the times we use same flags in both keys.
This will also reduce the macro use in terrain_graphics.
2010-07-24 02:24:20 +00:00
Ali El Gariani
149e1265c0 In terrain rules parsind, do images check and animation loading...
...in the one pass.

This also checks images of all frames instead of only the first one.
2010-07-23 19:56:43 +00:00
Mark de Wever
aa0b6ca9ad Fix a compiler warning. 2010-07-20 20:08:16 +00:00
Jérémy Rosen
95c41cdf82 new track layout system, works for tracks, stonebridge, woodbridge,
...and allows easier plugin of images within a bridge structure. The
basic macros are here but all the random variations etc are not.
2010-07-19 21:46:34 +00:00
Ali El Gariani
6c19fbef3f Clean ":layers" and add layer order and back/foreground flag 2010-07-18 01:47:07 +00:00
Ali El Gariani
14ba29f0f6 Clean the implentation of ':layers'
- also display (scaled) image from the source for easier identification

- show center.x/y

- support [variant]

- directly log from the engine function to avoid code duplication
2010-07-17 13:30:43 +00:00
Ali El Gariani
e229df747d tiny optimization of a loop 2010-07-17 13:30:32 +00:00
Guillaume Melquiond
ff1a0fa52b Avoided costly roundtrip through strings. 2010-07-17 13:17:38 +00:00
Ali El Gariani
6d8dbee178 New debug command ":layers" displaying layer info...
...from the hex under the mouse.  Commit to start to study terrain
layers, but code and UI details are dirty WiP
2010-07-16 21:37:15 +00:00
Ali El Gariani
87eef392dd Quick fix for broken map rebuild (which is very needed in editor) 2010-07-16 15:17:35 +00:00
Ali El Gariani
36586b3da3 Add a "probability" key into terrain [variant] (can be combined with ToD)
This provides an alternative way to have random terrain images.

Main advantages: much lighter (all in the same terrain rule) and allow
to use human-friendly probabilty distribution (sum = 100%)

Already working but its WML interface will be improved to support
heavy use.
2010-07-15 21:48:28 +00:00
Ali El Gariani
dce408bf6a In terrain [variant] allow to use a list of ToD instead of just one,
because the probable usage is to have the same image for several ToD.
syntax: tod=morning,afternoon
2010-07-15 21:48:23 +00:00
Ali El Gariani
e3219719d0 Simpler structure for ToD variants.
Faster for standard cases and will be more flexible for special variants
2010-07-15 21:48:20 +00:00
Ali El Gariani
9c4375d8fd Clean and optimize code sorting terrain layer. 2010-07-14 22:00:56 +00:00
Ali El Gariani
5de23820b7 Fix an off-by-1 error with terrain's layer...
...which sometimes could incorrectly put images in background instead
of foreground.

I didn't see any visible change but possibly fixes or introduces bug with
terrain rules using layer around 0.
2010-07-14 22:00:51 +00:00
Ali El Gariani
a2056397b4 Simplify some redundancy in background/foreground terrain cases 2010-07-11 04:28:21 +00:00
Ali El Gariani
750cc05961 change bad type name 2010-07-11 04:28:17 +00:00