This unordered_map thing was totally unnecessary and this header
is included everywhere. From the logs it looks like the boost
unordered_map is a fairly expensive include.
Instead of:
> In tag slider_definition which begins here, missing key id
Use:
> Missing key 'id=' in tag [slider_definition]
Since otherwise the wording is very awkward with the new format (the
file:line line comes after the error), all other key-related messages
use "'key='" to denote attribute names, and there's a double-blank typo
that was there even before I first touched this code.
Because I overlooked the validator's dependency on the preprocessor
lineno_string() function, we wound up with badly-formatted output like
the following:
> 20140619 03:16:32 error validation:
> gui/default/widget/slider_minimal.cfg:53
> included from gui/default.cfg:30
> included from gui/default/widget/slider_minimal.cfg:100
> included from gui/default.cfg:30: tag [wrong_tag] may not be used in [resolution]
This commit changes the validator's error formatting functions to
produce output more akin to the parser/preprocessor under the new
scheme introduced in version 1.11.10:
> 20140619 03:17:36 error validation: Tag [wrong_tag] may not be used in [resolution]
> at gui/default/widget/slider_minimal.cfg:53
> included from gui/default.cfg:30
> included from gui/default/widget/slider_minimal.cfg:100
> included from gui/default.cfg:30
There are no translatable strings involved in this change, so this
commit may be safely backported to 1.12.
This replaces the page number slider with a "minimal" variant slider and
an adjacent label widget whose text we enter manually.
The label format is "<PAGE>/<COUNT>" and it's untranslatable. Hopefully
this shouldn't cause any localization issues since it's all numbers and
we currently can't use alternative numeral systems anyway.
I'm leaving the page slider's maximum_value_label attribute intact just
in case this needs to be reverted later, since it's going into the 1.12
branch too.
The default variant's text label is both inflexible in content (can't
customize the format for non-edge values) and layout (reserves way more
space than it needs at a time for its text label, often resulting in
huge horizontal gaps between a slider and an adjacent widget). This
makes it unsuitable for use in gui2::tchat_log.
This new minimal variant will be wired into gui2::tchat_log next.
scope_active_.size() = SCOPE_COUNT, so scope_active_[SCOPE_COUNT] is
undefined behaviour.
it seems like in add_hotkey it can happen that
hotkey::get_hotkey_command(item.get_command()).scope return SCOPE_COUNT
for wml hotkeys
It is not called by any other compilation unit, so it's better to
internalize it and avoid being forced to declare SDL surface in
the header if possible etc.
In this commit, the order in which fake units vs real units was
changed without realizing the significance. Comments near to the
fake_units code makes it clear that the fake units are intended
to be drawn after the real units, so that e.g. when the whiteboard
is used, the fake units draw over the real ones.
It seems that we cannot avoid the segfault without adding gcc-4.8
download and install to the test sequence, but this seems to push
us over the time limit consistently. In this commit, go back to
using gcc-4.8 but disable everything but the wesnoth target itself
for the gcc build to save time.
In this commit the unit * in unit_animation is changed to a smart
pointer. This is to prevent the unit_map or some other object
from destroying the unit and creating a dangling pointer
(reported to cause segfaults).
In this commit, we also change the fake_unit class to make sure to
increment the refcounter when the fake_unit is constructed. The
reason is that the fake_unit holder is supposed to own that unit
and let it expire when it goes out of scope. No smart pointer is
supposed to delete it.
This mechanism should possibly be revisited, for example the
fake units could also be held in a reference counted pointer.
With the current system it is still possible that the fake_unit
will go out of scope and be destoryed while the animation is still
alive, this change only prevents smart pointers from destroying it
before it goes out of scope.
I also comment out the reentry_preventer class uses in
unit_animation.cpp, to prevent assertions from happening when I
test for example with the "double debug kill" version of the bug.
The reentry_preventer seems to be unnecessary now.
This addresses bug #18921 and maybe others.
The gcc-4.8 patch requires travis to download and install gcc-4.8
from an ubuntu ppa. This takes a few mintues and the gcc build is
already fairly close to the timelimit, so this change can push
some builds over the edge. Since it doesn't seem to be strictly
necessary right now, I comment out the code for v 4.8 install.
This commit adds a dedicated recall list manager class.
The purpose of this is to
- Simplify the code that interacts with the recall list. Prior to
the commit most such code was based on iteration with explicit
iterators, and called global helper functions implemented in
unit.cpp to wrap the code that finds a unit in a vector. It turns
out that interacting with the recall list was the *only* use of
that code, so we make it a member function of the recall list
manager and take it out of unit.cpp.
Most of the code that touches the recall list was previously
7 or 8 lines with a for loop, now it tends to be 1 or 2 lines,
although further refactor may be possible.
- Improve encapsulation. This makes it possible to track how
other classes are interacting with the recall list, and may
make it easier to debug recall list problems by adding debugging
output to the class.
The scoped_ptr<unit> construct which was used previously in
actions/create.cpp is unnecessary after this commit, and it seems
like it could be related to this error report:
http://wesnoth.org:8080/job/Wesnoth/branch=master,compiler=default,label=Debian7-64/185/consoleText
The most significant change of this commit is that
unit_creator::add_unit now does not make a "temporary" unit
instance from the cfg, and then copy construct it. From source
inspection that step appears to be unnecessary, and it somewhat
obfuscates the meaning of this code in actions/create.cpp