diff --git a/libs/video/renderer/sw/d_polyse.c b/libs/video/renderer/sw/d_polyse.c index 816f22c78..88db40c25 100644 --- a/libs/video/renderer/sw/d_polyse.c +++ b/libs/video/renderer/sw/d_polyse.c @@ -173,7 +173,7 @@ D_PolysetSetEdgeTable (void) #ifndef USE_INTEL_ASM -void +static void D_PolysetRecursiveTriangle (int *lp1, int *lp2, int *lp3) { int *temp; @@ -250,7 +250,7 @@ D_PolysetRecursiveTriangle (int *lp1, int *lp2, int *lp3) } -void +static void D_DrawSubdiv (void) { mtriangle_t *ptri; @@ -302,7 +302,7 @@ D_DrawSubdiv (void) } -void +static void D_DrawNonSubdiv (void) { mtriangle_t *ptri; diff --git a/libs/video/renderer/sw/sw_redge.c b/libs/video/renderer/sw/sw_redge.c index 9182336b3..7c191de09 100644 --- a/libs/video/renderer/sw/sw_redge.c +++ b/libs/video/renderer/sw/sw_redge.c @@ -253,7 +253,7 @@ R_StepActiveU (edge_t *pedge) #ifndef USE_INTEL_ASM -void +static void R_LeadingEdge (edge_t *edge) { espan_t *span; @@ -362,6 +362,64 @@ R_LeadingEdge (edge_t *edge) } } +static void +R_TrailingEdge (surf_t *surf, edge_t *edge) +{ + espan_t *span; + int iu; + + // don't generate a span if this is an inverted span, with the end edge + // preceding the start edge (that is, we haven't seen the start edge yet) + if (--surf->spanstate == 0) { + if (surf->insubmodel) + r_bmodelactive--; + + if (surf == surfaces[1].next) { + // emit a span (current top going away) + iu = edge->u >> 20; + if (iu > surf->last_u) { + span = span_p++; + span->u = surf->last_u; + span->count = iu - span->u; + span->v = current_iv; + span->pnext = surf->spans; + surf->spans = span; + } + // set last_u on the surface below + surf->next->last_u = iu; + } + + surf->prev->next = surf->next; + surf->next->prev = surf->prev; + } +} + +static void +R_CleanupSpan (void) +{ + surf_t *surf; + int iu; + espan_t *span; + + // now that we've reached the right edge of the screen, we're done with any + // unfinished surfaces, so emit a span for whatever's on top + surf = surfaces[1].next; + iu = edge_tail_u_shift20; + if (iu > surf->last_u) { + span = span_p++; + span->u = surf->last_u; + span->count = iu - span->u; + span->v = current_iv; + span->pnext = surf->spans; + surf->spans = span; + } + // reset spanstate for all surfaces in the surface stack + do { + surf->spanstate = 0; + surf = surf->next; + } while (surf != &surfaces[1]); +} + void R_GenerateSpans (void) { diff --git a/libs/video/renderer/sw/sw_rsprite.c b/libs/video/renderer/sw/sw_rsprite.c index 25ba9d7f8..880aad79d 100644 --- a/libs/video/renderer/sw/sw_rsprite.c +++ b/libs/video/renderer/sw/sw_rsprite.c @@ -116,7 +116,7 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane) if (dists[i] == 0 || dists[i + 1] == 0) continue; -#if __APPLE_CC__ == 1173 +#if __APPLE_CC__ <= 1175 // bug in gcc (GCC) 3.1 20020420 (prerelease) for darwin if ((dists[i] > 0) && (dists[i + 1] > 0)) continue;