diff options
author | Thanasis Antoniou | 2019-03-09 20:01:29 +0200 |
---|---|---|
committer | Thanasis Antoniou | 2019-03-09 20:01:29 +0200 |
commit | 90688204d2f7da59c67c9b34a793af43e3fb56fa (patch) | |
tree | 2344a84cedb018ff9c666052457ef82929d401c0 /engines/bladerunner/subtitles.h | |
parent | 5102af631d0ee3d22a4fdc079ee78d089f5dcf4a (diff) | |
download | scummvm-rg350-90688204d2f7da59c67c9b34a793af43e3fb56fa.tar.gz scummvm-rg350-90688204d2f7da59c67c9b34a793af43e3fb56fa.tar.bz2 scummvm-rg350-90688204d2f7da59c67c9b34a793af43e3fb56fa.zip |
BLADERUNNER: Subtitles code improvements
Allow for 4 lines of subtitles, but start from using 2 lines by default
Also added debugger command to allow for immediate text testing for subtitles
Diffstat (limited to 'engines/bladerunner/subtitles.h')
-rw-r--r-- | engines/bladerunner/subtitles.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/engines/bladerunner/subtitles.h b/engines/bladerunner/subtitles.h index 208a8f39e2..2947ab5645 100644 --- a/engines/bladerunner/subtitles.h +++ b/engines/bladerunner/subtitles.h @@ -41,14 +41,16 @@ class TextResource; class Font; class Subtitles { + friend class Debugger; // // Subtitles could be in 6 possible languages are EN_ANY, DE_DEU, FR_FRA, IT_ITA, ES_ESP // with corresponding _vm->_languageCode values: "E", "G", "F", "I", "R", "S" - // TODO Maybe support 1 + 6 * 26 entries to support multiple language subtitles? Would that be useful? - // TODO Or just support the current _vm->_languageCode ? [current implementation] - static const int kMaxNumOfSubtitlesLines = 3; - static const int kMaxWidthPerLineToAutoSplitThresholdPx = 610; - static const int kMaxTextResourceEntries = 1 + 25; // Support in-game subs (1) and all possible VQAs (25) with spoken dialogue or translatable text! + + static const int kMaxNumOfSubtitlesLines = 4; // At least one quote in the game requires 4 lines to be displayed correctly + static const int kStartFromSubtitleLineFromTop = 2; // Prefer drawing from this line (the top-most of available subtitle lines index is 0) by default + static const int kSubtitlesBottomYOffsetPx = 12; // In pixels. This is the bottom margin beneath the subtitles space + static const int kMaxWidthPerLineToAutoSplitThresholdPx = 610; // In pixels + static const int kMaxTextResourceEntries = 1 + 25; // Support in-game subs (1) and all possible VQAs (25) with spoken dialogue or translatable text! static const char *SUBTITLES_FILENAME_PREFIXES[kMaxTextResourceEntries]; static const char *SUBTITLES_FONT_FILENAME_EXTERNAL; @@ -59,6 +61,7 @@ class Subtitles { Font *_subsFont; bool _isVisible; + bool _forceShowWhenNoSpeech; Common::String _currentSubtitleTextFull; Common::String _subtitleLineQuote[kMaxNumOfSubtitlesLines]; int _subtitleLineScreenY[kMaxNumOfSubtitlesLines]; @@ -76,11 +79,11 @@ public: ~Subtitles(); void init(); - void setSubtitlesSystemInactive(bool flag); // disable subtitles system (possibly due to missing important resources like SUBTITLES.MIX file) + void setSubtitlesSystemInactive(bool flag); // disable subtitles system (possibly due to missing important resources like SUBTITLES.MIX file) const char *getInGameSubsText(int actorId, int speech_id) ; // get the text for actorId, quoteId (in-game subs) const char *getOuttakeSubsText(const Common::String &outtakesName, int frame); // get the text for this frame if any - void setGameSubsText(Common::String dbgQuote); // for debugging - explicit set subs text + void setGameSubsText(Common::String dbgQuote, bool force); // for debugging - explicit set subs text bool show(); bool hide(); bool isVisible() const; @@ -89,7 +92,6 @@ public: private: void draw(Graphics::Surface &s); - // bool showAt(int x, int y); // TODO maybe future use (?) void calculatePosition(); int getIdxForSubsTreName(const Common::String &treName) const; |