mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 10:52:19 -05:00
* Add hack to load bss texture in ovl_En_Jsjutan * Remove (debug?) reference to jsjutanShadowTex in LUS
This commit is contained in:
parent
34d6212ab2
commit
c9aafcf7c5
@ -653,8 +653,13 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina
|
|||||||
uint32_t seg = data & 0xFFFFFFFF;
|
uint32_t seg = data & 0xFFFFFFFF;
|
||||||
int32_t texAddress = Seg2Filespace(data, dList->parent->baseAddress);
|
int32_t texAddress = Seg2Filespace(data, dList->parent->baseAddress);
|
||||||
|
|
||||||
if (!Globals::Instance->HasSegment(GETSEGNUM(seg), res->parent->workerID))
|
if (!Globals::Instance->HasSegment(GETSEGNUM(seg), res->parent->workerID) || (res->GetName() == "sShadowMaterialDL"))
|
||||||
{
|
{
|
||||||
|
if (res->GetName() == "sShadowMaterialDL") {
|
||||||
|
// sShadowMaterialDL (In ovl_En_Jsjutan) has a texture in bss. This is a hack to override the reference to one
|
||||||
|
// to segment C. The actor has been modified to load the texture into segment C.
|
||||||
|
seg = 0x0C000000;
|
||||||
|
}
|
||||||
int32_t __ = (data & 0x00FF000000000000) >> 48;
|
int32_t __ = (data & 0x00FF000000000000) >> 48;
|
||||||
int32_t www = (data & 0x00000FFF00000000) >> 32;
|
int32_t www = (data & 0x00000FFF00000000) >> 32;
|
||||||
|
|
||||||
|
@ -2110,11 +2110,6 @@ unsigned int dListBP;
|
|||||||
int matrixBP;
|
int matrixBP;
|
||||||
uintptr_t clearMtx;
|
uintptr_t clearMtx;
|
||||||
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
uintptr_t jsjutanShadowTex = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void gfx_run_dl(Gfx* cmd) {
|
static void gfx_run_dl(Gfx* cmd) {
|
||||||
//puts("dl");
|
//puts("dl");
|
||||||
int dummy = 0;
|
int dummy = 0;
|
||||||
|
@ -367,8 +367,6 @@ void EnJsjutan_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||||||
thisx->shape.rot.z = Math_CosS(globalCtx->gameplayFrames * 3500) * 300.0f;
|
thisx->shape.rot.z = Math_CosS(globalCtx->gameplayFrames * 3500) * 300.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern uintptr_t jsjutanShadowTex;
|
|
||||||
|
|
||||||
void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||||
EnJsjutan* this = (EnJsjutan*)thisx;
|
EnJsjutan* this = (EnJsjutan*)thisx;
|
||||||
GlobalContext* globalCtx = globalCtx2;
|
GlobalContext* globalCtx = globalCtx2;
|
||||||
@ -396,13 +394,12 @@ void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func_80A89A6C(this, globalCtx);
|
func_80A89A6C(this, globalCtx);
|
||||||
jsjutanShadowTex = sShadowTex;
|
|
||||||
|
|
||||||
if (this->unk_164) {
|
if (this->unk_164) {
|
||||||
this->unk_164 = false;
|
this->unk_164 = false;
|
||||||
u8* carpTex = ResourceMgr_LoadTexByName(sCarpetTex);
|
u8* carpTex = ResourceMgr_LoadTexByName(sCarpetTex);
|
||||||
u8* shadTex = sShadowTex;
|
u8* shadTex = sShadowTex;
|
||||||
for (i = 0; i < ARRAY_COUNT(shadTex); i++) {
|
for (i = 0; i < ARRAY_COUNT(sShadowTex); i++) {
|
||||||
if (((u16*)carpTex)[i] != 0) { // Hack to bypass ZAPD exporting textures as u64.
|
if (((u16*)carpTex)[i] != 0) { // Hack to bypass ZAPD exporting textures as u64.
|
||||||
shadTex[i] = 0xFF;
|
shadTex[i] = 0xFF;
|
||||||
} else {
|
} else {
|
||||||
@ -421,6 +418,7 @@ void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
|||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
|
||||||
// Draws the carpet's shadow texture.
|
// Draws the carpet's shadow texture.
|
||||||
|
gSPSegment(POLY_OPA_DISP++, 0x0C, sShadowTex);
|
||||||
gSPDisplayList(POLY_OPA_DISP++, sShadowMaterialDL);
|
gSPDisplayList(POLY_OPA_DISP++, sShadowMaterialDL);
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user