Skip to content

Commit

Permalink
Don't access SObjectTag::mId directly, remove hack new in TOneStatic
Browse files Browse the repository at this point in the history
  • Loading branch information
Antidote committed Dec 24, 2024
1 parent 44b98ba commit 1ec5a25
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/Kyoto/SObjectTag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SObjectTag {
const FourCC GetType() const { return mType; }
static const char* Type2Text(FourCC type);

public:
private:
FourCC mType;
CAssetId mId;
};
Expand Down
1 change: 0 additions & 1 deletion include/Kyoto/TOneStatic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ template < typename T >
class TOneStatic {
public:
void* operator new(size_t sz, const char*, const char*);
void* operator new(size_t sz) { return operator new(sz, "\?\?(\?\?)", nullptr); }
void operator delete(void* ptr);

private:
Expand Down
2 changes: 1 addition & 1 deletion src/MetroidPrime/CCredits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ CIOWin::EMessageReturn CCredits::Update(float dt, CArchitectureQueue& queue) {
for (int i = 0; i < x18_creditsTable->GetStringCount(); ++i) {
x30_text.push_back(rstl::pair< rstl::single_ptr< CGuiTextSupport >, CVector2i >(
rs_new CGuiTextSupport(
gpResourceFactory->GetResourceIdByName(gpTweakGui->GetCreditsFont().data())->mId,
gpResourceFactory->GetResourceIdByName(gpTweakGui->GetCreditsFont().data())->GetId(),
CGuiTextProperties(true, true, kJustification_Center, kVerticalJustification_Top),
gpTweakGui->GetCreditsTextFontColor(), gpTweakGui->GetCreditsTextBorderColor(),
CColor::White(), CGraphics::GetViewport().mWidth - 64, 0, gpSimplePool,
Expand Down
2 changes: 1 addition & 1 deletion src/MetroidPrime/CMapArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,6 @@ const CVector3f& CMapArea::GetAreaPostTranslate(const IWorld& world, TAreaId aid

CFactoryFnReturn FMapAreaFactory(const SObjectTag& objTag, CInputStream& in,
const CVParamTransfer&) {
gHackAssetId = objTag.mId;
gHackAssetId = objTag.GetId();
return CFactoryFnReturn(rs_new CMapArea(in, gpResourceFactory->ResourceSize(objTag)));
}
2 changes: 1 addition & 1 deletion src/MetroidPrime/Player/CSamusFaceReflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static const CTransform4f skFaceModelViewAdjust =
CTransform4f::Scale(0.3f) * CTransform4f::Translate(CVector3f(0.f, 0.5f, 0.f));

CSamusFaceReflection::CSamusFaceReflection(const CStateManager& mgr)
: x0_modelData(CModelData(CAnimRes(gpResourceFactory->GetResourceIdByName(skFaceAssetIdName)->mId,
: x0_modelData(CModelData(CAnimRes(gpResourceFactory->GetResourceIdByName(skFaceAssetIdName)->GetId(),
CAnimRes::kDefaultCharIdx, CVector3f(1.f, 1.f, 1.f), 0, true)))
, x4c_lights(rs_new CActorLights(8, CVector3f::Zero(), 4, 4))
, x50_lookRot(CQuaternion::NoRotation())
Expand Down
2 changes: 1 addition & 1 deletion src/MetroidPrime/ScriptObjects/CScriptSpecialFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
if (msg == kSM_Increment) {
const SObjectTag* objectTag =
gpResourceFactory->GetResourceIdByName(xec_locatorName.data());
const CAssetId assetId = objectTag ? objectTag->mId : kInvalidAssetId;
const CAssetId assetId = objectTag ? objectTag->GetId() : kInvalidAssetId;

mgr.SetPendingOnScreenTex(assetId, CVector2i(int(x104_float3), int(x108_float4)),
CVector2i(int(xfc_float1), int(x100_float2)));
Expand Down
2 changes: 1 addition & 1 deletion src/MetroidPrime/Tweaks/CTweaks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CTweakPlayerRes* gpTweakPlayerRes = nullptr;
CTweakSlideShow* gpTweakSlideShow = nullptr;

CAssetId IDFromFactory(CResFactory& factory, const char* filename) {
return factory.GetResourceIdByName(filename)->mId;
return factory.GetResourceIdByName(filename)->GetId();
}

CTweaks::CTweaks() { mTweakObjects.resize(14, rstl::auto_ptr< ITweakObject >()); }
Expand Down
2 changes: 1 addition & 1 deletion src/MetroidPrime/Weapons/WeaponTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CAssetId get_asset_id_from_name(const char* name) {
if (!tag) {
return kInvalidAssetId;
}
return tag->mId;
return tag->GetId();
}

void get_token_vector(CAnimData& animData, int animIdx, rstl::vector< CToken >& tokensOut,
Expand Down

0 comments on commit 1ec5a25

Please sign in to comment.