mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +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
3 changed files with 6 additions and 8 deletions
|
@ -23,6 +23,4 @@ add_subdirectory(d3dx9_40)
|
|||
add_subdirectory(d3dx9_41)
|
||||
add_subdirectory(d3dx9_42)
|
||||
add_subdirectory(ddraw)
|
||||
if(NOT MSVC)
|
||||
add_subdirectory(wined3d)
|
||||
endif()
|
||||
add_subdirectory(wined3d)
|
||||
|
|
|
@ -1042,7 +1042,7 @@ void state_fogstartend(struct wined3d_context *context, const struct wined3d_sta
|
|||
fogend = tmpvalue.f;
|
||||
/* In GL, fogstart == fogend disables fog, in D3D everything's fogged.*/
|
||||
if(fogstart == fogend) {
|
||||
fogstart = -1.0f / 0.0f;
|
||||
fogstart = -INFINITY;
|
||||
fogend = 0.0f;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -199,8 +199,8 @@ static inline float float_16_to_32(const unsigned short *in) {
|
|||
} else if(e < 31) {
|
||||
return sgn * powf(2, (float)e - 15.0f) * (1.0f + ((float)m / 1024.0f));
|
||||
} else {
|
||||
if(m == 0) return sgn / 0.0f; /* +INF / -INF */
|
||||
else return 0.0f / 0.0f; /* NAN */
|
||||
if(m == 0) return sgn * INFINITY; /* +INF / -INF */
|
||||
else return NAN; /* NAN */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,8 +221,8 @@ static inline float float_24_to_32(DWORD in)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (m == 0) return sgn / 0.0f; /* +INF / -INF */
|
||||
else return 0.0f / 0.0f; /* NAN */
|
||||
if (m == 0) return sgn * INFINITY; /* +INF / -INF */
|
||||
else return NAN; /* NAN */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue