summaryrefslogtreecommitdiff
path: root/include/m_lights.h
diff options
context:
space:
mode:
authorMaide <34639600+Kelebek1@users.noreply.github.com>2023-08-19 01:53:53 +0100
committerGitHub <noreply@github.com>2023-08-18 17:53:53 -0700
commit7562124372f89c41c6ccfd1e18398c10c8e83814 (patch)
treedd8fbe34f5694cec267256d5a1a3951f7d002db3 /include/m_lights.h
parentc863d781327c1d371cb81ad31a4fd06b53e1b953 (diff)
m_lights (#54)
* m_lights * PR * fix * PR * a * Remove syms * Rebase and PR * Remove sym * Fix syms --------- Co-authored-by: Maide <you@example.com> Co-authored-by: emilybrooks <emilybrooksemilybrooks@gmail.com>
Diffstat (limited to 'include/m_lights.h')
-rw-r--r--include/m_lights.h110
1 files changed, 75 insertions, 35 deletions
diff --git a/include/m_lights.h b/include/m_lights.h
index 0fbdb59..740b5e2 100644
--- a/include/m_lights.h
+++ b/include/m_lights.h
@@ -5,50 +5,90 @@
#include "z64math.h"
#include "unk.h"
#include "color.h"
+#include "gbi.h"
struct GraphicsContext;
struct Game_Play;
+typedef struct LightPoint {
+ /* 0x0 */ s16 x;
+ /* 0x2 */ s16 y;
+ /* 0x4 */ s16 z;
+ /* 0x6 */ u8 color[3];
+ /* 0x9 */ u8 drawGlow;
+ /* 0xA */ s16 radius;
+} LightPoint; // size = 0xC
+
+typedef struct LightDiffuse {
+ /* 0x0 */ s8 x;
+ /* 0x1 */ s8 y;
+ /* 0x2 */ s8 z;
+ /* 0x3 */ u8 color[3];
+} LightDiffuse; // size = 0x6
+
+typedef union {
+ LightPoint point;
+ LightDiffuse diffuse;
+} LightParams; // size = 0xC
+
typedef struct Lights {
- /* 0x00 */ UNK_TYPE1 unk_00[0x80];
-} Lights; // size = 0x80
+ /* 0x00 */ u8 type;
+ /* 0x04 */ LightParams lights;
+} Lights; // size = 0x10
typedef struct LightNode {
- /* 0x00 */ char unk00[0xC];
+ /* 0x0 */ Lights* info;
+ /* 0x4 */ struct LightNode* prev;
+ /* 0x8 */ struct LightNode* next;
} LightNode; // size = 0xC
-typedef struct LightContext {
- /* 0x0 */ LightNode* listHead;
- /* 0x4 */ Color_RGB8 ambient;
- /* 0x7 */ Color_RGB8 fogColor;
- /* 0xA */ s16 fogNear; // how close until fog starts taking effect. range 0 - 996
- /* 0xC */ s16 zFar; // draw distance. range 0 - 12800
-} LightContext; // size = 0x10
-
-// void func_8009B1E0_jp();
-// void func_8009B23C_jp();
-// void func_8009B2A0_jp();
-// void func_8009B308_jp();
-// void func_8009B33C_jp();
-// void func_8009B394_jp();
-void LightsN_disp(Lights* light, struct GraphicsContext* gfxCtx);
-// void func_8009B504_jp();
-// void func_8009B534_jp();
-// void func_8009B72C_jp();
-// void func_8009B81C_jp();
-void LightsN_list_check(Lights* light, LightNode* lightNode, Vec3f* arg2);
-// void func_8009B954_jp();
-// void func_8009B9E0_jp();
-void Global_light_ct(LightContext* arg0);
-// void func_8009BA94_jp();
-// void func_8009BAC0_jp();
-Lights* Global_light_read(LightContext* lightCtx, struct GraphicsContext* gfxCtx);
-// void func_8009BB34_jp();
-// void func_8009BB40_jp();
-// void func_8009BB8C_jp();
-// void func_8009BBEC_jp();
-// void func_8009BC48_jp();
-// void func_8009BD90_jp();
+typedef struct LightBuffer {
+ /* 0x00 */ s32 current;
+ /* 0x04 */ s32 idx;
+ /* 0x08 */ LightNode lights[32];
+} LightBuffer; // size = 0x188
+
+typedef struct LightsN {
+ /* 0x00 */ u8 diffuse_count;
+ /* 0x08 */ Lightsn lights;
+}LightsN; // size = 0x80
+
+typedef struct Global_light {
+ /* 0x0 */ LightNode* list;
+ /* 0x4 */ u8 ambientColor[3];
+ /* 0x7 */ u8 fogColor[3];
+ /* 0xA */ s16 fogNear;
+ /* 0xC */ s16 fogFar;
+} Global_light; // size = 0x10
+
+typedef void (*light_point_proc)(LightsN*, LightParams*, Vec3f*);
+typedef void (*light_P_point_proc)(LightsN*, LightParams*, Vec3f*);
+
+void point_data_set(Lights* lights, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius, s32 type);
+void Light_point_ct(Lights* lights, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius);
+void Light_point2_ct(Lights* lights, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius);
+void Light_point_color_set(Lights* lights, u8 r, u8 g, u8 b, s16 radius);
+void Light_diffuse_ct(Lights* lights, s8 x, s8 y, s8 z, u8 r, u8 g, u8 b);
+void LightsN_ct(LightsN* lights, u8 r, u8 g, u8 b);
+void LightsN_disp(LightsN* lights, struct GraphicsContext* gfxCtx);
+Light* LightsN_new_diffuse(LightsN* lights);
+void LightsN__point_proc(LightsN* lights, LightParams* lightInfo, Vec3f* point);
+void LightsN__P_point_proc(LightsN* lights, LightParams* lightInfo, Vec3f* pos);
+void LightsN__diffuse_proc(LightsN* lights, LightParams* lightInfo, Vec3f* pos);
+void LightsN_list_check(LightsN* lights, LightNode* node, Vec3f* pos);
+LightNode* Light_list_buf_new(void);
+void Light_list_buf_delete(LightNode* lightNode);
+void Global_light_ct(Global_light* glight);
+void Global_light_ambient_set(Global_light* glight, u8 r, u8 g, u8 b);
+void Global_light_fog_set(Global_light* glight, u8 r, u8 g, u8 b, s16 near, s16 far);
+LightsN* Global_light_read(Global_light* glight, struct GraphicsContext* gfxCtx);
+void Global_light_list_ct(Global_light* glight);
+void Global_light_list_dt(Global_light* glight);
+LightNode* Global_light_list_new(struct Game_Play* play, Global_light* glight, Lights* light);
+void Global_light_list_delete(Global_light* glight, LightNode* lightNode);
+LightsN* new_Lights(struct GraphicsContext* gfxCtx, u8 ambient_r, u8 ambient_g, u8 ambient_b, u8 count, u8 light_r,
+ u8 light_g, u8 light_b, s8 dir_x, s8 dir_y, s8 dir_z);
+LightsN* new_LightsN(struct GraphicsContext* gfxCtx, u8 r, u8 g, u8 b);
void Light_list_point_draw(struct Game_Play* game_play);
#endif