mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-03-15 04:13:59 +03:00
Interpolated stars
This commit is contained in:
parent
9da016bac9
commit
13fd4ece9f
@ -142,7 +142,6 @@ static Gfx starSetupDL[] = {
|
|||||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), // Disable texturing
|
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 |
|
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_CULL_BACK |
|
||||||
G_SHADING_SMOOTH),
|
G_SHADING_SMOOTH),
|
||||||
//gsDPPipeSync(),
|
|
||||||
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE), // Use primitive color
|
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 |
|
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_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||||
@ -171,8 +170,6 @@ void Background_DrawStarfield(void) {
|
|||||||
float vy;
|
float vy;
|
||||||
const float STAR_MARGIN = 10.0f; // Margin to hide seam stars
|
const float STAR_MARGIN = 10.0f; // Margin to hide seam stars
|
||||||
|
|
||||||
FrameInterpolation_RecordOpenChild("Starfield", 0);
|
|
||||||
|
|
||||||
// Set projection to orthographic before drawing stars
|
// Set projection to orthographic before drawing stars
|
||||||
Lib_InitOrtho(&gMasterDisp);
|
Lib_InitOrtho(&gMasterDisp);
|
||||||
|
|
||||||
@ -216,6 +213,7 @@ void Background_DrawStarfield(void) {
|
|||||||
zCos = __cosf(gStarfieldRoll);
|
zCos = __cosf(gStarfieldRoll);
|
||||||
zSin = __sinf(gStarfieldRoll);
|
zSin = __sinf(gStarfieldRoll);
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < starCount; i++, yStar++, xStar++, color++) {
|
for (i = 0; i < starCount; i++, yStar++, xStar++, color++) {
|
||||||
// Adjust star positions with field offsets
|
// Adjust star positions with field offsets
|
||||||
bx = *xStar + xField;
|
bx = *xStar + xField;
|
||||||
@ -248,11 +246,7 @@ void Background_DrawStarfield(void) {
|
|||||||
// Check if the star is within the visible screen area with margin
|
// Check if the star is within the visible screen area with margin
|
||||||
if ((vx >= STAR_MARGIN) && (vx < currentScreenWidth - STAR_MARGIN) && (vy >= STAR_MARGIN) &&
|
if ((vx >= STAR_MARGIN) && (vx < currentScreenWidth - STAR_MARGIN) && (vy >= STAR_MARGIN) &&
|
||||||
(vy < currentScreenHeight - STAR_MARGIN)) {
|
(vy < currentScreenHeight - STAR_MARGIN)) {
|
||||||
// @recomp Tag the transform.
|
FrameInterpolation_RecordOpenChild("Starfield", i);
|
||||||
// gEXMatrixGroupDecomposed(gMasterDisp++, TAG_STARFIELD + i, G_EX_PUSH, G_MTX_MODELVIEW,
|
|
||||||
// G_EX_COMPONENT_AUTO, G_EX_COMPONENT_AUTO, G_EX_COMPONENT_AUTO,
|
|
||||||
// G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_SKIP,
|
|
||||||
// G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_AUTO, G_EX_EDIT_ALLOW);
|
|
||||||
|
|
||||||
// Translate to (vx, vy) in ortho coordinates
|
// Translate to (vx, vy) in ortho coordinates
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
@ -276,7 +270,7 @@ void Background_DrawStarfield(void) {
|
|||||||
gSPDisplayList(gMasterDisp++, starDL);
|
gSPDisplayList(gMasterDisp++, starDL);
|
||||||
|
|
||||||
// Pop the transform id
|
// Pop the transform id
|
||||||
// gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW);
|
FrameInterpolation_RecordCloseChild();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -287,8 +281,6 @@ void Background_DrawStarfield(void) {
|
|||||||
// Finalize rendering state
|
// Finalize rendering state
|
||||||
gDPPipeSync(gMasterDisp++);
|
gDPPipeSync(gMasterDisp++);
|
||||||
gDPSetColorDither(gMasterDisp++, G_CD_MAGICSQ);
|
gDPSetColorDither(gMasterDisp++, G_CD_MAGICSQ);
|
||||||
|
|
||||||
FrameInterpolation_RecordCloseChild();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in the Epilogue
|
void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in the Epilogue
|
||||||
@ -312,8 +304,6 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in
|
|||||||
float starfieldWidth = 1.0f * currentScreenWidth;
|
float starfieldWidth = 1.0f * currentScreenWidth;
|
||||||
float starfieldHeight = 1.0f * currentScreenHeight;
|
float starfieldHeight = 1.0f * currentScreenHeight;
|
||||||
|
|
||||||
FrameInterpolation_RecordOpenChild("Starfield", 0);
|
|
||||||
|
|
||||||
// Graphics pipeline setup
|
// Graphics pipeline setup
|
||||||
gDPPipeSync(gMasterDisp++);
|
gDPPipeSync(gMasterDisp++);
|
||||||
gDPSetCycleType(gMasterDisp++, G_CYC_FILL);
|
gDPSetCycleType(gMasterDisp++, G_CYC_FILL);
|
||||||
@ -362,11 +352,7 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in
|
|||||||
// Check if the star is within the visible screen area
|
// Check if the star is within the visible screen area
|
||||||
if ((vx >= 0) && (vx < currentScreenWidth) && (yMin < vy) && (vy < yMax)) {
|
if ((vx >= 0) && (vx < currentScreenWidth) && (yMin < vy) && (vy < yMax)) {
|
||||||
// Tag the transform. Assuming TAG_STARFIELD is a defined base tag value
|
// Tag the transform. Assuming TAG_STARFIELD is a defined base tag value
|
||||||
// @recomp Tag the transform.
|
FrameInterpolation_RecordOpenChild("SmallStarfield", i);
|
||||||
// gEXMatrixGroupDecomposed(gMasterDisp++, TAG_STARFIELD + i, G_EX_PUSH, G_MTX_MODELVIEW, G_EX_COMPONENT_AUTO,
|
|
||||||
// G_EX_COMPONENT_AUTO, G_EX_COMPONENT_AUTO, G_EX_COMPONENT_INTERPOLATE,
|
|
||||||
// G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE,
|
|
||||||
// G_EX_ORDER_AUTO, G_EX_EDIT_ALLOW);
|
|
||||||
// Translate to (vx, vy) in ortho coordinates
|
// Translate to (vx, vy) in ortho coordinates
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
Matrix_Translate(gGfxMatrix, vx - (currentScreenWidth / 2.0f), -(vy - (currentScreenHeight / 2.0f)), 0.0f,
|
Matrix_Translate(gGfxMatrix, vx - (currentScreenWidth / 2.0f), -(vy - (currentScreenHeight / 2.0f)), 0.0f,
|
||||||
@ -389,12 +375,11 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in
|
|||||||
gSPDisplayList(gMasterDisp++, starDLPartial);
|
gSPDisplayList(gMasterDisp++, starDLPartial);
|
||||||
|
|
||||||
// Pop the transform id
|
// Pop the transform id
|
||||||
// gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW);
|
FrameInterpolation_RecordCloseChild();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gDPPipeSync(gMasterDisp++);
|
gDPPipeSync(gMasterDisp++);
|
||||||
gDPSetColorDither(gMasterDisp++, G_CD_MAGICSQ);
|
gDPSetColorDither(gMasterDisp++, G_CD_MAGICSQ);
|
||||||
FrameInterpolation_RecordCloseChild();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_bg_8003E1E0(void) {
|
void func_bg_8003E1E0(void) {
|
||||||
|
@ -1505,8 +1505,8 @@ void Display_ActorMarks(void) {
|
|||||||
RCP_SetupDL_40();
|
RCP_SetupDL_40();
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(gTeamArrowsViewPos); i++) {
|
for (i = 0; i < ARRAY_COUNT(gTeamArrowsViewPos); i++) {
|
||||||
FrameInterpolation_RecordOpenChild(&gTeamArrowsViewPos[i], i);
|
|
||||||
if (gTeamArrowsViewPos[i].z < 0.0f) {
|
if (gTeamArrowsViewPos[i].z < 0.0f) {
|
||||||
|
FrameInterpolation_RecordOpenChild(&gTeamArrowsViewPos[i], i);
|
||||||
var_fs0 = (VEC3F_MAG(&gTeamArrowsViewPos[i])) * 0.0015f;
|
var_fs0 = (VEC3F_MAG(&gTeamArrowsViewPos[i])) * 0.0015f;
|
||||||
if (var_fs0 > 100.0f) {
|
if (var_fs0 > 100.0f) {
|
||||||
var_fs0 = 100.0f;
|
var_fs0 = 100.0f;
|
||||||
@ -1533,10 +1533,10 @@ void Display_ActorMarks(void) {
|
|||||||
gSPDisplayList(gMasterDisp++, sTeammateMarkDLs[i]);
|
gSPDisplayList(gMasterDisp++, sTeammateMarkDLs[i]);
|
||||||
}
|
}
|
||||||
Matrix_Pop(&gGfxMatrix);
|
Matrix_Pop(&gGfxMatrix);
|
||||||
|
FrameInterpolation_RecordCloseChild();
|
||||||
}
|
}
|
||||||
gTeamArrowsViewPos[i].x = gTeamArrowsViewPos[i].y = 0;
|
gTeamArrowsViewPos[i].x = gTeamArrowsViewPos[i].y = 0;
|
||||||
gTeamArrowsViewPos[i].z = 100.0f;
|
gTeamArrowsViewPos[i].z = 100.0f;
|
||||||
FrameInterpolation_RecordCloseChild();
|
|
||||||
}
|
}
|
||||||
gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP);
|
gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP);
|
||||||
}
|
}
|
||||||
@ -1551,6 +1551,7 @@ void Display_LockOnIndicator(void) {
|
|||||||
if (gLockOnTargetViewPos[i].z < 0.0f) {
|
if (gLockOnTargetViewPos[i].z < 0.0f) {
|
||||||
var_fs0 = VEC3F_MAG(&gLockOnTargetViewPos[i]);
|
var_fs0 = VEC3F_MAG(&gLockOnTargetViewPos[i]);
|
||||||
if (var_fs0 < 20000.0f) {
|
if (var_fs0 < 20000.0f) {
|
||||||
|
FrameInterpolation_RecordOpenChild("LcckOnIndicator", 0);
|
||||||
var_fs0 *= 0.0015f;
|
var_fs0 *= 0.0015f;
|
||||||
if (var_fs0 > 100.0f) {
|
if (var_fs0 > 100.0f) {
|
||||||
var_fs0 = 100.0f;
|
var_fs0 = 100.0f;
|
||||||
@ -1575,6 +1576,7 @@ void Display_LockOnIndicator(void) {
|
|||||||
gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255);
|
gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255);
|
||||||
gSPDisplayList(gMasterDisp++, D_1024F60);
|
gSPDisplayList(gMasterDisp++, D_1024F60);
|
||||||
Matrix_Pop(&gGfxMatrix);
|
Matrix_Pop(&gGfxMatrix);
|
||||||
|
FrameInterpolation_RecordCloseChild();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user