Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add registry flag to skip splash screens #50

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion inc/utest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -167,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);
Expand Down
66 changes: 43 additions & 23 deletions src/studio/utest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -286,12 +289,14 @@ bool APP::_FInit(ulong grfapp, ulong grfgob, long ginDef)
goto LFail;
}

if (!_FDisplayHomeLogo())

if (!_FDisplayHomeLogo(fSkipSplashScreen))
{
_FGenericError(PszLit("_FDisplayHomeLogo"));
_fDontReportInitFailure = fTrue;
goto LFail;
}

tsHomeLogo = TsCurrent();

if (!_FDetermineIfSlowCPU())
Expand All @@ -315,22 +320,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())
Expand Down Expand Up @@ -361,9 +375,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.
Expand Down Expand Up @@ -1459,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);
Expand All @@ -1478,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;
}

Expand Down