Fixed stars

This commit is contained in:
KiritoDv
2024-10-16 12:46:04 -06:00
parent b925cabee9
commit 0b23e06b77
3 changed files with 20 additions and 18 deletions
+1
View File
@@ -209,6 +209,7 @@ void Effect_Update(Effect*);
void TexturedLine_Update(TexturedLine*);
void TexturedLine_UpdateAll(void);
void Object_Update(void);
float FloatMod(float a, float b);
//fox_enmy2
void Actor237_Update(Actor*);
+6 -6
View File
@@ -66,12 +66,12 @@ typedef struct {
typedef struct {
/* 0x00000 */ SPTask task;
/* 0x00050 */ Vp viewports[0x10];
/* 0x00150 */ Mtx mtx[0x480];
/* 0x12150 */ Gfx unkDL1[0x180];
/* 0x12D50 */ Gfx masterDL[0x1380];
/* 0x1C950 */ Gfx unkDL2[0xD80];
/* 0x23550 */ Lightsn lights[0x100];
/* 0x00050 */ Vp viewports[0x10 * 4];
/* 0x00150 */ Mtx mtx[0x480 * 4];
/* 0x12150 */ Gfx unkDL1[0x180 * 4];
/* 0x12D50 */ Gfx masterDL[0x1380 * 4];
/* 0x1C950 */ Gfx unkDL2[0xD80 * 4];
/* 0x23550 */ Lightsn lights[0x100 * 4];
} GfxPool; // size = 0x2AD50, 0x8 aligned
void Controller_Init(void);
+13 -12
View File
@@ -136,6 +136,19 @@ static Gfx starDLPartial[] = {
gsSPEndDisplayList(),
};
// Setup render state for stars
static Gfx starSetupDL[] = {
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), // Disable texturing
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_CULL_BACK |
G_SHADING_SMOOTH),
//gsDPPipeSync(),
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE), // Use primitive color
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_OPA_SURF | G_RM_OPA_SURF2),
gsSPEndDisplayList(),
};
// @port: Starfield drawn with triangles, re-engineered by @Tharo & @TheBoy181
void Background_DrawStarfield(void) {
f32 by;
@@ -160,18 +173,6 @@ void Background_DrawStarfield(void) {
// Set projection to orthographic before drawing stars
Lib_InitOrtho(&gMasterDisp);
// Setup render state for stars
static Gfx starSetupDL[] = {
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), // Disable texturing
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_CULL_BACK |
G_SHADING_SMOOTH),
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE), // Use primitive color
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_OPA_SURF | G_RM_OPA_SURF2),
gsSPEndDisplayList(),
};
gSPDisplayList(gMasterDisp++, starSetupDL);
// Get current screen dimensions