[Scummvm-git-logs] scummvm master -> 915173612afcf654e26a79843a7bd182b48ff5e4
sluicebox
noreply at scummvm.org
Wed Oct 30 01:02:07 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
024999a4c7 SCI: Add detection entry for SQ3 Spanish translation
915173612a SCI: Validate font character offsets
Commit: 024999a4c793d4c7e82c8eae819f345599f13618
https://github.com/scummvm/scummvm/commit/024999a4c793d4c7e82c8eae819f345599f13618
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-10-29T18:00:48-07:00
Commit Message:
SCI: Add detection entry for SQ3 Spanish translation
Trac #15381
Changed paths:
engines/sci/detection_tables.h
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index f26689550b7..4e695adc013 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -5624,19 +5624,6 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO_STD16_PALETTEMODS },
- // Space Quest 3 - Hebrew DOS (from the Space Quest Collection)
- // Executable scanning reports "0.000.685", VERSION file reports "1.018"
- // This translation is still a work in progress
- { "sq3", "", {
- {"resource.map", 0, "55e91aeef1705bce2a9b79172682f36d", 5730},
- {"resource.001", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 490247},
- {"resource.002", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 715777},
- {"resource.003", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 703370},
- {"PATCHES/font.000", 0, "6fab182f1c071d1ed47be27776964baf", 3334},
- AD_LISTEND},
- Common::HE_ISR, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO_STD16_PALETTEMODS },
-
-
// Space Quest 3 - English DOS 6 x 360k Floppy (from misterhands, bug report Trac #10677 and goodoldgeorge, bug report Trac #10636)
// Executable scanning reports "0.000.685", VERSION file reports "1.018"
{"sq3", "", {
@@ -5728,6 +5715,25 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "0d8dfe42683b46f3131823233a91ce6a", 787066},
AD_LISTEND},
Common::EN_ANY, Common::kPlatformMacintosh, ADGF_UNSTABLE, GUIO_STD16_MAC_PALETTEMODS },
+
+ // Space Quest 3 - Hebrew DOS (from the Space Quest Collection)
+ // Executable scanning reports "0.000.685", VERSION file reports "1.018"
+ // This translation is still a work in progress
+ { "sq3", "", {
+ {"resource.map", 0, "55e91aeef1705bce2a9b79172682f36d", 5730},
+ {"resource.001", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 490247},
+ {"resource.002", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 715777},
+ {"resource.003", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 703370},
+ {"PATCHES/font.000", 0, "6fab182f1c071d1ed47be27776964baf", 3334},
+ AD_LISTEND},
+ Common::HE_ISR, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO_STD16_PALETTEMODS },
+
+ // Space Quest 3 - Spanish fan translation. VERSION file reports "06/03/2002"
+ { "sq3", "", {
+ {"resource.map", 0, "9ba042c797b62dd46d8979caeed61116", 3726},
+ {"resource.001", 0, "c47b9817cf13f16b803fcbce647e63f3", 1514692},
+ AD_LISTEND},
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO_STD16_PALETTEMODS },
#define GUIO_SQ4_CD GUIO5(GAMEOPTION_SQ4_SILVER_CURSORS, \
GAMEOPTION_PREFER_DIGITAL_SFX, \
Commit: 915173612afcf654e26a79843a7bd182b48ff5e4
https://github.com/scummvm/scummvm/commit/915173612afcf654e26a79843a7bd182b48ff5e4
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-10-29T18:00:48-07:00
Commit Message:
SCI: Validate font character offsets
Handles buggy fonts in fan translations
Changed paths:
engines/sci/graphics/scifont.cpp
engines/sci/resource/resource_patcher.cpp
diff --git a/engines/sci/graphics/scifont.cpp b/engines/sci/graphics/scifont.cpp
index 75a607797b7..15b405f7e4a 100644
--- a/engines/sci/graphics/scifont.cpp
+++ b/engines/sci/graphics/scifont.cpp
@@ -226,6 +226,21 @@ GfxFontFromResource::GfxFontFromResource(ResourceManager *resMan, GfxScreen *scr
} else {
_chars[i].offset = _resourceData.getUint16LEAt(charOffsetIndex);
}
+
+ // WORKAROUND: validate the character offset. several fan games have
+ // invalid offsets for character 127. SSCI only uses an offset when
+ // drawing, so it is unaffected as long as the character isn't used.
+ // Fixes LSL2/LSL3 Polish, SQ3 Spanish. Bug #10509
+ if (!(_chars[i].offset + 2 <= _resourceData.size())) {
+ warning("%s glyph %d has invalid offset: %d, resource size: %d",
+ _resourceData.name().c_str(), i, _chars[i].offset, _resourceData.size());
+
+ _chars[i].width = 0;
+ _chars[i].height = 0;
+ _chars[i].offset = 0;
+ continue;
+ }
+
_chars[i].width = _resourceData.getUint8At(_chars[i].offset);
_chars[i].height = _resourceData.getUint8At(_chars[i].offset + 1);
}
diff --git a/engines/sci/resource/resource_patcher.cpp b/engines/sci/resource/resource_patcher.cpp
index 213f13af823..973dbf8d112 100644
--- a/engines/sci/resource/resource_patcher.cpp
+++ b/engines/sci/resource/resource_patcher.cpp
@@ -131,24 +131,6 @@ static const byte lsl1RussianSound205[] = {
END
};
-
-#pragma mark -
-#pragma mark Leisure Suit Larry 2 and 3
-
-// LSL2 and LSL3 Polish contain several corrupt fonts. In each of these, the
-// offset for the final font entry (127) points beyond the end of the file.
-// This would have been a problem for Sierra's intepreter except that it
-// only parses characters when they're drawn and these games don't use
-// character 127, which is blank in the Polish fonts that aren't corrupt.
-// We parse and cache all characters up front so this is a problem for us.
-// We fix it here by patching the character count in the header from 128 down
-// to 127 so that the corrupt entries aren't processed. Bug #10509
-static const byte lsl2Lsl3PolishFont[] = {
- SKIP(0x02),
- REPLACE(1, 0x7F),
- END
-};
-
#pragma mark -
#pragma mark Phantasmagoria
@@ -512,10 +494,6 @@ static const byte torinPassageRussianPic61101[] = {
static const GameResourcePatch resourcePatches[] = {
{ GID_LAURABOW2, SCI_MEDIA_CD, Common::UNK_LANG, kResourceTypeView, 828, lauraBow2CdView828, false },
{ GID_LSL1, SCI_MEDIA_ALL, Common::RU_RUS, kResourceTypeSound, 205, lsl1RussianSound205, false },
- { GID_LSL2, SCI_MEDIA_ALL, Common::PL_POL, kResourceTypeFont, 1, lsl2Lsl3PolishFont, false },
- { GID_LSL2, SCI_MEDIA_ALL, Common::PL_POL, kResourceTypeFont, 7, lsl2Lsl3PolishFont, false },
- { GID_LSL3, SCI_MEDIA_ALL, Common::PL_POL, kResourceTypeFont, 1, lsl2Lsl3PolishFont, false },
- { GID_LSL3, SCI_MEDIA_ALL, Common::PL_POL, kResourceTypeFont, 9, lsl2Lsl3PolishFont, false },
{ GID_PHANTASMAGORIA, SCI_MEDIA_ALL, Common::UNK_LANG, kResourceTypeView, 64001, phant1View64001Palette, false },
{ GID_PQ4, SCI_MEDIA_CD, Common::EN_ANY, kResourceTypeView, 10988, pq4EnhancedAudioToggleView, true },
{ GID_QFG1VGA, SCI_MEDIA_ALL, Common::UNK_LANG, kResourceTypePalette, 904, qfg1vgaPalette904, false },
More information about the Scummvm-git-logs
mailing list