fixed bug #14019https://bugs.scummvm.org/ticket/14019
allocate single buffers to detect buffer overflows easier
removed radius modification
don't clamp vertices
use vtop and vbottom and converted them to int16
Apparently, this was already done once in b6b8701, but then broken soon after by a merge 22e3a83 (years ago).
From upstream 50800e0e2aca0b7678af4a24bd6322d82261760f
This was a silly thing to have, and actually it was not
implemented correctly, as a cam or viewport with 0th index is not
necessarily the "primary" one (set as Game.Camera and
Screen.Viewport). The logic was rather weak there anyway.
From upstream eb90cfa46251d595f8b8f8c5f29ea720d2833038
Previously Overlay.SetText was passing into CreateTextOverlay() -> Overlay_CreateTextCore() -> _display_main().
This effectively removed and recreated an overlay with different image but the same ID.
Also, previously, this method could have been only called for custom overlays in practice.
For these the script object was not touched, and kept the correct overlay reference.
The situation has changed when we let user script to access some of the internally created
overlays, such as Text and Portrait overlays created by a blocking Say command.
When these overlays are recreated, they also must be completely destroyed, invalidating any
existing script references. Hence calling _display_main() from Overlay.SetText() is no longer
acceptable, as it leads to a full overlay recreation, and possible duplication of a script
reference with two (or more) separate managed handles (this is almost like, two shared
pointers owning same object).
To fix this problem, here we replace a call to CreateTextOverlay() with manual recreation of a
textual image, and assigning a new image to the same overlay.
This does not change anything from the script's POV, as SetText method already suggests
that the overlay reference remains valid (previously only the internal object was secretly
replaced).
From upstream aaf6144e5123d36e4f04fcc6592b02ec18f869e0
This simply makes generation of the textual image a separate function that may be used elsewhere, besides creating a new message overlay.
From upstream a49550d32e9ea210e2d9b6711157251359d3c4c0
Mostly fixing memory leaks (Java references).
No need to preinit semaphore (sem_init is called).
First initialize methods ID before starting anything.
Aborts if a method is not found.
This has slightly different logic that original NHC override library.
Original library attempts to rotate the solution and current state by the
same amount. We do the following:
1. If correct solution didn't change, load as usual
2. If correct solution changed and puzzle was already solved, set both current
and correct solution to the new correct solution
3. If correct solution changed and puzzle was not already solved, reinit the
puzzle