* Enforce encounter with the Cloaked Figure
* Revert "Avoid counting encounters with 'Cloaked Figure'."
This reverts commit ada454b20a652136a2f6f29003a8d1137eead9c9.
That being when the logical viewport is slightly offset on the
underlying render target. SDL doesn't give a way of determining this
offset, but it's straightforward to calculate.
Draws now immediately apply to the render target, in stead of
accumulating on the drawing surface. This means textures can start
to be used for drawing in stead of surfaces, and both systems
should be able to be used interchangably for now.
Some things have been broken, including but probably not limited to:
* background blur
* the occasional direct SDL_FillRect call
* floating labels
* map screenshots
Some things will be broken if textures are used for drawing:
* widget restore images
* other screenshots
* clipping areas
However, this is the first step towards proper high-dpi hardware-
accelerated rendering.
po: in wesnoth-help's `<header>text='The files: .map and .cfg' ...`,
the change is just a spelling correction of "scenaro" to "scenario".
(cherry picked from commit b8a37cb8ca0596a74298e72bdca28a9fdf84f667)
This commit is the followup to a similar one I did regarding window initialization. Instead
of widgets being created on the heap and not being managed by a smart pointer until they're
added to a grid, they are now always managed by a unique_ptr. A shared_ptr would have been
easier, code-wise, since we'd be able to use functions like static_pointer_cast instead of having
to release, then cast, but the unique_ptr better shows that there should only ever be one place
owning a widget: either the grid it's in, or if it's a standalone instance. It does make the interface
a bit more awkward when it comes to non-owning raw pointers, and it is definitely a valid design
wherein those classes could just store a shared_ptr.
To that end, this commit covers a bunch of things:
* builder_widget::build (both overloads) and all its overrides now return unique_ptr<widget>.
* The builder_grid::build() override now returns the same instead of grid* since you can't
use covariant return types with smart pointers.
* The two implementation build helpers in builder_grid have been combined with an optional
replacement map as the second parameter. Uses of the version that took a grid pointer could
be easily converted to pass a reference instead.
* The pane, matrix, and viewport build() functions were removed in favor of making the ctor
public. In case there was a deprecated ctor, that was removed.
* The viewport now keeps a widget shared_ptr instead of a reference that was then deleted
by address-of. This was both better design and necessary to fix a crash.
* grid::swap_child now returns its passed-in wifdget if no replacement takes place. This is to
guard against crashes when recursing into child grids.
* generator_base::build now returns a unique_ptr.
* The listbox, multi_page, and stacked_widget now have their builders passed to `fianlize` instead
of having the generator object created in the constructor. This is because we need to keep a
non-owning pointer in the class, and since the generator returns a unique_ptr, it was easier just
to pass it in as an additional argument. This also means the listbox ctor was cleaned up a bit.