57600 Commits

Author SHA1 Message Date
gfgtdf
a9fd13f569 move rotate_random call playcampaign ->saved_game
this also removes some set_/remove snapshot calls, which are not needed
becasue there is no snapshot after convert_to_start_save.
2014-06-15 17:00:45 +02:00
gfgtdf
500f03d355 remove outcommented code 2014-06-15 17:00:44 +02:00
gfgtdf
5bfce15789 move carryover handling out of playcampaign.cpp
this also makes a small change in the savefile format: [endlevel] ->
[end_level_data] in snapshots.

we still have the "store_carryover" function in playcampaign.cpp which does the visual message.
Note that the real carryover happens after linger mode while that message happens before linger mode this simplifies linger mode saves.
2014-06-15 17:00:43 +02:00
gfgtdf
3574c44eb8 small playcampaign.cpp refactor 2014-06-15 17:00:42 +02:00
gfgtdf
29f84b0d74 move more code playcampaign -> saved_game
also removes some out commented code.
2014-06-15 17:00:41 +02:00
gfgtdf
12dec704cf change saved_game & savefile format
we move code from playcampaign.cpp to saved_game.cpp
we also change the savefile format so that ingame savegames don't
contain [carryover_sides_start] anymore becaus all that was already
merged to both [snapshot] and replay_start.

This commit is likley to break something. If so that will be fixed in
later commits.
2014-06-15 17:00:40 +02:00
mattsc
9645fc466b Coward Micro AI: add optional attack_if_trapped key
If set, the unit attacks the weakest enemy next to which it ends up at
the end of its move.
2014-06-15 07:21:34 -07:00
Chris Beck
38dd3f6fed Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-06-15 09:55:20 -04:00
Chris Beck
2510b779f6 rename animated.i to animated.tpp 2014-06-15 09:54:55 -04:00
Ignacio R. Morelle
369b24103e gui2/tcore_selection: Make the listbox grow vertically
This allows its top to be aligned to the dialog's top so it's not
centered vertically.
2014-06-14 23:35:41 -04:00
Ignacio R. Morelle
e7b14b41e1 Use Title Case for core names since they are used in menu context 2014-06-14 23:33:45 -04:00
Ignacio R. Morelle
8712e60bee gui2/taddon_filter_options: Make SP/MP campaigns checkbox use Sentence case
For consistency with all other non-menu/listbox checkboxes.

pofix rule included and applied.
2014-06-14 23:29:35 -04:00
Chris Beck
0a85eff55b disable a unit test which was broken
This test was broken in this commit
342ff4f718d678bea50419f11ad7d9a6ad1e7d58

We need to rerun the characterization to test to get the new
correct values, or it will fail. I'm disabling in the meantime.
2014-06-14 22:26:50 -04:00
Chris Beck
4cd8eb9f52 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-06-14 22:07:44 -04:00
Chris Beck
926effb41a fixup segfaults in replay viewer
After this commit e4eb0a3ede83ee338994708ebd48257627b47242 the
replay viewer would segfault during prestart events. However, it
turns out that nothing in the replay viewer, or in that commit,
was directly causing the segault. Instead, the display object
was holding dangling pointers for no reason, when it could have.
been simply computing the correct value (very cheaply). We clean
up the code in the display objects to fix the segfault.
2014-06-14 22:05:07 -04:00
Chris Beck
74e1230b9a delete duplicated set_team fcn
game_display and display versions of set_team were identical, in
header and in implementation, so we simply delete the game_display
one, as a strict refactor.
2014-06-14 21:51:45 -04:00
David Mikos
342ff4f718 Fix new get_relative_dir code translation issue 2014-06-15 09:41:10 +09:30
mattsc
c837ee8d42 Update Xcode project 2014-06-14 15:56:58 -07:00
Chris Beck
a60d5b0018 move formula ai features of unit to a unit formula manager
This use of handle-body idiom saves *alot* of includes, since a
huge number of objects include unit indirectly, and make no use
of the ai formula features.
2014-06-14 18:39:57 -04:00
Chris Beck
1796b4d7a0 remove unnecessary resources.hpp include from unit.hpp
It turned out that alot of compilation units were using resources
but not including the header, and only getting circuitously
through the display.hpp header which got it from unit.hpp. This
is an improvement since unit itself doesn't need the header,
and most classes probably don't either.
2014-06-14 17:17:45 -04:00
Chris Beck
85de1c2c55 remove unused portrait function from unit
This function was entirely unused, and deleting it allows us to
remove the "portrait.hpp" include from the unit.hpp header. (!)
2014-06-14 16:38:34 -04:00
aquileia
3ba90bbf64 gitignore: Merge rules from src/ directory 2014-06-14 20:10:32 +02:00
Mark de Wever
15ab52d460 Ignore doc/doxygen/html in older versions of git.
The ** syntax is introduced in a newer version of git.
2014-06-14 18:33:10 +02:00
Mark de Wever
02b761b24e Set the minimum width for a listbox cell.
This fixes bug #22046.
2014-06-14 14:43:45 +02:00
Ignacio R. Morelle
65570f5cb9 campaignd: Replace vector<pair<k,v>> with map<k,v> for the handlers table
std::vector<std::pair<k,v>> has worse look-up performance than
std::map<k,v> in general, not that the difference is too noticeable for
such a small dataset like campaignd's handlers table, that is built in
such a way its items are arranged in descending order of usage
frequency.

It still feels like this is the best thing to do to keep future
maintainers sane.
2014-06-14 01:13:35 -04:00
Chris Beck
81874be9f9 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-06-13 19:51:22 -04:00
Ignacio R. Morelle
8e3cfc8a2b Call set_button_state() from playsingle_controller::init_gui()
Fixes the minimap buttons sans the minimap unit/village drawing pair
being in an indeterminate overlay-less (blank) state for the duration of
the initial 'start' WML event in scenarios, unless they are interacted
with first.

set_button_state() has to be called after play_controller::init_gui()
finishes because that method calls game_display::begin() game first,
which in turn instantiates the theme UI GUI1 buttons. Notice that
set_button_state() is also called when the End Turn button is enabled
(e.g. after 'start' is finished).

The reason I'm not calling this from play_controller::init_gui()
directly is that I am concerned about possible interactions with the
replay_controller, which currently seems to do even sloppier work of the
GUI before the end of the 'start' event. I might move this call there if
that issue is sorted out, since it'll be needed for the
replay_controller anyway.
2014-06-13 19:38:48 -04:00
Chris Beck
678d43a056 remove code made dead in 84556b11
After this commit, the replay_controller constructs
tod_manager_start_ using the same parameters as the play_controller
constructs tod_manager_. So the copy construction after this is
superfluous.

https://github.com/wesnoth/wesnoth/commit/84556b11
2014-06-13 19:00:52 -04:00
Chris Beck
d1a4a52f40 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-06-13 16:31:50 -04:00
Mark de Wever
3f3461edbd Fix some CMake linker problems.
Commit bb1b4071a65159cdff43aa8e445c1370b5d8521c missed linker errors
when the tests were disabled, so fixed them now. Reported by Spoffy and
Ivanovic.
2014-06-13 21:55:18 +02:00
mattsc
306bf0cce8 Update changelog (and eliminate trailing spaces) 2014-06-13 12:38:53 -07:00
mattsc
dac6a2e152 SotBE: minor rebalancing of scenarios 15, 17 and 18
Based on play-testing on nightmare difficulty by Maiklas3000 and Theron.
2014-06-13 12:37:52 -07:00
Chris Beck
36d59f7646 put unit_map debug mode compilation on its own define
This helps with profiling using callgrind.
2014-06-13 15:32:56 -04:00
Chris Beck
d7c2675c58 tokenizer debug code is disabled by default
Change #ifdef DEBUG to #ifdef DEBUG_TOKENIZER, to assist with
profiling using callgrind.
2014-06-13 15:31:16 -04:00
mattsc
4253b6b5fd Update Xcode project 2014-06-13 12:13:26 -07:00
Mark de Wever
7b07dd34d4 Fix a compilation error in the SDL2 tool.
The error was introduced by the removal of sdl::twindow::clear()
in commit 03c0efe95b3f67cc2dad828523d2da0e83badad4.
2014-06-13 21:08:11 +02:00
Mark de Wever
152d50d5a8 Remove the wesconfig.h dependency from config.hpp.
The dependency is not needed and causes a lot of files to be compiled
when Wesnoth's version number changes.
2014-06-13 21:03:51 +02:00
Chris Beck
d2fe8d1e3f optimize parser
According to valgrind, the tokenizer::next_token function is called
several million times during a typical unit test. This commit
changes the parser to allocate the tokenizer as a member variable
of the class (on the stack) rather than on the heap using new,
thus it eliminates millions of calls to new.
2014-06-13 11:57:09 -04:00
Chris Beck
63e3395583 add callgrind output files to .gitignore 2014-06-13 11:32:55 -04:00
Chris Beck
b36c4e60f1 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-06-13 11:32:00 -04:00
Chris Beck
fddd043663 change unnecessary resources:: ptrs to local variable uses
play_controller has a smart pointer to the gui, it doesn't need
to use the resources links
2014-06-13 11:30:52 -04:00
Alexander van Gessel
07a6ba695e Merge pull request #199 from aquileia/ignore
Restructure and merge .gitignore files
2014-06-13 16:27:01 +02:00
Guorui Xi(Kevin)
fa5fce419c Fix mixed tabs and spaces 2014-06-13 21:38:53 +08:00
Ignacio R. Morelle
c9c33660dd gui2/twml_error: Ignore empty _info.cfg [info] title= attribute
This allows the synthetic add-on name to be used in the absence of an
[info] title= attribute, e.g. for add-ons downloaded with older versions
of Wesnoth or wesnoth_addon_manager.
2014-06-13 02:38:41 -04:00
Chris Beck
7df5aab23e remove unnecessary resource:: ptr uses
play_controller contains the whiteboard manager as a local variable,
and therefore doesn't need to use the externally linked resource
pointers.
2014-06-13 02:01:10 -04:00
Chris Beck
95749ec22b remove resources::display_context
This was only added to facilitate refactor, now it is no longer
necessary and can be removed.
2014-06-13 01:43:31 -04:00
Chris Beck
b339cc217a Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-06-13 01:19:10 -04:00
Chris Beck
8531ddeae5 add gamemap argument to tod_manager::add_time_area(config &c)
This is needed to properly parse a list of locations from strings,
to have the dimensions available.

This allows to refactor tod_manager and not use resources:: ptrs
in its implementation, instead using the objects from the relevant
context.
2014-06-13 01:17:55 -04:00
Ignacio R. Morelle
75f1345ff2 Add documentation for warn_early_init_failure()
Because the odds of someone altering the early init sequence in the
future and failing to realize the purpose of this code aren't low
enough. (I really should've included it in the main commit.)
2014-06-13 01:10:55 -04:00
Chris Beck
fe00d72dd2 refactor tod_manager::set_turn, next_turn, accept game_data arg
This improves encapsulation and almost allows to push resources
out of the tod_manager
2014-06-13 00:59:32 -04:00