Skip to content

Commit

Permalink
More properties
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquegemignani committed Jan 14, 2025
1 parent c88c5c4 commit 1d7cd59
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/G2ME01/rels/Tweaks/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ MetroidPrime/ScriptLoader/Struct/SLdrTweakGui.cpp:
MetroidPrime/ScriptLoader/SLdrTweakPlayerGun_Weapons.cpp:
.text start:0x000066C8 end:0x00006B34

MetroidPrime/ScriptLoader/SLdrTweakTargeting_VulnerabilityIndicator.cpp:
.text start:0x00006B34 end:0x00006CA8

MetroidPrime/ScriptLoader/SLdrTweakTargeting_Scan.cpp:
.text start:0x00006CA8 end:0x00006EC4

REL/REL_Setup.cpp:
.text start:0x0001DECC end:0x0001E070
.rodata start:0x00000408 end:0x0000048C
2 changes: 2 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ def MatchingFor(*versions):
Object(NonMatching, "MetroidPrime/ScriptLoader/Struct/SLdrTweakTargeting.cpp"),
Object(NonMatching, "MetroidPrime/ScriptLoader/Struct/SLdrTweakGui.cpp"),
Object(NonMatching, "MetroidPrime/ScriptLoader/SLdrTweakPlayerGun_Weapons.cpp"),
Object(NonMatching, "MetroidPrime/ScriptLoader/SLdrTweakTargeting_VulnerabilityIndicator.cpp"),
Object(NonMatching, "MetroidPrime/ScriptLoader/SLdrTweakTargeting_Scan.cpp"),
],
),
]
Expand Down
44 changes: 44 additions & 0 deletions src/MetroidPrime/ScriptLoader/SLdrTweakTargeting_Scan.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "MetroidPrime/ScriptLoader/SLdrTweakTargeting_Scan.hpp"

SLdrTweakTargeting_Scan::SLdrTweakTargeting_Scan()
: unknown(CColor::Green())
, scanLockLockedColor(CColor::Green())
, scanLockUnlockedColor(CColor::Green()) {
scanLockScale = 1.0f;
scanLockTransitionTime = 0.30000001f;
scanLockTranslation = 1.0f;
}

SLdrTweakTargeting_Scan::~SLdrTweakTargeting_Scan() {}

void LoadTypedefSLdrTweakTargeting_Scan(SLdrTweakTargeting_Scan& sldrThis, CInputStream& input) {
int propertyCount = input.ReadUint16();
for (int i = 0; i < propertyCount; ++i) {
uint propertyId = (uint)input.ReadInt32();
u16 propertySize = input.ReadUint16();

switch (propertyId) {
case 0xa0857b6e:
sldrThis.scanLockScale = input.ReadFloat();
break;
case 0xa4cce30f:
sldrThis.scanLockTransitionTime = input.ReadFloat();
break;
case 0x8e9bfea3:
sldrThis.scanLockTranslation = input.ReadFloat();
break;
case 0x768110cd:
sldrThis.unknown = CColor(input);
break;
case 0x319f966b:
sldrThis.scanLockLockedColor = CColor(input);
break;
case 0xa81f378c:
sldrThis.scanLockUnlockedColor = CColor(input);
break;
default:
input.ReadBytes(nullptr, propertySize);
break;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "MetroidPrime/ScriptLoader/SLdrTweakTargeting_VulnerabilityIndicator.hpp"

SLdrTweakTargeting_VulnerabilityIndicator::SLdrTweakTargeting_VulnerabilityIndicator() {
indicatorAngle = 0.0f;
indicatorColor = CColor::Black();
}

SLdrTweakTargeting_VulnerabilityIndicator::~SLdrTweakTargeting_VulnerabilityIndicator() {}

void LoadTypedefSLdrTweakTargeting_VulnerabilityIndicator(SLdrTweakTargeting_VulnerabilityIndicator& sldrThis, CInputStream& input) {
int propertyCount = input.ReadUint16();
for (int i = 0; i < propertyCount; ++i) {
uint propertyId = (uint)input.ReadInt32();
u16 propertySize = input.ReadUint16();

switch (propertyId) {
case 0x4c86af42:
sldrThis.indicatorAngle = input.ReadFloat();
break;
case 0x436b66ac:
sldrThis.indicatorColor = CColor(input);
break;
default:
input.ReadBytes(nullptr, propertySize);
break;
}
}
}

0 comments on commit 1d7cd59

Please sign in to comment.