wined3d: Simplify the transformed position fixup a bit.
This commit is contained in:
parent
75b89c931b
commit
37491bb5d1
|
@ -506,28 +506,16 @@ static inline void fixup_d3dcolor(DWORD *dst_color)
|
|||
|
||||
static inline void fixup_transformed_pos(float *p)
|
||||
{
|
||||
float x, y, z, w;
|
||||
|
||||
/* rhw conversion like in drawStridedSlow */
|
||||
if (p[3] == 1.0 || ((p[3] < eps) && (p[3] > -eps)))
|
||||
/* rhw conversion like in position_float4(). */
|
||||
if (p[3] != 1.0 && p[3] != 0.0)
|
||||
{
|
||||
x = p[0];
|
||||
y = p[1];
|
||||
z = p[2];
|
||||
w = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
w = 1.0 / p[3];
|
||||
x = p[0] * w;
|
||||
y = p[1] * w;
|
||||
z = p[2] * w;
|
||||
}
|
||||
p[0] = x;
|
||||
p[1] = y;
|
||||
p[2] = z;
|
||||
float w = 1.0 / p[3];
|
||||
p[0] *= w;
|
||||
p[1] *= w;
|
||||
p[2] *= w;
|
||||
p[3] = w;
|
||||
}
|
||||
}
|
||||
|
||||
const BYTE *buffer_get_memory(IWineD3DBuffer *iface, UINT offset, GLuint *buffer_object)
|
||||
{
|
||||
|
|
|
@ -4316,13 +4316,16 @@ static void WINE_GLAPI position_float4(const void *data)
|
|||
{
|
||||
const GLfloat *pos = data;
|
||||
|
||||
if (pos[3] < eps && pos[3] > -eps)
|
||||
glVertex3fv(pos);
|
||||
else {
|
||||
if (pos[3] != 0.0 && pos[3] != 1.0)
|
||||
{
|
||||
float w = 1.0 / pos[3];
|
||||
|
||||
glVertex4f(pos[0] * w, pos[1] * w, pos[2] * w, w);
|
||||
}
|
||||
else
|
||||
{
|
||||
glVertex3fv(pos);
|
||||
}
|
||||
}
|
||||
|
||||
static void WINE_GLAPI diffuse_d3dcolor(const void *data)
|
||||
|
|
Loading…
Reference in New Issue