1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Correct gSPFlushTriangles() to make it compatible with WCW Backstage Assault

Fixed issue #95
This commit is contained in:
Sergey Lipskiy 2015-04-01 18:37:32 +06:00
parent da0f5afb44
commit f96d54bd1f
3 changed files with 19 additions and 35 deletions

View File

@ -155,6 +155,8 @@ void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent)
RDP_Init();
G_TRI2 = G_TRI4 = G_QUAD = G_RDPNOOP; // For correct work of gSPFlushTriangles()
switch (m_pCurrent->type) {
case F3D: F3D_Init(); break;
case F3DEX: F3DEX_Init(); break;

16
gSP.cpp
View File

@ -24,6 +24,22 @@
using namespace std;
inline void gSPFlushTriangles()
{
if ((gSP.geometryMode & G_SHADING_SMOOTH) == 0) {
video().getRender().drawTriangles();
return;
}
if (
(RSP.nextCmd != G_TRI1) &&
(RSP.nextCmd != G_TRI2) &&
(RSP.nextCmd != G_TRI4) &&
(RSP.nextCmd != G_QUAD)
)
video().getRender().drawTriangles();
}
void gSPCombineMatrices()
{
MultMatrix(gSP.matrix.projection, gSP.matrix.modelView[gSP.matrix.modelViewi], gSP.matrix.combined);

36
gSP.h
View File

@ -15,41 +15,7 @@
#define CHANGED_CPU_FB_WRITE 0x80
#define CHANGED_TEXTURESCALE 0x100
#if 1 // It causes geometry loss in WCW Backstage Assault. Performance drops in many games when disabled.
#define gSPFlushTriangles() \
if \
( \
( \
(video().getRender().getTrianglesCount() > 1000) || \
((gSP.geometryMode & G_SHADING_SMOOTH) == 0) || \
( \
(RSP.nextCmd != G_NOOP) && \
(RSP.nextCmd != G_RDPNOOP) && \
(RSP.nextCmd != G_MOVEMEM) && \
(RSP.nextCmd != G_ENDDL) && \
(RSP.nextCmd != G_DL) && \
(RSP.nextCmd != G_VTXCOLORBASE) && \
(RSP.nextCmd != G_TRI1) && \
(RSP.nextCmd != G_TRI2) && \
(RSP.nextCmd != G_TRI4) && \
(RSP.nextCmd != G_QUAD) && \
(RSP.nextCmd != G_VTX) && \
(RSP.nextCmd != G_MTX) \
) \
) || \
( \
(RSP.nextCmd != G_TRI1) && \
(RSP.nextCmd != G_TRI2) && \
(RSP.nextCmd != G_TRI4) && \
(RSP.nextCmd != G_QUAD) \
) \
) \
{ \
video().getRender().drawTriangles(); \
}
#else
#define gSPFlushTriangles() video().getRender().drawTriangles();
#endif
//void gSPFlushTriangles();
#define CLIP_X 0x03
#define CLIP_NEGX 0x01