Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f97a9e3c
Commit
f97a9e3c
authored
Apr 05, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Fix and clarify texture filter state mappings.
parent
f41ee7cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
15 deletions
+74
-15
device.c
dlls/ddraw/device.c
+74
-15
No files found.
dlls/ddraw/device.c
View file @
f97a9e3c
...
...
@@ -2409,22 +2409,60 @@ IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
case
D3DRENDERSTATE_TEXTUREMIN
:
{
WINED3DTEXTUREFILTERTYPE
tex_min
;
WINED3DTEXTUREFILTERTYPE
tex_mip
;
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
0
,
WINED3DSAMP_MINFILTER
,
&
tex_min
);
0
,
WINED3DSAMP_MINFILTER
,
&
tex_min
);
if
(
FAILED
(
hr
))
{
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
hr
=
IWineD3DDevice_GetSamplerState
(
This
->
wineD3DDevice
,
0
,
WINED3DSAMP_MIPFILTER
,
&
tex_mip
);
switch
(
tex_min
)
{
case
WINED3DTEXF_POINT
:
*
Value
=
D3DFILTER_NEAREST
;
switch
(
tex_mip
)
{
case
WINED3DTEXF_NONE
:
*
Value
=
D3DFILTER_NEAREST
;
break
;
case
WINED3DTEXF_POINT
:
*
Value
=
D3DFILTER_MIPNEAREST
;
break
;
case
WINED3DTEXF_LINEAR
:
*
Value
=
D3DFILTER_LINEARMIPNEAREST
;
break
;
default:
ERR
(
"Unhandled mip filter %#x.
\n
"
,
tex_mip
);
*
Value
=
D3DFILTER_NEAREST
;
break
;
}
break
;
case
WINED3DTEXF_LINEAR
:
*
Value
=
D3DFILTER_LINEAR
;
switch
(
tex_mip
)
{
case
WINED3DTEXF_NONE
:
*
Value
=
D3DFILTER_LINEAR
;
break
;
case
WINED3DTEXF_POINT
:
*
Value
=
D3DFILTER_MIPLINEAR
;
break
;
case
WINED3DTEXF_LINEAR
:
*
Value
=
D3DFILTER_LINEARMIPLINEAR
;
break
;
default:
ERR
(
"Unhandled mip filter %#x.
\n
"
,
tex_mip
);
*
Value
=
D3DFILTER_LINEAR
;
break
;
}
break
;
default:
ERR
(
"Unhandled texture mag %d !
\n
"
,
tex_min
);
*
Value
=
0
;
ERR
(
"Unhandled texture min filter %#x.
\n
"
,
tex_min
);
*
Value
=
D3DFILTER_NEAREST
;
break
;
}
break
;
}
...
...
@@ -2652,22 +2690,39 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
/* Some render states need special care */
switch
(
RenderStateType
)
{
/*
* The ddraw texture filter mapping works like this:
* D3DFILTER_NEAREST Point min/mag, no mip
* D3DFILTER_MIPNEAREST Point min/mag, point mip
* D3DFILTER_LINEARMIPNEAREST: Point min/mag, linear mip
*
* D3DFILTER_LINEAR Linear min/mag, no mip
* D3DFILTER_MIPLINEAR Linear min/mag, point mip
* D3DFILTER_LINEARMIPLINEAR Linear min/mag, linear mip
*
* This is the opposite of the GL naming convention,
* D3DFILTER_LINEARMIPNEAREST corresponds to GL_NEAREST_MIPMAP_LINEAR.
*/
case
D3DRENDERSTATE_TEXTUREMAG
:
{
WINED3DTEXTUREFILTERTYPE
tex_mag
=
WINED3DTEXF_POINT
;
WINED3DTEXTUREFILTERTYPE
tex_mag
;
switch
(
(
D3DTEXTUREFILTER
)
Value
)
switch
(
Value
)
{
case
D3DFILTER_NEAREST
:
case
D3DFILTER_MIPNEAREST
:
case
D3DFILTER_LINEARMIPNEAREST
:
tex_mag
=
WINED3DTEXF_POINT
;
break
;
case
D3DFILTER_LINEAR
:
case
D3DFILTER_MIPLINEAR
:
case
D3DFILTER_LINEARMIPLINEAR
:
tex_mag
=
WINED3DTEXF_LINEAR
;
break
;
default:
tex_mag
=
WINED3DTEXF_POINT
;
ERR
(
"Unhandled texture mag %d !
\n
"
,
Value
);
break
;
}
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
...
...
@@ -2678,24 +2733,26 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
case
D3DRENDERSTATE_TEXTUREMIN
:
{
WINED3DTEXTUREFILTERTYPE
tex_min
=
WINED3DTEXF_POINT
;
WINED3DTEXTUREFILTERTYPE
tex_mip
=
WINED3DTEXF_NONE
;
WINED3DTEXTUREFILTERTYPE
tex_min
;
WINED3DTEXTUREFILTERTYPE
tex_mip
;
switch
((
D3DTEXTUREFILTER
)
Value
)
{
case
D3DFILTER_NEAREST
:
tex_min
=
WINED3DTEXF_POINT
;
tex_mip
=
WINED3DTEXF_NONE
;
break
;
case
D3DFILTER_LINEAR
:
tex_min
=
WINED3DTEXF_LINEAR
;
tex_mip
=
WINED3DTEXF_NONE
;
break
;
case
D3DFILTER_MIPNEAREST
:
tex_min
=
WINED3DTEXF_POINT
;
tex_mip
=
WINED3DTEXF_POINT
;
break
;
case
D3DFILTER_MIPLINEAR
:
tex_min
=
WINED3DTEXF_
POINT
;
tex_mip
=
WINED3DTEXF_
LINEAR
;
tex_min
=
WINED3DTEXF_
LINEAR
;
tex_mip
=
WINED3DTEXF_
POINT
;
break
;
case
D3DFILTER_LINEARMIPNEAREST
:
tex_min
=
WINED3DTEXF_POINT
;
...
...
@@ -2708,11 +2765,13 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
default:
ERR
(
"Unhandled texture min %d !
\n
"
,
Value
);
tex_min
=
WINED3DTEXF_POINT
;
tex_mip
=
WINED3DTEXF_NONE
;
break
;
}
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
0
,
WINED3DSAMP_MIPFILTER
,
tex_mip
);
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
0
,
WINED3DSAMP_MIPFILTER
,
tex_mip
);
hr
=
IWineD3DDevice_SetSamplerState
(
This
->
wineD3DDevice
,
0
,
WINED3DSAMP_MINFILTER
,
tex_min
);
...
...
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