57380 Commits

Author SHA1 Message Date
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
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
Ignacio R. Morelle
30f1e25369 Suggest checking the data dir path when unable to initialize fonts
Not being able to initialize fonts is usually the direct consequence of
a failure to read data/hardwired/fonts.cfg, possibly because the game
data dir was incorrectly set or detected. Thus, it's the ideal point
during early initialization to provide a hint on stderr for players.

I specifically avoided mentioning anything about "installing" the game
so as to not contribute to the common misconception that the game needs
to be installed to run.
2014-06-13 00:50:04 -04:00
Ignacio R. Morelle
1b483bbf31 Don't call preprocess_file() on an empty path if fonts.cfg can't be found
get_wml_location() returns an empty string on failure, and there is
really no point in calling preprocess_file() on that -- it only results
in a confusing error message.

Replaces this sequence often found when Wesnoth can't resolve the path
to its data directory:

  20140612 23:37:05 error filesystem: Trying to open file with empty name.
  20140612 23:37:05 error config: Could not open file
  could not initialize fonts

... with the following one:

  20140612 23:38:52 error font: could not resolve path to fonts.cfg, file not found
  could not initialize fonts

... which should be a little bit more helpful in pointing users in the
right direction in the aforementioned case.
2014-06-12 23:41:15 -04:00
Chris Beck
80be563f1a refactor tod_manager::get_illuminated_tod to take unit_map as arg
Improve encapsulation, eventually remove all resources::pointers
from this object.
2014-06-12 22:19:37 -04:00
Chris Beck
a5b9489e13 refactor tod_manager::get_illuminated_tod to take map as an arg
Helps to encapsulate, and eliminate unnecessary resources::pointers.
2014-06-12 21:48:26 -04:00
Chris Beck
b135692379 remove some unnecessary includes in header 2014-06-12 20:52:15 -04:00
Chris Beck
2c312a11ef Merge branch 'refactor_reports' 2014-06-12 20:39:42 -04:00
Chris Beck
89c22a8279 add virtual fcns to display, remove refs to game_display in reports
This commit adds virtual functions covering "observers",
"displayed_unit_hex", and "playing_side", in display:: object.
This allows to avoid dynamic casts in the reports.cpp file, and
to eliminate a header. It avoids the possibility of segfault when
using the editor if the reports context isn't set up correctly.
2014-06-12 20:37:18 -04:00
Chris Beck
dd8e0159f9 add tod manager to report::context
This allows to remove all remaining resources:: links from the
reports generator code, and to finish removing several expensive
dependencies from that compilation unit.
2014-06-12 20:09:05 -04:00
Chris Beck
816be79aa2 add reports::context structure, and use it for reports 2014-06-12 19:52:09 -04:00
Chris Beck
2a2a50a178 make whiteboard a shared_pointer in resources
This makes subsequent commit easier, because lua wants to be able
to make reports, and therefore needs a report_context
2014-06-12 19:41:38 -04:00
Chris Beck
f4754496d3 remove unnecessary (duplicated) accessors 2014-06-12 19:33:15 -04:00
Chris Beck
8faa4bf059 refactor reports to take display_context as an argument 2014-06-12 19:29:30 -04:00
Chris Beck
7078dd34e6 purge a useless "report()" function in reports.cpp 2014-06-12 19:25:50 -04:00
Chris Beck
5145c9422c display takes a pointer to whiteboard manager
It uses a shared_ptr, to prevent crashes during play_controller
initialization. But it only holds a weak_ptr, to preserve
previous behavior of skipping whiteboard ops when the ptr is
NULL.

It requires also for us to construct the whiteboard before
constructing the gui, so that we have a valid pointer to pass.

Most likely all of the managers will have to be moved forward,
in this commit we move forward the whiteboard and pathfinding
module, anticipating future commits.
2014-06-12 19:21:00 -04:00
Chris Beck
4406cdfae0 add accessors for selected, moused-over hex to class display 2014-06-12 18:54:42 -04:00
Ignacio R. Morelle
62eb55a5a7 new_release: Workaround race condition in wesnothd SIGHUP handler
If we try to send a message immediately after signaling SIGHUP to
wesnothd, it won't get caught by wesnothd, probably because the control
socket is being reopened just as the message arrives. Thus, we need a 1
second delay after the signal.

This was fixed in production a while ago but I forgot to commit the
change.
2014-06-12 18:17:31 -04:00
Ignacio R. Morelle
912456bf29 send_server_command: Fix issues with screen stuff command not working
At least on baldras' version of screen, the stuff command argument here
absolutely needs to be wrapped in single or double quotes to work.

I actually fixed this months ago but forgot to commit.
2014-06-12 18:15:03 -04:00
Ignacio R. Morelle
1a1ccea4cb update_server: 1.11 is the 1.12 branch 2014-06-12 17:21:34 -04:00
Ignacio R. Morelle
090f8bf0cb update_server: Build from master if the $VERISON is not recognized 2014-06-12 17:21:34 -04:00
Chris Beck
a035ae61c0 fixup travis.yml
The gcc build was strict = false not strict = true
2014-06-12 17:10:40 -04:00