diff options
| author | robojumper <robojumper@gmail.com> | 2026-01-18 12:27:37 +0100 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2026-01-18 12:27:37 +0100 |
| commit | 679541bee2a8053a1a1a8e1493886512d5bda5f9 (patch) | |
| tree | fd74077c99baf915e78ab0f595c5929d70325b83 /src/egg | |
| parent | df5bd1a7b50bf21f2ea9bd250a4f64053c0ac431 (diff) | |
More symbols from NSMBW
Diffstat (limited to 'src/egg')
| -rw-r--r-- | src/egg/gfx/eggDrawGX.cpp | 18 | ||||
| -rw-r--r-- | src/egg/gfx/eggDrawPathDOF.cpp | 14 | ||||
| -rw-r--r-- | src/egg/gfx/eggLightObject.cpp | 4 | ||||
| -rw-r--r-- | src/egg/gfx/eggLightTexture.cpp | 4 | ||||
| -rw-r--r-- | src/egg/gfx/eggLightTextureMgr.cpp | 2 | ||||
| -rw-r--r-- | src/egg/gfx/eggStateEfb.cpp | 38 |
6 files changed, 40 insertions, 40 deletions
diff --git a/src/egg/gfx/eggDrawGX.cpp b/src/egg/gfx/eggDrawGX.cpp index d13efa19..8ab23ff1 100644 --- a/src/egg/gfx/eggDrawGX.cpp +++ b/src/egg/gfx/eggDrawGX.cpp @@ -523,9 +523,9 @@ void DrawGX::SetVtxState(EGG::DrawGX::VtxType type) { } } -const u8 sDetailLevels[] = {0x10, 0x20}; - void DrawGX::CreateDisplayList(EGG::Heap *pHeap) { + static const u8 POS_NUM[] = {0x10, 0x20}; + u8 ALIGN_DECL(32) tmpDisplayList[16 * 1024]; OSInitFastCast(); @@ -567,7 +567,7 @@ void DrawGX::CreateDisplayList(EGG::Heap *pHeap) { case DL_4: GXDrawSphere(8, 16); break; case DL_5: case DL_6: { - u16 numSegments = sDetailLevels[i - DL_5] + 1; + u16 numSegments = POS_NUM[i - DL_5] + 1; f32 radPerSegment = 2.0f * M_PI / (numSegments - 1); GXBegin(GX_LINESTRIP, GX_VTXFMT0, numSegments); for (int i = 0; i < numSegments; i++) { @@ -579,7 +579,7 @@ void DrawGX::CreateDisplayList(EGG::Heap *pHeap) { } case DL_9: case DL_10: { - u16 numSegments = sDetailLevels[i - DL_9] + 1; + u16 numSegments = POS_NUM[i - DL_9] + 1; f32 radPerSegment = 2.0f * M_PI / (numSegments - 1); GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, numSegments * 2); for (int i = 0; i < numSegments; i++) { @@ -592,21 +592,21 @@ void DrawGX::CreateDisplayList(EGG::Heap *pHeap) { } nw4r::math::MTX34 mtx; PSMTXTrans(mtx, 0.0f, 0.5f, 0.0f); - DrawCircleYPolygonFan(mtx, 0.0f, sDetailLevels[i - DL_9]); + DrawCircleYPolygonFan(mtx, 0.0f, POS_NUM[i - DL_9]); PSMTXIdentity(mtx); PSMTXRotRad(mtx, M_PI, 0x7A); PSMTXTransApply(mtx, mtx, 0.0f, -0.5f, 0.0f); - DrawCircleYPolygonFan(mtx, 0.0f, sDetailLevels[i - DL_9]); + DrawCircleYPolygonFan(mtx, 0.0f, POS_NUM[i - DL_9]); break; } case DL_11: case DL_12: { nw4r::math::MTX34 mtx; PSMTXIdentity(mtx); - DrawCircleYPolygonFan(mtx, 1.0f, sDetailLevels[i - DL_11]); + DrawCircleYPolygonFan(mtx, 1.0f, POS_NUM[i - DL_11]); PSMTXRotRad(mtx, M_PI, 0x7A); - DrawCircleYPolygonFan(mtx, 0.0f, sDetailLevels[i - DL_11]); + DrawCircleYPolygonFan(mtx, 0.0f, POS_NUM[i - DL_11]); break; } case DL_7: @@ -614,7 +614,7 @@ void DrawGX::CreateDisplayList(EGG::Heap *pHeap) { nw4r::math::MTX34 mtx; PSMTXIdentity(mtx); PSMTXRotRad(mtx, M_PI / 2.0f, 0x78); - DrawCircleYPolygonFan(mtx, 0.0f, sDetailLevels[i - DL_7]); + DrawCircleYPolygonFan(mtx, 0.0f, POS_NUM[i - DL_7]); break; } diff --git a/src/egg/gfx/eggDrawPathDOF.cpp b/src/egg/gfx/eggDrawPathDOF.cpp index 5b977e99..d7d5767f 100644 --- a/src/egg/gfx/eggDrawPathDOF.cpp +++ b/src/egg/gfx/eggDrawPathDOF.cpp @@ -61,7 +61,7 @@ DrawPathDOF::~DrawPathDOF() { mpMask = nullptr; } -void DrawPathDOF::execute() { +void DrawPathDOF::updateShimmer() { field_0x5C += field_0x6C * field_0x7C; field_0x60 += field_0x70 * field_0x7C; @@ -115,8 +115,8 @@ void DrawPathDOF::internalResetForDraw() { void DrawPathDOF::internalDraw(u16 idx) { if (idx == 0) { if (StateEfb::CheckFlag0x2() == 0) { - StateEfb::fn_804B4270( - static_cast<StateEfb::BufferType>((field_0x1C >> 2) & 1), reinterpret_cast<u32>(this) + StateEfb::pushWorkBuffer( + static_cast<StateEfb::WorkBuffer>((field_0x1C >> 2) & 1), reinterpret_cast<u32>(this) ); } StateGX::invalidateTexAllGX(); @@ -130,8 +130,8 @@ void DrawPathDOF::internalDraw(u16 idx) { switch (idx) { case 1: - StateEfb::popWorkBuffer(StateEfb::BUFFER_0, reinterpret_cast<u32>(this)); - StateEfb::releaseEfb(StateEfb::BUFFER_3, reinterpret_cast<u32>(this)); + StateEfb::popWorkBuffer(false, reinterpret_cast<u32>(this)); + StateEfb::releaseEfb(StateEfb::BUFFER_TYPE_3, reinterpret_cast<u32>(this)); break; case 2: if (mpTextureBuffer != nullptr) { @@ -148,13 +148,13 @@ void DrawPathDOF::internalDrawLite(u16 idx) { const Screen::DataEfb &efb = screen.GetDataEfb(); switch (idx) { case 0: { - TextureBuffer *capturedBuf = StateEfb::captureEfb(StateEfb::BUFFER_3, false, reinterpret_cast<u32>(this)); + TextureBuffer *capturedBuf = StateEfb::captureEfb(StateEfb::BUFFER_TYPE_3, false, reinterpret_cast<u32>(this)); StateGX::setPixelFormatGX(GX_PF_RGB8_Z24, GX_ZC_LINEAR); StateGX::ScopedColor colorGuard(true); StateGX::ScopedAlpha alphaGuard(false); StateGX::ScopedDither ditherGuard(false); PostEffectBase::setProjection(screen); - f32 *floats = StateEfb::fn_804B4550(); + f32 *floats = StateEfb::shiftWorkSpaceViewportGX(); f32 scale = (field_0x1C & 4) != 0 ? 0.25f : 0.5f; f32 width1 = screen.GetWidth() * scale; f32 height1 = screen.GetHeight() * scale; diff --git a/src/egg/gfx/eggLightObject.cpp b/src/egg/gfx/eggLightObject.cpp index 6bf66ef1..5bf0b97b 100644 --- a/src/egg/gfx/eggLightObject.cpp +++ b/src/egg/gfx/eggLightObject.cpp @@ -130,10 +130,10 @@ void LightObject::CalcView(nw4r::math::MTX34 const &viewMtx) { } } -void LightObject::fn_804A9C30(const LightTexture *tex, nw4r::math::VEC3 *pVec, GXColor *color) const { +void LightObject::CalcFinalDirColor(const LightTexture &tex, nw4r::math::VEC3 *pVec, GXColor *color) const { *pVec = field_0x94; *color = mLightColor; - f32 f = tex->getFloat(mIndex); + f32 f = tex.getFloat(mIndex); if (f < 1.0f) { color->r = color->r * f; color->g = color->g * f; diff --git a/src/egg/gfx/eggLightTexture.cpp b/src/egg/gfx/eggLightTexture.cpp index b8b823ca..3452484b 100644 --- a/src/egg/gfx/eggLightTexture.cpp +++ b/src/egg/gfx/eggLightTexture.cpp @@ -308,7 +308,7 @@ void LightTexture::initDrawSetting(u16 u1, u16 u2, u16 u3, u16 u4) { GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA); } -void LightTexture::getTexDimensions(u16 *x, u16 *y, u16 *w, u16 *h, u16 count) { +void LightTexture::getRequiredPosAndSize(u16 *x, u16 *y, u16 *w, u16 *h, u16 count) { *x = sDrawPosX; *y = sDrawPosY; @@ -550,7 +550,7 @@ void LightTexture::addLight(const EGG::LightObject &obj) { nw4r::math::VEC3 vec; GXColor color; - obj.fn_804A9C30(this, &vec, &color); + obj.CalcFinalDirColor(*this, &vec, &color); int remainder = field_0x9F % field_0x9D; if (field_0x9F == field_0x9D) { GXSetBlendMode(GX_BM_BLEND, GX_BL_ONE, GX_BL_ONE, GX_LO_CLEAR); diff --git a/src/egg/gfx/eggLightTextureMgr.cpp b/src/egg/gfx/eggLightTextureMgr.cpp index e9d0b27a..09de2e1e 100644 --- a/src/egg/gfx/eggLightTextureMgr.cpp +++ b/src/egg/gfx/eggLightTextureMgr.cpp @@ -204,7 +204,7 @@ void LightTextureManager::drawAndCaptureTexture(f32 ox, f32 oy, f32 sx, f32 sy) u16 x1, y1, x2, y2; TextureBuffer *buf = nullptr; - LightTexture::getTexDimensions(&x1, &y1, &x2, &y2, mTextureCount); + LightTexture::getRequiredPosAndSize(&x1, &y1, &x2, &y2, mTextureCount); x2 += x2 & 3; y2 += y2 & 3; diff --git a/src/egg/gfx/eggStateEfb.cpp b/src/egg/gfx/eggStateEfb.cpp index 721c71a9..e2a11581 100644 --- a/src/egg/gfx/eggStateEfb.cpp +++ b/src/egg/gfx/eggStateEfb.cpp @@ -12,7 +12,7 @@ namespace EGG { -StateEfb::Buffer StateEfb::spBufferSet[BUFFER_MAX]; +StateEfb::Buffer StateEfb::spBufferSet[BUFFER_TYPE_MAX]; f32 StateEfb::sWorkSpaceV[6]; f32 StateEfb::sWorkSpaceHideV[6]; f32 StateEfb::sShiftViewPort[6]; @@ -49,9 +49,9 @@ TextureBuffer *StateEfb::captureEfb(BufferType type, bool noTransparencyMaybe, u bool doCapture = true; switch (type) { - case BUFFER_0: - case BUFFER_1: { - f32 arg = type == BUFFER_0 ? 0.25f : 0.5f; + case BUFFER_TYPE_0: + case BUFFER_TYPE_1: { + f32 arg = type == BUFFER_TYPE_0 ? 0.25f : 0.5f; sWorkSpaceV[2] = efb.vp.x2 * arg; sWorkSpaceV[3] = efb.vp.y2 * arg; @@ -92,11 +92,11 @@ TextureBuffer *StateEfb::captureEfb(BufferType type, bool noTransparencyMaybe, u break; } - case BUFFER_2: + case BUFFER_TYPE_2: spBufferSet[type].buf = TextureBuffer::alloc(efb.vp.x2, efb.vp.y2, GX_TF_RGBA8); spBufferSet[type].buf->setPixModeSync(false); break; - case BUFFER_3: + case BUFFER_TYPE_3: spBufferSet[type].buf = TextureBuffer::alloc( efb.vp.x2 / 2.0f, efb.vp.y2 / 2.0f, GetUseTfRgb565() ? GX_TF_RGB565 : GX_TF_RGBA8 ); @@ -138,16 +138,16 @@ bool StateEfb::releaseEfb(BufferType type, u32 userData) { } } -void StateEfb::fn_804B4270(BufferType type, u32 userData) { - if (type == BUFFER_0) { - if (sWorkBuffer == 1) { - StateEfb::releaseEfb(BUFFER_0, spBufferSet[0].userData); +void StateEfb::pushWorkBuffer(WorkBuffer buffer, u32 userData) { + if (buffer == WORK_BUFFER_0) { + if (sWorkBuffer == WORK_BUFFER_1) { + StateEfb::releaseEfb(BUFFER_TYPE_0, spBufferSet[BUFFER_TYPE_0].userData); } - captureEfb(BUFFER_1, false, userData); - sWorkBuffer = 0; - } else if (type == BUFFER_1 && sWorkBuffer != 0) { - captureEfb(BUFFER_0, false, userData); - sWorkBuffer = 1; + captureEfb(BUFFER_TYPE_1, false, userData); + sWorkBuffer = WORK_BUFFER_0; + } else if (buffer == WORK_BUFFER_1 && sWorkBuffer != WORK_BUFFER_0) { + captureEfb(BUFFER_TYPE_0, false, userData); + sWorkBuffer = WORK_BUFFER_1; } } @@ -155,9 +155,9 @@ void StateEfb::popWorkBuffer(bool b, u32 userData) { if (sWorkBuffer != -1) { BufferType i = static_cast<BufferType>(-1); if (sWorkBuffer == 0) { - i = BUFFER_1; + i = BUFFER_TYPE_1; } else if (sWorkBuffer == 1) { - i = BUFFER_0; + i = BUFFER_TYPE_0; } if (spBufferSet[i].userData == userData) { @@ -195,14 +195,14 @@ void StateEfb::popWorkBuffer(bool b, u32 userData) { DrawGX::DrawDL(DrawGX::DL_16, mtx, DrawGX::WHITE); } } - releaseEfb((i), spBufferSet[i].userData); + releaseEfb(i, spBufferSet[i].userData); sWorkBuffer = -1; sPushCount += 1; } } } -f32 *StateEfb::fn_804B4550() { +f32 *StateEfb::shiftWorkSpaceViewportGX() { const Screen::DataEfb &efb = GlobalDrawState::getScreen().GetDataEfb(); sShiftViewPort[0] = sWorkSpaceV[0]; sShiftViewPort[1] = sWorkSpaceV[1]; |
