Add CTweakGui

Former-commit-id: 65eb93855e
This commit is contained in:
Phillip Stephens 2023-01-13 08:50:50 -08:00
parent 4b8975fa40
commit 9a25b36092
4 changed files with 143 additions and 13 deletions

View File

@ -3,8 +3,8 @@
.section .data .section .data
.balign 8 .balign 8
.global lbl_803DA440 .global __vt__9CTweakGui
lbl_803DA440: __vt__9CTweakGui:
# ROM: 0x3D7440 # ROM: 0x3D7440
.4byte 0 .4byte 0
.4byte 0 .4byte 0
@ -127,9 +127,9 @@ __ct__9CTweakGuiFR12CInputStream:
/* 80074360 000712C0 94 21 FF 90 */ stwu r1, -0x70(r1) /* 80074360 000712C0 94 21 FF 90 */ stwu r1, -0x70(r1)
/* 80074364 000712C4 7C 08 02 A6 */ mflr r0 /* 80074364 000712C4 7C 08 02 A6 */ mflr r0
/* 80074368 000712C8 3C C0 80 3E */ lis r6, __vt__12ITweakObject@ha /* 80074368 000712C8 3C C0 80 3E */ lis r6, __vt__12ITweakObject@ha
/* 8007436C 000712CC 3C A0 80 3E */ lis r5, lbl_803DA440@ha /* 8007436C 000712CC 3C A0 80 3E */ lis r5, __vt__9CTweakGui@ha
/* 80074370 000712D0 90 01 00 74 */ stw r0, 0x74(r1) /* 80074370 000712D0 90 01 00 74 */ stw r0, 0x74(r1)
/* 80074374 000712D4 38 05 A4 40 */ addi r0, r5, lbl_803DA440@l /* 80074374 000712D4 38 05 A4 40 */ addi r0, r5, __vt__9CTweakGui@l
/* 80074378 000712D8 93 E1 00 6C */ stw r31, 0x6c(r1) /* 80074378 000712D8 93 E1 00 6C */ stw r31, 0x6c(r1)
/* 8007437C 000712DC 7C 9F 23 78 */ mr r31, r4 /* 8007437C 000712DC 7C 9F 23 78 */ mr r31, r4
/* 80074380 000712E0 93 C1 00 68 */ stw r30, 0x68(r1) /* 80074380 000712E0 93 C1 00 68 */ stw r30, 0x68(r1)
@ -808,9 +808,9 @@ __dt__9CTweakGuiFv:
/* 80074DD0 00071D30 93 C1 00 08 */ stw r30, 8(r1) /* 80074DD0 00071D30 93 C1 00 08 */ stw r30, 8(r1)
/* 80074DD4 00071D34 7C 7E 1B 79 */ or. r30, r3, r3 /* 80074DD4 00071D34 7C 7E 1B 79 */ or. r30, r3, r3
/* 80074DD8 00071D38 41 82 01 40 */ beq lbl_80074F18 /* 80074DD8 00071D38 41 82 01 40 */ beq lbl_80074F18
/* 80074DDC 00071D3C 3C 60 80 3E */ lis r3, lbl_803DA440@ha /* 80074DDC 00071D3C 3C 60 80 3E */ lis r3, __vt__9CTweakGui@ha
/* 80074DE0 00071D40 34 1E 03 34 */ addic. r0, r30, 0x334 /* 80074DE0 00071D40 34 1E 03 34 */ addic. r0, r30, 0x334
/* 80074DE4 00071D44 38 03 A4 40 */ addi r0, r3, lbl_803DA440@l /* 80074DE4 00071D44 38 03 A4 40 */ addi r0, r3, __vt__9CTweakGui@l
/* 80074DE8 00071D48 90 1E 00 00 */ stw r0, 0(r30) /* 80074DE8 00071D48 90 1E 00 00 */ stw r0, 0(r30)
/* 80074DEC 00071D4C 41 82 00 0C */ beq lbl_80074DF8 /* 80074DEC 00071D4C 41 82 00 0C */ beq lbl_80074DF8
/* 80074DF0 00071D50 38 7E 03 34 */ addi r3, r30, 0x334 /* 80074DF0 00071D50 38 7E 03 34 */ addi r3, r30, 0x334

View File

@ -64,7 +64,7 @@ LIBS = [
["MetroidPrime/Tweaks/CTweakPlayerControl", True], ["MetroidPrime/Tweaks/CTweakPlayerControl", True],
"MetroidPrime/Tweaks/CTweakPlayerGun", "MetroidPrime/Tweaks/CTweakPlayerGun",
"MetroidPrime/CPauseScreen", "MetroidPrime/CPauseScreen",
"MetroidPrime/Tweaks/CTweakGui", ["MetroidPrime/Tweaks/CTweakGui", False],
["MetroidPrime/ScriptObjects/CScriptActor", False], ["MetroidPrime/ScriptObjects/CScriptActor", False],
["MetroidPrime/ScriptObjects/CScriptTrigger", False], ["MetroidPrime/ScriptObjects/CScriptTrigger", False],
["MetroidPrime/ScriptObjects/CScriptWaypoint", True], ["MetroidPrime/ScriptObjects/CScriptWaypoint", True],

View File

@ -3,15 +3,22 @@
#include "MetroidPrime/Tweaks/ITweakObject.hpp" #include "MetroidPrime/Tweaks/ITweakObject.hpp"
#include "Kyoto/TOneStatic.hpp"
#include "Kyoto/Graphics/CColor.hpp" #include "Kyoto/Graphics/CColor.hpp"
#include "Kyoto/Math/CVector3f.hpp" #include "Kyoto/Math/CVector3f.hpp"
#include "rstl/reserved_vector.hpp" #include "rstl/reserved_vector.hpp"
#include "rstl/string.hpp" #include "rstl/string.hpp"
class CTweakGui : public ITweakObject { class CTweakGui : public ITweakObject, public TOneStatic< CTweakGui > {
public: public:
enum EHudVisMode { kHud_Zero, kHud_One, kHud_Two, kHud_Three }; enum EHudVisMode {
kHud_Zero,
kHud_One,
kHud_Two,
kHud_Three,
};
enum EHelmetVisMode { enum EHelmetVisMode {
kHelmet_ReducedUpdate, kHelmet_ReducedUpdate,
@ -22,6 +29,8 @@ public:
kHelmet_HelmetOnly kHelmet_HelmetOnly
}; };
CTweakGui(CInputStream& in);
float GetMapAlphaInterpolant() const { return x8_mapAlphaInterp; } float GetMapAlphaInterpolant() const { return x8_mapAlphaInterp; }
float GetPauseBlurFactor() const { return xc_pauseBlurFactor; } float GetPauseBlurFactor() const { return xc_pauseBlurFactor; }
float GetRadarXYRadius() const { return x10_radarXYRadius; } float GetRadarXYRadius() const { return x10_radarXYRadius; }
@ -80,9 +89,13 @@ public:
float GetFaceReflectionHeight() const { return x148_faceReflectionHeight; } float GetFaceReflectionHeight() const { return x148_faceReflectionHeight; }
float GetFaceReflectionAspect() const { return x14c_faceReflectionAspect; } float GetFaceReflectionAspect() const { return x14c_faceReflectionAspect; }
float GetMissileWarningPulseTime() const { return x1a0_missileWarningPulseTime; } float GetMissileWarningPulseTime() const { return x1a0_missileWarningPulseTime; }
float GetExplosionLightFalloffMultConstant() const { return x1a4_explosionLightFalloffMultConstant; } float GetExplosionLightFalloffMultConstant() const {
return x1a4_explosionLightFalloffMultConstant;
}
float GetExplosionLightFalloffMultLinear() const { return x1a8_explosionLightFalloffMultLinear; } float GetExplosionLightFalloffMultLinear() const { return x1a8_explosionLightFalloffMultLinear; }
float GetExplosionLightFalloffMultQuadratic() const { return x1ac_explosionLightFalloffMultQuadratic; } float GetExplosionLightFalloffMultQuadratic() const {
return x1ac_explosionLightFalloffMultQuadratic;
}
float GetHudDamagePeakFactor() const { return x1b4_hudDamagePeakFactor; } float GetHudDamagePeakFactor() const { return x1b4_hudDamagePeakFactor; }
float GetHudDamageFilterGainConstant() const { return x1b8_hudDamageFilterGainConstant; } float GetHudDamageFilterGainConstant() const { return x1b8_hudDamageFilterGainConstant; }
float GetHudDamageFilterGainLinear() const { return x1bc_hudDamageFilterGainLinear; } float GetHudDamageFilterGainLinear() const { return x1bc_hudDamageFilterGainLinear; }
@ -142,7 +155,6 @@ public:
const CColor& GetCreditsTextFontColor() const { return x300_; } const CColor& GetCreditsTextFontColor() const { return x300_; }
const CColor& GetCreditsTextBorderColor() const { return x304_; } const CColor& GetCreditsTextBorderColor() const { return x304_; }
static float FaceReflectionDistanceDebugValueToActualValue(float v); static float FaceReflectionDistanceDebugValueToActualValue(float v);
static float FaceReflectionHeightDebugValueToActualValue(float v); static float FaceReflectionHeightDebugValueToActualValue(float v);
static float FaceReflectionAspectDebugValueToActualValue(float v); static float FaceReflectionAspectDebugValueToActualValue(float v);

View File

@ -0,0 +1,118 @@
#include "MetroidPrime/Tweaks/CTweakGui.hpp"
#include "Kyoto/Streams/CInputStream.hpp"
CTweakGui::CTweakGui(CInputStream& in)
: x4_(in.ReadBool())
, x8_mapAlphaInterp(in.ReadFloat())
, xc_pauseBlurFactor(in.ReadFloat())
, x10_radarXYRadius(in.ReadFloat())
, x14_(in.ReadFloat())
, x18_(in.ReadFloat())
, x1c_(in.ReadFloat())
, x20_(in.ReadFloat())
, x24_radarZRadius(in.ReadFloat())
, x28_radarZCloseRadius(in.ReadFloat())
, x2c_(0)
, x30_(in.ReadFloat())
, x34_energyBarFilledSpeed(in.ReadFloat())
, x38_energyBarShadowSpeed(in.ReadFloat())
, x3c_energyBarDrainDelay(in.ReadFloat())
, x40_energyBarAlwaysResetDelay(in.ReadBool())
, x44_hudDamagePracticalsGainConstant(in.ReadFloat())
, x48_hudDamagePracticalsGainLinear(in.ReadFloat())
, x4c_hudDamagePracticalsInitConstant(in.ReadFloat())
, x50_hudDamagePracticalsInitLinear(in.ReadFloat())
, x54_hudDamageLightSpotAngle(in.ReadFloat())
, x58_damageLightAngleC(in.ReadFloat())
, x5c_damageLightAngleL(in.ReadFloat())
, x60_damageLightAngleQ(in.ReadFloat())
, x64_damageLightPreTranslate(in)
, x70_damageLightCenterTranslate(in)
, x7c_damageLightXfXAngle(in.ReadFloat())
, x80_damageLightXfZAngle(in.ReadFloat())
, x84_hudDecoShakeTranslateVelConstant(in.ReadFloat())
, x88_hudDecoShakeTranslateVelLinear(in.ReadFloat())
, x8c_maxDecoDamageShakeTranslate(in.ReadFloat())
, x90_decoDamageShakeDeceleration(in.ReadFloat())
, x94_decoShakeGainConstant(in.ReadFloat())
, x98_decoShakeGainLinear(in.ReadFloat())
, x9c_decoShakeInitConstant(in.ReadFloat())
, xa0_decoShakeInitLinear(in.ReadFloat())
, xa4_maxDecoDamageShakeRotate(in.ReadFloat())
, xa8_hudCamFovTweak(in.ReadInt32())
, xac_hudCamYTweak(in.ReadInt32())
, xb0_hudCamZTweak(in.ReadInt32())
, xb4_(in.ReadFloat())
, xb8_(in.ReadFloat())
, xbc_(in.ReadFloat())
, xc0_beamVisorMenuAnimTime(in.ReadFloat())
, xc4_visorBeamMenuItemActiveScale(in.ReadFloat())
, xc8_visorBeamMenuItemInactiveScale(in.ReadFloat())
, xcc_visorBeamMenuItemTranslate(in.ReadFloat())
, xd0_(in.ReadFloat())
, xd4_(in.ReadInt32())
, xd8_((in.ReadFloat() * 0.002777778f) * 6.283185f)
, xdc_((in.ReadFloat() * 0.002777778f) * 6.283185f)
, xe0_(in.ReadFloat())
, xe4_threatRange(in.ReadFloat())
, xe8_radarScopeCoordRadius(in.ReadFloat())
, xec_radarPlayerPaintRadius(in.ReadFloat())
, xf0_radarEnemyPaintRadius(in.ReadFloat())
, xf4_missileArrowVisTime(in.ReadFloat())
, xf8_hudVisMode((EHudVisMode)in.ReadInt32())
, xfc_helmetVisMode((EHelmetVisMode)in.ReadInt32())
, x100_enableAutoMapper(in.ReadInt32())
, x104_(in.ReadInt32())
, x108_enableTargetingManager(in.ReadInt32())
, x10c_enablePlayerVisor(in.ReadInt32())
, x110_threatWarningFraction(in.ReadFloat())
, x114_missileWarningFraction(in.ReadFloat())
, x118_freeLookFadeTime(in.ReadFloat())
, x11c_(in.ReadFloat())
, x120_(in.ReadFloat())
, x124_(in.ReadFloat())
, x128_(in.ReadFloat())
, x12c_freeLookSfxPitchScale(in.ReadFloat())
, x130_noAbsoluteFreeLookSfxPitch(in.ReadBool())
, x134_(in.ReadFloat())
, x138_(in.ReadFloat())
, x13c_faceReflectionOrthoWidth(in.ReadInt32())
, x140_faceReflectionOrthoHeight(in.ReadInt32())
, x144_faceReflectionDistance(in.ReadInt32())
, x148_faceReflectionHeight(in.ReadInt32())
, x14c_faceReflectionAspect(in.ReadInt32())
, x150_(in)
, x160_(in)
, x170_(in)
, x180_(in)
, x190_(in)
, x1a0_missileWarningPulseTime(in.ReadFloat())
, x1a4_explosionLightFalloffMultConstant(in.ReadFloat())
, x1a8_explosionLightFalloffMultLinear(in.ReadFloat())
, x1ac_explosionLightFalloffMultQuadratic(in.ReadFloat())
, x1b0_(in.ReadFloat())
, x1b4_hudDamagePeakFactor(in.ReadFloat())
, x1b8_hudDamageFilterGainConstant(in.ReadFloat())
, x1bc_hudDamageFilterGainLinear(in.ReadFloat())
, x1c0_hudDamageFilterInitConstant(in.ReadFloat())
, x1c4_hudDamageFilterInitLinear(in.ReadFloat())
, x1c8_energyDrainModPeriod(in.ReadFloat())
, x1cc_energyDrainSinusoidalPulse(in.ReadBool())
, x1cd_energyDrainFilterAdditive(in.ReadBool())
, x1d0_hudDamagePulseDuration(in.ReadFloat())
, x1d4_hudDamageColorGain(in.ReadFloat())
, x1d8_hudDecoShakeTranslateGain(in.ReadFloat())
, x1dc_hudLagOffsetScale(in.ReadFloat())
, x1e0_(in.ReadFloat())
, x1e4_(in.ReadFloat())
, x1e8_(in.ReadFloat())
, x1ec_(in.ReadFloat())
, x1f0_(in.ReadFloat())
, x1f4_(in.ReadFloat())
, x1f8_(in.ReadFloat())
, x1fc_(in.ReadFloat())
, x200_(x1f4_ * 0.25f, x1f8_ * 0.25f, x1fc_ * 0.25f)
, x204_xrayBlurScaleLinear(0.0014f)
, x208_xrayBlurScaleQuadratic(0.0000525f)
, x20c_(in.ReadFloat()) {}