diff --git a/src/doomdef.h b/src/doomdef.h index fbfcf573..d5ba877c 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -428,6 +428,15 @@ INT32 I_GetKey(void); #define max(x, y) (((x) > (y)) ? (x) : (y)) #endif +// Floating point comparison epsilons from float.h +#ifndef FLT_EPSILON +#define FLT_EPSILON 1.1920928955078125e-7f +#endif + +#ifndef DBL_EPSILON +#define DBL_EPSILON 2.2204460492503131e-16 +#endif + // An assert-type mechanism. #ifdef PARANOIA #define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__)) diff --git a/src/r_data.c b/src/r_data.c index e0b9a814..a21ba49a 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1220,7 +1220,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) continue; if (maskcolor == extra_colormaps[i].maskcolor && fadecolor == extra_colormaps[i].fadecolor - && fabsf((float)(maskamt - extra_colormaps[i].maskamt)) < 1.0E-36f + && fabs(maskamt - extra_colormaps[i].maskamt) < DBL_EPSILON && fadestart == extra_colormaps[i].fadestart && fadeend == extra_colormaps[i].fadeend && fog == extra_colormaps[i].fog) diff --git a/src/r_segs.c b/src/r_segs.c index 6bdc8eab..6d6ba1ef 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1126,9 +1126,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) // Get data for the column col = (column_t *)((UINT8 *)R_GetColumn(texnum,maskedtexturecol[dc_x]) - 3); - // guess what I just fixed? -monster psychic cat - dc_colormap = colormaps; - // SoM: New code does not rely on R_DrawColumnShadowed_8 which // will (hopefully) put less strain on the stack. if (dc_numlights)