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
fd15b8d0
Commit
fd15b8d0
authored
Aug 25, 2006
by
Jan Zerebecki
Committed by
Alexandre Julliard
Aug 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use a common function for all D3DCMPFUNC -> GLenum conversions.
parent
c8548fb8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
33 deletions
+13
-33
device.c
dlls/wined3d/device.c
+10
-30
utils.c
dlls/wined3d/utils.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/device.c
View file @
fd15b8d0
...
...
@@ -3325,9 +3325,11 @@ static void renderstate_stencil(IWineD3DDeviceImpl *This, D3DRENDERSTATETYPE Sta
if
(
This
->
stateBlock
->
set
.
renderState
[
WINED3DRS_TWOSIDEDSTENCILMODE
]
)
twosided_enable
=
This
->
stateBlock
->
renderState
[
WINED3DRS_TWOSIDEDSTENCILMODE
];
if
(
This
->
stateBlock
->
set
.
renderState
[
WINED3DRS_STENCILFUNC
]
)
func
=
StencilFunc
(
This
->
stateBlock
->
renderState
[
WINED3DRS_STENCILFUNC
]);
if
(
!
(
func
=
CompareFunc
(
This
->
stateBlock
->
renderState
[
WINED3DRS_STENCILFUNC
])
)
)
func
=
GL_ALWAYS
;
if
(
This
->
stateBlock
->
set
.
renderState
[
WINED3DRS_CCW_STENCILFUNC
]
)
func_ccw
=
StencilFunc
(
This
->
stateBlock
->
renderState
[
WINED3DRS_CCW_STENCILFUNC
]);
if
(
!
(
func_ccw
=
CompareFunc
(
This
->
stateBlock
->
renderState
[
WINED3DRS_CCW_STENCILFUNC
])
)
)
func
=
GL_ALWAYS
;
if
(
This
->
stateBlock
->
set
.
renderState
[
WINED3DRS_STENCILREF
]
)
ref
=
This
->
stateBlock
->
renderState
[
WINED3DRS_STENCILREF
];
if
(
This
->
stateBlock
->
set
.
renderState
[
WINED3DRS_STENCILMASK
]
)
...
...
@@ -3353,10 +3355,12 @@ static void renderstate_stencil(IWineD3DDeviceImpl *This, D3DRENDERSTATETYPE Sta
twosided_enable
=
Value
;
break
;
case
WINED3DRS_STENCILFUNC
:
func
=
StencilFunc
(
Value
);
if
(
!
(
func
=
CompareFunc
(
Value
)
)
)
func
=
GL_ALWAYS
;
break
;
case
WINED3DRS_CCW_STENCILFUNC
:
func_ccw
=
StencilFunc
(
Value
);
if
(
!
(
func_ccw
=
CompareFunc
(
Value
)
)
)
func_ccw
=
GL_ALWAYS
;
break
;
case
WINED3DRS_STENCILREF
:
ref
=
Value
;
...
...
@@ -3560,20 +3564,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D
case
WINED3DRS_ZFUNC
:
{
int
glParm
=
0
;
int
glParm
=
CompareFunc
(
Value
)
;
switch
((
D3DCMPFUNC
)
Value
)
{
case
D3DCMP_NEVER
:
glParm
=
GL_NEVER
;
break
;
case
D3DCMP_LESS
:
glParm
=
GL_LESS
;
break
;
case
D3DCMP_EQUAL
:
glParm
=
GL_EQUAL
;
break
;
case
D3DCMP_LESSEQUAL
:
glParm
=
GL_LEQUAL
;
break
;
case
D3DCMP_GREATER
:
glParm
=
GL_GREATER
;
break
;
case
D3DCMP_NOTEQUAL
:
glParm
=
GL_NOTEQUAL
;
break
;
case
D3DCMP_GREATEREQUAL
:
glParm
=
GL_GEQUAL
;
break
;
case
D3DCMP_ALWAYS
:
glParm
=
GL_ALWAYS
;
break
;
default:
FIXME
(
"Unrecognized/Unhandled D3DCMPFUNC value %ld
\n
"
,
Value
);
}
if
(
glParm
)
{
glDepthFunc
(
glParm
);
checkGLcall
(
"glDepthFunc"
);
...
...
@@ -3676,19 +3668,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D
ref
=
0
.
0
;
}
else
{
ref
=
((
float
)
This
->
stateBlock
->
renderState
[
WINED3DRS_ALPHAREF
])
/
255
.
0
f
;
switch
((
D3DCMPFUNC
)
This
->
stateBlock
->
renderState
[
WINED3DRS_ALPHAFUNC
])
{
case
D3DCMP_NEVER
:
glParm
=
GL_NEVER
;
break
;
case
D3DCMP_LESS
:
glParm
=
GL_LESS
;
break
;
case
D3DCMP_EQUAL
:
glParm
=
GL_EQUAL
;
break
;
case
D3DCMP_LESSEQUAL
:
glParm
=
GL_LEQUAL
;
break
;
case
D3DCMP_GREATER
:
glParm
=
GL_GREATER
;
break
;
case
D3DCMP_NOTEQUAL
:
glParm
=
GL_NOTEQUAL
;
break
;
case
D3DCMP_GREATEREQUAL
:
glParm
=
GL_GEQUAL
;
break
;
case
D3DCMP_ALWAYS
:
glParm
=
GL_ALWAYS
;
break
;
default:
FIXME
(
"Unrecognized/Unhandled D3DCMPFUNC value %ld
\n
"
,
This
->
stateBlock
->
renderState
[
WINED3DRS_ALPHAFUNC
]);
}
glParm
=
CompareFunc
(
This
->
stateBlock
->
renderState
[
WINED3DRS_ALPHAFUNC
]);
}
if
(
glParm
)
{
This
->
alphafunc
=
glParm
;
...
...
dlls/wined3d/utils.c
View file @
fd15b8d0
...
...
@@ -665,7 +665,7 @@ GLenum StencilOp(DWORD op) {
}
}
GLenum
Stencil
Func
(
DWORD
func
)
{
GLenum
Compare
Func
(
DWORD
func
)
{
switch
((
D3DCMPFUNC
)
func
)
{
case
D3DCMP_NEVER
:
return
GL_NEVER
;
case
D3DCMP_LESS
:
return
GL_LESS
;
...
...
@@ -677,7 +677,7 @@ GLenum StencilFunc(DWORD func) {
case
D3DCMP_ALWAYS
:
return
GL_ALWAYS
;
default:
FIXME
(
"Unrecognized D3DCMPFUNC value %ld
\n
"
,
func
);
return
GL_ALWAYS
;
return
0
;
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
fd15b8d0
...
...
@@ -1244,7 +1244,7 @@ const char* debug_d3dpool(WINED3DPOOL pool);
/* Routines for GL <-> D3D values */
GLenum
StencilOp
(
DWORD
op
);
GLenum
Stencil
Func
(
DWORD
func
);
GLenum
Compare
Func
(
DWORD
func
);
void
set_tex_op
(
IWineD3DDevice
*
iface
,
BOOL
isAlpha
,
int
Stage
,
D3DTEXTUREOP
op
,
DWORD
arg1
,
DWORD
arg2
,
DWORD
arg3
);
void
set_tex_op_nvrc
(
IWineD3DDevice
*
iface
,
BOOL
is_alpha
,
int
stage
,
D3DTEXTUREOP
op
,
DWORD
arg1
,
DWORD
arg2
,
DWORD
arg3
,
INT
texture_idx
);
void
set_texture_matrix
(
const
float
*
smat
,
DWORD
flags
,
BOOL
calculatedCoords
);
...
...
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