mirror of
https://github.com/zeldaret/ss
synced 2026-05-24 07:10:53 -04:00
Merge branch '🥚' of https://github.com/robojumper/ss into pr/142
This commit is contained in:
@@ -2256,6 +2256,9 @@ egg/gfx/eggIScnProc.cpp:
|
||||
|
||||
egg/gfx/eggLightManager.cpp:
|
||||
.text start:0x804A7F80 end:0x804A9808
|
||||
.data start:0x8056F068 end:0x8056F098
|
||||
.sdata start:0x80574F28 end:0x80574F30
|
||||
.sdata2 start:0x8057F678 end:0x8057F690
|
||||
|
||||
egg/gfx/eggLightObject.cpp:
|
||||
.text start:0x804A9810 end:0x804AB24C
|
||||
|
||||
@@ -37369,7 +37369,7 @@ __vt__Q23EGG10FogManager = .data:0x8056F010; // type:object size:0x1C
|
||||
__vt__Q23EGG7Frustum = .data:0x8056F030; // type:object size:0x14
|
||||
EGG__GfxEnginer__Configuration__vtable = .data:0x8056F048; // type:object size:0x10
|
||||
__vt__Q23EGG8IScnProc = .data:0x8056F058; // type:object size:0x10
|
||||
EGG__LightManager__vtable = .data:0x8056F068; // type:object size:0x30
|
||||
__vt__Q23EGG12LightManager = .data:0x8056F068; // type:object size:0x2C
|
||||
__vt__Q23EGG11LightObject = .data:0x8056F098; // type:object size:0x20
|
||||
__vt__Q23EGG12LightTexture = .data:0x8056F0B8; // type:object size:0x38
|
||||
__vt__Q23EGG19LightTextureManager = .data:0x8056F0F0; // type:object size:0x1C
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#ifndef EGG_LIGHT_H
|
||||
#define EGG_LIGHT_H
|
||||
|
||||
#include "egg/prim/eggBinary.h"
|
||||
#include "nw4r/types_nw4r.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
class LightTextureManager;
|
||||
|
||||
// TODO: Fill out more
|
||||
class LightManager : public IBinary<LightManager> {
|
||||
public:
|
||||
struct BinData {};
|
||||
// vt at 0x00
|
||||
LightManager(u32, u32, u8);
|
||||
virtual ~LightManager();
|
||||
virtual void SetBinaryInner(const Bin &) override;
|
||||
virtual void GetBinaryInner(Bin *) const override;
|
||||
virtual size_t GetBinarySize() const override;
|
||||
virtual void SetBinaryInner(const Bin &, const Bin &, f32) override;
|
||||
virtual void Reset();
|
||||
virtual void Calc(nw4r::g3d::ScnRoot *);
|
||||
virtual void CalcView(const nw4r::math::MTX34 &, u8, nw4r::g3d::ScnRoot *);
|
||||
virtual void DoneDraw();
|
||||
|
||||
LightTextureManager *GetTextureMgr() const {
|
||||
return mTextureMgr;
|
||||
}
|
||||
|
||||
u8 TODO_0x04[0x14 - 0x04];
|
||||
LightTextureManager *mTextureMgr;
|
||||
u8 TODO_0x18[0x28 - 0x18];
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,73 @@
|
||||
#ifndef EGG_LIGHT_MANAGER_H
|
||||
#define EGG_LIGHT_MANAGER_H
|
||||
|
||||
#include "egg/egg_types.h"
|
||||
#include "egg/gfx/eggLightObject.h"
|
||||
#include "egg/prim/eggBinary.h"
|
||||
#include "nw4r/types_nw4r.h"
|
||||
#include "rvl/GX/GXLight.h"
|
||||
#include "rvl/GX/GXTypes.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
// TODO: Fill out more
|
||||
class LightManager : public IBinary<LightManager> {
|
||||
struct LightData {
|
||||
/* 0x00 */ LightObject mLightObject;
|
||||
};
|
||||
|
||||
// ???
|
||||
union Counts {
|
||||
struct {
|
||||
/* 0x00 */ u8 mNumEggLightObjects;
|
||||
/* 0x01 */ u8 mNumUnks;
|
||||
};
|
||||
};
|
||||
|
||||
struct Unk1 {
|
||||
/* 0x00 */ GXColor mColor;
|
||||
/* 0x04 */ const char *mStr;
|
||||
/* 0x08 */ u8 field_0x08;
|
||||
};
|
||||
|
||||
public:
|
||||
struct BinData {};
|
||||
// vt at 0x00
|
||||
LightManager(u32, u32, u8);
|
||||
virtual ~LightManager();
|
||||
virtual void SetBinaryInner(const Bin &) override;
|
||||
virtual void GetBinaryInner(Bin *) const override;
|
||||
virtual size_t GetBinarySize() const override;
|
||||
virtual void SetBinaryInner(const Bin &, const Bin &, f32) override;
|
||||
virtual void Reset();
|
||||
virtual void Calc(nw4r::g3d::ScnRoot *);
|
||||
virtual void CalcView(const nw4r::math::MTX34 &, u8, nw4r::g3d::ScnRoot *);
|
||||
virtual void DoneDraw();
|
||||
|
||||
void BecomeInvalidLight(int);
|
||||
|
||||
LightTextureManager *GetTextureMgr() const {
|
||||
return mpTextureMgr;
|
||||
}
|
||||
|
||||
LightObject *GetLightObject(int i) {
|
||||
return &mpLightData[i].mLightObject;
|
||||
}
|
||||
|
||||
/* 0x04 */ Counts mCounts0x04;
|
||||
/* 0x06 */ Counts mCounts0x06;
|
||||
/* 0x08 */ LightData *mpLightData;
|
||||
/* 0x0C */ Unk1 *mpUnk1;
|
||||
/* 0x10 */ GXLightObj *mpLightObjs;
|
||||
/* 0x14 */ LightTextureManager *mpTextureMgr;
|
||||
/* 0x18 */ GXColor mColor;
|
||||
/* 0x1C */ u8 field_0x1C;
|
||||
/* 0x1D */ u8 field_0x1D;
|
||||
/* 0x1E */ u16 mFlags;
|
||||
/* 0x20 */ u32 field_0x20;
|
||||
/* 0x24 */ s16 field_0x24;
|
||||
};
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
#endif
|
||||
@@ -58,6 +58,18 @@ public:
|
||||
return mDist;
|
||||
}
|
||||
|
||||
void SetIndex(u16 index) {
|
||||
mIndex = index;
|
||||
}
|
||||
|
||||
void ClearField0xA0() {
|
||||
field_0xA0 = 0;
|
||||
}
|
||||
|
||||
void ClearFlag4() {
|
||||
mFlags = mFlags & 0xFFFE;
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x04 */ u16 mIndex;
|
||||
/* 0x06 */ u16 field_0x06;
|
||||
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
#ifndef M3D_H
|
||||
#define M3D_H
|
||||
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "egg/gfx/eggFogManager.h"
|
||||
#include "egg/gfx/eggLight.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "m/m_allocator.h"
|
||||
#include "nw4r/g3d/g3d_scnroot.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,74 @@
|
||||
#include "egg/gfx/eggLight.h"
|
||||
#include "egg/gfx/eggLightManager.h"
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "egg/gfx/eggDrawGX.h"
|
||||
#include "egg/gfx/eggLightObject.h"
|
||||
#include "egg/gfx/eggLightTextureMgr.h"
|
||||
#include "rvl/GX/GXLight.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
LightManager::LightManager(u32 p1, u32 p2, u8 p3) {
|
||||
Counts c;
|
||||
c.mNumEggLightObjects = p1;
|
||||
c.mNumUnks = p2;
|
||||
|
||||
mCounts0x04 = c;
|
||||
mCounts0x06 = c;
|
||||
mpLightData = nullptr;
|
||||
mpUnk1 = nullptr;
|
||||
mpTextureMgr = nullptr;
|
||||
|
||||
field_0x1C = p3;
|
||||
mFlags = 0x40;
|
||||
field_0x20 = 0;
|
||||
field_0x24 = -1;
|
||||
|
||||
mpTextureMgr = new LightTextureManager(this);
|
||||
u16 numGxObjs = mCounts0x04.mNumEggLightObjects < 8 ? mCounts0x04.mNumEggLightObjects : 8;
|
||||
mpLightObjs = new GXLightObj[field_0x1C * numGxObjs]();
|
||||
mpLightData = new LightData[mCounts0x04.mNumEggLightObjects]();
|
||||
mpUnk1 = new Unk1[mCounts0x04.mNumUnks]();
|
||||
|
||||
for (int i = 0; i < mCounts0x04.mNumEggLightObjects; i++) {
|
||||
GetLightObject(i)->SetIndex(i);
|
||||
GetLightObject(i)->ClearField0xA0();
|
||||
BecomeInvalidLight(i);
|
||||
}
|
||||
|
||||
for (u16 i = 0; i < (u32)mCounts0x04.mNumUnks; i++) {
|
||||
mpUnk1[i].field_0x08 = 0;
|
||||
}
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
||||
LightManager::~LightManager() {
|
||||
delete mpTextureMgr;
|
||||
delete[] mpLightObjs;
|
||||
delete[] mpLightData;
|
||||
delete[] mpUnk1;
|
||||
}
|
||||
|
||||
static const char *resetPattern = "--";
|
||||
|
||||
void LightManager::Reset() {
|
||||
for (int i = 0; i < mCounts0x04.mNumEggLightObjects; i++) {
|
||||
LightObject *obj = GetLightObject(i);
|
||||
obj->Reset();
|
||||
if (i > 0) {
|
||||
obj->ClearFlag4();
|
||||
}
|
||||
}
|
||||
|
||||
for (u16 i = 0; i < (u32)mCounts0x04.mNumUnks; i++) {
|
||||
mpUnk1[i].mColor = (GXColor){0x64, 0x64, 0x64, 0xFF};
|
||||
mpUnk1[i].mStr = resetPattern;
|
||||
}
|
||||
mColor = DrawGX::BLACK;
|
||||
field_0x1D = 0;
|
||||
mFlags = mFlags & 0xFFE0;
|
||||
}
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
@@ -286,9 +286,9 @@ void LightObject::CopyFromG3D(
|
||||
}
|
||||
} else {
|
||||
// TODO
|
||||
mFlags = mFlags & 0xFFFE;
|
||||
ClearFlag4();
|
||||
if (optObj != nullptr) {
|
||||
optObj->mFlags = optObj->mFlags & 0xFFFE;
|
||||
optObj->ClearFlag4();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -367,8 +367,7 @@ bool LightObject::ApplyAnmResultB(const nw4r::g3d::LightAnmResult &res) {
|
||||
mShininess = res.shininess;
|
||||
return true;
|
||||
} else {
|
||||
// TODO
|
||||
mFlags = mFlags & 0xFFFE;
|
||||
ClearFlag4();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "m/m3d/m3d.h"
|
||||
|
||||
#include "egg/gfx/eggDrawGX.h"
|
||||
#include "egg/gfx/eggFogManager.h"
|
||||
#include "egg/gfx/eggGfxEngine.h"
|
||||
#include "egg/gfx/eggLightManager.h"
|
||||
#include "egg/gfx/eggLightTexture.h"
|
||||
#include "egg/gfx/eggLightTextureMgr.h"
|
||||
#include "egg/gfx/eggScreen.h"
|
||||
@@ -13,6 +15,7 @@
|
||||
#include "nw4r/g3d/g3d_state.h"
|
||||
#include "nw4r/g3d/res/g3d_resmat.h"
|
||||
#include "nw4r/g3d/res/g3d_resmdl.h"
|
||||
|
||||
#include "rvl/GX.h" // IWYU pragma: export
|
||||
|
||||
namespace m3d {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "d/col/bg/d_bg_w_kcol.h"
|
||||
#include "d/d_rawarchive.h"
|
||||
#include "egg/gfx/eggLightTextureMgr.h"
|
||||
#include "egg/gfx/eggLightManager.h"
|
||||
#include "m/m3d/m3d.h"
|
||||
#include "nw4r/g3d.h" // IWYU pragma: export
|
||||
#include "toBeSorted/arc_managers/current_stage_arc_manager.h"
|
||||
|
||||
Reference in New Issue
Block a user