d3d8: Fixed POINTSCALEENABLE.
This commit is contained in:
parent
3c17322e75
commit
80c82f527f
@ -2976,32 +2976,39 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3
|
|||||||
case D3DRS_POINTSCALE_B :
|
case D3DRS_POINTSCALE_B :
|
||||||
case D3DRS_POINTSCALE_C :
|
case D3DRS_POINTSCALE_C :
|
||||||
case D3DRS_POINTSCALEENABLE :
|
case D3DRS_POINTSCALEENABLE :
|
||||||
{
|
{
|
||||||
/* If enabled, supply the parameters, otherwise fall back to defaults */
|
/*
|
||||||
if (This->StateBlock->renderstate[D3DRS_POINTSCALEENABLE]) {
|
* POINTSCALEENABLE controls how point size value is treated. If set to
|
||||||
GLfloat att[3] = {1.0f, 0.0f, 0.0f};
|
* true, the point size is scaled with respect to height of viewport.
|
||||||
att[0] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_A]);
|
* When set to false point size is in pixels.
|
||||||
att[1] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_B]);
|
*
|
||||||
att[2] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_C]);
|
* http://msdn.microsoft.com/library/en-us/directx9_c/point_sprites.asp
|
||||||
|
*/
|
||||||
|
|
||||||
if (GL_SUPPORT(EXT_POINT_PARAMETERS)) {
|
/* Default values */
|
||||||
GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att);
|
GLfloat att[3] = {1.0f, 0.0f, 0.0f};
|
||||||
checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);");
|
if(This->StateBlock->renderstate[D3DRS_POINTSCALEENABLE]) {
|
||||||
} else {
|
att[0] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_A]) /
|
||||||
TRACE("D3DRS_POINTSCALEENABLE not supported on this opengl\n");
|
(This->StateBlock->viewport.Height * This->StateBlock->viewport.Height);
|
||||||
}
|
att[1] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_B]) /
|
||||||
} else {
|
(This->StateBlock->viewport.Height * This->StateBlock->viewport.Height);
|
||||||
GLfloat att[3] = {1.0f, 0.0f, 0.0f};
|
att[2] = *((float*)&This->StateBlock->renderstate[D3DRS_POINTSCALE_C]) /
|
||||||
if (GL_SUPPORT(EXT_POINT_PARAMETERS)) {
|
(This->StateBlock->viewport.Height * This->StateBlock->viewport.Height);
|
||||||
GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att);
|
|
||||||
checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);");
|
|
||||||
} else {
|
|
||||||
TRACE("D3DRS_POINTSCALEENABLE not supported, but not on either\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(GL_SUPPORT(ARB_POINT_PARAMETERS)) {
|
||||||
|
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, att);
|
||||||
|
checkGLcall("glPointParameterfvARB(GL_DISTANCE_ATTENUATION_ARB, ...");
|
||||||
|
}
|
||||||
|
else if(GL_SUPPORT(EXT_POINT_PARAMETERS)) {
|
||||||
|
GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att);
|
||||||
|
checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
TRACE("POINT_PARAMETERS not supported in this version of opengl\n");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case D3DRS_COLORWRITEENABLE :
|
case D3DRS_COLORWRITEENABLE :
|
||||||
{
|
{
|
||||||
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
|
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user