DIRECTOR: Move quirk640x480Desktop() to GF_

This commit is contained in:
Eugene Sandulenko 2023-07-22 13:38:46 +02:00
parent 4b15de35f7
commit 3e0318dcca
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
5 changed files with 41 additions and 27 deletions

View File

@ -1686,6 +1686,7 @@ namespace Director {
#define MACGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
#define MACGAME1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
#define PIPGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformPippin,ADGF_MACRESFORK,v)
#define PIPGAME1f(t,e,f,m,s,v,fl) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformPippin,(fl|ADGF_MACRESFORK),v)
#define WINGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
#define WINGAME1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
#define FMTGAME1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformFMTowns,ADGF_NO_FLAGS,v)
@ -1695,13 +1696,17 @@ namespace Director {
#define WINDEMO1(t,e,f,m,s,v) GENGAME1_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_DEMO,v)
#define WINDEMO1t(t,e,f,m,s,v) GENGAME1t_(t,e,f,m,s,Common::EN_ANY,Common::kPlatformWindows,ADGF_DEMO,v)
#define MACGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
#define MACGAME1f_l(t,e,f,m,s,l,v,fl) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(fl|ADGF_MACRESFORK),v)
#define PIPGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformPippin,ADGF_MACRESFORK,v)
#define WINGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
#define WINGAME1f_l(t,e,f,m,s,l,v,fl) GENGAME1_(t,e,f,m,s,l,Common::kPlatformWindows,fl,v)
#define WINGAME1t_l(t,e,f,m,s,l,v) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformWindows,ADGF_NO_FLAGS,v)
#define WINGAME1tf_l(t,e,f,m,s,l,v,fl) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformWindows,fl,v)
#define MACGAME1t_l(t,e,f,m,s,l,v) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformMacintosh,ADGF_MACRESFORK,v)
#define FMTGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformFMTowns,ADGF_NO_FLAGS,v)
#define SHKGAME1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformShockwave,ADGF_NO_FLAGS,v)
#define MACDEMO1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(ADGF_MACRESFORK|ADGF_DEMO),v)
#define MACDEMO1f_l(t,e,f,m,s,l,v,fl) GENGAME1_(t,e,f,m,s,l,Common::kPlatformMacintosh,(fl|ADGF_MACRESFORK|ADGF_DEMO),v)
#define PIPDEMO1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformPippin,(ADGF_MACRESFORK|ADGF_DEMO),v)
#define WINDEMO1_l(t,e,f,m,s,l,v) GENGAME1_(t,e,f,m,s,l,Common::kPlatformWindows,ADGF_DEMO,v)
#define WINDEMO1t_l(t,e,f,m,s,l,v) GENGAME1t_(t,e,f,m,s,l,Common::kPlatformWindows,ADGF_DEMO,v)
@ -2002,8 +2007,11 @@ static const DirectorGameDescription gameDescriptions[] = {
WINGAME1_l("henachoco04", "", "BENTO.EXE", "3a42f519df56d4cecac5e0915cf90f33", 2330381, Common::JA_JPN, 400),
MACGAME1_l("henachoco05", "", "yaken", "3731a1d809be07929da1f5d691ee3c97", 290398, Common::JA_JPN, 402),
WINGAME1_l("henachoco05", "", "YAKEN.EXE", "1f9b0ef872de7b84063a53b2a1083c60", 2103629, Common::JA_JPN, 400),
// Rodem expects to be able to track the mouse cursor outside the
// window, which is impossible in ScummVM. Giving it a virtual
// desktop allows it to work like it would have on the original OS.
MACGAME1f_l("henachoco05", "", "yaken", "3731a1d809be07929da1f5d691ee3c97", 290398, Common::JA_JPN, 402, GF_DESKTOP|GF_640x480),
WINGAME1f_l("henachoco05", "", "YAKEN.EXE", "1f9b0ef872de7b84063a53b2a1083c60", 2103629, Common::JA_JPN, 400, GF_DESKTOP|GF_640x480),
// German release is D5
MACGAME1("majestic", "", "Majestic", "01be45e7241194dad07938e7059b88e3", 483518, 400),
@ -4409,12 +4417,19 @@ static const DirectorGameDescription gameDescriptions[] = {
WINGAME2("kfk", "", "KFK.EXE", "75a9f8838cd654701afdd50e68cf5736", 2696447,
"KFKTHEME.MID", "ce462c95d4fcb85c6a967893937ed7be", 13033, 404),
// Kids Box opens with a 320x150 splash screen before switching to
// a full screen 640x480 game window. If desktop mode is off, ScummVM
// will pick a game window that fits the splash screen and then try
// to squish the full size game window into it.
// It runs in 640x480; clipping it to this size ensures the main
// game window takes up the full screen, and only the splash is windowed.
// Windows and Mac versions are D5
PIPGAME1("kidsbox", "", "KIDS BOX", "bcd3c718db258701496b3c5bcb827ef2", 484095, 404),
PIPGAME1f("kidsbox", "", "KIDS BOX", "bcd3c718db258701496b3c5bcb827ef2", 484095, 404, GF_DESKTOP|GF_640x480),
// Filename is 'キッズ・ボックス体験版', or 'Kids Box Trial Version'
MACDEMO1_l("kidsbox", "Trial Version", "xn--ncke4ac8bb8onj201w4bzdvqte", "bcd3c718db258701496b3c5bcb827ef2", 484067, Common::JA_JPN, 404),
MACDEMO1f_l("kidsbox", "Trial Version", "xn--ncke4ac8bb8onj201w4bzdvqte", "bcd3c718db258701496b3c5bcb827ef2", 484067, Common::JA_JPN, 404, GF_DESKTOP|GF_640x480),
// Decomposed variant
MACDEMO1_l("kidsbox", "Trial Version", "xn--2bka2dk1cd9dd8swlt060aix7dzd6e", "bcd3c718db258701496b3c5bcb827ef2", 484067, Common::JA_JPN, 404),
MACDEMO1f_l("kidsbox", "Trial Version", "xn--2bka2dk1cd9dd8swlt060aix7dzd6e", "bcd3c718db258701496b3c5bcb827ef2", 484067, Common::JA_JPN, 404, GF_DESKTOP|GF_640x480),
WINGAME1("kidtools", "", "DEMO.EXE", "da65c64d0821c0d689f8a3ead9301a2a", 15606953, 400),
@ -4510,8 +4525,8 @@ static const DirectorGameDescription gameDescriptions[] = {
"MAKERS/MAIN.DIR", "05c3dff851aecbfeb1d3818404f3140c", 3391418, 404),
// Original filename is 'ママ うたおう!'
MACGAME1_l("mamauta1", "", "xn--p6jvhap8h77aa78233b", "8b138db44d4421cc7294a9dc792ccf1b", 308012, Common::JA_JPN, 402),
WINGAME1t_l("mamauta1", "", "MAMAUTA.EXE", "89106ff6f97699c9c6237bc65df3d042", 760057, Common::JA_JPN, 404),
MACGAME1f_l("mamauta1", "", "xn--p6jvhap8h77aa78233b", "8b138db44d4421cc7294a9dc792ccf1b", 308012, Common::JA_JPN, 402, GF_DESKTOP|GF_640x480),
WINGAME1tf_l("mamauta1", "", "MAMAUTA.EXE", "89106ff6f97699c9c6237bc65df3d042", 760057, Common::JA_JPN, 404, GF_DESKTOP|GF_640x480),
MACDEMO1_l("manhole", "Masterpiece Edition Demo", "The Manhole DEMO", "583a2d78dfcc184f2fbabfd3187322c1", 301861, Common::JA_JPN, 400),
MACDEMO1_l("manhole", "Masterpiece Edition Demo", "The Manhole DEMO", "583a2d78dfcc184f2fbabfd3187322c1", 301669, Common::JA_JPN, 400),

View File

@ -217,6 +217,14 @@ Common::Error DirectorEngine::run() {
_wmMode |= Graphics::kWMMode32bpp;
#endif
if (getGameFlags() & GF_DESKTOP)
_wmMode &= ~Graphics::kWMModeNoDesktop;
if (getGameFlags() & GF_640x480) {
_wmWidth = 640;
_wmHeight = 480;
}
_wm = new Graphics::MacWindowManager(_wmMode, &_director3QuickDrawPatterns, getLanguage());
_wm->setEngine(this);

View File

@ -92,6 +92,12 @@ enum {
kDebugXObj = 1 << 21,
};
enum {
GF_DESKTOP = 1 << 0,
GF_640x480 = 1 << 1,
GF_32BPP = 1 << 2,
};
struct MovieReference {
Common::String movie;
Common::String frameS;
@ -157,6 +163,7 @@ public:
void setVersion(uint16 version);
Common::Platform getPlatform() const;
Common::Language getLanguage() const;
uint32 getGameFlags() const;
Common::String getTargetName() { return _targetName; }
const char *getExtra();
Common::String getRawEXEName() const;

View File

@ -87,12 +87,6 @@ static void quirkLimit15FPS() {
g_director->_fpsLimit = 15;
}
static void quirk640x480Desktop() {
g_director->_wmMode &= ~Graphics::kWMModeNoDesktop;
g_director->_wmWidth = 640;
g_director->_wmHeight = 480;
}
static void quirkHollywoodHigh() {
// Hollywood High demo has a killswitch that stops playback
// if the year is after 1996.
@ -177,22 +171,8 @@ struct Quirk {
{ "wrath", Common::kPlatformMacintosh, &quirkLimit15FPS },
{ "wrath", Common::kPlatformWindows, &quirkLimit15FPS },
// Rodem expects to be able to track the mouse cursor outside the
// window, which is impossible in ScummVM. Giving it a virtual
// desktop allows it to work like it would have on the original OS.
{ "henachoco05", Common::kPlatformMacintosh, &quirk640x480Desktop },
{ "henachoco05", Common::kPlatformWindows, &quirk640x480Desktop },
// Kids Box opens with a 320x150 splash screen before switching to
// a full screen 640x480 game window. If desktop mode is off, ScummVM
// will pick a game window that fits the splash screen and then try
// to squish the full size game window into it.
// It runs in 640x480; clipping it to this size ensures the main
// game window takes up the full screen, and only the splash is windowed.
{ "kidsbox", Common::kPlatformMacintosh, &quirk640x480Desktop },
{ "hollywoodhigh", Common::kPlatformWindows, &quirkHollywoodHigh },
{ "lzone", Common::kPlatformWindows, &quirkLzone },
{ "mamauta1", Common::kPlatformMacintosh, &quirk640x480Desktop },
{ "mamauta1", Common::kPlatformWindows, &quirk640x480Desktop },
{ "mcluhan", Common::kPlatformWindows, &quirkMcLuhanWin },
{ "mcluhan", Common::kPlatformMacintosh, &quirkMcLuhanMac },
// Star Trek titles install fonts into the system

View File

@ -43,6 +43,10 @@ Common::Platform DirectorEngine::getPlatform() const {
return _gameDescription->desc.platform;
}
uint32 DirectorEngine::getGameFlags() const {
return _gameDescription->desc.flags;
}
uint16 DirectorEngine::getDescriptionVersion() const {
return _gameDescription->version;
}