Commit Graph
101 Commits
Author SHA1 Message Date
Walter Agazzi 81757a1121 AGS: Engine: fixed text-based lipsync inconsistent frame delay
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
2024-10-30 18:07:42 +02:00
Walter Agazzi bb0ff49ee4 AGS: Engine: fixed wouttextxy_AutoOutline inconsistent int param types
From upstream d6d10c38e60292d24d343d8220b58fc83e7eabd7
2024-10-30 18:07:42 +02:00
Walter Agazzi fcde33269f AGS: Engine: fixed auto outline for the fonts with abnormal extents
From upstream 307c15797c3c094507a281f39041ca5524313388
2024-10-30 18:07:42 +02:00
Walter Agazzi 7b81ba52d6 AGS: Fix "Engine: fixed speech stuck in "post state" under some conditions" commit
Fix line that was lost for some reason.
From upstream dd209c2ce73d5c07e3672604cf4f442dc7683bde
2024-10-30 18:07:42 +02:00
Walter Agazzi 3e276ee58c AGS: Engine: assert text_window_ds before using
From upstream 5830ae32bf896940effaf357b576950ad161a7fa
2024-10-30 18:07:42 +02:00
Walter Agazzi bb55a804e0 AGS: Engine: picked voice-over token parsing to a function
From upstream ec70451d88d7bf7eae3a3f0b847e5b57e07fa54b
2024-10-30 18:07:42 +02:00
Walter Agazzi 419e2d7372 AGS: Engine: simplify display_at, and only call it for blocking messagebox
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
2024-10-30 18:07:42 +02:00
Walter Agazzi f0d0caa6d1 AGS: Engine: when fast-forwarding, skip blocking Say instantly
From upstream 67e77534a64cb6bb464f72ffdeb41630f8126af4
2024-10-30 18:07:42 +02:00
Walter Agazzi d03da04675 AGS: Common: hide GUIButton's image properties behind the get/set methods
from upstream 56659d75d0bbf31b4679be89e9b9a3bfbc259f97
2024-10-30 18:07:42 +02:00
Walter Agazzi 5b66b860af AGS: Engine: separate functions for getting game's set and real fps
From upstream cacaa9be6f7a0194b89fd2255acc9b8b612622b4
2024-10-30 18:07:42 +02:00
Walter Agazzi f9087ab378 AGS: Engine: optimized ScreenOverlays storage (vector variant)
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
2024-10-30 18:07:42 +02:00
Walter Agazzi d8d4a77724 AGS: Engine: hide "screenover" vector behind interface functions
From upstream 3b049092875293b0960013910586f3adb017c862
2024-10-30 18:07:42 +02:00
Walter Agazzi 90f94f74c0 AGS: Engine: reduced spriteset's [] operator use where possible
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
2024-10-30 18:07:42 +02:00
Walter Agazzi 99cbbaacac AGS: Engine: removed obscure hack from draw_button_background()
From upstream e7d5488e4a7d53aa0dc00c07204a0cdadb858197
2024-10-30 18:07:42 +02:00
Walter Agazzi cfbd6c1637 AGS: Engine: fixed character scale not updating at the fully blocking state
Also fixed disabled objects and characters updating unnecessarily.
This complements c5e2030 and f41eb86

from upstream 963f0e133189bc9aad1cecb8321a5aa370c8cfd7
2024-10-30 18:07:42 +02:00
Paul Gilbert c2a476411c AGS: Move std namespace into common/std/ 2024-07-07 15:28:31 -07:00
Walter Agazzi 092ef64fc6 AGS: Engine: fixed speech stuck in "post state" under some conditions
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
2024-03-28 12:00:55 +01:00
Walter Agazzi 71e453930a AGS: Fix partial outlines for some letters in Kathy Rain
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.
2024-02-11 23:22:14 +01:00
Walter Agazzi 95b0b2fc4d AGS: Engine: when drawing TextWindow clip border pieces, fix over corners
This fixes vertical or horizontal borders to be drawn under rightmost and bottom
corners, which may have transparent parts.
From upstream a77393abc2353a7d8309b7edf1f0ff582c34778c
2024-01-17 03:12:27 +01:00
Walter Agazzi ff0298be68 AGS: Engine: ignore mod and special keys when skipping speech and wait
Partially from upstream 8079c87ca11fa6b60ed2dd2ce345cda6c384c00b
2023-08-13 10:58:26 +02:00
Thierry Crozat 4dcde68f4a AGS: Remove unnecessary include of std/math.h 2023-06-06 08:59:58 +01:00
Walter Agazzi f9de999bbe AGS: Engine: Update cursor and dependent "logic" in special game states
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
2023-04-29 13:11:41 +02:00
Walter Agazzi b554ab3bad AGS: Engine: fixed non-blocking speech disabling interface
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
2023-04-29 13:11:41 +02:00
Walter Agazzi c366ce5eef AGS: Removed update_polled_stuff_if_runtime() from data loading functions
Leave it with a new name as `update_polled_stuff()` only in functions
related to the game update.
From upstream 95dc139f51e704da19792e5480e69bbfe7ec27aa
2023-03-12 20:58:28 +00:00
Walter Agazzi 51e541cfb6 AGS: Remove unneeded La Croix Pan workaround
The help text now behaves like the original game
2023-01-20 14:14:56 +00:00
Walter Agazzi 862759135e AGS: Engine: split out create_textual_image() out of _display_main()
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
2023-01-20 14:14:56 +00:00
Thierry Crozat 3286cf18ec AGS: Engine: in display_main exceed all the keypress buffer
From upstream d2100b01ee4a85219b481dcd7593f0e0d419523e
2022-12-17 22:10:55 +01:00
Thierry Crozat e2497cff42 AGS: include KeyMods flags in the WaitSkipResult
From upstream 65bfbb9bde733457b8ab958bb3cd273f7fadcb25
2022-10-10 00:16:16 +01:00
Thierry Crozat 5987bc5e6e AGS: rewrote eAGSMouseButton enum to sync with the script API
* 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
2022-10-10 00:16:16 +01:00
Thierry Crozat 52bf81b33e AGS: Fix regression with GUI Text Antialiasing option not working 2022-06-06 22:42:36 +01:00
Paul Gilbert 7282304951 AGS: Script API: implemented room overlays
From upstream 65a7cd7e7566d3a1111be10b70dcb51b1853cd88
2022-05-06 20:16:42 -07:00
Paul Gilbert cf091f2d3e AGS: Replaced couple of variables in ScreenOverlay with flags
From upstream 38a4e8c262f0ec796225494fc939b283680caf57
2022-05-06 20:16:41 -07:00
Paul Gilbert ec38c1c61c AGS: Refactor core overlay creation funcs to return ScreenOverlay*
From upstream f89b2e8e59da107fcbb7a75bf7e1aa293a45fb2b
2022-05-05 22:41:10 -07:00
Paul Gilbert b1649597d7 AGS: Replaced Math/std Min/Max with ScummVM macros
Inspired by 6dee5ee6f271c600e30879d892295ea6069e8cc9
2022-05-05 22:41:10 -07:00
Paul Gilbert da1178d905 AGS: Implemented proper HasAlphaChannel for all gui controls
From upstream 83306ee321e127368a41068f32bd4899ae00223e
2022-05-05 22:41:06 -07:00
Paul Gilbert 6ee31a530e AGS: Removed unnecessary ags_domouse() calls
From upstream de28de1dd44d991a479ae0adb5fdb4996fe33656
2022-04-29 22:20:39 -07:00
Paul Gilbert a1a0323d28 AGS: Removed few redundant function args
From upstream 4c80a7fb3afdfd8d7b82f16b7aeac5418565f608
2022-04-24 16:00:03 -07:00
Paul Gilbert 17bac5b1ef AGS: Removed redundant function domouse(int what)
From upstream 3dfda41382bdd10e3b2b78f797fade8b5dcc1efa
2022-04-23 18:15:02 -07:00
Paul Gilbert 5cc7daedfe AGS: Use outline fonts too when getting outlined text width / height
From upstream 1f3960014a313fc7b47dd26274ffd87b96bbbb87
2022-04-22 20:34:19 -07:00
Paul Gilbert 8e310c5d98 AGS: Split GameState::want_speech into two variables for easier handling
From upstream 2f6e7362f742c59020fc6a70fdf67c5a87ff2e69
2022-03-27 19:14:55 -07:00
Paul Gilbert 86f3f8933b AGS: Use real font height for speech & dialog option bitmap sizes
From upstream 22af623cadce89ac27777cf2178649a71fc2a345
2022-03-23 20:50:27 -07:00
Paul Gilbert 3e6c42ab8d AGS: get_font_height() returns compatible height
From upstream 61f726f71b7aee4d7e2ec09d5252061488b9aa81
2022-03-22 22:30:14 -07:00
Paul Gilbert d42b639142 AGS: Always precalculate and save font linespacing (as outlined)
From upstream 8ba3a77e38a6dc8ace6d6393042730d73292a1a7
2022-03-22 22:30:14 -07:00
Paul Gilbert e9c153ad4a AGS: Removed unused function getfontlinegap()
From upstream fa357693ba7e465a3b17b5e3bb785d7d2f9a7325
2022-03-22 22:30:14 -07:00
Paul Gilbert df29806aec AGS: Replaced the remaining wgettextheight() with get_font_height()
From upstream d9c4a0306a6718cb03ccd6e84c1e63d093d9a64a
2022-03-22 22:30:13 -07:00
Paul Gilbert dc3ce9f70a AGS: Renamed few font functions for consistent naming style
From upstream 9c355da410b734edc79212009a5e1be0b502c3b0
2022-03-22 22:30:13 -07:00
Paul Gilbert c25b08448d AGS: Removed AudioChannelsLock as it's no longer needed
From upstream 43f9320f66bb881920e6f812d1c642e793b134b6
2022-03-18 21:29:56 -07:00
Paul Gilbert 6bf83c7f39 AGS: Removed Overlays' arbitrary limit
From upstream 735dcfb14069b38aace4cef9468d44b63349d1bd
2022-03-15 22:28:36 -07:00
Paul Gilbert fd0e16ffc3 AGS: implemented stencil cache per Font for automatic outlining
From upstream e32c4bf46b5f74b904ac491bb6017ceb8f8e2bbf
2022-03-14 21:04:08 -07:00
Paul Gilbert 641ade11fa AGS: Fixed crash in auto outline in case of empty text argument
From upstream e3665a3c073e574d3e4fade869b3c0c3e88508e5
2022-03-14 21:04:08 -07:00