mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
SCUMM: Add setting for correct font spacing in Indy 3 Mac
For all the purists out there (I know there is at least one), the default behavior is to try and emulate the original's slightly broken font spacing. Even though I prefer correct spacing myself.
This commit is contained in:
parent
a67958a71f
commit
11bf8833df
@ -1502,9 +1502,10 @@ void CharsetRendererPCE::setDrawCharIntern(uint16 chr) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CharsetRendererMac::CharsetRendererMac(ScummEngine *vm, const Common::String &fontFile)
|
CharsetRendererMac::CharsetRendererMac(ScummEngine *vm, const Common::String &fontFile, bool correctFontSpacing)
|
||||||
: CharsetRendererCommon(vm) {
|
: CharsetRendererCommon(vm) {
|
||||||
|
|
||||||
|
_correctFontSpacing = correctFontSpacing;
|
||||||
_pad = false;
|
_pad = false;
|
||||||
_glyphSurface = NULL;
|
_glyphSurface = NULL;
|
||||||
|
|
||||||
@ -1773,7 +1774,7 @@ void CharsetRendererMac::printChar(int chr, bool ignoreCharsetMask) {
|
|||||||
// the width of a string (e.g. to center text on screen). It is,
|
// the width of a string (e.g. to center text on screen). It is,
|
||||||
// however, used for things like the Grail Diary.
|
// however, used for things like the Grail Diary.
|
||||||
|
|
||||||
if (_vm->_game.id == GID_INDY3 && !drawToTextBox && (width & 1))
|
if (!_correctFontSpacing && !drawToTextBox && (width & 1))
|
||||||
width++;
|
width++;
|
||||||
|
|
||||||
if (enableShadow) {
|
if (enableShadow) {
|
||||||
|
@ -278,9 +278,11 @@ public:
|
|||||||
class CharsetRendererMac : public CharsetRendererCommon {
|
class CharsetRendererMac : public CharsetRendererCommon {
|
||||||
protected:
|
protected:
|
||||||
Graphics::MacFONTFont _macFonts[2];
|
Graphics::MacFONTFont _macFonts[2];
|
||||||
|
bool _correctFontSpacing;
|
||||||
bool _pad;
|
bool _pad;
|
||||||
int _lastTop;
|
int _lastTop;
|
||||||
|
|
||||||
|
|
||||||
int getDrawWidthIntern(uint16 chr);
|
int getDrawWidthIntern(uint16 chr);
|
||||||
|
|
||||||
void printCharInternal(int chr, int color, bool shadow, int x, int y);
|
void printCharInternal(int chr, int color, bool shadow, int x, int y);
|
||||||
@ -292,7 +294,7 @@ protected:
|
|||||||
Graphics::Surface *_glyphSurface;
|
Graphics::Surface *_glyphSurface;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CharsetRendererMac(ScummEngine *vm, const Common::String &fontFile);
|
CharsetRendererMac(ScummEngine *vm, const Common::String &fontFile, bool correctFontSpacing);
|
||||||
~CharsetRendererMac() override;
|
~CharsetRendererMac() override;
|
||||||
|
|
||||||
void setCurID(int32 id) override;
|
void setCurID(int32 id) override;
|
||||||
|
@ -200,6 +200,13 @@ static const ExtraGuiOption macV3LowQualityMusic = {
|
|||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const ExtraGuiOption macV3CorrectFontSpacing = {
|
||||||
|
_s("Use correct font spacing"),
|
||||||
|
_s("Draw text with correct font spacing. This arguably looks better, but doesn't match the original behavior."),
|
||||||
|
"mac_v3_correct_font_spacing",
|
||||||
|
false
|
||||||
|
};
|
||||||
|
|
||||||
static const ExtraGuiOption smoothScrolling = {
|
static const ExtraGuiOption smoothScrolling = {
|
||||||
_s("Enable smooth scrolling"),
|
_s("Enable smooth scrolling"),
|
||||||
_s("(instead of the normal 8-pixels steps scrolling)"),
|
_s("(instead of the normal 8-pixels steps scrolling)"),
|
||||||
@ -227,13 +234,30 @@ const ExtraGuiOptions ScummMetaEngineDetection::getExtraGuiOptions(const Common:
|
|||||||
if (guiOptions.contains(GUIO_TRIM_FMTOWNS_TO_200_PIXELS))
|
if (guiOptions.contains(GUIO_TRIM_FMTOWNS_TO_200_PIXELS))
|
||||||
options.push_back(fmtownsTrimTo200);
|
options.push_back(fmtownsTrimTo200);
|
||||||
}
|
}
|
||||||
// The Steam Mac version of Loom is more akin to the VGA DOS version,
|
|
||||||
// and that's how ScummVM usually sees it. But that rebranding does not
|
// The Steam Mac versions of Loom and Indy 3 are more akin to the VGA
|
||||||
// happen until later.
|
// DOS versions, and that's how ScummVM usually sees them. But that
|
||||||
|
// rebranding does not happen until later.
|
||||||
|
|
||||||
|
// The low quality music in Loom was probably intended for low-end
|
||||||
|
// Macs. It plays only one channel, instead of three.
|
||||||
|
|
||||||
if (target.empty() || (gameid == "loom" && platform == Common::kPlatformMacintosh && extra != "Steam")) {
|
if (target.empty() || (gameid == "loom" && platform == Common::kPlatformMacintosh && extra != "Steam")) {
|
||||||
options.push_back(macV3LowQualityMusic);
|
options.push_back(macV3LowQualityMusic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The original Macintosh interpreter didn't use the correct spacing
|
||||||
|
// between characters for some of the text, e.g. the Grail Diary. This
|
||||||
|
// appears to have been because of rounding errors, and was apparently
|
||||||
|
// fixed in Loom. Enabling this setting allows ScummVM to draw the
|
||||||
|
// text more correctly, at the cost of not matching the original quite
|
||||||
|
// as well. (At the time of writing, there are still cases, at least in
|
||||||
|
// Loom, where text isn't correctly positioned.)
|
||||||
|
|
||||||
|
if (target.empty() || (gameid == "indy3" && platform == Common::kPlatformMacintosh && extra != "Steam")) {
|
||||||
|
options.push_back(macV3CorrectFontSpacing);
|
||||||
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1661,9 +1661,10 @@ void ScummEngine::setupCharsetRenderer(const Common::String &macFontFile) {
|
|||||||
#endif
|
#endif
|
||||||
if (_game.platform == Common::kPlatformFMTowns)
|
if (_game.platform == Common::kPlatformFMTowns)
|
||||||
_charset = new CharsetRendererTownsV3(this);
|
_charset = new CharsetRendererTownsV3(this);
|
||||||
else if (_game.platform == Common::kPlatformMacintosh && !macFontFile.empty())
|
else if (_game.platform == Common::kPlatformMacintosh && !macFontFile.empty()) {
|
||||||
_charset = new CharsetRendererMac(this, macFontFile);
|
bool correctFontSpacing = _game.id == GID_LOOM || ConfMan.getBool("mac_v3_correct_font_spacing");
|
||||||
else
|
_charset = new CharsetRendererMac(this, macFontFile, correctFontSpacing);
|
||||||
|
} else
|
||||||
_charset = new CharsetRendererV3(this);
|
_charset = new CharsetRendererV3(this);
|
||||||
#ifdef ENABLE_SCUMM_7_8
|
#ifdef ENABLE_SCUMM_7_8
|
||||||
} else if (_game.version == 8) {
|
} else if (_game.version == 8) {
|
||||||
|
Loading…
Reference in New Issue
Block a user