diff options
| author | Max Roncace <me@caseif.net> | 2025-08-11 02:22:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 23:22:28 -0700 |
| commit | ddf4fc0677f6b93162389063168458244e14ac59 (patch) | |
| tree | 6a5ed9d344a1f28860754a8220659fd0fdefa243 /src | |
| parent | 87858822619e0a503e12f78690388c67df13f220 (diff) | |
Misc framework fixes (#2578)
Diffstat (limited to 'src')
| -rw-r--r-- | src/SSystem/SComponent/c_cc_d.cpp | 16 | ||||
| -rw-r--r-- | src/d/actor/d_a_npc_saru.cpp | 2 | ||||
| -rw-r--r-- | src/d/d_cc_d.cpp | 4 | ||||
| -rw-r--r-- | src/d/d_drawlist.cpp | 27 | ||||
| -rw-r--r-- | src/m_Do/m_Do_graphic.cpp | 7 |
5 files changed, 52 insertions, 4 deletions
diff --git a/src/SSystem/SComponent/c_cc_d.cpp b/src/SSystem/SComponent/c_cc_d.cpp index 713ba728a0..55ac56a417 100644 --- a/src/SSystem/SComponent/c_cc_d.cpp +++ b/src/SSystem/SComponent/c_cc_d.cpp @@ -299,6 +299,22 @@ void cCcD_ShapeAttr::getShapeAccess(cCcD_ShapeAttr::Shape* pshape) const { pshape->_4.x = 0.0f; } +bool cCcD_PntAttr::GetNVec(cXyz const& param_0, cXyz* param_1) const { + param_1->x = param_0.x - vtx.x; + param_1->y = param_0.y - vtx.y; + param_1->z = param_0.z - vtx.z; + if (cM3d_IsZero(PSVECMag(param_1))) { + param_1->x = 0.0f; + param_1->y = 0.0f; + param_1->z = 0.0f; + return false; + } else { + PSVECNormalize(param_1, param_1); + return true; + } +} + + /* 80263A88-80263B58 25E3C8 00D0+00 1/0 1/0 0/0 .text * CrossAtTg__12cCcD_TriAttrCFRC12cCcD_CpsAttrP4cXyz */ bool cCcD_TriAttr::CrossAtTg(const cCcD_CpsAttr& cpsAttr, cXyz* pxyz) const { diff --git a/src/d/actor/d_a_npc_saru.cpp b/src/d/actor/d_a_npc_saru.cpp index 2187d57554..5c958206c8 100644 --- a/src/d/actor/d_a_npc_saru.cpp +++ b/src/d/actor/d_a_npc_saru.cpp @@ -248,7 +248,7 @@ daNpc_Saru_c::~daNpc_Saru_c() { /* ############################################################################################## */ /* 80AC44F8-80AC4588 000000 0090+00 9/9 0/0 0/0 .rodata m__18daNpc_Saru_Param_c */ -daNpc_Saru_HIO_c const daNpc_Saru_Param_c::m = { +daNpc_Saru_HIOParam const daNpc_Saru_Param_c::m = { 140.0f, -3.0f, 1.0f, diff --git a/src/d/d_cc_d.cpp b/src/d/d_cc_d.cpp index 9b1a1d15c8..87506ebee2 100644 --- a/src/d/d_cc_d.cpp +++ b/src/d/d_cc_d.cpp @@ -364,6 +364,10 @@ dCcD_GObjInf* dCcD_GetGObjInf(cCcD_Obj* p_obj) { return (dCcD_GObjInf*)p_obj->GetGObjInf(); } +cCcD_ShapeAttr* dCcD_Pnt::GetShapeAttr() { + return this; +} + /* 800847D0-80084814 07F110 0044+00 0/0 1/1 20/20 .text Set__8dCcD_CpsFRC11dCcD_SrcCps */ void dCcD_Cps::Set(dCcD_SrcCps const& src) { dCcD_GObjInf::Set(src.mObjInf); diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index aaa698ba56..4ed9d94495 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -4,17 +4,18 @@ // #include "d/d_drawlist.h" -#include "d/d_s_play.h" +#include "JSystem/J2DGraph/J2DAnimation.h" +#include "JSystem/J2DGraph/J2DGrafContext.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "JSystem/J3DGraphBase/J3DDrawBuffer.h" #include "SSystem/SComponent/c_bg_s_shdw_draw.h" #include "SSystem/SComponent/c_math.h" #include "d/d_com_inf_game.h" +#include "d/d_s_play.h" #include "dol2asm.h" #include "m_Do/m_Do_graphic.h" #include "m_Do/m_Do_lib.h" #include "m_Do/m_Do_mtx.h" -#include "JSystem/J2DGraph/J2DGrafContext.h" class dDlst_blo_c : public dDlst_base_c { public: @@ -911,6 +912,11 @@ void dDlst_2DMt_c::draw() { } } +// stand-in for a stripped function that calls J2DPicture::getTexture +JUTTexture* dummy_getTexture(J2DPicture* picture) { + return picture->getTexture(0); +} + /* 80053A00-80053A9C 04E340 009C+00 0/0 1/1 0/0 .text __ct__10dDlst_2D_cFP7ResTIMGssssUc */ dDlst_2D_c::dDlst_2D_c(ResTIMG* i_timg, s16 i_posX, s16 i_posY, s16 i_sizeX, s16 i_sizeY, @@ -934,6 +940,23 @@ void dDlst_blo_c::draw() { mScreen.draw(field_0x120, field_0x124, dComIfGp_getCurrentGrafPort()); } +// stand-in for a function that pulls in a bunch of inline functions but was presumably stripped +void dummy_misc() { + J2DScreen* screen; + J2DPane* pane; + J2DPicture* picture; + J2DAnmBase* anmBase; + J2DAnmColor* anmColor; + delete anmBase; + picture->setBlack(JUtility::TColor(0, 0, 0, 0)); + picture->setWhite(JUtility::TColor(0, 0, 0, 0)); + pane->getTypeID(); + pane->makeMatrix(0.0f, 0.0f); + pane->calcMtx(); + screen->clearAnmTransform(); + anmColor->searchUpdateMaterialID(screen); +} + /* 80053CDC-80053CEC 04E61C 0010+00 0/0 2/2 0/0 .text init__8cM_rnd_cFiii */ void cM_rnd_c::init(int s0, int s1, int s2) { seed0 = s0; diff --git a/src/m_Do/m_Do_graphic.cpp b/src/m_Do/m_Do_graphic.cpp index fe637f1093..a7f09f999b 100644 --- a/src/m_Do/m_Do_graphic.cpp +++ b/src/m_Do/m_Do_graphic.cpp @@ -17,7 +17,12 @@ #include "m_Do/m_Do_machine.h" #include "m_Do/m_Do_main.h" #include "SSystem/SComponent/c_math.h" +// Possibly fakematch? +// Using `sym off` for this header fixes J2DOrthoGraph::~J2DOrthoGraph being +// incorrectly placed in a separate .text section. +#pragma sym off #include "JSystem/J2DGraph/J2DOrthoGraph.h" +#pragma sym on #include "JSystem/JParticle/JPADrawInfo.h" #include "JSystem/JUtility/JUTConsole.h" #include "JSystem/JFramework/JFWSystem.h" @@ -510,7 +515,7 @@ static void drawDepth2(view_class* param_0, view_port_class* param_1, int param_ GXBegin(GX_QUADS, GX_VTXFMT0, 4); GXPosition3s16(x_orig, y_orig_pos, -5); GXTexCoord2s8(0, 0); - GXPosition3s16(width, y_orig_pos, -5); + GXPosition3s16(width, y_orig_pos, -5); GXTexCoord2s8(1, 0); GXPosition3s16(width, height, -5); GXTexCoord2s8(1, 1); |
