Commit graph

75233 commits

Author SHA1 Message Date
Severin Glöckner
d15e348f16 merging 1.14 po files into master
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}
2019-08-03 05:57:22 +02:00
Charles Dang
6049851251 Small cleanup
We don't really need the return value.
2019-08-02 21:25:23 +11:00
Steve Cotton
0f948f793c Refactoring [movetype] to deprecate the "flies" key, use "flying" instead
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.
2019-08-01 18:58:56 +02:00
Charles Dang
13b1758526
Use an atomic bool flag since Soliton pointed out the last method still had a race condition 2019-08-02 01:23:10 +11:00
Nils Kneuper
923e9aa466 updated Chinese (Traditional) translation 2019-08-01 11:24:27 +02:00
Nils Kneuper
37edb6babc updated Portuguese (Brazil) translation 2019-08-01 11:22:45 +02:00
Charles Dang
21d21b0a26
GUI2/Network Transmission: delegate connection polling to a worker thread 2019-08-01 13:45:53 +11:00
Steve Cotton
86f430c2dd Refactoring movetype and terrain_costs (#2486)
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.
2019-07-31 11:39:39 +02:00
Charles Dang
ef47599d96 Throw when creating a surface with negative dimensions, small cleanup
There isn't a palette attached to that format as far as I can tell.
2019-07-31 19:13:13 +11:00
sigurdfdragon
9c1d69254d Changelog: Update with DM changes 2019-07-29 17:22:01 -04:00
sigurdfdragon
23dd6661b5 DM: Use [leader] tag for side 1 throughout 2019-07-29 17:10:34 -04:00
sigurdfdragon
887dd1c586 DM: Expand use of wmllint validate to silence warnings 2019-07-29 17:10:34 -04:00
sigurdfdragon
31e1a21398 DM S12: Allow respective recruits when the loyalists & mages join Delfador 2019-07-29 17:10:33 -04:00
sigurdfdragon
02a68df071 DM S08: Show carryover report to make it clear the scenario has ended 2019-07-29 17:10:33 -04:00
sigurdfdragon
924287be15 DM S09 & 10: Increase difficulty 2019-07-29 17:10:33 -04:00
Gunter Labes
40a343268a
Check if isutf8 is installed and exit 0 if not
We don't want to exit with failure if the tool is not installed.
Simplified exclusion of certain file extensions.
2019-07-29 20:54:08 +02:00
Praveen Batra
a3a57cbff6 EI S15: Fix typo 2019-07-29 17:41:57 +11:00
Steve Cotton
ea25735501 Remove code from replay_controller that's already handled by the hotkey system
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.
2019-07-28 18:38:18 +02:00
Nils Kneuper
9b998568b0 updated Portuguese (Brazil) translation 2019-07-27 17:27:41 +02:00
Pentarctagon
b8acbfe8d0 Put --add-cap right after docker run. 2019-07-25 19:18:47 -05:00
Pentarctagon
1165ce0d39 Docker doesn't like --cap-add for some reason. 2019-07-25 18:33:35 -05:00
Pentarctagon
b0200d1380 Attempt to fix gdb error when attempting to disable aslr 2019-07-25 18:27:19 -05:00
Gunter Labes
4607205f53
Remove typedef unused since 567dba1 2019-07-25 19:53:24 +02:00
Pentarctagon
e47fc68ef0 OpenMP isn't supported anymore, so don't set OMP_WAIT_POLICY in cwesnoth.cmd. 2019-07-24 19:53:41 -05:00
Charles Dang
edaeca2ab6 Removed OpenMP code (closes #4130)
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.
2019-07-25 11:39:33 +11:00
Gunter Labes
90c7335228
Properly log advancing to the next scenario
Restores part of commit 2932d30.
2019-07-24 13:35:38 +02:00
Nils Kneuper
f0f1aab935 updated Portuguese (Brazil) translation 2019-07-23 21:12:39 +02:00
gfgtdf
4741b0037b fix unit_type_fix on variations
previously it would not apply the changes to the variations,in particular the genders
2019-07-23 19:31:34 +02:00
gfgtdf
1fafa76962 remove unused argument 2019-07-23 19:31:34 +02:00
Charles Dang
ba025668a6 Deal with warnings about reinterpret_cast sizes on the 64 bit build 2019-07-23 12:30:02 +11:00
Charles Dang
0e173a451d Removed set_pixel_format
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).
2019-07-23 12:30:01 +11:00
Steve Cotton
a4893a8990 Fix units fading in or out affecting other units of the same type 2019-07-23 09:54:33 +11:00
Steve Cotton
358f564301 Add unit tests for movement and vision costs
Includes changing the terrain costs, and aliased terrains.

Can be cleanly cherry-picked to 1.14.
2019-07-22 17:18:20 +02:00
Charles Dang
e62982325a We use noexcept directly on this branch 2019-07-22 23:27:11 +11:00
Charles Dang
8fcbbcee9f Fixed some circuitous logic
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.
2019-07-22 21:19:08 +11:00
Charles Dang
ee35f6ac9a Cleaned up various surface-related backend things
* 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.
2019-07-22 15:39:00 +11:00
Charles Dang
2470984af3 Prepend 'SDL2/' to all SDL includes
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.
2019-07-22 15:35:55 +11:00
josteph
7ebc663723 changelog: Add #3330 as requested in #3514 2019-07-21 00:43:02 +00:00
nemaara
3818582149 TSG: fix storytext typo 2019-07-20 15:57:57 -04:00
loonycyborg
4ed39d7ee7 pot-update and regenerate doc files
as requested in issue #4173
2019-07-18 16:10:13 +03:00
Pentarctagon
95286cb49f Command line --preprocess missing some macros.
Command line --preprocess doesn't process macros in data/core/units.cfg.

Fixes #4152.
2019-07-16 19:15:29 -05:00
Nils Kneuper
ae2d89b132 updated Portuguese (Brazil) translation 2019-07-16 22:23:23 +02:00
loonycyborg
f8a18ac759 Merge pull request #4169 2019-07-16 17:02:14 +03:00
loonycyborg
b72181c0e6 Merge branch 'help_ref_count_master' of https://github.com/stevecotton/wesnoth into stevecotton-help_ref_count_master 2019-07-16 16:47:23 +03:00
loonycyborg
05d109215d Fix -Wdeprecated-copy compiler warnings with gcc 9 2019-07-16 13:11:05 +03:00
Steve Cotton
eabf933c8e Fix Wdeprecated-copy in wfl::variant, and add move operations
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.
2019-07-16 09:53:47 +11:00
Nils Kneuper
1fac6ac1a6 updated Portuguese (Brazil) translation 2019-07-15 23:23:59 +02:00
Nils Kneuper
c0ca4156d7 updated Portuguese (Brazil) translation 2019-07-15 20:54:48 +02:00
Steve Cotton
66f0924c8b SoF S2: Dialogue fixes (no dwarves outside, repeated comment about side entrances)
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.
2019-07-15 20:51:07 +02:00
Steve Cotton
469fcc9c52 Convert help_impl's ref-counting to std::shared_ptr
This is part of #4166, as topic_text wasn't consistent with
the Rule of Three.
2019-07-15 16:51:12 +02:00