mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-06 01:41:11 +00:00
Fix floating point comparisons
This commit is contained in:
parent
1249f37fc5
commit
1654aa34c5
2 changed files with 7 additions and 3 deletions
|
@ -412,7 +412,9 @@ void GenerateVertexNormals(model_t *model)
|
||||||
testY = *testPtr++;
|
testY = *testPtr++;
|
||||||
testZ = *testPtr++;
|
testZ = *testPtr++;
|
||||||
|
|
||||||
if (x != testX || y != testY || z != testZ)
|
if (fabsf(x - testX) > FLT_EPSILON
|
||||||
|
|| fabsf(y - testY) > FLT_EPSILON
|
||||||
|
|| fabsf(z - testZ) > FLT_EPSILON)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Found a vertex match! Add it...
|
// Found a vertex match! Add it...
|
||||||
|
|
|
@ -964,7 +964,7 @@ EXPORT void HWRAPI(Draw2DLine) (F2DCoord * v1,
|
||||||
c.alpha = byte2float[Color.s.alpha];
|
c.alpha = byte2float[Color.s.alpha];
|
||||||
|
|
||||||
// This is the preferred, 'modern' way of rendering lines -- creating a polygon.
|
// This is the preferred, 'modern' way of rendering lines -- creating a polygon.
|
||||||
if (v2->x != v1->x)
|
if (fabsf(v2->x - v1->x) > FLT_EPSILON)
|
||||||
angle = (float)atan((v2->y-v1->y)/(v2->x-v1->x));
|
angle = (float)atan((v2->y-v1->y)/(v2->x-v1->x));
|
||||||
else
|
else
|
||||||
angle = (float)N_PI_DEMI;
|
angle = (float)N_PI_DEMI;
|
||||||
|
@ -1770,7 +1770,7 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
|
||||||
if (nextFrameIndex != -1)
|
if (nextFrameIndex != -1)
|
||||||
nextframe = &mesh->tinyframes[nextFrameIndex % mesh->numFrames];
|
nextframe = &mesh->tinyframes[nextFrameIndex % mesh->numFrames];
|
||||||
|
|
||||||
if (!nextframe || pol == 0.0f)
|
if (!nextframe || fpclassify(pol) == FP_ZERO)
|
||||||
{
|
{
|
||||||
pglVertexPointer(3, GL_SHORT, 0, frame->vertices);
|
pglVertexPointer(3, GL_SHORT, 0, frame->vertices);
|
||||||
pglNormalPointer(GL_BYTE, 0, frame->normals);
|
pglNormalPointer(GL_BYTE, 0, frame->normals);
|
||||||
|
@ -2151,6 +2151,8 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
||||||
|
|
||||||
INT32 fademaskdownloaded = tex_downloaded; // the fade mask that has been set
|
INT32 fademaskdownloaded = tex_downloaded; // the fade mask that has been set
|
||||||
|
|
||||||
|
(void)alpha;
|
||||||
|
|
||||||
// Use a power of two texture, dammit
|
// Use a power of two texture, dammit
|
||||||
if(screen_width <= 1024)
|
if(screen_width <= 1024)
|
||||||
texsize = 1024;
|
texsize = 1024;
|
||||||
|
|
Loading…
Reference in a new issue