[30/47] WineD3D: Move WINED3DRS_WRAPx to the state table
Stefan Dösinger
stefan at codeweavers.com
Sun Dec 10 16:20:45 CST 2006
-------------- next part --------------
From 86a8bf6316d9bb1cdf5bf142c0de3e213274be1e Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Sun, 10 Dec 2006 19:16:33 +0100
Subject: [PATCH] WineD3D: Move WINED3DRS_WRAPx to the state table
---
dlls/wined3d/device.c | 32 ++++++-------------------
dlls/wined3d/state.c | 63 +++++++++++++++++++++++++++++++++++++------------
2 files changed, 55 insertions(+), 40 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 6765004..3a059df 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3407,16 +3407,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl
case WINED3DRS_LASTPIXEL :
case WINED3DRS_SOFTWAREVERTEXPROCESSING :
case WINED3DRS_POINTSPRITEENABLE :
- StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
- break;
-
- /** not supported */
- case WINED3DRS_ZVISIBLE :
- {
- LEAVE_GL();
- return WINED3DERR_INVALIDCALL;
- }
-
case WINED3DRS_WRAP0 :
case WINED3DRS_WRAP1 :
case WINED3DRS_WRAP2 :
@@ -3433,21 +3423,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl
case WINED3DRS_WRAP13 :
case WINED3DRS_WRAP14 :
case WINED3DRS_WRAP15 :
- /**
- http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/texture/
- http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/programmingguide/FixedFunction/Textures/texturewrapping.asp
- http://www.gamedev.net/reference/programming/features/rendererdll3/page2.asp
- Descussion that ways to turn on WRAPing to solve an opengl conversion problem.
- http://www.flipcode.org/cgi-bin/fcmsg.cgi?thread_show=10248
-
- so far as I can tell, wrapping and texture-coordinate generate go hand in hand,
- */
- {
- if(Value) {
- ERR("(%p)->(%s,%d) Texture wraping not yet supported\n",This, debug_d3drenderstate(State), Value);
- }
+ StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
- }
+
+ /** not supported */
+ case WINED3DRS_ZVISIBLE :
+ {
+ LEAVE_GL();
+ return WINED3DERR_INVALIDCALL;
+ }
case WINED3DRS_MULTISAMPLEANTIALIAS :
{
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index f844565..496874a 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1068,6 +1068,37 @@ static void state_pointsprite(DWORD stat
}
}
+static void state_wrap(DWORD state, IWineD3DStateBlockImpl *stateblock) {
+ /**
+ http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/texture/
+ http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/programmingguide/FixedFunction/Textures/texturewrapping.asp
+ http://www.gamedev.net/reference/programming/features/rendererdll3/page2.asp
+ Descussion that ways to turn on WRAPing to solve an opengl conversion problem.
+ http://www.flipcode.org/cgi-bin/fcmsg.cgi?thread_show=10248
+
+ so far as I can tell, wrapping and texture-coordinate generate go hand in hand,
+ */
+ TRACE("Stub\n");
+ if(stateblock->renderState[WINED3DRS_WRAP0] ||
+ stateblock->renderState[WINED3DRS_WRAP1] ||
+ stateblock->renderState[WINED3DRS_WRAP2] ||
+ stateblock->renderState[WINED3DRS_WRAP3] ||
+ stateblock->renderState[WINED3DRS_WRAP4] ||
+ stateblock->renderState[WINED3DRS_WRAP5] ||
+ stateblock->renderState[WINED3DRS_WRAP6] ||
+ stateblock->renderState[WINED3DRS_WRAP7] ||
+ stateblock->renderState[WINED3DRS_WRAP8] ||
+ stateblock->renderState[WINED3DRS_WRAP9] ||
+ stateblock->renderState[WINED3DRS_WRAP10] ||
+ stateblock->renderState[WINED3DRS_WRAP11] ||
+ stateblock->renderState[WINED3DRS_WRAP12] ||
+ stateblock->renderState[WINED3DRS_WRAP13] ||
+ stateblock->renderState[WINED3DRS_WRAP14] ||
+ stateblock->renderState[WINED3DRS_WRAP15] ) {
+ ERR("(WINED3DRS_WRAP0) Texture wraping not yet supported\n");
+ }
+}
+
const struct StateEntry StateTable[] =
{
/* State name representative, apply function */
@@ -1201,14 +1232,14 @@ const struct StateEntry StateTable[] =
{ /*126, Undefined */ 0, state_undefined },
{ /*127, Undefined */ 0, state_undefined },
/* Big hole ends */
- { /*128, WINED3DRS_WRAP0 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*129, WINED3DRS_WRAP1 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*130, WINED3DRS_WRAP2 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*131, WINED3DRS_WRAP3 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*132, WINED3DRS_WRAP4 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*133, WINED3DRS_WRAP5 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*134, WINED3DRS_WRAP6 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*135, WINED3DRS_WRAP7 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
+ { /*128, WINED3DRS_WRAP0 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*129, WINED3DRS_WRAP1 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*130, WINED3DRS_WRAP2 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*131, WINED3DRS_WRAP3 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*132, WINED3DRS_WRAP4 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*133, WINED3DRS_WRAP5 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*134, WINED3DRS_WRAP6 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*135, WINED3DRS_WRAP7 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
{ /*136, WINED3DRS_CLIPPING */ STATE_RENDER(WINED3DRS_CLIPPING), state_clipping },
{ /*137, WINED3DRS_LIGHTING */ STATE_RENDER(WINED3DRS_LIGHTING) /* Vertex decl! */,state_lighting },
{ /*138, WINED3DRS_EXTENTS */ STATE_RENDER(WINED3DRS_EXTENTS), state_unknown },
@@ -1273,14 +1304,14 @@ const struct StateEntry StateTable[] =
{ /*195, WINED3DRS_DEPTHBIAS */ STATE_RENDER(WINED3DRS_DEPTHBIAS), state_unknown },
{ /*196, undefined */ 0, state_undefined },
{ /*197, undefined */ 0, state_undefined },
- { /*198, WINED3DRS_WRAP8 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*199, WINED3DRS_WRAP9 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*200, WINED3DRS_WRAP10 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*201, WINED3DRS_WRAP11 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*202, WINED3DRS_WRAP12 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*203, WINED3DRS_WRAP13 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*204, WINED3DRS_WRAP14 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
- { /*205, WINED3DRS_WRAP15 */ STATE_RENDER(WINED3DRS_WRAP0), state_unknown },
+ { /*198, WINED3DRS_WRAP8 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*199, WINED3DRS_WRAP9 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*200, WINED3DRS_WRAP10 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*201, WINED3DRS_WRAP11 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*202, WINED3DRS_WRAP12 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*203, WINED3DRS_WRAP13 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*204, WINED3DRS_WRAP14 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
+ { /*205, WINED3DRS_WRAP15 */ STATE_RENDER(WINED3DRS_WRAP0), state_wrap },
{ /*206, WINED3DRS_SEPARATEALPHABLENDENABLE */ STATE_RENDER(WINED3DRS_SEPARATEALPHABLENDENABLE), state_unknown },
{ /*207, WINED3DRS_SRCBLENDALPHA */ STATE_RENDER(WINED3DRS_SEPARATEALPHABLENDENABLE), state_unknown },
{ /*208, WINED3DRS_DESTBLENDALPHA */ STATE_RENDER(WINED3DRS_SEPARATEALPHABLENDENABLE), state_unknown },
--
1.4.2.4
More information about the wine-patches
mailing list