mirror of
https://github.com/zeldaret/mm.git
synced 2025-02-20 05:21:39 +00:00

* Bring over progress from another branch Co-authored-by: Maide <34639600+Kelebek1@users.noreply.github.com> * cleanup, fake match Play_Init * small fixes * Some small cleanup * Match func_80165460 (from debug) * Match func_80165658 * Match func_80165DB8, func_80165DCC, func_80165DF0, func_80165E04 * Match func_80167DE4 (from debug) * Match func_80167F0C * Match func_80168DAC * Matched func_80169100 * Matched func_801691F0 * import D_801DFA18 * match Play_Main thanks to debug * cleanup * synray does it again * add docs from debug * fix func_801656A4 * more docs and cleanup * Match func_80166B30 and diff fake match in Init * import transition docs from OoT * Play Update, sort of * cleanup Play_Update * more cleanup * slightly more docs * small docs * Play_Draw WIP Thanks @petrie911 * progress? * two more matches * format * misc play docs * transitions cleanup * Motion Blur * Transitions * Fog * Bombers notebook + small cleanup * bss * Camera Functions * Picto functions * Init * MotionBlur Clean up * Floor Surface * Pictographs some more * regs * fix circular dependency problem * Cleanup PR commits outside play * namefixer * PR picto * PR audio * PR small clean ups * debug strings * Picto defines * bss * enums * remove void * typedefs * Hireso -> BombersNotebook * bss comments * bss and I8/I5 functions * Smaller PR comments * Transitions * Combine enums * Revert "Combine enums" This reverts commit 0da1ebcaed69a3ce0fbd5942460b67f80f0e15e7. * Fix Transition defines * RGBA16 macros * Unname * worldCoverAlpha * Rename Update and Draw * PR review, plus annotate bug * Clean up nonmatchings with a closer DrawGame * Format * New macros * UpdateMain and DrawMain * Fix merge * Small cleanups from PR * zFar * Intensity macros * Format * Remove bss comments * Compression/decompression * Small cleanup * Format * More PR cleanup * Cleanup picto stuff * format * Fix compression comments * Play processes state enums DONE -> READY * cutscene comment * fix bss Co-authored-by: Maide <34639600+Kelebek1@users.noreply.github.com> Co-authored-by: engineer124 <engineer124engineer124@gmail.com> Co-authored-by: petrie911 <pmontag@PHYS-S129.iowa.uiowa.edu> Co-authored-by: angie <angheloalf95@gmail.com>
92 lines
2.3 KiB
C
92 lines
2.3 KiB
C
#ifndef Z64LIGHT_H
|
|
#define Z64LIGHT_H
|
|
|
|
#include "ultra64.h"
|
|
#include "PR/gbi.h"
|
|
#include "color.h"
|
|
|
|
typedef struct {
|
|
/* 0x00 */ u8 ambientColor[3];
|
|
/* 0x03 */ s8 diffuseDir1[3];
|
|
/* 0x06 */ u8 diffuseColor1[3];
|
|
/* 0x09 */ s8 diffusePos2[3];
|
|
/* 0x0C */ u8 diffuseColor[3];
|
|
/* 0x0F */ u8 fogColor[3];
|
|
/* 0x12 */ s16 fogNear;
|
|
/* 0x14 */ s16 zFar;
|
|
} LightSettings; // size = 0x16
|
|
|
|
typedef struct {
|
|
/* 0x00 */ s16 ambientColor[3];
|
|
/* 0x06 */ s16 diffuseColor1[3];
|
|
/* 0x0C */ s16 diffuseColor2[3];
|
|
/* 0x12 */ s16 fogColor[3];
|
|
/* 0x18 */ s16 fogNear;
|
|
/* 0x1A */ s16 zFar;
|
|
} EnvLightSettings; // size = 0x1C
|
|
|
|
typedef struct {
|
|
/* 0x0 */ s16 x;
|
|
/* 0x2 */ s16 y;
|
|
/* 0x4 */ s16 z;
|
|
/* 0x6 */ u8 color[3];
|
|
/* 0x9 */ u8 drawGlow;
|
|
/* 0xA */ s16 radius;
|
|
} LightPoint; // size = 0xC
|
|
|
|
typedef struct {
|
|
/* 0x0 */ s8 x;
|
|
/* 0x1 */ s8 y;
|
|
/* 0x2 */ s8 z;
|
|
/* 0x3 */ u8 color[3];
|
|
} LightDirectional; // size = 0x6
|
|
|
|
typedef union LightParams {
|
|
LightPoint point;
|
|
LightDirectional dir;
|
|
} LightParams; // size = 0xC
|
|
|
|
typedef struct LightInfo {
|
|
/* 0x0 */ u8 type;
|
|
/* 0x2 */ LightParams params;
|
|
} LightInfo; // size = 0xE
|
|
|
|
typedef struct Lights {
|
|
/* 0x00 */ u8 enablePosLights;
|
|
/* 0x01 */ u8 numLights;
|
|
/* 0x08 */ Lightsn l;
|
|
} Lights; // size = 0x80
|
|
|
|
typedef struct LightNode {
|
|
/* 0x0 */ LightInfo* info;
|
|
/* 0x4 */ struct LightNode* prev;
|
|
/* 0x8 */ struct LightNode* next;
|
|
} LightNode; // size = 0xC
|
|
|
|
#define LIGHTS_BUFFER_SIZE 32
|
|
|
|
typedef struct LightsBuffer {
|
|
/* 0x000 */ s32 numOccupied;
|
|
/* 0x004 */ s32 searchIndex;
|
|
/* 0x008 */ LightNode lights[LIGHTS_BUFFER_SIZE];
|
|
} LightsBuffer; // size = 0x188
|
|
|
|
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
|
|
|
|
typedef enum LightType {
|
|
/* 0 */ LIGHT_POINT_NOGLOW,
|
|
/* 1 */ LIGHT_DIRECTIONAL,
|
|
/* 2 */ LIGHT_POINT_GLOW
|
|
} LightType;
|
|
|
|
typedef void (*LightsBindFunc)(Lights* lights, LightParams* params, Vec3f* vec);
|
|
typedef void (*LightsPosBindFunc)(Lights* lights, LightParams* params, struct PlayState* play);
|
|
|
|
#endif
|