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.
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.
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.
This is a more reliable way to detect distro with systemd support.
"systemd" binary may not be in PATH while systemctl would have to be.
This helps with part of issue #5692
This commmit fixes some issues related to save_index:
* fixes a bug in save_index_class::remove() method.
The method incorrectly tries to remove an attribute from root config instead of removing 'save' children.
In effect, save files were not being removed from the save_index file.
* removes call to save_index_manager_->remove() in savegame::finish_save_game
This call to remove() is incorrect and has no effect except causing unneeded call to write_save_index().
* introduces a new clean_up_index() method in save_index_class.
The method removes non-existing save files from the index. Clean up is triggered only during the first
synchronisation of the index to disc and only if the index has more save files than found on disk.