42 Commits

Author SHA1 Message Date
dhruv 6cb386374e PRIVATE: refactor isSfx(). 2026-01-31 20:31:41 +01:00
dhruv 638319e7ea PRIVATE: fix sound priority order.
previously, only one sound could be loaded at a time which made it difficult to check if a sound is a sfx or speech because we had to parse it twice once to check then once to load, this commit adds an array to handle active subtitles for each sound handle and one for video subtitles.
2026-01-31 20:31:41 +01:00
dhruv 149f5a98ca VIDEO: add static isSfxFile helper + getter for SRT entries. 2026-01-31 20:31:41 +01:00
Filippos Karapetis 90f6e3d406 VIDEO: Store the number of split subtitle lines to be rendered
This is needed in cases where we need to displace the subtitle bounding
box, depending on the number of lines to be drawn
2026-01-01 08:06:55 +11:00
Filippos Karapetis af15f6266d VIDEO: Move overlay manipulation code in the base Subtitles class 2026-01-01 08:06:55 +11:00
Filippos Karapetis b930babbd4 VIDEO: Use a pointer for SRT parser in the Subtitles class
Overridden classes may not need it
2026-01-01 08:06:55 +11:00
Filippos Karapetis 8c170537c9 VIDEO: Simplify subtitle code 2026-01-01 08:06:55 +11:00
Filippos Karapetis 6507527c49 VIDEO: Move the subtitle bounding box recalculation code 2026-01-01 08:06:55 +11:00
Le Philousophe 312fe24ecc VIDEO: Free the fonts when destroying the Subtitles and changing fonts 2025-11-14 11:47:16 +02:00
Le Philousophe 7a55588e6e VIDEO: Fix subtitles word wrapping 2025-11-14 11:47:16 +02:00
Le Philousophe 76ff394365 VIDEO: Clip the subtitles drawing rectangle to avoid overdraw
If the drawRect is bigger (read taller in height), in Surface SDL mode,
there is an overflow when copying the data.
2025-11-14 11:47:16 +02:00
Le Philousophe c46252ddb9 VIDEO: Store the Surface inside the Subtitles class
Using a pointer is useless as the surface object is allocated once in the
constructor.
The Surface data is still allocated as needed and is freed in the
destructor.
This fixes a memory leak on the Surface data.
2025-11-14 11:47:16 +02:00
Le Philousophe 3a3ff2c8ed VIDEO: Use integer constants for font styles
This avoids matching with strings when there is no need.
2025-11-14 11:47:16 +02:00
Le Philousophe 0442ca3038 VIDEO: Various fixes and cleanups for Subtitles
- Avoid copying SRT parts, load them in place instead
- Remove getSubtitle function which is useless
- Put back drawSubtitle as a const function
- Repair subtitle dev mode
- Don't compute aggregated subtitle text if it's not needed
2025-11-14 11:47:16 +02:00
Donovan Watteau ed9399f157 VIDEO: Fix warning when building without freetype2 2025-10-03 15:29:53 +02:00
neuromancer 758e9a52bc PRIVATE: better support for parsing tags in subtitles 2025-08-19 09:08:11 +02:00
neuromancer 24b38ae23c VIDEO: parse tags in subtitles and allow multiples fonts 2025-08-18 17:43:49 +02:00
Miro Kropacek 24dcacfe69 JANITORIAL: Add missing references to const function parameters
Applied to all 'const Common::' and 'const Graphics::' instances.
2025-04-13 02:20:09 +03:00
Filippos Karapetis a28cb792cf VIDEO: Use pointers when deleting inside range loops 2025-03-27 13:47:57 +08:00
Filippos Karapetis 7cb70d585f VIDEO: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +08:00
Cameron Cawley 7e0dfe0081 GRAPHICS: Use custom stream callbacks for loading TTF fonts 2024-07-23 15:33:43 +01:00
Le Philousophe 85952c72bf VIDEO: Move API to Path 2023-12-24 13:19:25 +01:00
BLooperZ 5ff6bd08cb VIDEO: Allow drawing subtitles in const methods 2023-08-06 14:46:10 +02:00
Le Philousophe c6e9986e67 VIDEO: Also try to load font from fonts.dat
This what is expected for now anyway
2023-01-26 07:42:48 +01:00
Le Philousophe db1d834729 VIDEO: Handle screen size change in subtitles
This avoids assertions failures when overlay is resized while displaying
subtitles
2022-11-20 17:18:38 +01:00
Le Philousophe fd6c95c35b VIDEO: Cleanup subtitles dev mode 2022-11-20 17:18:38 +01:00
Le Philousophe 30743f4a5e VIDEO: Optimize subtitles rendering
Subtitle text is only rendered while necessary.
Overlay management is done in the class instead of expecting engine to
handle it.
Overlay is not cleared when there is alpha support. This avoids useless
memory operations while the overlay being transparent, game screen is
rendered below it.
2022-11-20 17:18:38 +01:00
Die4Ever 6d7d970e17 VIDEO: subtitles dev mode config 2022-09-29 11:27:47 +02:00
BLooperZ aea6f5348a VIDEO: Support BiDi text in subtitles 2022-09-24 11:41:50 +02:00
Eugene Sandulenko 878b79a149 VIDEO: Fix compilation without freetype2 2022-09-24 00:42:28 +02:00
BLooperZ 3f611f9d51 VIDEO: Adapt subtitles overlay to text size 2022-09-23 11:05:01 +02:00
Eugene Sandulenko a72b97097c VIDEO: With shadow we do not need to render monochrome anymore 2022-09-23 11:05:01 +02:00
Eugene Sandulenko 0a093d5e0a VIDEO: Attempt to fake font outline 2022-09-23 11:05:01 +02:00
Eugene Sandulenko dff6943cbf VIDEO: Render subtitles without antialiasing (less artifacts) 2022-09-23 11:05:01 +02:00
Eugene Sandulenko 57ba69d046 VIDEO: Switched to Unicode 2022-09-23 11:05:01 +02:00
Eugene Sandulenko f255467bd3 VIDEO: Center subtitles on screen 2022-09-23 11:05:01 +02:00
Eugene Sandulenko 2ca793f720 VIDEO: Finished subtitle drawing implementation 2022-09-23 11:05:01 +02:00
Eugene Sandulenko af8c37db9d VIDEO: Initial code for drawing subtitles on overlay 2022-09-23 11:05:01 +02:00
Eugene Sandulenko 9cb80bc9fb VIDEO: Load font for Subtitles 2022-09-23 11:05:01 +02:00
Eugene Sandulenko 8fa9f74d59 VIDEO: Fix crash on subtitles reload 2022-09-23 11:05:01 +02:00
Eugene Sandulenko bb42c9bda4 VIDEO: Started implementation of generic Subtitles class 2022-09-23 11:05:01 +02:00
Eugene Sandulenko d02ff2ea5a VIDEO: Renamed srt_parser.* to subtitles.* 2022-09-23 11:05:01 +02:00