Fixes a crash when playing a replay that includes a theme, when that theme doesn't
have all of the buttons that the removed code expected. For example, this replay
from SXRPG 5.2.3 has two replay themes, of which one lacks button-nextmove:
* https://replays.wesnoth.org/1.14/20190701/SXRPG_TempleOfBones_Turn_8_(53897).bz2
All of the button::enable() calls were unnecessary logic, because the hotkey
system will query replay_controller::can_execute_command() and enable or
disable the buttons to match. However, the enable() calls appear to have had
the side-effect of triggering the hotkey system to check the buttons' required
states and redraw.
The code in build_replay_theme() was unreachable, because replay_controller
doesn't attach itself to the completely_redrawn event.
We already concluded a long time ago the introduction of OMP was quite ineffective at speeding up
performance
Most of this code was removed previously. This just gets rid of a few remnants that snuck back in
when we rolled back the master branch.
This is rather redundant. It's only called once when the CVideo subsystem is initialized and
nowhere else, and we already use the ARGB8888 format for all surfaces (which is what my testing
has revealed the SDL framebuffer surface's format is).
By using a surface object here I ran the rick of a logic loop. The ctor would try to refor the surface using
the neutral pixel format while trying to set up the neutral pixel format.
* Removed create_neutral_surface in favor of a surface ctor that takes w/h dimensions.
* Removed make_neutral_surface in favor of a surface::make_neutral function. Most usecases of this were
to make a copy of a surface anyway, so I added a new surface::clone function
* Moved the pixel format validation and conversion to the surface class. Now *all* surfaces should be
guaranteed to be in the 'neutral' format. Any new surface that is created (with clone() or the dimension
ctor will be in that format, and any time a raw SDL_Surface* ptr is assigned, it is also converted. This
applies both to the ctor and assignment operators.
* Removed create_compatible_surface. All surfaces should be compatible in the first place.
* Removed surface::assign was in favor of simple assignment operators. The existing assignment operators
already just called assign().
* Removed surface::null in favor of the implicit SDL_Surface* conversion operator for consistency. We were
already using null and implicit pointer bool conversion, so I decided to go with the latter. I was going
to add an operator bool(), but it was ambiguous in surface-to-surface comparisons.
This was needed to get the build working with vcpkg's version of SDL, where all the SDL files are
in their own SDL folder. However, our cmake config also has a note saying it was a deliberate choice
to move our SDL files *out* of their SDL2 folder due to certain distros (FreeBSD is mentioned) not
putting the files in said folder in the first place.
Fixes the majority of the warnings in issue #4166.
This class already shared copies of value_ between instances,
it seems to be the immutable design pattern so can share from
const to non-const instances safely.
Cherry-picking this to 1.14 needs a trivial conflict to be
resolved, the next line in the .cpp file has changed from
size_t in 1.14 to std::size_t in 1.15.
If all the dwarves are inside when the gate closes, don't say there were some lost outside.
Make the dialogue about the north and south side entrances only trigger once.
Closes issue 2a of #1584
Previously the warning was always given on turn 7. It will still trigger even
if the player has units ready to defend that crossing, because I think it's
better to show the message and let the player think "I'm already ready" than to
have it pop up once some fighting has already happened; and it seems easier to
test this logic than to test logic for not showing the message if the crossing
is currently guarded.
Also add a first_time_only=no to the check_income event, so that it can trigger
on turn 7 if it doesn't trigger on turn 6.