The problem was that the delay formula used integer division (twice), and precision loss
resulted in calculated value to "jump" up and down even from a slight change in input text length.
Fixed this by reimplementing calculation using a floating point division instead.
Used a different literal coefficient, found experimentally, to approximately match the result of the
old formula in certain key text lengths, for backwards compatibility.
From upstream d783f5678d974b8d4cfdde3c7011b0a56dc4c3ac
Because _displayspeech() was calling _display_at(), there happen two consecutive
calls to try_auto_play_speech().
If text contains more "&" characters that might lead to an unexpected scripting
error, or even an overriding voice-over.
Instead made _displayspeech() call display_main() directly, and simplified
display_at() to work strictly as a message box starter.
From upstream 1899fad4c4df0e2ddce7eb04699eb262e3638674
Keep ScreenOverlays in std::vector, but do not erase elements
in the middle and invalidate them instead. Record free indexes
in a helper stack.
When creating a new overlay, first check for the recorded free indexes.
Overlay's type now equals storage index.
This speeds up both creation/deletion of overlays, and their access.
Removed the gap between "fixed" overlay types and custom ones,
to save space. If we ever need more special overlays, these could
be created as custom and their ids saved in a variable (similar to
how background speech works). Previously present special overlay
types are left for backwards compatibility (and to simplify the transition).
From upstream f7d2f162fa55aa1b6f37195d890ebe047a204154
The spriteset's [] operator loads a sprite, but some operations may
omit that and check the preloaded information instead.
This also makes it more certain where the actual sprite's bitmap is necessary.
From upstream df30fc1edd30d4f334addaf7883286e745dea2c3
Also fixed disabled objects and characters updating unnecessarily.
This complements c5e2030 and f41eb86
from upstream 963f0e133189bc9aad1cecb8321a5aa370c8cfd7
This fixes repeated post-state on/off switching, and as a consequence - endless loop
in cause of a "..." sentence, that is run until messagetime reaches -1 on its own,
which did not happen because of repeated post-state.
NOTE: looks like an original bug introduced along with the DisplayPostTimeMs property.
From upstream 37360990b22a79380f2a5b34e686a2d2fbcf7de1
Clifftop's Spritefont plugin returns a off-by one size for font2 that
causes a broken outline for some characters. Fixing the value on
the plugin side breaks line spacing, this adds a workaround to the
autooutliner to avoid the issue.
This fixes vertical or horizontal borders to be drawn under rightmost and bottom
corners, which may have transparent parts.
From upstream a77393abc2353a7d8309b7edf1f0ff582c34778c
Because some things were previously updated during the
render, we also need to explicitly run these whenever we do
not update whole game, but need to keep cursor updated:
* Dialog options;
* blocking Display command
* built-in gui dialogs
From upstream e236f3ee05bb7e1e748fb050c99ba1afa564ec65
Apparently, this is an ancient bug, but it became noticeable
now after some changes to the GUI update logic fixes and
optimizations.
From upstream e069c3f51c08c163df023157e99e14bbcefd317a
Leave it with a new name as `update_polled_stuff()` only in functions
related to the game update.
From upstream 95dc139f51e704da19792e5480e69bbfe7ec27aa
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
* Changed from -1 - based constants to 0 - based constants;
* These were purely internal values, therefore no API would be harmed;
* Removed necessity of converting from internal mouse button code to script and back all the time;
* On a side note, this fixes a bug where WaitMouse etc were returning incorrect values on mouse skip, because we forgot to convert from internal to script code.
From upstream 471098d239b076c494beb2d554572ccb69372667