Bump libultraship

This commit is contained in:
KiritoDv
2024-04-03 02:18:17 -06:00
parent b5b93e0e56
commit 59dc1cf083
3 changed files with 17 additions and 11 deletions
+1 -1
View File
@@ -1,9 +1,9 @@
#pragma once
#include "libultraship/src/Context.h"
#ifdef __cplusplus
#include <vector>
#include <Fast3D/gfx_pc.h>
#include "libultraship/src/Context.h"
#define SAMPLES_HIGH 544
#define SAMPLES_LOW 528
+15 -9
View File
@@ -28,18 +28,24 @@ extern "C" void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0) {
}
extern "C" void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr) {
char* imgData = (char*)texAddr;
auto data = reinterpret_cast<char*>(texAddr);
if (texAddr != 0 && GameEngine_OTRSigCheck(imgData)) {
auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResource(imgData);
if (texAddr != 0 && GameEngine_OTRSigCheck(data)) {
const auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResource(data);
const auto type = static_cast<LUS::ResourceType>(res->GetInitData()->Type);
if (res->GetInitData()->Type == LUS::ResourceType::DisplayList)
texAddr = (uintptr_t)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
else if (res->GetInitData()->Type == LUS::ResourceType::Array)
texAddr = (uintptr_t)(std::static_pointer_cast<LUS::Array>(res))->Vertices.data();
else {
texAddr = (uintptr_t) res->GetRawPointer();
switch(type) {
case LUS::ResourceType::DisplayList:
texAddr = reinterpret_cast<uintptr_t>(&std::static_pointer_cast<LUS::DisplayList>(res)->Instructions[0]);
break;
case LUS::ResourceType::Array:
texAddr = reinterpret_cast<uintptr_t>(std::static_pointer_cast<LUS::Array>(res)->Vertices.data());
break;
default:
texAddr = reinterpret_cast<uintptr_t>(res->GetRawPointer());
break;
}
}
__gSPInvalidateTexCache(pkt, texAddr);
}