78888 Commits

Author SHA1 Message Date
Celtic Minstrel
96964f0dd1 Log any Lua errors during map generation 2021-05-08 17:15:02 -04:00
Celtic Minstrel
b20e226f30 Unit test to verify that [event]delayed_variable_substitution=no works 2021-05-08 17:15:02 -04:00
Celtic Minstrel
900c576fe8 Fix bug in wesnoth.map.read_location 2021-05-08 17:15:02 -04:00
Steve Cotton
f282eb7948 Render only a viewport area in pango_text and text_shape
The line-by-line workaround for rendering huge areas of text is dropped, as we
now only expect to be rendering screen-sized or smaller parts of the text.

Rendering huge texts (greater than 64kpixels high) now requires the caller of
pango_text::render() to change to calling pango_text::render(SDL_Rect) instead.
This is used by text_shape, fixing the crash when opening the credits screen.

This should reduce memory usage when rendering text. It doesn't seem to reduce
the amount of work done by Pango, but the drawing will be clipped in the Cairo
library.
2021-05-08 23:01:54 +02:00
Gunter Labes
b740153d92
Add missing newline 2021-05-08 16:20:34 +02:00
Nils Kneuper
44525e56a9 updated Czech translation 2021-05-08 13:31:56 +02:00
Pentarctagon
24d546df63 Some more cmake cleanups.
Also moved boost and openssl to using the "import targets" (ie: https://cmake.org/cmake/help/latest/module/FindBoost.html#imported-targets) which are apparently the modern way to use cmake. Many of the other libraries don't support that however, and SDL is only fully(?) supported using this as of cmake 3.19.
2021-05-07 15:53:21 -05:00
Pentarctagon
34a493e6df
Remove unused cmake files. 2021-05-07 11:38:47 -05:00
Pentarctagon
986e2eb998
Fixup spaces > tabs. 2021-05-07 11:25:10 -05:00
Steve Cotton
13bc062975 Remove the old PNG optimisation script
A Python version was added in b3fe980d709add4fb8b3fb88faad946bfe55e477, the
main reason for removing the old one is that it's inconsistent to have two
tools where one does almost (but not quite) the same as the other.

Both versions check that the old and new images look the same. However, if any
tool changed the pixels' values then old script would discard the changes from
the other tools too. The new script checks the image after each tool is run, so
that the optimisations from the other tools can still be kept.

The indexed2rgb.sh script had a call to utils/wesnoth-optipng. It's deleted
instead of updated because both wesnoth-optipng itself (since 17c242a9f) and
the new woptipng both do what indexed2rgb.sh did (they all run ImageMagick with
option "png:color-type=6").
2021-05-07 12:01:59 +02:00
Pentarctagon
edb225da8e Directly check for iOS rather than using an SDL header. 2021-05-07 00:02:02 -05:00
Pentarctagon
b95d72f9c1 Use cmake to create VS project files.
Due to an upstream change in vcpkg that breaks the simple integration previously available with `vcpkg integrate install`, building using that setup method is no longer possible. In order to work correctly, cmake must instead be used to generate the VS project files, since that is able to integrate with vcpkg, since vcpkg also uses cmake to build all the library dependencies.

An additional benefit of this is that it will no longer be necessary to separately update the VS project files since it will read the same source_lists files as cmake (on linux) and scons do.

This also enables running the WML unit tests on Windows with this in order to confirm that a valid wesnoth.exe is in fact being generated as well as fixes building the boost unit tests.

The warning level for both release and debug builds are now at level three, the remaining warnings have been fixed, and therefore strict builds have been enabled - any warning will now cause the build to fail, just like for the linux jobs.

Known issues:
* The boost unit tests don't actually run successfully - they fail on CI at least with an exit code on 201 - however I don't know if this is a real problem or just a problem with running headless on CI.
* The debug build doesn't quite work since the executables are built against the non-debug dlls but cmake copies over the debug dlls into the output directory. For now this can be worked around by copying the release dlls into the debug directory.
* The instructions in INSTALL.md are not very good since I don't use Windows and thus can't write anything more detailed. Ideally someone who uses Windows can add more detailed step by step instructions at some point.

Fixes #5741
2021-05-07 00:02:02 -05:00
Steve Cotton
df41f13e41 Rewrite the WML unit test for sighted events
The old version's [event]name=sighted had a {RETURN} statement in it,
which meant the test stopped on the first sighting. Most of the test
wasn't testing anything.
2021-05-06 01:21:59 +02:00
newfrenchy83
00452c0187
add 'ability_id_active' attribute to filter (#5739)
Add 'ability_id_active' attribute to filter

Until now, only the type of ability could be filtered with activity, and id only for unit who have ability, same if she's inactive.
2021-05-03 14:38:05 -05:00
loonycyborg
ad38010a03
update flatpak manifest because boost download url changed 2021-05-03 20:28:58 +03:00
sigurdfdragon
f67f28d7a9 Fix deprecation message 2021-05-03 11:26:40 -04:00
Steve Cotton
24e2f8f767 Whitespace fixes for no newline at end of file
The new CI script whitespace-checking script changes these, but not on Linux.
2021-05-03 11:52:40 +02:00
Iris Morelle
847233d5ee campaignd: Fix erroneous error message text 2021-05-03 04:35:18 -04:00
Steve Cotton
529d5c1a46 Run woptipng on images with bad iCCP, and associated files
The files that had bad iCC profiles were the following subset. I ran woptipng
on the files that were checked in at the same time too.
* data/core/images/portraits/monsters/woodland_boar.png
* data/core/images/portraits/undead/zombie-boar.png
* data/core/images/terrain/castle/troll/tile.png
* data/core/images/units/human-loyalists/heavyinfantry-attack-8.png
* data/core/images/units/human-outlaws/bandit-idle-1.png
* data/core/images/units/human-outlaws/bandit-idle-2.png
* data/core/images/units/human-outlaws/bandit-idle-3.png
* data/core/images/units/human-outlaws/bandit-idle-4.png
* data/core/images/units/human-outlaws/bandit-idle-5.png
* data/core/images/units/human-outlaws/bandit-idle-6.png
* data/core/images/units/human-outlaws/trapper-bow-attack1.png
* data/core/images/units/human-outlaws/trapper-bow-attack2.png
* data/core/images/units/human-outlaws/trapper-bow-attack3.png
* data/core/images/units/human-outlaws/trapper-bow-attack4.png
* data/core/images/units/human-outlaws/trapper-bow-attack5.png
* data/core/images/units/human-outlaws/trapper-bow-attack6.png
* data/core/images/units/human-outlaws/trapper-bow-attack7.png
* data/core/images/units/human-outlaws/trapper-bow-defend.png
* data/core/images/units/human-outlaws/trapper-bow.png
* data/core/images/units/human-outlaws/trapper.png
2021-05-03 10:33:40 +02:00
newfrenchy83
1cb2393b42 fix anerror 2021-05-02 19:40:48 -05:00
newfrenchy83
ad95696b4a Fix teaching_anim not implmmented in variation_id=sceptre of Httt Princes and Battle Princess
I have forget to pull this in variation scpeter of unit_type
2021-05-02 19:40:48 -05:00
Pentarctagon
9dde4d5f6d
sed doesn't work quite the same on macOS. 2021-05-02 17:09:10 -05:00
Tahsin Jahin Khalid
0547941b13 [world conquest] Restored 2 instances of wml.parsed
1. removed the "cfg = cfg" thing
2. restored 2 instances of wml.parsed()

As for the wml.parsed() in line 74 of effects.lua, I chose to not re-add it as it causes an error.
2021-05-02 17:06:26 -05:00
Tahsin Jahin Khalid
45d7372e69 [world conquest] fix remaining deprecated code usage
1. Fixed an un-added entry in the changelog
2. fixed the last 2 deprecation messages
3. removed instances of `wml.parsed` as it is no longer required.
2021-05-02 17:06:26 -05:00
Pentarctagon
73c4e19ea2
Make whitespace fixing a script. 2021-05-02 16:40:40 -05:00
Nils Kneuper
07a4be462b updated Italian translation 2021-05-01 13:15:11 +02:00
Iris Morelle
667cb7f571 Remove orphaned declarations of removed functions 2021-05-01 02:59:52 -04:00
Pentarctagon
c4b42eadc0
Fix cmake warning. 2021-04-29 20:29:42 -05:00
Gunter Labes
e061cc1415
Remove obsolete code path
This was left in by 7434533 for some reason.
2021-04-29 17:51:13 +02:00
Steve Cotton
5015c666f0 Make command-line option --language never require --all-translations
When the user supplies an exact locale identifier on the command line,
it doesn't make sense to check whether it's an incomplete translation.
2021-04-29 16:50:34 +02:00
Steve Cotton
b2d39d2754 Only render the visible area in canvas.cpp
If a widget is partially hidden or off-screen, this commit makes canvas.cpp
optimise and only draw the visible part.

Many of the asserts in canvas.cpp are removed, as the surface is no longer the
full canvas. The SDL_Render* functions do support the out-of-bounds and
negative values for x and y that are now passed to them, these are tested by
SDL2's testviewport.c.

Scrolling by a single pixel will force canvas::draw to do the full work of
redrawing the canvas. I had considered rendering a few of the off-screen lines
too, however it seems this isn't optimisable because the dirty flag is already
set on each redraw - that can be traced to window.cpp's push_draw_event()
causing canvas::set_is_dirty(true) to be called.

Refactor handling of the x, y, w, h variables with a common rect_bounded_shape
class, so that there are less code paths that might have unnoticed bugs.
2021-04-29 12:35:14 +02:00
Pentarctagon
d7234242d4
Changelog update. 2021-04-28 23:03:27 -05:00
Pentarctagon
bc5878f153 Write displayed fps values to disk. 2021-04-28 22:59:49 -05:00
Pentarctagon
afded0db32
Remove extraneous translation marks from tests. 2021-04-28 13:40:56 -05:00
Gunter Labes
b74f2e1471
Remove obsolete comment 2021-04-28 19:51:40 +02:00
Steve Cotton
8e315683ae Add wesnoth.colors[name].pango_color and use it in the multiplayer turns-over dialog 2021-04-28 10:44:19 +02:00
Steve Cotton
26b3ad42a5 Multiplayer turns over dialog: stop using %d and %s in translatable strings
This should probably be changed into a table of GUI2 widgets, but this commit
is an improvement on what was here before. It removes the broken conjunct list
formatting for 3-way ties. However, it also means that there are 5 lines per
language to translate again.

Fixes #4274.
2021-04-28 09:11:29 +02:00
newfrenchy83
03e87ffb2c remove SDL2_ttf.a to codeblock projectfiles 2021-04-27 17:53:49 -05:00
Pentarctagon
384fe35bab
Remove a reference to travis. 2021-04-27 15:29:30 -05:00
Steve Cotton
bfe1f516ac Keep the Windows CIs on a version of vcpkg that builds Wesnoth
Quick workaround for #5741, the Windows builds weren't finding Pango's header
files when used with vcpkg version 546813ae7b9e2873dd3d38e78b27ac5582feae10
([glib up to gtk] update and make it work with meson).

Hopefully we can revert this workaround soon.
2021-04-27 20:03:57 +02:00
Pentarctagon
a09ffa9fd8
Remove sdl2-ttf dependency from VC16 projectfiles. 2021-04-27 11:31:50 -05:00
Elvish_Hunter
265116e1a0 wmlparser3: fixed a crash when using XML output 2021-04-27 17:54:22 +02:00
Pentarctagon
3858737ac3
Remove sdl2-ttf dependency from vcpkg on CI. 2021-04-27 09:32:31 -05:00
Iris Morelle
c6c4c81e8e Update changelog
[ci skip]
2021-04-27 04:57:59 -04:00
Grzegorz Halat
70d8df7c9e Remove a workaround for pre-SDL2.0.5 bug in SDL_BlitSurface()
display::scroll() method has a workaround for a bug in
SDL_BlitSurface(). This SDL2 functions was not working correctly
with overlapping source and destination surfaces.

The bug has been fixed in SDL2.0.5 by this commit:
aae28e3ec1

This workaround is not required after SDL2 version bump to 2.0.8.
2021-04-27 04:53:27 -04:00
Grzegorz Halat
452ebd01af Remove compile-time SDL2 version checks used to determine SDL_CreateRGBSurfaceWithFormat() availability
These checks are not required after SDL2 version bump to 2.0.8.
2021-04-27 04:53:27 -04:00
Grzegorz Halat
ae58e58a30 Remove workarounds for SDL2.0.6 bug in SDL_FreeSurface()
Workarounds in CVideo class and surface::free_surface() method are not
required after SDL2 version bump to 2.0.8.

The workaround in CVideo class was incorrectly applied for SDL2 >= 2.0.6,
instead exactly for 2.0.6, as in the case of surface::free_surface().

After removing workarounds, the surface::clear_without_free() method
has no callers and can be removed.
2021-04-27 04:53:27 -04:00
Grzegorz Halat
c0db7311bb Bump SDL2 version to 2.0.8 2021-04-27 04:53:27 -04:00
nemaara
9e4c770553 HttT: date fix again 2021-04-26 20:58:45 -04:00
Hejnewar
f027cd4900
Fix #5729 2021-04-26 18:17:47 +02:00