This ports translations to master, which had been added before the pot-update on master.
(ref #4173)
command used for merging:
msgmerge --previous ${stable_file} ${master_file}
This makes [movetype] consistent with [unit]. The code in movetype.cpp is used
for handling both of those tags and so already had support for "flying" in the
merge() and write() functions.
This shouldn't be backported to 1.14. For this reason, it also includes
handling the C++ todos to use C++14's std::make_unique.
Simplify the public interface for movement, vision and jamming costs to only
the movetype class and a read-only interface called "terrain_costs". Changes
to terrain_costs now need to be done through the movetype instance, so logic
about how movement, vision and jamming interact with each other can be handled
in movetype. This fixes a possible dangling-pointer issue: the default
copy/move implementation in movetype::terrain_info would have copied raw
pointers, without ensuring that those pointers remained valid.
This feels too complex, but also feels like time to merge it and do any further
cleanup as a separate commit. For example, there's only one place that calls
make_data_unique, and one place that calls make_data_shareable. Merging the
functions should make it clearer.
The terrain_info class is now a private class implementing the terrain_costs
interface, previously it was a public class with raw pointers to other
instances of itself, and a copy constructor which copied the raw-pointers
as-is. One of the raw pointers is still there, but it's only non-null when both
instances involved are owned by one instance of movetype.
=== To cherry-pick back to 1.14 ===
Cherry-pick the tests from 358f564301.
* units.cpp: needs a manual merge. Remove the `set_attr_changed(UA_MOVEMENT_TYPE)`
call from the master version.
* movetype.cpp: take the changes in this commit, in each case the conflict is
the change of std::shared_ptr::unique() to std::shared_ptr::count(), which
has been replaced with make_data_shareable() and make_data_writable().
* movetype.hpp: take the changes in this commit, deleting the old terrain_costs
class and adding functions to movetype.
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.