From now on we're reasoning in terms of text speed, just like the interpreter does,
which means: delay == 9 - speed.
This allows us to sync the internal GUI and the ScummVM GUI more easily, and
allows for a better correspondence to the original interpreters.
This replaces every single strcpy call in the engine with
Common::strlcpy.
Some of these might cases seem a bit pointless, but it is
supposed to discourage future use of strcpy. If people don't
see a single occasion of it they might think twice before they
use it...
The recent PR 4204 made me aware of some things I had kind of tried to ignore when I updated these dialogs for CJK font support.
Currently, the language for the pause/restart/quit messages is tied to the GUI/launcher language and the translation manager is used to translate the. E. g., if you start the French version of MM or ZAK and have a launcher language setting of English, you will get the English pause/restart/quit messages. If you set the launcher language to French you will get it the French ones. Also, the encodings from the translation manager aren't compatible with the game string encodings (mostly solved by PR 4204, though).
This commit now gets rid of any translation manager use here. Instead, we tie the translations for these messages to the game language.
I have included all strings for the v1/v2 language variants I found in the detection table.
I am interested in having the exact original messages here. However, I have only inserted them from the English interpreters, since those are all I have. For the other languages, for the time being, I have just used the texts from the translation manager and reencoded those with codepage 850. So, if anyone has access to an original v1/v2 interpreter in French, Italian, German, Spanish, Russian or Swedish, he/she might want to extract and replace the strings here with the correct ones...
Not 100% correct, since LEC used an incomplete, tweaked and variable
internal code page that's just based on CP850, but it should still be
an improvement.
fakeBidiString accepts an argument named ignoreVerb. When it is set, we do
not reverse the current section at this point (only these 2 characters are
swapped, so that they'll be swapped back when reversing everything at once
afterwards).
But the condition above covers also end of string *current == 0 along with
the control characters, so on this case, the function still looked for the
newline character past the string buffer. On some cases, a previous string
that was written on the same buffer (the buffer is reused for every string
in the engine), can have newline exactly at this point, and we applied the
same logic, and swapped the newline with 0, which eventually resulted with
some garbled text from the previous buffer.
Fix by excluding end of buffer for this condition.
For example: 07 FF 07 21 00
The first 07 is the skull, then ff 07 21 appends the verb referenced in
variable 33. If this verb contains control characters, the result is
something like "07 FF 0A 0F 29 ... Some text".
Now, the bidi algorithm *doesn't* skip all the initial control characters
(they are skipped later in the loop), and it only reverses the text, but
the 07 remains in the beginning. The result is 07 FF 0A 0F 29 ... txet emoS
Use a similar technique like was done for INDY4 - Skip the initial 07
character, then append it in the end, and replace the original one with a
space. This gives 32 FF 0A 0F 29 ... txet emoS 07.
In some versions of Sam & Max, such as the French and German releases,
talking to Evelyn Morrison while wearing the bigfoot costume will
attach some lines to Max even though Sam's voice is used there.
The floppy intro uses different actors for Sam and Max themselves. There
is no need to slow down Sam's animation while Max beats up the
scientist, and the timing adjustments had to be re-done. The rest of the
workarounds from the CD version still apply.
- Attach actor talk texts to the appropriate text renderer and get rid of redundant code.
- Cleanup subtitle text handling.
- Fix handling of ^codes.
- Fix more regressions from last commit.
- Correct some x/y positioning.
(inspired by PR 3276 - this here has the desired effect, but actually allows the removal of hacks, workarounds and redundancy code instead of adding more of that sort)
The purpose is to have the same accurate font rendering that we already have in the Smush code also for the ingame texts. The original interpreters draw the text like that, so this is not a weirdo invention of mine.
This is still broken. The main purpose was to get as much code done as necessary to have it at least compile again and correctly run the Smush texts.
The rest still needs quite some work...