diff --git a/include/JSystem/J2DGraph/J2DPane.h b/include/JSystem/J2DGraph/J2DPane.h index 5465a5dad..00deb40fe 100644 --- a/include/JSystem/J2DGraph/J2DPane.h +++ b/include/JSystem/J2DGraph/J2DPane.h @@ -67,6 +67,7 @@ public: JSUTree* getEndChild() { return mPaneTree.getEndChild(); } const JSUTree* getPaneTree() { return &mPaneTree; } u8 getAlpha() const { return mAlpha; } + void setAlpha(u8 alpha) { mAlpha = alpha; } bool isConnectParent() const { return mIsConnectParent; } public: diff --git a/include/JSystem/J2DGraph/J2DPicture.h b/include/JSystem/J2DGraph/J2DPicture.h index a59066140..252af9507 100644 --- a/include/JSystem/J2DGraph/J2DPicture.h +++ b/include/JSystem/J2DGraph/J2DPicture.h @@ -2,6 +2,7 @@ #define J2DPICTURE_H #include "JSystem/J2DGraph/J2DPane.h" +#include "JSystem/JUtility/JUTTexture.h" #include "JSystem/JUtility/TColor.h" #include "dolphin/gx/GX.h" @@ -38,6 +39,10 @@ public: int changeTexture(const char*, u8); void drawFullSet(f32, f32, f32, f32, J2DBinding, J2DMirror, bool, Mtx*); void draw(f32, f32, f32, f32, bool, bool, bool); + void draw(f32 x, f32 y, bool, bool, bool) { + if (mNumTexture > 0) + draw(x, y, mpTexture[0]->getWidth(), mpTexture[0]->getHeight(), false, false, false); + } void drawOut(const JGeometry::TBox2&, const JGeometry::TBox2&); void drawTexCoord(f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, Mtx*); void setTevMode(); diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 936a9a9cd..875735ab5 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -27,8 +27,8 @@ public: protected: /* 0x004 */ J2DPicture mPicture; - /* 0x128 */ s16 mWidth; - /* 0x12A */ s16 mHeight; + /* 0x128 */ s16 mX; + /* 0x12A */ s16 mY; /* 0x12C */ u8 mAlpha; /* 0x12D */ u8 field_0x12e[3]; }; @@ -201,6 +201,7 @@ private: class dDlst_shadowControl_c { public: + dDlst_shadowControl_c() { mRealNum = 0; } void init(); void reset(); void imageDraw(f32 (*)[4]); diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index 87efbc145..6aa97874a 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -89,13 +89,17 @@ void dDlst_2DMt_c::draw() { } /* 80082130-800821B0 .text __ct__10dDlst_2D_cFP7ResTIMGssUc */ -dDlst_2D_c::dDlst_2D_c(ResTIMG*, s16, s16, u8) { - /* Nonmatching */ +dDlst_2D_c::dDlst_2D_c(ResTIMG* timg, s16 x, s16 y, u8 alpha) { + mPicture.initiate(timg, NULL); + mX = x; + mY = y; + mAlpha = alpha; } /* 800821B0-80082264 .text draw__10dDlst_2D_cFv */ void dDlst_2D_c::draw() { - /* Nonmatching */ + mPicture.setAlpha(mAlpha); + mPicture.draw(mX, mY, false, false, false); } /* 80082424-80082794 .text draw__18dDlst_effectLine_cFv */ @@ -335,22 +339,59 @@ void dDlst_alphaInvVolPacket::draw() { } /* 80085BBC-80085BFC .text newData__13dDlst_peekZ_cFssPUl */ -int dDlst_peekZ_c::newData(s16, s16, u32*) { - /* Nonmatching */ +int dDlst_peekZ_c::newData(s16 x, s16 y, u32* pDst) { + if (mCount >= 0x40) + return 0; + + dDlst_peekZ_entry *pEntry = &mEntries[mCount]; + pEntry->x = x; + pEntry->y = y; + pEntry->dst = pDst; + mCount++; + return 1; } /* 80085BFC-80085C6C .text peekData__13dDlst_peekZ_cFv */ void dDlst_peekZ_c::peekData() { - /* Nonmatching */ + dDlst_peekZ_entry * pEntry = &mEntries[0]; + for (s32 i = 0; i < mCount; pEntry++, i++) + GXPeekZ(pEntry->x, pEntry->y, pEntry->dst); + mCount = 0; } /* 80085C6C-80085D74 .text __ct__12dDlst_list_cFv */ dDlst_list_c::dDlst_list_c() { - /* Nonmatching */ + field_0x50 = &field_0x3c[ARRAY_SIZE(field_0x3c)]; + mp2DOpaTopEnd = &mp2DOpaTopArr[ARRAY_SIZE(mp2DOpaTopArr)]; + mp2DOpaEnd = &mp2DOpaArr[ARRAY_SIZE(mp2DOpaArr)]; + mp2DXluEnd = &mp2DXluArr[ARRAY_SIZE(mp2DXluArr)]; + mpOpaListSky = NULL; + mpXluListSky = NULL; + mpOpaListP0 = NULL; + mpOpaListP1 = NULL; + mpXluListP1 = NULL; + mpOpaListBG = NULL; + mpXluListBG = NULL; + mpOpaList = NULL; + mpXluList = NULL; + mpOpaListFilter = NULL; + mpOpaListMaskOff = NULL; + mpXluListMaskOff = NULL; + mpOpaListInvisible = NULL; + mpXluListInvisible = NULL; + mpOpaList2D = NULL; + mpAlphaModel = NULL; + mpSpotModel = NULL; } static J3DDrawBuffer * J3DDrawBuffer__create(u32 size) { - return new J3DDrawBuffer(size); + J3DDrawBuffer * buffer = new J3DDrawBuffer(); + if (buffer != NULL) { + if (buffer->allocBuffer(size) == 0) + return buffer; + delete buffer; + } + return NULL; } /* 80085F6C-800861F4 .text init__12dDlst_list_cFv */