-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document "Normal" Skybox #1955
base: main
Are you sure you want to change the base?
Document "Normal" Skybox #1955
Changes from 1 commit
ded1d61
db8bd19
78f6eee
2a8d49e
8101140
b2000a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,27 @@ typedef enum { | |
/* 5 */ WEATHER_MODE_HEAVY_RAIN // scene must define settings for light config 4 | ||
} WeatherMode; | ||
|
||
typedef enum { | ||
// Clear Sky | ||
SKYBOX_INDEX_CLEAR_SUNRISE, | ||
SKYBOX_INDEX_CLEAR_DAY, | ||
SKYBOX_INDEX_CLEAR_SUNSET, | ||
SKYBOX_INDEX_CLEAR_NIGHT, | ||
// Cloudy Sky | ||
SKYBOX_INDEX_CLOUDY_SUNRISE, | ||
SKYBOX_INDEX_CLOUDY_DAY, | ||
SKYBOX_INDEX_CLOUDY_SUNSET, | ||
SKYBOX_INDEX_CLOUDY_NIGHT, | ||
// Holy (not implemented correctly) | ||
SKYBOX_INDEX_HOLY0, | ||
SKYBOX_INDEX_HOLY_RESERVED_9, | ||
SKYBOX_INDEX_HOLY_RESERVED_10, | ||
SKYBOX_INDEX_HOLY_RESERVED_11, | ||
// Error checking | ||
SKYBOX_INDEX_INIT_MAGIC = 99, // Magic number used to detect a fault during initialization, value unused. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: IMO There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me what makes it magic is that the assigned value of 99 is set but never used by the program; it'd only show up when looking at a memory viewer. |
||
SKYBOX_INDEX_UNDEFINED = 0xFF | ||
} SkyboxIndex; | ||
|
||
typedef enum { | ||
/* 0 */ CHANGE_SKYBOX_INACTIVE, | ||
/* 1 */ CHANGE_SKYBOX_REQUESTED, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,10 @@ typedef struct { | |
|
||
extern SkyboxFile gNormalSkyFiles[]; | ||
|
||
// Tests if the skybox palette for the given skybox should be written to color index 0-127. | ||
// If false, it should be written to color index 128-255 | ||
#define IS_NORMAL_SKY_PALETTE_ALLOC_FRONT(skyboxIndex) ((skyboxIndex & 1) ^ ((skyboxIndex & 4) >> 2)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it should be something more direct, like |
||
|
||
void Skybox_Init(struct GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId); | ||
Mtx* Skybox_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z); | ||
void Skybox_Draw(SkyboxContext* skyboxCtx, struct GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we have a better descriptor than just "index" for this concept in general. Ill take a closer look at this and try to think about it more, but it makes reading all of the code pretty clunky to me.
Dont think "type" works cause this isnt necessarily the skybox type. But looking for something along those lines