Add more J3D_ASSERTs (#2491)

* Fix debug build

* Add more J3D_ASSERTs

* Move J3DShapeMtx to correct header for assert

* Add VSCode task for ninja changes_all
This commit is contained in:
LagoLunatic
2025-06-20 02:41:43 -04:00
committed by GitHub
parent 25d13c76e4
commit ac06966414
24 changed files with 268 additions and 174 deletions
+5 -1
View File
@@ -2,6 +2,7 @@
#define J3DTEXTURE_H
#include "JSystem/J3DGraphBase/J3DStruct.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "dolphin/types.h"
@@ -23,7 +24,10 @@ public:
/* 803366A4 */ virtual ~J3DTexture() {}
u16 getNum() const { return mNum; }
ResTIMG* getResTIMG(u16 entry) const { return &mpRes[entry]; }
ResTIMG* getResTIMG(u16 entry) const {
J3D_ASSERT(72, entry < mNum, "Error : range over.");
return &mpRes[entry];
}
void setResTIMG(u16 entry, const ResTIMG& timg) {
mpRes[entry] = timg;
mpRes[entry].imageOffset = ((mpRes[entry].imageOffset + (u32)&timg - (u32)(mpRes + entry)));