mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
Use DBL_EPSILON for colormap comparison
This commit is contained in:
parent
58728ec358
commit
e9e5128754
2 changed files with 7 additions and 1 deletions
|
@ -410,6 +410,10 @@ INT32 I_GetKey(void);
|
|||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
// Floating point comparison epsilons from float.h
|
||||
#define FLT_EPSILON 1.1920928955078125e-7f
|
||||
#define DBL_EPSILON 2.2204460492503131e-16
|
||||
|
||||
// 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__))
|
||||
|
|
|
@ -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
|
||||
&& fabs(maskamt - extra_colormaps[i].maskamt) < 1.0E-36
|
||||
&& fabs(maskamt - extra_colormaps[i].maskamt) < DBL_EPSILON
|
||||
&& fadestart == extra_colormaps[i].fadestart
|
||||
&& fadeend == extra_colormaps[i].fadeend
|
||||
&& fog == extra_colormaps[i].fog)
|
||||
|
@ -1229,6 +1229,8 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
|
|||
}
|
||||
}
|
||||
|
||||
CONS_Printf("Making a new colormap\n");
|
||||
|
||||
if (num_extra_colormaps == MAXCOLORMAPS)
|
||||
I_Error("R_CreateColormap: Too many colormaps! the limit is %d\n", MAXCOLORMAPS);
|
||||
|
||||
|
|
Loading…
Reference in a new issue