From 37b98344fb615c90aa7fec3c15d8446ee0774d70 Mon Sep 17 00:00:00 2001 From: William Bettridge-Radford Date: Sun, 6 Aug 2023 15:26:34 +0100 Subject: [PATCH 1/2] add flag to skip splash screens --- inc/utest.h | 1 + src/studio/utest.cpp | 52 +++++++++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/inc/utest.h b/inc/utest.h index d5134885..9f2ec8a5 100644 --- a/inc/utest.h +++ b/inc/utest.h @@ -61,6 +61,7 @@ class KWA : public KWA_PAR #define kszProductsKey PszLit("Software\\Microsoft\\Microsoft Kids\\3D Movie Maker\\Products") #define kszUserDataValue PszLit("UserData") #define kszBetterSpeedValue PszLit("BetterSpeed") +#define kszSkipSplashScreenValue PszLit("SkipSplashScreen") // FGetSetRegKey flags enum diff --git a/src/studio/utest.cpp b/src/studio/utest.cpp index b532bfa3..1e27e860 100644 --- a/src/studio/utest.cpp +++ b/src/studio/utest.cpp @@ -173,6 +173,9 @@ bool APP::_FInit(ulong grfapp, ulong grfgob, long ginDef) ulong tsSplashScreen; FNI fniUserDoc; long fFirstTimeUser; + long fSkipSplashScreen = fFalse; + + FGetSetRegKey(kszSkipSplashScreenValue, &fSkipSplashScreen, size(fSkipSplashScreen), fregSetDefault); // Only allow one copy of 3DMM to run at a time: if (_FAppAlreadyRunning()) @@ -286,11 +289,14 @@ bool APP::_FInit(ulong grfapp, ulong grfgob, long ginDef) goto LFail; } - if (!_FDisplayHomeLogo()) + if (!fSkipSplashScreen) { - _FGenericError(PszLit("_FDisplayHomeLogo")); - _fDontReportInitFailure = fTrue; - goto LFail; + if (!_FDisplayHomeLogo()) + { + _FGenericError(PszLit("_FDisplayHomeLogo")); + _fDontReportInitFailure = fTrue; + goto LFail; + } } tsHomeLogo = TsCurrent(); @@ -315,22 +321,31 @@ bool APP::_FInit(ulong grfapp, ulong grfgob, long ginDef) goto LFail; } - while (TsCurrent() - tsHomeLogo < kdtsHomeLogo) - ; // spin until home logo has been up long enough + if (!fSkipSplashScreen) + { + while (TsCurrent() - tsHomeLogo < kdtsHomeLogo) + ; // spin until home logo has been up long enough + } - if (!_FShowSplashScreen()) + if (!fSkipSplashScreen) { - _FGenericError(PszLit("_FShowSplashScreen")); - _fDontReportInitFailure = fTrue; - goto LFail; + if (!_FShowSplashScreen()) + { + _FGenericError(PszLit("_FShowSplashScreen")); + _fDontReportInitFailure = fTrue; + goto LFail; + } } tsSplashScreen = TsCurrent(); - if (!_FPlaySplashSound()) + if (!fSkipSplashScreen) { - _FGenericError(PszLit("_FPlaySplashSound")); - _fDontReportInitFailure = fTrue; - goto LFail; + if (!_FPlaySplashSound()) + { + _FGenericError(PszLit("_FPlaySplashSound")); + _fDontReportInitFailure = fTrue; + goto LFail; + } } if (!_FGetUserName()) @@ -361,9 +376,12 @@ bool APP::_FInit(ulong grfapp, ulong grfgob, long ginDef) goto LFail; } - while (TsCurrent() - tsSplashScreen < kdtsSplashScreen) - ; // spin until splash screen has been up long enough - Pkwa()->SetMbmp(pvNil); // bring down splash screen + if (!fSkipSplashScreen) + { + while (TsCurrent() - tsSplashScreen < kdtsSplashScreen) + ; // spin until splash screen has been up long enough + Pkwa()->SetMbmp(pvNil); // bring down splash screen + } // If the user specified a doc on the command line, go straight // to the studio. Otherwise, start the building. From 8e221613e30cf46548e5239f1a2d2c7dc3256186 Mon Sep 17 00:00:00 2001 From: William Bettridge-Radford Date: Sat, 12 Aug 2023 16:06:08 +0100 Subject: [PATCH 2/2] fix; load palette if skipping the splash screen --- inc/utest.h | 2 +- src/studio/utest.cpp | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/inc/utest.h b/inc/utest.h index 9f2ec8a5..60175d58 100644 --- a/inc/utest.h +++ b/inc/utest.h @@ -168,7 +168,7 @@ class APP : public APP_PAR bool _FGetUserDirectories(void); bool _FReadUserData(void); bool _FWriteUserData(void); - bool _FDisplayHomeLogo(void); + bool _FDisplayHomeLogo(bool fSkipSplashScreen); bool _FDetermineIfSlowCPU(void); bool _FOpenResourceFile(void); bool _FInitKidworld(void); diff --git a/src/studio/utest.cpp b/src/studio/utest.cpp index 1e27e860..debcb091 100644 --- a/src/studio/utest.cpp +++ b/src/studio/utest.cpp @@ -289,15 +289,14 @@ bool APP::_FInit(ulong grfapp, ulong grfgob, long ginDef) goto LFail; } - if (!fSkipSplashScreen) + + if (!_FDisplayHomeLogo(fSkipSplashScreen)) { - if (!_FDisplayHomeLogo()) - { - _FGenericError(PszLit("_FDisplayHomeLogo")); - _fDontReportInitFailure = fTrue; - goto LFail; - } + _FGenericError(PszLit("_FDisplayHomeLogo")); + _fDontReportInitFailure = fTrue; + goto LFail; } + tsHomeLogo = TsCurrent(); if (!_FDetermineIfSlowCPU()) @@ -1477,7 +1476,7 @@ bool APP::FGetSetRegKey(PSZ pszValueName, void *pvData, long cbData, ulong grfre /*************************************************************************** Set the palette and bring up the Microsoft Home Logo ***************************************************************************/ -bool APP::_FDisplayHomeLogo(void) +bool APP::_FDisplayHomeLogo(bool fSkipSplashScreen) { AssertBaseThis(0); AssertPo(_pcfl, 0); @@ -1496,14 +1495,17 @@ bool APP::_FDisplayHomeLogo(void) GPT::SetActiveColors(pglclr, fpalIdentity); ReleasePpo(&pglclr); - if (!_pcfl->FFind(kctgMbmp, kcnoMbmpHomeLogo, &blck)) - return fFalse; - pmbmp = MBMP::PmbmpRead(&blck); - if (pvNil == pmbmp) - return fFalse; - _pkwa->SetMbmp(pmbmp); - ReleasePpo(&pmbmp); - UpdateMarked(); + if (!fSkipSplashScreen) { + if (!_pcfl->FFind(kctgMbmp, kcnoMbmpHomeLogo, &blck)) + return fFalse; + pmbmp = MBMP::PmbmpRead(&blck); + if (pvNil == pmbmp) + return fFalse; + _pkwa->SetMbmp(pmbmp); + ReleasePpo(&pmbmp); + UpdateMarked(); + } + return fTrue; }