mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-03 10:41:30 -04:00
uniform GameEngine_OTRSigCheck
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user