51753 Commits

Author SHA1 Message Date
J. Tyne
dc036c62b3 Push accounting for slow in terrain costs from unit to movetype.
This merges three small codepaths, but the real motivation is a
possible future use.
2013-02-22 02:03:42 +00:00
J. Tyne
a93a627656 Use an existing variable instead of constructing an identical one.
(This is just a minor optimization that I happened to notice.)
2013-02-22 01:04:48 +00:00
J. Tyne
6e34ab66eb Consistency in highlighting teleport destinations
Previously, wesnoth.highlight_hex would only highlight through global
tunnels if the unit in question had a teleport ability. Now tunnels
are considered for all units.
2013-02-22 00:54:43 +00:00
J. Tyne
605054ee16 Flag a parameter that is not correct with a @todo.
At the moment, I do not know what the correct parameter should be, but
a hardcode of the first team cannot handle all possibilities.
This is in the implementation of a deprecated Lua function
(wesnoth.highlight_hex), so it might end up removed before being fixed.
2013-02-22 00:33:38 +00:00
J. Tyne
fd24c3c7c4 Documentation corrections/updates. 2013-02-22 00:13:46 +00:00
J. Tyne
fdcb11f5df Pass a struct by const reference instead of by value. 2013-02-22 00:09:20 +00:00
J. Tyne
e8d9dc33a6 Eliminate an unused parameter.
It would take more work to use this parameter, and all current uses
would have this parameter always be *resources::units anyway.
2013-02-21 22:22:05 +00:00
J. Tyne
31f1fb1be3 Eliminate a parameter that is always *resources::teams. 2013-02-21 21:37:00 +00:00
J. Tyne
cefb07f63b Eliminate a parameter that is always *resources::game_map. 2013-02-21 20:55:50 +00:00
J. Tyne
910c2a0bf3 Documentation of how an unused feature is broken.
The feature in question (the AI using speculative unit maps) is
probably better handled a different way, which would allow a layer of
overhead to be removed. I'll leave it up to the AI folks to decide
how to proceed.
2013-02-21 18:42:19 +00:00
J. Tyne
6a235dc133 Use village_value instead of get_village_value()
No need to calculate the same value twice in a row, particularly when
the first calculation is already stored in a variable.
2013-02-21 17:25:32 +00:00
J. Tyne
367ce14be1 Initialization optimization
Delay a potentially expensive initialization until it is known to be
needed.
2013-02-21 15:17:20 +00:00
Elias Pschernig
0b5c23db51 [wmlunits] Fork the process before parsing each addon...
...to allow recovery from out-of-mem.
2013-02-21 14:53:13 +00:00
J. Tyne
96618861e6 New scheme for coloring vision costs in the help:
white for "normal" (that is, same as movement cost), yellow for
"worse" (more than movement cost), and green for "better" (less than
movement cost). This should work out better for players, as it plays
against the default of vision costs equaling movement costs.
2013-02-21 02:49:08 +00:00
J. Tyne
32468a2a1f Improve the condition for when to display vision costs in the help.
Previously, vision costs defined via movetype= were not displayed.
2013-02-21 01:39:42 +00:00
J. Tyne
5115c490ae Have unit_type::vision() return movement()...
...when vision_ is negative by default (as is done in unit::vision()).
This fixes an issue where the help would display all vision costs in
red.
2013-02-21 00:18:26 +00:00
Lari Nieminen
237d87d1e8 Added localization source files for the new bigmaps. 2013-02-20 19:55:01 +00:00
J. Tyne
3280d83721 Allow units and unit types to share movetype data.
(The data gets copy-on-write semantics.)
2013-02-20 16:37:35 +00:00
J. Tyne
69ea2eb711 Changelog entry for 2013-02-20T15:11:40Z!jt_coding@verizon.net 2013-02-20 16:28:02 +00:00
J. Tyne
bd4666decb Make vision costs easier to use.
Previously, a unit's vision costs would fall back to movement costs
only if no vision costs were defined. Now this occurs "by terrain" --
the vision cost for a specific terrain will fall back to the movement
cost for that specific terrain, even if the vision cost for another
terrain had been defined. This makes it easier to define, for example,
being able to see over deep water without changing vision in other
cases.
2013-02-20 15:11:40 +00:00
J. Tyne
bb70a29017 Overhaul of unit_movement_type
This is a general overhaul of the class embodying movement types,
featuring:

* Better data encapsulation

* Less duplication of code between unit.cpp and unit_type.cpp

* Easier to use

* New files for the class (VC and XCode projects still need updating)

* New (shorter) name for the class

Some additional revisions will be coming.

The primary motivation for this was to get a class that embodies
movement costs (part of the data encapsulation).
2013-02-20 02:25:14 +00:00
Nils Kneuper
3d9a8e4213 updated Chinese (Traditional) translation 2013-02-19 19:52:27 +00:00
Ignacio R. Morelle
a3694f9b84 Revert "wmllint: ids in [time_area] are not associated to units...
...most of the time"

Done already in 2012-08-19T22:42:19Z!anonymissimus@arcor.de by anonymissimus.

This reverts commit 2013-02-19T06:44:24Z!shadowm@wesnoth.org.
2013-02-19 06:51:28 +00:00
Ignacio R. Morelle
05b12ecb69 wmllint: ids in [time_area] are not associated to units most of the time
The exception is when the [time_area] action is part of an event and
it contains an id-based SUF inside an SLF, but that should be rare
enough.
2013-02-19 06:44:24 +00:00
Richard Kettering
3425fab4c5 Added in sleepwalker's new, complete set of animations...
...for the Dwarven Fighter line, as well as two associated macros.
2013-02-18 05:01:52 +00:00
J. Tyne
dbf31b04ef Changelog entry for 2013-01-31T20:58:05Z!jt_coding@verizon.net 2013-02-17 23:40:14 +00:00
Jérémy Rosen
8f67ec7fcc fix a couple of anim bugs introduced by patch 33682 2013-02-17 21:04:47 +00:00
Mark de Wever
577fd3d29b Add SDL 2.0 compatibility.
Disable a run-time check required in SDL 1.2 due to a change in glibc.
Later versions of SDL 1.2 already have a fix for this change so no need
to do this for version 2.0.
2013-02-17 18:42:47 +00:00
Mark de Wever
77cb0a1ae9 Add SDL 2.0 compatibility.
Switched to using the SDL clipboard routines instead of our own ones.
The disadvantage is that the SDL clipboard has no proper support for the
various X11 clipboards (yet).
2013-02-17 18:42:44 +00:00
Mark de Wever
576a039f85 Add SDL 2.0 compatibility.
The SDL_PixelFormat in 2.0 misses a few fields so don't use them in the
check in set_pixel_format. (Also added a remark about some not tested
fields in the struct.)
2013-02-17 18:42:42 +00:00
Mark de Wever
d792f6e4ca Add SDL 2.0 compatibility.
Threads can have a name in SDL 2.0, initialise it with an empty
C-string. Once/if we move to SDL 2.0 we can look whether we want to put
useful information in the string.
2013-02-17 18:42:39 +00:00
Mark de Wever
07f2ac93ec Remove the unused function thread::kill().
The underlaying function SDL_KillThread will not be supported by SDL 2.0
so remove the unused function.
2013-02-17 18:42:37 +00:00
Mark de Wever
b34eb860f9 Use boost::noncopyable to avoid copying classes. 2013-02-17 18:42:33 +00:00
Sergey Popov
c81524347f Brainfart fix 2013-02-17 01:15:15 +00:00
Alexander van Gessel
d93bcd8332 Ignore _info.cfg when checking for non-single-file add-ons 2013-02-17 01:28:56 +01:00
Mark de Wever
9674d6b644 Use boost::noncopyable to avoid copying a class. 2013-02-16 20:36:18 +00:00
Jérémy Rosen
e1590a4254 apply patch #3682 by Coffee:
make image a progressive parameter+big WML simplification
2013-02-16 18:13:39 +00:00
Mark de Wever
23a6e1f566 Avoid click dismissing moving a unit.
When click dismissing a dialogue in the past the DOWN event was used.
This lead to a bug. The obvious change was to switch to the UP event,
this lead to another bug; the dialogue was directly dismissed. Since
the game map code uses the UP and DOWN event to select a unit there is
no simple solution.

Upon entry this value stores the mouse button state at entry.  When a
button is DOWN and goes UP that button does _not_ trigger a dismissal
of the dialogue, instead that button's down state is removed from this
variable. Therefore the next UP event does dismiss the dialogue.

(Fixes bug #18970)
2013-02-16 16:11:31 +00:00
Sergey Popov
857f238fbd Don't use pkg-config's --atleast-version arg when checking for pango
It doesn't seem to work with some versions of pkg-config, e.g. the one
found on Ubuntu 10.04
2013-02-16 14:30:22 +00:00
Sergey Popov
61997d771c Added version check for pango to scons 2013-02-16 12:09:50 +00:00
Mark de Wever
2b939cebc7 Remove pango version checks.
Since the required version is increased, the checks are no longer
required.
2013-02-16 09:07:35 +00:00
Mark de Wever
53259cf8c8 Increased the pango cairo dependency to 1.24.4.
Loonycyborg I didn't see a version check in SCons and I didn't add one,
please review.
2013-02-16 09:07:31 +00:00
Simon Forsyth
3c41b7c75a Fix bug preventing regenerating units from retreating with experimental AI
(thanks mattsc)
2013-02-16 03:11:14 +00:00
J. Tyne
9d098188e4 Add missing "Id" lines. 2013-02-15 20:09:41 +00:00
J. Tyne
7aa7b7d05c Add the missing "Id" line. 2013-02-15 20:04:32 +00:00
J. Tyne
219fe1df0b Use a symbolic constant instead of a literal constant. 2013-02-15 19:59:57 +00:00
Mark de Wever
c2619963bc Remove an unused variable.
Issue found by cppcheck.
2013-02-15 18:14:31 +00:00
Mark de Wever
f83641e7ac Remove an unused variable.
Issue found by cppcheck.
2013-02-15 18:14:29 +00:00
Mark de Wever
c97f67c18b Remove an unused assignment.
Issue found by cppcheck.
2013-02-15 18:14:26 +00:00
Mark de Wever
be2403a93b Remove an unused assignment.
Issue found by cppcheck.
2013-02-15 18:14:23 +00:00