* Relabeled the "Notes" column to "Translations" since that's what it
really is.
* Replaced the Download label with an icon and moved it to the add-on
names column.
* Restyled add-on version/author a bit.
* Add-on type is now more or less aligned to the middle of the icon
(regardless of what the cell height actually is -- there can be extra
empty space below the type line if the add-on title is too long, for
instance).
This also adds SVG icons to be used in table headers instead of GIF
images for browsers that support SVG in background-image. It makes
things scale better for high DPI screens.
This escapes all strings provided by add-ons server data to guarantee
they can't be used to get extraneous and potentially harmful HTML into
the generated web index.
However, and because I don't have time to look into the dense regex
contained in the relevant code right now, it also removes the hidden
feature of linkifying any URLs found in add-on descriptions. It's a
small price to pay for our safety, really.
the `replay_->at_end()` check was added in 81b6c3ab9957b25261c2ac683b49ec1e30279fb8 and is not needed anymore after 9ca66784794fa6eed0fd74558a2368f42030087e
This also removes the `gamestate().gamedata_.phase() != game_data::PLAY` check which was previously there to fix the case when a [change_controller] was received while waiting for a serversided random seed during a start event. But that's not needed anymore after 11daa5113a since now the client doesn't anymore call maybe_do_init_side whenever he reveives a [change_controller]
Awhile back I added some code to remove any resolutions from the list that exceeded the current DPI.
I seem to have misunderstood some of the functionality.
First, off, GetCurrentDisplayMode doesn't seem to return current resolution. From my tests, it seems
to return a "maximum maximized size" of some sort equal to GetUsableDisplayBounds - 1 (see below):
* Render output size: 800, 600
* Display mode size: 1536, 864
* Window size: 800, 600
* Display Bounds: x: 0, y: 0, w: 1537, h: 865
* Usable display bounds: x: 0, y: 0, w: 1537, h: 865
The actual
window size, which @celticminstrel informs me is what we should be measuring here, is actually returned
by either GetWindowSize or GetRenderOutputSize. According to SDL, the latter should return pixel size
and the former screen coordinates. In my tests, though, the results are the same. This might be different
on macOS or iOS. Either way, I've changed current_resolution(), getx(), and gety() to use the results of
GetWindowSize().
Additionally, it seems I don't need to multiply any display modes by the DPI scale factor if I check the
sizes against the aforementioned "max maximized area" w/h. For that I use GetDisplayBounds however...
though again, I'm not sure that's the best way to do this. It does seem to work correctly to fix the
aforementioned bug, anyway. I'll need to figure out more about the handling of DPI on Windows vs macOS
or iOS. There's an implication that the measurements some of these functions return is different.
@gfgtdf explained in IRC that it's often used to slow Wesnoth down (instead
of speeding it up, as I had assumed).
This should also allow unit tests to compile again.
The FPS cap, originally implemented in 2007, is very poorly done. It
doesn't take frame time variance into account, and is therefore almost
guaranteed to cause missed frames all the time. It doesn't increase timer
granularity on Windows, which causes SDL_Delay() to often take much longer
than intended. And it's hardcoded for 50 FPS, which fits poorly with 60 Hz
displays.
This new implementation fixes all those issues.
My experience is that the game feels much, much smoother with the new
implementation, perfectly competitive with 1.12. In my opinion, performance
is now at an acceptable level for a stable release.
Add a new max_animation_time_ variable that checks whether the time
for the movement animation exceeds the potential time. This will
restrict the time interval to match the offset 0~1:200,0~1:200,etc.
as the unit is moving.
fixes partly #1794
This isn't a perfect solution: It migth be better if the host just sends the name of the addons along with their ids so the clients could just use that.