[wesnoth-commits] [wesnoth/wesnoth] 1cdc4e: IntroWML code cleanup and fix/rename of [image]res...

Steve Cotton noreply at github.com
Wed Nov 4 11:25:04 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 1cdc4ef530835876621f74b681646271fc4646b0
      https://github.com/wesnoth/wesnoth/commit/1cdc4ef530835876621f74b681646271fc4646b0
  Author: Steve Cotton <steve at octalot.co.uk>
  Date:   2020-11-04 (Wed, 04 Nov 2020)

  Changed paths:
    M changelog.md
    M data/schema/core/addons.cfg
    M src/gui/dialogs/story_viewer.cpp
    M src/storyscreen/part.cpp
    M src/storyscreen/part.hpp

  Log Message:
  -----------
  IntroWML code cleanup and fix/rename of [image]resize_with_background=

Prior to this commit, the scaled= attribute was undocumented and had what I
assume was a bug - when enabled the image was scaled up to the width and height
of the background - not to the same ratio as the background, but to the full
size. So if you had a 1000 pixel wide background in an 800 pixel wide window,
then scaled=yes meant each journey-marker was an 800 pixel-wide blob.

However, if anyone was using it with background-size images as overlays then
this commit will break that usage - that use case is still supported by having
multiple [background_layer]s.

Closes #5223, which was a question about whether to fix or simply remove the
scaled attribute. Given that [background_layer]scale= and [image]scaled= have
different meanings (the background_layer one should and does cause it to be
full-window), I've kept the 'd' on the end of 'scaled' too.

Use a loop instead of recursion. This cleanup is prompted by #5041 (drawing
map labels in IntroWML), which will add more items to be drawn in this loop.
The old implementation would not have triggered tail-recursion optimisations,
as the recursion site wasn't the final code in the function.

Correct documentation in the .hpp file about when the delay takes effect (this
isn't a behavior change, just a documentation correction).

Review the schema, and remove attributes that aren't supported by the code.
Many of these attributes are supported for `background_layer` but not `image`.





More information about the Commits mailing list