mirror of
https://github.com/reactos/reactos.git
synced 2024-08-02 17:40:58 +00:00
[WINED3D]
- Do not rely on undefined behavior to get values easily accessible as constants. - Quick build fix. Will be sent to Wine, possibly modified. svn path=/trunk/; revision=56432
This commit is contained in:
parent
3c49ba735f
commit
46a246e79b
|
@ -23,6 +23,4 @@ add_subdirectory(d3dx9_40)
|
||||||
add_subdirectory(d3dx9_41)
|
add_subdirectory(d3dx9_41)
|
||||||
add_subdirectory(d3dx9_42)
|
add_subdirectory(d3dx9_42)
|
||||||
add_subdirectory(ddraw)
|
add_subdirectory(ddraw)
|
||||||
if(NOT MSVC)
|
add_subdirectory(wined3d)
|
||||||
add_subdirectory(wined3d)
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -1042,7 +1042,7 @@ void state_fogstartend(struct wined3d_context *context, const struct wined3d_sta
|
||||||
fogend = tmpvalue.f;
|
fogend = tmpvalue.f;
|
||||||
/* In GL, fogstart == fogend disables fog, in D3D everything's fogged.*/
|
/* In GL, fogstart == fogend disables fog, in D3D everything's fogged.*/
|
||||||
if(fogstart == fogend) {
|
if(fogstart == fogend) {
|
||||||
fogstart = -1.0f / 0.0f;
|
fogstart = -INFINITY;
|
||||||
fogend = 0.0f;
|
fogend = 0.0f;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -199,8 +199,8 @@ static inline float float_16_to_32(const unsigned short *in) {
|
||||||
} else if(e < 31) {
|
} else if(e < 31) {
|
||||||
return sgn * powf(2, (float)e - 15.0f) * (1.0f + ((float)m / 1024.0f));
|
return sgn * powf(2, (float)e - 15.0f) * (1.0f + ((float)m / 1024.0f));
|
||||||
} else {
|
} else {
|
||||||
if(m == 0) return sgn / 0.0f; /* +INF / -INF */
|
if(m == 0) return sgn * INFINITY; /* +INF / -INF */
|
||||||
else return 0.0f / 0.0f; /* NAN */
|
else return NAN; /* NAN */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,8 +221,8 @@ static inline float float_24_to_32(DWORD in)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m == 0) return sgn / 0.0f; /* +INF / -INF */
|
if (m == 0) return sgn * INFINITY; /* +INF / -INF */
|
||||||
else return 0.0f / 0.0f; /* NAN */
|
else return NAN; /* NAN */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue