Merge remote-tracking branch 'base/port' into port

This commit is contained in:
Raf committed 2023-09-03 02:45:19 +08:00
commit 488198b7da
3 files changed
+11 -5

No files matched your search

+2
View File
@@ -1183,10 +1183,12 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo
// if (rand()%2) return;
if ((rsp.extra_geometry_mode & G_NO_CLIPPING_EXT) == 0) {
if (v1->clip_rej & v2->clip_rej & v3->clip_rej) {
// The whole triangle lies outside the visible area
return;
}
}
if ((rsp.geometry_mode & G_CULL_BOTH) != 0) {
float dx1 = v1->x / (v1->w) - v2->x / (v2->w);
+8 -5
View File
@@ -855,6 +855,7 @@ Gfx *skyRender(Gfx *gdl)
mtx4MultMtx4(camGetWorldToScreenMtxf(), &g_SkyMtx, mtx);
mtxF2L(mtx, mtx);
gSPSetExtraGeometryModeEXT(gdl++, G_NO_CLIPPING_EXT);
gSPMatrix(gdl++, osVirtualToPhysical(mtx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH);
gSPColor(gdl++, osVirtualToPhysical(cols), numvertices);
gSPVertex(gdl++, osVirtualToPhysical(verts), numvertices, 0);
@@ -863,8 +864,8 @@ Gfx *skyRender(Gfx *gdl)
verts[i].x = watervertices3d[i].x;
verts[i].y = watervertices3d[i].y;
verts[i].z = watervertices3d[i].z;
verts[i].s = watervertices3d[i].s;
verts[i].t = watervertices3d[i].t;
verts[i].s = skyClamp(watervertices3d[i].s, -32768.f, 32767.f);
verts[i].t = skyClamp(watervertices3d[i].t, -32768.f, 32767.f);
verts[i].colour = i * 4;
cols[i].r = watervertices3d[i].r;
cols[i].g = watervertices3d[i].g;
@@ -881,6 +882,7 @@ Gfx *skyRender(Gfx *gdl)
}
gSPPopMatrix(gdl++, G_MTX_MODELVIEW);
gSPClearExtraGeometryModeEXT(gdl++, G_NO_CLIPPING_EXT);
#endif
}
}
@@ -1336,17 +1338,17 @@ Gfx *skyRender(Gfx *gdl)
mtx4MultMtx4(camGetWorldToScreenMtxf(), &g_SkyMtx, mtx);
mtxF2L(mtx, mtx);
gSPSetExtraGeometryModeEXT(gdl++, G_NO_CLIPPING_EXT);
gSPMatrix(gdl++, osVirtualToPhysical(mtx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH);
gSPColor(gdl++, osVirtualToPhysical(cols), numvertices);
gSPVertex(gdl++, osVirtualToPhysical(verts), numvertices, 0);
const f32 iscale = 1.f / scale;
for (s32 i = 0; i < numvertices; ++i) {
verts[i].x = skyvertices3d[i].x;
verts[i].y = skyvertices3d[i].y;
verts[i].z = skyvertices3d[i].z;
verts[i].s = skyvertices3d[i].s;
verts[i].t = skyvertices3d[i].t;
verts[i].s = skyClamp(skyvertices3d[i].s, -32768.f, 32767.f);
verts[i].t = skyClamp(skyvertices3d[i].t, -32768.f, 32767.f);
verts[i].colour = i * 4;
cols[i].r = skyvertices3d[i].r;
cols[i].g = skyvertices3d[i].g;
@@ -1363,6 +1365,7 @@ Gfx *skyRender(Gfx *gdl)
}
gSPPopMatrix(gdl++, G_MTX_MODELVIEW);
gSPClearExtraGeometryModeEXT(gdl++, G_NO_CLIPPING_EXT);
#endif
}
+1
View File
@@ -201,6 +201,7 @@
#define G_ASPECT_RIGHT_EXT 0x00000020
#define G_ASPECT_CENTER_EXT (G_ASPECT_LEFT_EXT | G_ASPECT_RIGHT_EXT)
#define G_ASPECT_MODE_EXT G_ASPECT_CENTER_EXT
#define G_NO_CLIPPING_EXT 0x00000040
/* Extended command macros */