Browse Source

ref_soft: Bound texcoords again, disable drawing spans on FloorDivMod overflow

pull/2/head
mittorn 6 years ago
parent
commit
0c6c0003b1
  1. 11
      r_polyse.c
  2. 4
      r_triapi.c

11
r_polyse.c

@ -105,6 +105,11 @@ byte *skinstart;
void (*d_pdrawspans)(spanpackage_t *pspanpackage); void (*d_pdrawspans)(spanpackage_t *pspanpackage);
void R_PolysetStub (spanpackage_t *pspanpackage)
{
}
void R_PolysetDrawSpans8_33 (spanpackage_t *pspanpackage); void R_PolysetDrawSpans8_33 (spanpackage_t *pspanpackage);
void R_PolysetDrawSpans8_66 (spanpackage_t *pspanpackage); void R_PolysetDrawSpans8_66 (spanpackage_t *pspanpackage);
void R_PolysetDrawSpans8_Opaque (spanpackage_t *pspanpackage); void R_PolysetDrawSpans8_Opaque (spanpackage_t *pspanpackage);
@ -308,12 +313,16 @@ void FloorDivMod (float numer, float denom, int *quotient,
} }
if( q > INT_MAX / 2 || q < INT_MIN / 2 ) if( q > INT_MAX / 2 || q < INT_MIN / 2 )
{ {
gEngfuncs.Con_Printf( S_ERROR"FloorDivMod: q overflow!\n" ); int i;
d_pdrawspans = R_PolysetStub;
gEngfuncs.Con_Printf( S_ERROR "FloorDivMod: q overflow!\n" );
q = 1; q = 1;
} }
if( r > INT_MAX / 2 || r < INT_MIN / 2 ) if( r > INT_MAX / 2 || r < INT_MIN / 2 )
{ {
int i;
d_pdrawspans = R_PolysetStub;
gEngfuncs.Con_Printf( S_ERROR "FloorDivMod: r overflow!\n"); gEngfuncs.Con_Printf( S_ERROR "FloorDivMod: r overflow!\n");
r = 1; r = 1;
} }

4
r_triapi.c

@ -245,8 +245,8 @@ void TriTexCoord2f( volatile float u, volatile float v )
v1 = v1 - 1; v1 = v1 - 1;
s = r_affinetridesc.skinwidth * bound(0,u1,1); s = r_affinetridesc.skinwidth * bound(0.01,u1,0.99);
t = r_affinetridesc.skinheight * bound(0,v1,1); t = r_affinetridesc.skinheight * bound(0.01,v1,0.99);
} }
/* /*

Loading…
Cancel
Save