mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-03 07:30:56 +00:00
SCUMM: slightly changed behavior of 16bit mode detection
(another attempt to fix SCUMM FM-TOWNS for ANDROID)
This commit is contained in:
parent
ae67a9a958
commit
283872018b
@ -50,6 +50,7 @@ void ScummEngine::loadCJKFont() {
|
||||
|
||||
if (_game.version <= 5 && _game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { // FM-TOWNS v3 / v5 Kanji
|
||||
#ifdef DISABLE_TOWNS_DUAL_LAYER_MODE
|
||||
GUIErrorMessage("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build");
|
||||
error("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build");
|
||||
#else
|
||||
// use FM-TOWNS font rom, since game files don't have kanji font resources
|
||||
|
@ -1155,24 +1155,29 @@ Common::Error ScummEngine::init() {
|
||||
#endif
|
||||
) {
|
||||
#ifdef USE_RGB_COLOR
|
||||
_outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
|
||||
Common::List<Graphics::PixelFormat> tryModes = _system->getSupportedFormats();
|
||||
// Try default 555 mode first
|
||||
tryModes.push_front(_outputPixelFormat);
|
||||
_outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
|
||||
|
||||
for (Common::List<Graphics::PixelFormat>::iterator g = tryModes.begin(); g != tryModes.end(); ++g) {
|
||||
if (g->bytesPerPixel != 2 || g->aBits())
|
||||
continue;
|
||||
_outputPixelFormat = *g;
|
||||
if (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine) {
|
||||
initGraphics(screenWidth, screenHeight, screenWidth > 320, &_outputPixelFormat);
|
||||
// Other modes than 555 are only supported for FM-TOWNS games and LOOM PCE.
|
||||
// Especially the HE games require 555.
|
||||
if (*g == _system->getScreenFormat() || (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine))
|
||||
break;
|
||||
if (_outputPixelFormat != _system->getScreenFormat())
|
||||
return Common::kUnsupportedColorMode;
|
||||
} else {
|
||||
Common::List<Graphics::PixelFormat> tryModes = _system->getSupportedFormats();
|
||||
for (Common::List<Graphics::PixelFormat>::iterator g = tryModes.begin(); g != tryModes.end(); ++g) {
|
||||
if (g->bytesPerPixel != 2 || g->aBits())
|
||||
g = tryModes.erase(g);
|
||||
|
||||
if (*g == _outputPixelFormat) {
|
||||
tryModes.clear();
|
||||
tryModes.push_back(_outputPixelFormat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
initGraphics(screenWidth, screenHeight, screenWidth > 320, tryModes);
|
||||
if (_system->getScreenFormat().bytesPerPixel != 2)
|
||||
return Common::kUnsupportedColorMode;
|
||||
}
|
||||
|
||||
if (_outputPixelFormat != _system->getScreenFormat())
|
||||
return Common::kUnsupportedColorMode;
|
||||
#else
|
||||
if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
|
||||
warning("Starting game without the required 16bit color support.\nYou may experience color glitches");
|
||||
@ -1184,7 +1189,7 @@ Common::Error ScummEngine::init() {
|
||||
} else {
|
||||
#ifdef DISABLE_TOWNS_DUAL_LAYER_MODE
|
||||
if (_game.platform == Common::kPlatformFMTowns && _game.version == 5)
|
||||
error("This game requires dual graphics layer support which is disabled in this build");
|
||||
return Common::Error(Common::kUnsupportedColorMode, "This game requires dual graphics layer support which is disabled in this build");
|
||||
#endif
|
||||
initGraphics(screenWidth, screenHeight, (screenWidth > 320));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user