uniform GameEngine_OTRSigCheck

This commit is contained in:
coco875
2025-01-05 11:30:10 +01:00
parent a82fbbdfd9
commit 6eb35d2bf8
4 changed files with 16 additions and 10 deletions
+6 -5
View File
@@ -4,13 +4,14 @@
#include "DisplayList.h"
#include "resource/type/ResourceType.h"
#include "resource/type/Array.h"
extern "C" int GameEngine_OTRSigCheck(const char* data);
extern "C" {
#include <align_asset_macro.h>
}
extern "C" void gSPDisplayList(Gfx* pkt, Gfx* dl) {
char* imgData = (char*) dl;
if (GameEngine_OTRSigCheck(imgData) == 1) {
if (GameEngine_OTRSigCheck(imgData)) {
auto resource = Ship::Context::GetInstance()->GetResourceManager()->LoadResource(imgData);
auto res = std::static_pointer_cast<LUS::DisplayList>(resource);
dl = &res->Instructions[0];
@@ -21,7 +22,7 @@ extern "C" void gSPDisplayList(Gfx* pkt, Gfx* dl) {
extern "C" void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0) {
if (GameEngine_OTRSigCheck((char*) v) == 1) {
if (GameEngine_OTRSigCheck((char*) v)) {
v = (uintptr_t) ResourceGetDataByName((char*) v);
}
@@ -31,7 +32,7 @@ extern "C" void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0) {
extern "C" void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr) {
auto data = reinterpret_cast<char*>(texAddr);
if (texAddr != 0 && GameEngine_OTRSigCheck(data) == 1) {
if (texAddr != 0 && GameEngine_OTRSigCheck(data)) {
const auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResource(data);
const auto type = static_cast<LUS::ResourceType>(res->GetInitData()->Type);