* The vector of surfaces is now a class member variable instead of a local
variable. This saves a memory allocation every time the function is called
- which is worth it in this case, as the function is a major performance
bottleneck.
* The surfaces are now being moved instead of copied where possible. Turns
out that freeing a SDL surface is fairly expensive in performance-critical
code.
* Pointers to ToDs are now cached, reducing the number of calls to
get_time_of_day() from 37 to 7.
In a stress-test in Aetheryn's Mod at 50 % zoom, the FPS I was getting on
my PC (Intel Core i5-4430) increased from 16 to 23.
* Detail the `GNUInstallDirs` changes
* Non-Windows builds now use the absolute path for all
data paths. This is less brittle, as relative path
lookup in Unix always depends on the current value of
the PWD environmental variable.
This reverts commit 556331ac3f.
Since the keys aren't working, the implementation shouldn't be in the
Git repository. Otherwise some poor soul will attempt to use them and
face additional work afterwards.
This is meant to be a cleaner replacement to the [size_lock] widget. Both keys are optional,
in which case the layout engine will assume dynamic sizing for that dimension. Dynamic sizing
will also occur if either the fixed with or height evaluates to 0 or less.
This quells warnings from CMake about reserved target names, and reduces confusion about which `test` is intended: the wesnoth executable or the standard shell command.
Partial revert of commit 010edbe1b9.
The commit caused every GUI2 window to be fully invalidated and redrawn 50
times per second, with massive CPU usage cost. No wonder that some players
have been complaining about too high CPU usage while idling in fullscreen
GUI dialogs.
I couldn't find any obvious regressions with this change. It looks like the
underlying issue has disappeared at some point.
In my tests, CPU usage while idling in the addon manager dropped from 17 %
to 2.5 % (across all cores).
I did one of these about a year ago, but in the time since I realize it was honestly really crowded
and had some fundamental problems (for example, the listbox would get a horizontal scrollbar if a game
with a lot of mods was started).
This time around, I've focused on simplicity. The main changes:
* The minimap has been made 10 px larger. This was to accommodate the 5 px borders, so now the actual
map image is 72x72.
* Game name and scenario name have swapped places, and the latter is now larger.
* Game names are no longer colorized based on the number of vacant slots or whether you can observe
the game or not.
* The Turns/Slots label coloring has been toned down and been made larger. It is now either white
(game has started), green (vacant slots available), or yellow (vacant slots available for reloaded game).
* The Turns limit no longer displays "/-" for games with unlimited turns. Now you just get "Turn n".
* Due to 1bfa170856, proper names of all missing content is displayed. I also got rid of those
"Unknown Scenario"/"Unknown Campaign" labels in favor of a simple red-color game type token (S or C),
respectively.
* All game setting icons have been moved to a tooltip attached to an info icon, except those for
Password Required and Observes Allowed.
* The info icon will also change color (and its tooltip display a message) if the player need to download
additional content to join that game.
This reverts commit 02de08338c.
Mainline does *not* contain paths with backslashes. If it did, the game
would be broken on GNU/Linux and macOS (and we'd need to fix it anyway).
Instead, it's more likely that we have code somewhere that generates
paths dynamically using backslashes on Windows, and the correct fix is
to change that code to use forward slashes instead.
Follow up 'ceba081542a4'. It is nice to remove the previously
announced message when announces are being delivered very quickly, but
maybe movement feedback announces should be exempt of that. Before
this rev, Whenever an 'Enemy unit sighted' message was being ordered
coupled with a subsequent 'press $HOTKEY to keep moving', the 'Enemy
unit sighted' message was getting discarded.
src/actions/move.cpp: Movement feedback is important, do not remove
previous messaging when announcing.
src/display.cpp: Do not remove previously announced label when so
requested.
src/display.hpp: Add a `struct` device meant to pass optional
arguments to `void announce(const std::string&, const color_t&, ...)`
instead of primitive typed optional arguments (one, `int`, was being
in use, I would have needed to add a second one, `bool`, but when
trying to do that, the `bool` value would be received by the function
as the `int` argument when not providing an explicit value for the
`int` argument (see `src/actions/move.cpp`). Given C++11, for optional
arguments, does not (to the extent of my understanding) allow
specifying the argument name on the calling place, I was forced into
adding this struct in order to jail all primitive typed optional
arguments.
src/synced_commands.cpp: Adapt to new public API in `class display`.
This reverts commit 1b9c07eb40.
I'm reverting this (at least temporarily) since it seems mainline contains *numerous* paths with
backslashes. This change basically spams console with warnings just from mainline/core content,
in addition to having other negative side effects such as leader image generation failing when
populating a save_index file. Plus, if backslashes really broke things on Linux, I think we'd have
had a multitude of people complaining about half their images not showing up on that platform, which
(AFAIK) has not been the case.
Backslashes only work on Windows. A UMC author may accidentally use them in
their add-on that won't then work properly on GNU/Linux and macOS.
Just disallow them on all platforms to avoid problems.
The intent is to avoid UMC authors accidentally mistyping a file name
and making an addon that doesn't work correctly on GNU/Linux.
Thanks to @Arcanister for suggesting the GetFinalPathNameByHandle function.
Fixes#2068.
As pointed out in the ticket, commit
98648ddf63 changed the implementation of
hex_digest() to use hexadecimal numbers instead of base64, causing new
calculated hashes during [upload] and other authenticated operations to
not match what campaignd already had on record.
This commit fixes that by using utils::md5::base64_digest() as
recommended by celticminstrel (which had already been done for wesnothd
but not campaignd, of course). It also matches the 1.12 version of the
campaignd hashing code this way.
Additionally, new uploads/passphrases since the deployment of that change
will need to be re-set by hand to get their base64 versions into the
server config.