Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
352e60e6
Commit
352e60e6
authored
Jan 06, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d: Explicitly translate texture stage states.
Ddraw and d3d8 already translate half of them, it turns out the lookup table actually saves lines there.
parent
c51bc826
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
208 additions
and
246 deletions
+208
-246
device.c
dlls/d3d8/device.c
+48
-78
device.c
dlls/d3d9/device.c
+39
-2
device.c
dlls/ddraw/device.c
+121
-166
No files found.
dlls/d3d8/device.c
View file @
352e60e6
...
...
@@ -1266,100 +1266,70 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, D
return
hr
;
}
static
const
struct
tss_lookup
{
BOOL
sampler_state
;
DWORD
state
;
}
tss_lookup
[]
=
{
{
FALSE
,
WINED3DTSS_FORCE_DWORD
},
/* 0, unused */
{
FALSE
,
WINED3DTSS_COLOROP
},
/* 1, D3DTSS_COLOROP */
{
FALSE
,
WINED3DTSS_COLORARG1
},
/* 2, D3DTSS_COLORARG1 */
{
FALSE
,
WINED3DTSS_COLORARG2
},
/* 3, D3DTSS_COLORARG2 */
{
FALSE
,
WINED3DTSS_ALPHAOP
},
/* 4, D3DTSS_ALPHAOP */
{
FALSE
,
WINED3DTSS_ALPHAARG1
},
/* 5, D3DTSS_ALPHAARG1 */
{
FALSE
,
WINED3DTSS_ALPHAARG2
},
/* 6, D3DTSS_ALPHAARG2 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT00
},
/* 7, D3DTSS_BUMPENVMAT00 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT01
},
/* 8, D3DTSS_BUMPENVMAT01 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT10
},
/* 9, D3DTSS_BUMPENVMAT10 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT11
},
/* 10, D3DTSS_BUMPENVMAT11 */
{
FALSE
,
WINED3DTSS_TEXCOORDINDEX
},
/* 11, D3DTSS_TEXCOORDINDEX */
{
FALSE
,
WINED3DTSS_FORCE_DWORD
},
/* 12, unused */
{
TRUE
,
WINED3DSAMP_ADDRESSU
},
/* 13, D3DTSS_ADDRESSU */
{
TRUE
,
WINED3DSAMP_ADDRESSV
},
/* 14, D3DTSS_ADDRESSV */
{
TRUE
,
WINED3DSAMP_BORDERCOLOR
},
/* 15, D3DTSS_BORDERCOLOR */
{
TRUE
,
WINED3DSAMP_MAGFILTER
},
/* 16, D3DTSS_MAGFILTER */
{
TRUE
,
WINED3DSAMP_MINFILTER
},
/* 17, D3DTSS_MINFILTER */
{
TRUE
,
WINED3DSAMP_MIPFILTER
},
/* 18, D3DTSS_MIPFILTER */
{
TRUE
,
WINED3DSAMP_MIPMAPLODBIAS
},
/* 19, D3DTSS_MIPMAPLODBIAS */
{
TRUE
,
WINED3DSAMP_MAXMIPLEVEL
},
/* 20, D3DTSS_MAXMIPLEVEL */
{
TRUE
,
WINED3DSAMP_MAXANISOTROPY
},
/* 21, D3DTSS_MAXANISOTROPY */
{
FALSE
,
WINED3DTSS_BUMPENVLSCALE
},
/* 22, D3DTSS_BUMPENVLSCALE */
{
FALSE
,
WINED3DTSS_BUMPENVLOFFSET
},
/* 23, D3DTSS_BUMPENVLOFFSET */
{
FALSE
,
WINED3DTSS_TEXTURETRANSFORMFLAGS
},
/* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
{
TRUE
,
WINED3DSAMP_ADDRESSW
},
/* 25, D3DTSS_ADDRESSW */
{
FALSE
,
WINED3DTSS_COLORARG0
},
/* 26, D3DTSS_COLORARG0 */
{
FALSE
,
WINED3DTSS_ALPHAARG0
},
/* 27, D3DTSS_ALPHAARG0 */
{
FALSE
,
WINED3DTSS_RESULTARG
},
/* 28, D3DTSS_RESULTARG */
};
static
HRESULT
WINAPI
IDirect3DDevice8Impl_GetTextureStageState
(
LPDIRECT3DDEVICE8
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
*
pValue
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
const
struct
tss_lookup
*
l
=
&
tss_lookup
[
Type
];
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
switch
(
Type
)
{
case
D3DTSS_ADDRESSU
:
Type
=
WINED3DSAMP_ADDRESSU
;
break
;
case
D3DTSS_ADDRESSV
:
Type
=
WINED3DSAMP_ADDRESSV
;
break
;
case
D3DTSS_ADDRESSW
:
Type
=
WINED3DSAMP_ADDRESSW
;
break
;
case
D3DTSS_BORDERCOLOR
:
Type
=
WINED3DSAMP_BORDERCOLOR
;
break
;
case
D3DTSS_MAGFILTER
:
Type
=
WINED3DSAMP_MAGFILTER
;
break
;
case
D3DTSS_MAXANISOTROPY
:
Type
=
WINED3DSAMP_MAXANISOTROPY
;
break
;
case
D3DTSS_MAXMIPLEVEL
:
Type
=
WINED3DSAMP_MAXMIPLEVEL
;
break
;
case
D3DTSS_MINFILTER
:
Type
=
WINED3DSAMP_MINFILTER
;
break
;
case
D3DTSS_MIPFILTER
:
Type
=
WINED3DSAMP_MIPFILTER
;
break
;
case
D3DTSS_MIPMAPLODBIAS
:
Type
=
WINED3DSAMP_MIPMAPLODBIAS
;
break
;
default:
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3DDevice_GetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
Type
,
pValue
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
WineD3DDevice
,
Stage
,
Type
,
pValue
);
if
(
l
->
sampler_state
)
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
WineD3DDevice
,
Stage
,
l
->
state
,
pValue
);
else
hr
=
IWineD3DDevice_GetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
l
->
state
,
pValue
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetTextureStageState
(
LPDIRECT3DDEVICE8
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
Value
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
const
struct
tss_lookup
*
l
=
&
tss_lookup
[
Type
];
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
switch
(
Type
)
{
case
D3DTSS_ADDRESSU
:
Type
=
WINED3DSAMP_ADDRESSU
;
break
;
case
D3DTSS_ADDRESSV
:
Type
=
WINED3DSAMP_ADDRESSV
;
break
;
case
D3DTSS_ADDRESSW
:
Type
=
WINED3DSAMP_ADDRESSW
;
break
;
case
D3DTSS_BORDERCOLOR
:
Type
=
WINED3DSAMP_BORDERCOLOR
;
break
;
case
D3DTSS_MAGFILTER
:
Type
=
WINED3DSAMP_MAGFILTER
;
break
;
case
D3DTSS_MAXANISOTROPY
:
Type
=
WINED3DSAMP_MAXANISOTROPY
;
break
;
case
D3DTSS_MAXMIPLEVEL
:
Type
=
WINED3DSAMP_MAXMIPLEVEL
;
break
;
case
D3DTSS_MINFILTER
:
Type
=
WINED3DSAMP_MINFILTER
;
break
;
case
D3DTSS_MIPFILTER
:
Type
=
WINED3DSAMP_MIPFILTER
;
break
;
case
D3DTSS_MIPMAPLODBIAS
:
Type
=
WINED3DSAMP_MIPMAPLODBIAS
;
break
;
default:
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3DDevice_SetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
Type
,
Value
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
WineD3DDevice
,
Stage
,
Type
,
Value
);
if
(
l
->
sampler_state
)
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
WineD3DDevice
,
Stage
,
l
->
state
,
Value
);
else
hr
=
IWineD3DDevice_SetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
l
->
state
,
Value
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
...
...
dlls/d3d9/device.c
View file @
352e60e6
...
...
@@ -1008,13 +1008,50 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9EX ifac
return
hr
;
}
static
const
WINED3DTEXTURESTAGESTATETYPE
tss_lookup
[]
=
{
WINED3DTSS_FORCE_DWORD
,
/* 0, unused */
WINED3DTSS_COLOROP
,
/* 1, D3DTSS_COLOROP */
WINED3DTSS_COLORARG1
,
/* 2, D3DTSS_COLORARG1 */
WINED3DTSS_COLORARG2
,
/* 3, D3DTSS_COLORARG2 */
WINED3DTSS_ALPHAOP
,
/* 4, D3DTSS_ALPHAOP */
WINED3DTSS_ALPHAARG1
,
/* 5, D3DTSS_ALPHAARG1 */
WINED3DTSS_ALPHAARG2
,
/* 6, D3DTSS_ALPHAARG2 */
WINED3DTSS_BUMPENVMAT00
,
/* 7, D3DTSS_BUMPENVMAT00 */
WINED3DTSS_BUMPENVMAT01
,
/* 8, D3DTSS_BUMPENVMAT01 */
WINED3DTSS_BUMPENVMAT10
,
/* 9, D3DTSS_BUMPENVMAT10 */
WINED3DTSS_BUMPENVMAT11
,
/* 10, D3DTSS_BUMPENVMAT11 */
WINED3DTSS_TEXCOORDINDEX
,
/* 11, D3DTSS_TEXCOORDINDEX */
WINED3DTSS_FORCE_DWORD
,
/* 12, unused */
WINED3DTSS_FORCE_DWORD
,
/* 13, unused */
WINED3DTSS_FORCE_DWORD
,
/* 14, unused */
WINED3DTSS_FORCE_DWORD
,
/* 15, unused */
WINED3DTSS_FORCE_DWORD
,
/* 16, unused */
WINED3DTSS_FORCE_DWORD
,
/* 17, unused */
WINED3DTSS_FORCE_DWORD
,
/* 18, unused */
WINED3DTSS_FORCE_DWORD
,
/* 19, unused */
WINED3DTSS_FORCE_DWORD
,
/* 20, unused */
WINED3DTSS_FORCE_DWORD
,
/* 21, unused */
WINED3DTSS_BUMPENVLSCALE
,
/* 22, D3DTSS_BUMPENVLSCALE */
WINED3DTSS_BUMPENVLOFFSET
,
/* 23, D3DTSS_BUMPENVLOFFSET */
WINED3DTSS_TEXTURETRANSFORMFLAGS
,
/* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
WINED3DTSS_FORCE_DWORD
,
/* 25, unused */
WINED3DTSS_COLORARG0
,
/* 26, D3DTSS_COLORARG0 */
WINED3DTSS_ALPHAARG0
,
/* 27, D3DTSS_ALPHAARG0 */
WINED3DTSS_RESULTARG
,
/* 28, D3DTSS_RESULTARG */
WINED3DTSS_FORCE_DWORD
,
/* 29, unused */
WINED3DTSS_FORCE_DWORD
,
/* 30, unused */
WINED3DTSS_FORCE_DWORD
,
/* 31, unused */
WINED3DTSS_CONSTANT
,
/* 32, D3DTSS_CONSTANT */
};
static
HRESULT
WINAPI
IDirect3DDevice9Impl_GetTextureStageState
(
LPDIRECT3DDEVICE9EX
iface
,
DWORD
Stage
,
D3DTEXTURESTAGESTATETYPE
Type
,
DWORD
*
pValue
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DDevice_GetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
Type
,
pValue
);
hr
=
IWineD3DDevice_GetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
tss_lookup
[
Type
]
,
pValue
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
@@ -1025,7 +1062,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetTextureStageState(LPDIRECT3DDEVI
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DDevice_SetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
Type
,
Value
);
hr
=
IWineD3DDevice_SetTextureStageState
(
This
->
WineD3DDevice
,
Stage
,
tss_lookup
[
Type
]
,
Value
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
dlls/ddraw/device.c
View file @
352e60e6
...
...
@@ -4997,6 +4997,40 @@ IDirect3DDeviceImpl_3_SetTexture(IDirect3DDevice3 *iface,
return
hr
;
}
static
const
struct
tss_lookup
{
BOOL
sampler_state
;
DWORD
state
;
}
tss_lookup
[]
=
{
{
FALSE
,
WINED3DTSS_FORCE_DWORD
},
/* 0, unused */
{
FALSE
,
WINED3DTSS_COLOROP
},
/* 1, D3DTSS_COLOROP */
{
FALSE
,
WINED3DTSS_COLORARG1
},
/* 2, D3DTSS_COLORARG1 */
{
FALSE
,
WINED3DTSS_COLORARG2
},
/* 3, D3DTSS_COLORARG2 */
{
FALSE
,
WINED3DTSS_ALPHAOP
},
/* 4, D3DTSS_ALPHAOP */
{
FALSE
,
WINED3DTSS_ALPHAARG1
},
/* 5, D3DTSS_ALPHAARG1 */
{
FALSE
,
WINED3DTSS_ALPHAARG2
},
/* 6, D3DTSS_ALPHAARG2 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT00
},
/* 7, D3DTSS_BUMPENVMAT00 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT01
},
/* 8, D3DTSS_BUMPENVMAT01 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT10
},
/* 9, D3DTSS_BUMPENVMAT10 */
{
FALSE
,
WINED3DTSS_BUMPENVMAT11
},
/* 10, D3DTSS_BUMPENVMAT11 */
{
FALSE
,
WINED3DTSS_TEXCOORDINDEX
},
/* 11, D3DTSS_TEXCOORDINDEX */
{
TRUE
,
WINED3DSAMP_ADDRESSU
},
/* 12, D3DTSS_ADDRESS */
{
TRUE
,
WINED3DSAMP_ADDRESSU
},
/* 13, D3DTSS_ADDRESSU */
{
TRUE
,
WINED3DSAMP_ADDRESSV
},
/* 14, D3DTSS_ADDRESSV */
{
TRUE
,
WINED3DSAMP_BORDERCOLOR
},
/* 15, D3DTSS_BORDERCOLOR */
{
TRUE
,
WINED3DSAMP_MAGFILTER
},
/* 16, D3DTSS_MAGFILTER */
{
TRUE
,
WINED3DSAMP_MINFILTER
},
/* 17, D3DTSS_MINFILTER */
{
TRUE
,
WINED3DSAMP_MIPFILTER
},
/* 18, D3DTSS_MIPFILTER */
{
TRUE
,
WINED3DSAMP_MIPMAPLODBIAS
},
/* 19, D3DTSS_MIPMAPLODBIAS */
{
TRUE
,
WINED3DSAMP_MAXMIPLEVEL
},
/* 20, D3DTSS_MAXMIPLEVEL */
{
TRUE
,
WINED3DSAMP_MAXANISOTROPY
},
/* 21, D3DTSS_MAXANISOTROPY */
{
FALSE
,
WINED3DTSS_BUMPENVLSCALE
},
/* 22, D3DTSS_BUMPENVLSCALE */
{
FALSE
,
WINED3DTSS_BUMPENVLOFFSET
},
/* 23, D3DTSS_BUMPENVLOFFSET */
{
FALSE
,
WINED3DTSS_TEXTURETRANSFORMFLAGS
},
/* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
};
/*****************************************************************************
* IDirect3DDevice7::GetTextureStageState
*
...
...
@@ -5023,102 +5057,63 @@ IDirect3DDeviceImpl_7_GetTextureStageState(IDirect3DDevice7 *iface,
{
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice7
,
iface
);
HRESULT
hr
;
const
struct
tss_lookup
*
l
=
&
tss_lookup
[
TexStageStateType
];
TRACE
(
"(%p)->(%08x,%08x,%p): Relay!
\n
"
,
This
,
Stage
,
TexStageStateType
,
State
);
if
(
!
State
)
return
DDERR_INVALIDPARAMS
;
EnterCriticalSection
(
&
ddraw_cs
);
switch
(
TexStageStateType
)
if
(
l
->
sampler_state
)
{
/* Mipfilter is a sampler state with different values */
case
D3DTSS_MIPFILTER
:
{
WINED3DTEXTUREFILTERTYPE
value
;
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
l
->
state
,
State
);
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MIPFILTER
,
&
value
);
switch
(
value
)
switch
(
TexStageStateType
)
{
/* Mipfilter is a sampler state with different values */
case
D3DTSS_MIPFILTER
:
{
case
WINED3DTEXF_NONE
:
*
State
=
D3DTFP_NONE
;
break
;
case
WINED3DTEXF_POINT
:
*
State
=
D3DTFP_POINT
;
break
;
case
WINED3DTEXF_LINEAR
:
*
State
=
D3DTFP_LINEAR
;
break
;
default:
ERR
(
"Unexpected mipfilter value %d
\n
"
,
value
);
*
State
=
D3DTFP_NONE
;
switch
(
*
State
)
{
case
WINED3DTEXF_NONE
:
*
State
=
D3DTFP_NONE
;
break
;
case
WINED3DTEXF_POINT
:
*
State
=
D3DTFP_POINT
;
break
;
case
WINED3DTEXF_LINEAR
:
*
State
=
D3DTFP_LINEAR
;
break
;
default:
ERR
(
"Unexpected mipfilter value %#x
\n
"
,
*
State
);
*
State
=
D3DTFP_NONE
;
break
;
}
break
;
}
break
;
}
/* Minfilter is a sampler state too, equal values */
case
D3DTSS_MINFILTER
:
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MINFILTER
,
State
);
break
;
/* Magfilter has slightly different values */
case
D3DTSS_MAGFILTER
:
{
WINED3DTEXTUREFILTERTYPE
wined3dfilter
;
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MAGFILTER
,
&
wined3dfilter
);
switch
(
wined3dfilter
)
/* Magfilter has slightly different values */
case
D3DTSS_MAGFILTER
:
{
case
WINED3DTEXF_POINT
:
*
State
=
D3DTFG_POINT
;
break
;
case
WINED3DTEXF_LINEAR
:
*
State
=
D3DTFG_LINEAR
;
break
;
case
WINED3DTEXF_ANISOTROPIC
:
*
State
=
D3DTFG_ANISOTROPIC
;
break
;
case
WINED3DTEXF_FLATCUBIC
:
*
State
=
D3DTFG_FLATCUBIC
;
break
;
case
WINED3DTEXF_GAUSSIANCUBIC
:
*
State
=
D3DTFG_GAUSSIANCUBIC
;
break
;
default:
ERR
(
"Unexpected wined3d mag filter value %d
\n
"
,
wined3dfilter
);
*
State
=
D3DTFG_POINT
;
switch
(
*
State
)
{
case
WINED3DTEXF_POINT
:
*
State
=
D3DTFG_POINT
;
break
;
case
WINED3DTEXF_LINEAR
:
*
State
=
D3DTFG_LINEAR
;
break
;
case
WINED3DTEXF_ANISOTROPIC
:
*
State
=
D3DTFG_ANISOTROPIC
;
break
;
case
WINED3DTEXF_FLATCUBIC
:
*
State
=
D3DTFG_FLATCUBIC
;
break
;
case
WINED3DTEXF_GAUSSIANCUBIC
:
*
State
=
D3DTFG_GAUSSIANCUBIC
;
break
;
default:
ERR
(
"Unexpected wined3d mag filter value %#x
\n
"
,
*
State
);
*
State
=
D3DTFG_POINT
;
break
;
}
break
;
}
break
;
}
case
D3DTSS_ADDRESS
:
case
D3DTSS_ADDRESSU
:
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_ADDRESSU
,
State
);
break
;
case
D3DTSS_ADDRESSV
:
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_ADDRESSV
,
State
);
break
;
case
D3DTSS_BORDERCOLOR
:
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_BORDERCOLOR
,
State
);
break
;
case
D3DTSS_MIPMAPLODBIAS
:
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MIPMAPLODBIAS
,
State
);
break
;
case
D3DTSS_MAXMIPLEVEL
:
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MAXMIPLEVEL
,
State
);
break
;
case
D3DTSS_MAXANISOTROPY
:
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MAXANISOTROPY
,
State
);
break
;
default:
hr
=
IWineD3DDevice_GetTextureStageState
(
This
->
wineD3DDevice
,
Stage
,
TexStageStateType
,
State
);
break
;
default:
break
;
}
}
else
{
hr
=
IWineD3DDevice_GetTextureStageState
(
This
->
wineD3DDevice
,
Stage
,
l
->
state
,
State
);
}
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
...
...
@@ -5187,106 +5182,66 @@ IDirect3DDeviceImpl_7_SetTextureStageState(IDirect3DDevice7 *iface,
DWORD
State
)
{
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice7
,
iface
);
const
struct
tss_lookup
*
l
=
&
tss_lookup
[
TexStageStateType
];
HRESULT
hr
;
TRACE
(
"(%p)->(%08x,%08x,%08x): Relay!
\n
"
,
This
,
Stage
,
TexStageStateType
,
State
);
EnterCriticalSection
(
&
ddraw_cs
);
switch
(
TexStageStateType
)
if
(
l
->
sampler_state
)
{
/* Mipfilter is a sampler state with different values */
case
D3DTSS_MIPFILTER
:
switch
(
TexStageStateType
)
{
WINED3DTEXTUREFILTERTYPE
value
;
switch
(
State
)
/* Mipfilter is a sampler state with different values */
case
D3DTSS_MIPFILTER
:
{
case
D3DTFP_NONE
:
value
=
WINED3DTEXF_NONE
;
break
;
case
D3DTFP_POINT
:
value
=
WINED3DTEXF_POINT
;
break
;
case
0
:
/* Unchecked */
case
D3DTFP_LINEAR
:
value
=
WINED3DTEXF_LINEAR
;
break
;
default:
ERR
(
"Unexpected mipfilter value %d
\n
"
,
State
);
value
=
WINED3DTEXF_NONE
;
switch
(
State
)
{
case
D3DTFP_NONE
:
State
=
WINED3DTEXF_NONE
;
break
;
case
D3DTFP_POINT
:
State
=
WINED3DTEXF_POINT
;
break
;
case
0
:
/* Unchecked */
case
D3DTFP_LINEAR
:
State
=
WINED3DTEXF_LINEAR
;
break
;
default:
ERR
(
"Unexpected mipfilter value %d
\n
"
,
State
);
State
=
WINED3DTEXF_NONE
;
break
;
}
break
;
}
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MIPFILTER
,
value
);
break
;
}
/* Minfilter is a sampler state too, equal values */
case
D3DTSS_MINFILTER
:
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MINFILTER
,
State
);
break
;
/* Magfilter has slightly different values */
case
D3DTSS_MAGFILTER
:
{
WINED3DTEXTUREFILTERTYPE
wined3dfilter
;
switch
((
D3DTEXTUREMAGFILTER
)
State
)
/* Magfilter has slightly different values */
case
D3DTSS_MAGFILTER
:
{
case
D3DTFG_POINT
:
wined3dfilter
=
WINED3DTEXF_POINT
;
break
;
case
D3DTFG_LINEAR
:
wined3dfilter
=
WINED3DTEXF_LINEAR
;
break
;
case
D3DTFG_FLATCUBIC
:
wined3dfilter
=
WINED3DTEXF_FLATCUBIC
;
break
;
case
D3DTFG_GAUSSIANCUBIC
:
wined3dfilter
=
WINED3DTEXF_GAUSSIANCUBIC
;
break
;
case
D3DTFG_ANISOTROPIC
:
wined3dfilter
=
WINED3DTEXF_ANISOTROPIC
;
break
;
default:
ERR
(
"Unexpected d3d7 mag filter type %d
\n
"
,
State
);
wined3dfilter
=
WINED3DTEXF_POINT
;
switch
(
State
)
{
case
D3DTFG_POINT
:
State
=
WINED3DTEXF_POINT
;
break
;
case
D3DTFG_LINEAR
:
State
=
WINED3DTEXF_LINEAR
;
break
;
case
D3DTFG_FLATCUBIC
:
State
=
WINED3DTEXF_FLATCUBIC
;
break
;
case
D3DTFG_GAUSSIANCUBIC
:
State
=
WINED3DTEXF_GAUSSIANCUBIC
;
break
;
case
D3DTFG_ANISOTROPIC
:
State
=
WINED3DTEXF_ANISOTROPIC
;
break
;
default:
ERR
(
"Unexpected d3d7 mag filter type %d
\n
"
,
State
);
State
=
WINED3DTEXF_POINT
;
break
;
}
break
;
}
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MAGFILTER
,
wined3dfilter
);
break
;
}
case
D3DTSS_ADDRESS
:
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_ADDRESSV
,
State
);
/* Drop through */
case
D3DTSS_ADDRESSU
:
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_ADDRESSU
,
State
);
break
;
case
D3DTSS_ADDRESSV
:
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_ADDRESSV
,
State
);
break
;
case
D3DTSS_BORDERCOLOR
:
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_BORDERCOLOR
,
State
);
break
;
case
D3DTSS_MIPMAPLODBIAS
:
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MIPMAPLODBIAS
,
State
);
break
;
case
D3DTSS_MAXMIPLEVEL
:
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MAXMIPLEVEL
,
State
);
break
;
case
D3DTSS_ADDRESS
:
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_ADDRESSV
,
State
);
break
;
case
D3DTSS_MAXANISOTROPY
:
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
WINED3DSAMP_MAXANISOTROPY
,
State
)
;
break
;
default
:
break
;
}
default:
hr
=
IWineD3DDevice_SetTextureStageState
(
This
->
wineD3DDevice
,
Stage
,
TexStageStateType
,
State
);
break
;
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
Stage
,
l
->
state
,
State
);
}
else
{
hr
=
IWineD3DDevice_SetTextureStageState
(
This
->
wineD3DDevice
,
Stage
,
l
->
state
,
State
);
}
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment