Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
void genStageUpdateMapTypeFlags(sead::SafeString *newTypeName, sead::SafeString *newMapName, sead::SafeString *a3)
{
setCurrentMapTypeAndName(newTypeName, newMapName);
const sead::SafeString currentMapType = getCurrentMapType();
const sead::SafeString currentMapName = getCurrentMapName();
const bool isCDungeon = (currentMapType == "CDungeon");
const bool isGameTestDungeon = (currentMapType == "GameTestDungeon");
const bool isActorViewer = (currentMapName == "ActorViewer");
// stuff involving qword_71025CE6D8 (which is never initialised in release versions?)
const bool debugMaybe = false;
const bool isViewer = (currentMapType == "Viewer");
const bool isMarioClubTestDungeon = (currentMapType == "MarioClubTestDungeon");
const bool isMainFieldDungeon = (currentMapType == "MainFieldDungeon");
sIsDebugOrDevMap = false;
sIsViewerMapType = false;
bool isRemainsElectric, isRemainsFire, isRemainsWater, isRemainsWind, isFinalTrial = false;
if ( !isMarioClubTestDungeon && !isCDungeon && !isMainFieldDungeon &&
(!isGameTestDungeon || isActorViewer || debugMaybe))
{
sIsDungeon = false;
sIsCDungeon = false;
sIsTestDungeon = false;
sIsMainFieldDungeon = false;
if ( isActorViewer )
{
sIsActorViewer = true;
sIsDebugOrDevMap = true;
}
else
{
sIsActorViewer = false;
}
if ( debugMaybe )
{
sStageDebug = true;
sIsDebugOrDevMap = true;
}
else
{
sStageDebug = false;
}
if ( isViewer )
{
sIsDebugOrDevMap = true;
sIsViewerMapType = true;
}
}
else
{
sIsDungeon = true;
sIsCDungeon = isCDungeon;
sIsTestDungeon = !isCDungeon && (isGameTestDungeon || isMarioClubTestDungeon);
sIsMainFieldDungeon = !isCDungeon && !(isGameTestDungeon || isMarioClubTestDungeon);
sIsActorViewer = false;
sStageDebug = false;
if ( sIsTestDungeon )
sIsDebugOrDevMap = true;
if ( sIsMainFieldDungeon )
{
isRemainsElectric = (currentMapName == "RemainsElectric");
isRemainsFire = (currentMapName == "RemainsFire");
isRemainsWater = (currentMapName == "RemainsWater");
isRemainsWind = (currentMapName == "RemainsWind");
isFinalTrial = (currentMapName == "FinalTrial");
}
}
sIsRemainsElectric = isRemainsElectric;
sIsRemainsFire = isRemainsFire;
sIsRemainsWater = isRemainsWater;
sIsRemainsWind = isRemainsWind;
sIsFinalTrial = isFinalTrial;
sIsAocField = currentMapType.findIndex("AocField") != -1;
const bool isMainField = (currentMapType == "MainField");
sIsMainField = isMainField;
sNotStageDebugOrActorViewerOrDungeon = !sStageDebug && !sIsActorViewer && !sIsDungeon;
// copy flags... example:
sIsDebugOrDevMap2 = sIsDebugOrDevMap;
str_qword_71025CC138 = a3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment