Commit dfccba71 authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

Pass through floats correctly to the render states at

initialization. Fixes point problems.
parent d970c097
...@@ -57,6 +57,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T ...@@ -57,6 +57,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T
D3DLINEPATTERN lp; D3DLINEPATTERN lp;
int i; int i;
int j; int j;
float tmpfloat = 0.0f;
LPDIRECT3DDEVICE8 iface = (LPDIRECT3DDEVICE8) This; LPDIRECT3DDEVICE8 iface = (LPDIRECT3DDEVICE8) This;
/* Note this may have a large overhead but it should only be executed /* Note this may have a large overhead but it should only be executed
...@@ -97,9 +98,9 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T ...@@ -97,9 +98,9 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_ZVISIBLE, 0); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_ZVISIBLE, 0);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGCOLOR, 0); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGCOLOR, 0);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGTABLEMODE, D3DFOG_NONE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGTABLEMODE, D3DFOG_NONE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGSTART, 0.0f); tmpfloat = 0.0f; IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGSTART, *((DWORD *)&tmpfloat));
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGEND, 1.0f); tmpfloat = 1.0f; IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGEND, *((DWORD *)&tmpfloat));
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGDENSITY, 1.0f); tmpfloat = 1.0f; IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_FOGDENSITY, *((DWORD *)&tmpfloat));
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_EDGEANTIALIAS, FALSE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_EDGEANTIALIAS, FALSE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_ZBIAS, 0); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_ZBIAS, 0);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_RANGEFOGENABLE, FALSE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_RANGEFOGENABLE, FALSE);
...@@ -141,8 +142,8 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T ...@@ -141,8 +142,8 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_VERTEXBLEND, D3DVBF_DISABLE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_VERTEXBLEND, D3DVBF_DISABLE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_CLIPPLANEENABLE, 0); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_CLIPPLANEENABLE, 0);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_SOFTWAREVERTEXPROCESSING, FALSE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_SOFTWAREVERTEXPROCESSING, FALSE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSIZE, 1.0f); tmpfloat = 1.0f; IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSIZE, *((DWORD *)&tmpfloat));
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSIZE_MIN, 0.0f); tmpfloat = 0.0f; IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSIZE_MIN, *((DWORD *)&tmpfloat));
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSPRITEENABLE, FALSE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSPRITEENABLE, FALSE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSCALEENABLE, FALSE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSCALEENABLE, FALSE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSCALE_A, TRUE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSCALE_A, TRUE);
...@@ -151,12 +152,12 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T ...@@ -151,12 +152,12 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_MULTISAMPLEANTIALIAS, TRUE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_MULTISAMPLEANTIALIAS, TRUE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_PATCHEDGESTYLE, D3DPATCHEDGE_DISCRETE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_PATCHEDGESTYLE, D3DPATCHEDGE_DISCRETE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_PATCHSEGMENTS, 1.0f); tmpfloat = 1.0f; IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_PATCHSEGMENTS, *((DWORD *)&tmpfloat));
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_DEBUGMONITORTOKEN, D3DDMT_DISABLE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_DEBUGMONITORTOKEN, D3DDMT_DISABLE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSIZE_MAX, (DWORD) 64.0f); tmpfloat = 64.0f; IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POINTSIZE_MAX, (DWORD) *((DWORD *)&tmpfloat));
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_COLORWRITEENABLE, 0x0000000F); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_COLORWRITEENABLE, 0x0000000F);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_TWEENFACTOR, (DWORD) 0.0f); tmpfloat = 0.0f; IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_TWEENFACTOR, (DWORD) *((DWORD *)&tmpfloat));
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_BLENDOP, D3DBLENDOP_ADD); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_BLENDOP, D3DBLENDOP_ADD);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POSITIONORDER, D3DORDER_CUBIC); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_POSITIONORDER, D3DORDER_CUBIC);
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_NORMALORDER, D3DORDER_LINEAR); IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_NORMALORDER, D3DORDER_LINEAR);
......
...@@ -284,7 +284,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) { ...@@ -284,7 +284,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
ICOM_THIS(IDirect3DSurface8Impl,iface); ICOM_THIS(IDirect3DSurface8Impl,iface);
if (FALSE == This->locked) { if (FALSE == This->locked) {
ERR("trying to lock unlocked surf@%p\n", This); ERR("trying to Unlock an unlocked surf@%p\n", This);
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment