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.
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.
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").
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
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.
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.
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
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.
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.
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.
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.