summaryrefslogtreecommitdiff
path: root/include/egg
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-03-27 15:41:44 +0100
committerrobojumper <robojumper@gmail.com>2025-03-27 15:41:44 +0100
commit811e7746780f14a4d26e351d592c79b52072e4df (patch)
treec10ed8ae6213b9001c496b8fe03d1e178fc5be06 /include/egg
parent6c5ed3a266ff5a66f70a269655057d7efbb1afa7 (diff)
LightTexture close
Diffstat (limited to 'include/egg')
-rw-r--r--include/egg/gfx/eggLightManager.h6
-rw-r--r--include/egg/gfx/eggLightTexture.h9
-rw-r--r--include/egg/gfx/eggLightTextureMgr.h27
3 files changed, 41 insertions, 1 deletions
diff --git a/include/egg/gfx/eggLightManager.h b/include/egg/gfx/eggLightManager.h
index c715dcef..b684bd06 100644
--- a/include/egg/gfx/eggLightManager.h
+++ b/include/egg/gfx/eggLightManager.h
@@ -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;
diff --git a/include/egg/gfx/eggLightTexture.h b/include/egg/gfx/eggLightTexture.h
index bb52ed78..419f6d44 100644
--- a/include/egg/gfx/eggLightTexture.h
+++ b/include/egg/gfx/eggLightTexture.h
@@ -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
diff --git a/include/egg/gfx/eggLightTextureMgr.h b/include/egg/gfx/eggLightTextureMgr.h
index 4225e0db..0ce4f1f2 100644
--- a/include/egg/gfx/eggLightTextureMgr.h
+++ b/include/egg/gfx/eggLightTextureMgr.h
@@ -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;