LightTexture close

This commit is contained in:
robojumper
2025-03-27 15:41:44 +01:00
parent 6c5ed3a266
commit 811e774678
6 changed files with 341 additions and 21 deletions
+5 -1
View File
@@ -27,13 +27,13 @@ class LightManager : public IBinary<LightManager> {
};
};
public:
struct AmbientObject {
/* 0x00 */ nw4r::g3d::AmbLightObj mLightObj;
/* 0x04 */ const char *mLightName;
/* 0x08 */ u8 field_0x08;
};
public:
struct BinAmbient {
/* 0x00 */ u8 field_0x00;
/* 0x01 */ u8 field_0x01;
@@ -93,6 +93,10 @@ public:
return &mpLightData[i].mLightObject;
}
const AmbientObject *GetAmbientObject(int i) const {
return &mpAmbientObjects[i];
}
/* 0x04 */ Counts mCounts;
/* 0x06 */ Counts mSavedCounts;
/* 0x08 */ LightData *mpLightData;
+9
View File
@@ -56,6 +56,7 @@ public:
static void initDrawSetting(u16, u16, u16, u16);
void addLight(const EGG::LightObject&);
void fn_804AC0E0(int, const GXColor&, bool);
void draw(int);
void beginDebugDraw();
void debugDraw(int);
@@ -72,6 +73,11 @@ public:
private:
static void fn_804AB270();
static void fn_804AB310(const GXColor &color);
static void fn_804AB440();
static void fn_804AB600();
static void getTexDimensions(u16*, u16*, u16*, u16*, u16);
static void fn_804AC0A0(int, int*, int*);
static void loadTextureData(int index, void *data, GXTexFmt fmt);
@@ -118,6 +124,9 @@ private:
static u16 sDrawNumX;
static u16 sDrawNumY;
static CpuTexture *spNormalEnvironment;
// unsure
static bool sUseDebug;
};
} // namespace EGG
+27
View File
@@ -1,7 +1,9 @@
#ifndef EGG_LIGHT_TEXTURE_MGR_H
#define EGG_LIGHT_TEXTURE_MGR_H
#include "common.h"
#include "egg/gfx/eggLightTexture.h"
#include "egg/gfx/eggLightManager.h"
#include "egg/prim/eggBinary.h"
#include "nw4r/g3d/res/g3d_resmdl.h"
@@ -45,7 +47,32 @@ public:
return mTextureCount;
}
LightTexture *getTextureByName(const char *name) const {
int idx = getTextureIndex(name);
if (idx != -1) {
return mpTextures[idx];
} else {
return nullptr;
}
}
const nw4r::g3d::AmbLightObj &GetAmbientObj(int idx) const {
return mpLightMgr->GetAmbientObject(idx)->mLightObj;
}
const LightObject *GetLightObject(u16 i) const {
return mpObjects[i];
}
LightObject *GetLightObject(u16 i) {
return mpObjects[i];
}
private:
int getTextureIndex(const char *name) const;
/* 0x04 */ u8 field_0x04;
/* 0x06 */ u16 mTextureCount;
/* 0x08 */ LightTexture **mpTextures;