WINTERMUTE: Fix detection for Chinese reversion2
Current "data.dcp" infromation is from reversion1 and not from reversion2 game... surely a C&P mistake
NOTE: This is a 2.5D game that is out of ScummVM scope
Developer's Download page states that there are EN/RU/IT versions:
http://reptilesquest.000webhostapp.com/index.php?page=5
However, rq_demo_beta25_multilang.exe allows to select only EN/RU.
italian.dcp can be extracted from rq_demo_beta25_multilang.exe using any
tool for Inno Setup installer.
Removed unnecessary '\0' byte written after a string. Reasons to remove:
1. Hamlet game does not write 0 after string when running this code:
var SomeFile = new File((Game.SaveDirectory + "\gamelet.save"));
SomeFile.OpenAsText(2);
SomeFile.WriteText(LVL_N);
SomeFile.Close();
2. Original WME does not have this:
https://github.com/retrowork/Wintermute-Engine/blob/master/src/engine_core/wme_base/SXFile.cpp#L303
Assertion was caused by providing "saves/" prefixed string to
WindowsFilesystemNode::getChild() function, that asserts on '/'
characters.
Wintermute game code:
if(!(Game.FileExists((Game.SaveDirectory + "\gamelet.save")))) {
Directory.Create(Game.SaveDirectory);
}
...
Assertion stack:
from C:\WINDOWS\System32\KernelBase.dll
from C:\WINDOWS\System32\msvcrt.dll
(this=0xcfdf710,
n=...) at backends/fs/windows/windows-fs.cpp:158
n=...)
at common/fs.cpp:68
(filename=...)
at engines/wintermute/base/file/base_disk_file.cpp:76
at engines/wintermute/base/file/base_disk_file.cpp:105
this=0x50795e0, filename=...)
at engines/wintermute/base/base_file_manager.cpp:326
(this=0xcea72f0,
script=0xcf657d0, stack=0xcf6a2e0, thisStack=0xcf69ee0,
name=0xcfd8870 "FileExists") at
engines/wintermute/base/base_game.cpp:1523
...
WINTERMUTE: Enhanced BaseUtils::normalizeAngle to run the while if angle is greater than 359.
When normalizing an angle, we expect the number to be between 0 and
359 (since 360 is 0), this changes the util so 360 is transformed to 0.
The case for 359.8 (which this would make it -0.2) is covered by the following
while loop, which will increase it back to 359.8.
This seems to be some fan-made translation patch. File "string3.tab"
seems to be the only thing translated, and it's stored as a plain file,
outside dcp packages. Patch is applied to original by adding this file.
On undetected game user gets message like this:
```
Matched game IDs for the Wintermute engine: actualdest-win,
basisoctavus-win-cz,
agustin-win, bthreshold-win, bickadoodle-win, bookofgron-win-ru,
carolreed4-demo-win, carolreed5-win, carolreed6-win,
carolreed7-demo-win,
carolreed8-win, carolreed9-win, carolreed10-win, carolreed11-win,
carolreed12-win, carolreed13-win, carolreed14-win, chivalry-win,
corrosion-win,
deadcity-win-cz, dfafadventure-win, dirtysplit-win, dreaming-win,
driller-win,
...
```
It's confusing that some carolreed games are mentioned as demos and some
are not.
Fixed this by reordering them.
* WINTERMUTE: Add detection for "The Driller Incident"
"The Driller Incident" is a small freeware game for Wintermute,
avaliable in English and Russian: http://questzone.ru/enzi/files/1645
* WINTERMUTE: Add detection table for "One Helluva Day" demo
"One Helluva Day" is a point-and-click adventure demo in English / Czech
/ Russian.
Free download:
https://store.steampowered.com/app/603680/One_helluva_day/
* WINTERMUTE: Support CHARSET property for TT fonts
"// we don't need this anymore" was a mistake =)
Surely, most Wintermute games are either designed for 1252 language
(DE_DEU, EN_ANY, ES_ESP, FR_FRA, IT_ITA, PT_BRA), or don't use TrueType
fonts (5ma, deadcity, grotter1, grotter2, thekite, tib), or use
CHARSET=1 with UTF strings (dirtysplit, reversion1, reversion2, twc),
which meen this conversion is not needed for those games.
However, there are some games that explicitly states CHARSET=10 (driller
(RU_RUS), oknytt (RU_RUS), onehelluvaday (UNK_LANG when playing as
Russian)) and there are some games with CHARSET=1 with non-1252 in mind
(bookofgron (RU_RUS excepts 1251), carolreed4 (RU_RUS excepts 1251),
kulivocko (CZ_CZE excepts 1250)).
This fixes text in some games: bookofgron, carolreed4, driller, kulivocko,
oknytt, onehelluvaday.
* WINTERMUTE: Break savegame compatibility
sizeof(BaseFontTT) was changed, so let's break savegame compatibility
* COMMON: Add conversion tables for win1253 and win1257
* COMMON: Add string conversion from U32String back to Common::String
convertUtf32ToUtf8 code is based on Wintermute::ConvertUTF32toUTF8
convertFromU32String use convertUtf32ToUtf8 for UTF8 or lookup through
conversion table for single-byte encodings
* WINTERMUTE: Use Common::convert functions for non-UTF charsets
* WINTERMUTE: Fix whitespaces at detection tables
* WINTERMUTE: Add TODO comments
For some reason getFontHeight() is off-by-one comparing to height set in
TITLE_RECT, which made text being bigger then title rect and drawing was
skipped.
This fixes https://bugs.scummvm.org/ticket/6501
* WINTERMUTE: Add detection for unsupported "Basis Octavus" game
This game is not supported by ScummVM, because it's 2.5D. However, there
are already other 2.5D games in detection table and the intent is to add
all known games, and support 2.5D in ResidualVM later.
* WINTERMUTE: Add detection for Alimardan dilogy
"Alimardan's Mischief" and "Alimardan Meets Merlin" are games by Iranian
developer Resana Shokooh Kavir (http://rskgd.com/)
It seems that Persian versions also exist, I'll surely look at it later:
https://www.digikala.com/product/dkp-75901
There were 2 steam releases for alimardan1:
https://steamdb.info/depot/694421/manifests/
There was only one steam release of alimardan2:
https://steamdb.info/depot/694431/manifests/
* WINTERMUTE: Add detection for Oknytt 1.12
Oknytt had 2 steam releases (1.12 and 1.13):
https://steamdb.info/depot/286321/manifests/
I have downloaded 1.12 and added detection.
* WINTERMUTE: Add empty strings between detection table lines
* WINTERMUTE: Add detection for Steam versions of reversion1 for Windows
Source: https://steamdb.info/depot/270572/manifests/
* WINTERMUTE: Add detection for Steam version of reversion1 for Linux
Source: https://steamdb.info/depot/270571/manifests/
* WINTERMUTE: Fix localization loading for Mac and Linux
Mac and Linux builds of reversion1 & reversion2 does not have any
"languages" folders.
So, we need to filter those files according to filenames too.
Once there is such filtering, there is no need for this overspecific
hack for revision1's xlanguage_pt.dcp.
* WINTERMUTE: Add detection for Steam versions of reversion2 for Windows
Source: https://steamdb.info/depot/281061/manifests/
* WINTERMUTE: Language packages priority for Linux & Mac
* WINTERMUTE: Add detection for Steam versions of reversion2 for Linux
Source: https://steamdb.info/depot/281062/manifests/
* WINTERMUTE: Add detection for Steam versions of reversion2 for Mac
Source: https://steamdb.info/depot/281063/manifests/
* WINTERMUTE: Add detection for Steam versions of reversion1 for Mac
Source: https://steamdb.info/depot/270573/manifests/
* WINTERMUTE: Add detection for old Desura versions of reversion2
Source: https://bugs.scummvm.org/ticket/6564
* WINTERMUTE: Add detection for Spanish versions of reversion1&2
As was shown by windlepoons, xlanguage_* contains additional translation
package, while data.dcp contains original translation (which is
Spanish).
So, even without owning those old releases of reversion1&2, I can wrote
detection tables for them by not looking for any "xlanguage_*.dcp" file.
However, we shouldn't use WME_ENTRY1s for Spanish, because advanced
detector say "new best match, removing all previous candidates" once it
hit a WME_ENTRY2s. Instead, let's just look for data.dcp twice to give
user a choice of several WME_ENTRY2s. Lor Linux, it's WME_ENTRY3s.
* WINTERMUTE: Filter language packages ignoring folder name
There are 4 types of multilang games:
1. Each installation contain a data.dcp package (same for all languages)
+ an additional language package. Other localization packages are not
installed. Those games are: "Helga Deep In Trouble", "Dirty Split",
"Looky".
2. Each installation contain a data.dcp package (same for all languages)
+ a folder with all localization packages + a single "selected" language
package copied to main folder. "xlanguage_" prefix is usual for
reversion series. Other games usually use "english.dcp", "spanich.dcp",
"czech.dcp", etc.
Those are: "Five Lethal Demons", "Five Magical Amulets", "Dead City",
"Oknytt", "Reversion: The Escape", "Reversion: The Meeting".
3. All localizations are inside data.dcp all-together. Those are: "One
Hellavu Day", "The White Chamber" and "James Peris: No License Nor
Control".
4. Different data.dcp build for each language. All other known games are
here.
This code covers all known filenames for localization packages and
provide several guessworks for ignoring all irrelevant localization
packages.
* WINTERMUTE: Add localization detection for Five Lethal Demons
* WINTERMUTE: Tweak detection for Dead City (Czech)
"english.dcp" is not required to play Dead City in Czech language, so we
don't need to detect it
* WINTERMUTE: Add detection table for Looky in English
I got English version here:
https://bullshit-softworx.itch.io/looky-adventure
* WINTERMUTE: Add detection for Czech versions of Helga
"english.dcp" happen to be optional
This kind of fixes https://bugs.scummvm.org/ticket/6572 WME: Rosemary -
Sprite flaw on going upwards
Some Rosemary sprites have non-fully transparent background pixels,
sprites of walking up has LOTS of them. Testing Rosemary walking
character in a test WME game demonstrates some glitches with original
WME as well. However, character sprite is downscaled most of time, and
with original WME it isn't that seen when sprite is downscaled.
This pull request provides a workaround for this case instead of
changing downscaling algorithms:
* if game ID is "rosemary"
* if loaded sprite is from "actors" folder
* if bytesPerPixel is 4
* if some pixel's alpha is between 1 and 15
* set this pixel's alpha to 0
This code is used only in debug mode and only to display some script
counters.
States are handled in the very same way in WME Lite, so there is no
reason to log tons of warning here.
Tanya Grotter series has a cheat, that is triggered with
(Keyboard.IsKeyDown("A") && Keyboard.IsControl && Keyboard.IsAlt &&
Game.DebugMode) condition.
vKeyToKeyCode(97) would produce a warning message, fixed this.
It's hard to believe, but this fixes bug "#10432" WME Carol Reed
Mysteries hint system not working.
Carol Reed hint system happen to heavily use line.Split(";") results,
which were wrong by 1 byte (delimeter was appended to result while it
shouldn't be).
I started with decompiling Carol Reed source code, reproducing issue
with a stand-alone test project (which worked with WME and showed [null]
with ScummVM). then minimized it to a minimal testcase:
var line = new String("New Goal;Visit Christina at the Art
Museum;1;0;S;;");
var ar = line.Split(";");
if((ar[0] == "New Goal")) { var g = ar[1]; }
This pull request adds all games listed in
https://bugs.scummvm.org/ticket/10863:
// Carol Reed 10 - Bosch's Damnation
// Carol Reed 11 - Shades Of Black
// Carol Reed 12 - Profound Red
// Carol Reed 13 - The Birdwatcher
// Carol Reed 14 - The Fall Of April
// Rebecca Carlson Mystery 01 - Silent Footsteps
// Corrosion: Cold Winter Waiting (Enhanced Edition)
// Rhiannon: Curse of the four Branches (Premium Edition)
I don't have those games, so I can't check if those sums are correct.
Actual name of "hamlet" is "Hamlet or the last game without MMORPG
features, shaders and product placement". Fixed misprint in word
"MMORPG".
Also added one more Hamlet version from
https://bugs.scummvm.org/ticket/10980.
My version has another checksum, so I can't test it.
Official downloads page for the White Chamber
(http://www.studiotrophis.com/site/downloads) contains 2 links:
1. Download from IndieDB (thewhitechamber1.7SETUP.exe, 376180149 bytes)
(built 2008.06.29, installed game is detectable by ScummVM)
2. Direct Download (thewhitechamber1.7SETUP - Definitive Edition.exe,
376180083 bytes) (built 2008.06.26, installed game is unknown to
ScummVM)
Both version are called "v1.7 - Definitive Edition".
speech.dcp is different: "german/COMPUT050.ogg" was renamed to
"german/COMPUT050.ogg"
data.dcp & language.dcp content is the same for those versions, except
for timestamps (Wed, 25 Jun 2008 21:01:32 GMT vs Sun, 29 Jun 2008
19:36:33 GMT)
Several questions:
1. Is it alright to list those builds as Common::UNK_LANG ? Should we
change this to 9 records for exact langs: Common::EN_ANY,
Common::FR_FRA, Common::IT_ITA, Common::DE_DEU, Common::CZ_CZE,
Common::RU_RUS,
Common::GR_GRE, Common::PT_POR, Common::PL_POL?
2. Should we provide a fix for "german/COMPUT050.ogg" lookup in version
that was built 2008.06.26 or this must be kept as is?