ksys/ProductReporter: add PanicReason

This commit is contained in:
Léo Lam 2024-04-25 01:10:05 +01:00
parent ffc35ea350
commit 96f611fa5d
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 15 additions and 1 deletions

View File

@ -36,6 +36,16 @@ public:
u8 _3a[5]; u8 _3a[5];
}; };
enum class PanicReason {
OverlayArenaFull = 0,
HavokMainHeapFull = 1,
ActorCreateHeapFull = 2,
ResourceSHeapFull = 3,
ResourceLHeapFull = 4,
AudioHeapFull = 5,
TextureHandleMgrSlow = 6,
};
class ProductReporter { class ProductReporter {
public: public:
ProductReporter() = default; ProductReporter() = default;
@ -48,6 +58,10 @@ public:
static bool getSomeBool(); static bool getSomeBool();
bool isEnabled() const; bool isEnabled() const;
sead::BitFlag32 getPanicReasons() const { return mPanicReasons; }
void addPanicReason(PanicReason reason) { mPanicReasons.setBit(int(reason)); }
void clearPanicReason() { mPanicReasons.makeAllZero(); }
s32 getRomWorkTime() const; s32 getRomWorkTime() const;
s32 getSceneWorkTime() const; s32 getSceneWorkTime() const;
void resetSceneWorkTime(); void resetSceneWorkTime();
@ -96,7 +110,7 @@ public:
} }
private: private:
u8 _0[8]; sead::BitFlag32 mPanicReasons;
Container mContainer1; Container mContainer1;
Container mContainer2; Container mContainer2;