Final Step of CVar macro/sectionalizing (#4107)

* p

* Missed the prefix renames.

* More missed ones.

* Mostly finished cleanup.
Removed a few CVars and some related functionality.

* Bit more (prepping non-existent title card color editing).

* Resolve gCrowdControl.

* Final cleanup.

* Universal constant, not acceleration...

* Preset CVars.
This commit is contained in:
Malkierian
2024-05-05 12:14:55 -07:00
committed by GitHub
parent b6fc54ad8b
commit 6443a986d9
82 changed files with 1435 additions and 1457 deletions

View File

@@ -627,12 +627,6 @@ void Play_Init(GameState* thisx) {
gTrnsnUnkState = 0;
play->transitionMode = TRANS_MODE_OFF;
if (CVarGetInteger("gSceneTransitions", 255)!= 255){
play->transitionMode = CVarGetInteger("gSceneTransitions", 0);
gSaveContext.nextTransitionType = CVarGetInteger("gSceneTransitions", 0);
play->transitionType = CVarGetInteger("gSceneTransitions", 0);
}
FrameAdvance_Init(&play->frameAdvCtx);
Rand_Seed((u32)osGetTime());
Matrix_Init(&play->state);
@@ -800,7 +794,7 @@ void Play_Update(PlayState* play) {
HREG(82) = 0;
}
if (CVarGetInteger("gFreeCamera", 0) && Player_InCsMode(play)) {
if (CVarGetInteger(CVAR_SETTING("FreeLook.Enabled"), 0) && Player_InCsMode(play)) {
play->manualCamera = false;
}
@@ -1514,7 +1508,7 @@ void Play_Draw(PlayState* play) {
// Flip the projections and invert culling for the OPA and XLU display buffers
// These manage the world and effects
if (CVarGetInteger("gMirroredWorld", 0)) {
if (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)) {
gSPSetExtraGeometryMode(POLY_OPA_DISP++, G_EX_INVERT_CULLING);
gSPSetExtraGeometryMode(POLY_XLU_DISP++, G_EX_INVERT_CULLING);
gSPMatrix(POLY_OPA_DISP++, play->view.projectionFlippedPtr, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
@@ -1748,7 +1742,7 @@ void Play_Draw(PlayState* play) {
GameInteractor_ExecuteOnPlayDrawEnd();
// Reset the inverted culling
if (CVarGetInteger("gMirroredWorld", 0)) {
if (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)) {
gSPClearExtraGeometryMode(POLY_OPA_DISP++, G_EX_INVERT_CULLING);
gSPClearExtraGeometryMode(POLY_XLU_DISP++, G_EX_INVERT_CULLING);
}
@@ -1796,11 +1790,11 @@ void Play_Main(GameState* thisx) {
PlayState* play = (PlayState*)thisx;
// Decrease the easy pause buffer timer every frame
if (CVarGetInteger("gCheatEasyPauseBufferTimer", 0) > 0) {
CVarSetInteger("gCheatEasyPauseBufferTimer", CVarGetInteger("gCheatEasyPauseBufferTimer", 0) - 1);
if (CVarGetInteger(CVAR_GENERAL("CheatEasyPauseBufferTimer"), 0) > 0) {
CVarSetInteger(CVAR_GENERAL("CheatEasyPauseBufferTimer"), CVarGetInteger(CVAR_GENERAL("CheatEasyPauseBufferTimer"), 0) - 1);
}
if (play->envCtx.unk_EE[2] == 0 && CVarGetInteger("gLetItSnow", 0)) {
if (play->envCtx.unk_EE[2] == 0 && CVarGetInteger(CVAR_GENERAL("LetItSnow"), 0)) {
play->envCtx.unk_EE[3] = 64;
Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_OBJECT_KANKYO, 0, 0, 0, 0, 0, 0, 3, 0);
}
@@ -1977,11 +1971,11 @@ void Play_InitScene(PlayState* play, s32 spawn)
}
void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) {
uint8_t mqMode = CVarGetInteger("gBetterDebugWarpScreenMQMode", WARP_MODE_OVERRIDE_OFF);
int16_t mqModeScene = CVarGetInteger("gBetterDebugWarpScreenMQModeScene", -1);
uint8_t mqMode = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQMode"), WARP_MODE_OVERRIDE_OFF);
int16_t mqModeScene = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQModeScene"), -1);
if (mqMode != WARP_MODE_OVERRIDE_OFF && sceneNum != mqModeScene) {
CVarClear("gBetterDebugWarpScreenMQMode");
CVarClear("gBetterDebugWarpScreenMQModeScene");
CVarClear(CVAR_GENERAL("BetterDebugWarpScreenMQMode"));
CVarClear(CVAR_GENERAL("BetterDebugWarpScreenMQModeScene"));
}
OTRPlay_SpawnScene(play, sceneNum, spawn);