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
405e11ea
Commit
405e11ea
authored
Jun 10, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Jun 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Cleanup GetSrcAndOpFromValue().
- Cleanup GetSrcAndOpFromValue(). - Use naming more consistent with the rest of the file.
parent
a28ebdf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
71 deletions
+42
-71
utils.c
dlls/wined3d/utils.c
+42
-70
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-1
No files found.
dlls/wined3d/utils.c
View file @
405e11ea
...
...
@@ -399,6 +399,44 @@ GLenum StencilOp(DWORD op) {
}
}
static
void
get_src_and_opr
(
DWORD
arg
,
BOOL
is_alpha
,
GLenum
*
source
,
GLenum
*
operand
)
{
/* The D3DTA_ALPHAREPLICATE flag specifies the alpha component of the
* input should be used for all input components. The D3DTA_COMPLEMENT
* flag specifies the complement of the input should be used. */
BOOL
from_alpha
=
is_alpha
||
arg
&
D3DTA_ALPHAREPLICATE
;
BOOL
complement
=
arg
&
D3DTA_COMPLEMENT
;
/* Calculate the operand */
if
(
complement
)
{
if
(
from_alpha
)
*
operand
=
GL_ONE_MINUS_SRC_ALPHA
;
else
*
operand
=
GL_ONE_MINUS_SRC_COLOR
;
}
else
{
if
(
from_alpha
)
*
operand
=
GL_SRC_ALPHA
;
else
*
operand
=
GL_SRC_COLOR
;
}
/* Calculate the source */
switch
(
arg
&
D3DTA_SELECTMASK
)
{
case
D3DTA_CURRENT
:
*
source
=
GL_PREVIOUS_EXT
;
break
;
case
D3DTA_DIFFUSE
:
*
source
=
GL_PRIMARY_COLOR_EXT
;
break
;
case
D3DTA_TEXTURE
:
*
source
=
GL_TEXTURE
;
break
;
case
D3DTA_TFACTOR
:
*
source
=
GL_CONSTANT_EXT
;
break
;
case
D3DTA_SPECULAR
:
/*
* According to the GL_ARB_texture_env_combine specs, SPECULAR is
* 'Secondary color' and isn't supported until base GL supports it
* There is no concept of temp registers as far as I can tell
*/
FIXME
(
"Unhandled texture arg D3DTA_SPECULAR
\n
"
);
*
source
=
GL_TEXTURE
;
break
;
default:
FIXME
(
"Unrecognized texture arg %#lx
\n
"
,
arg
);
*
source
=
GL_TEXTURE
;
break
;
}
}
/* Set texture operations up - The following avoids lots of ifdefs in this routine!*/
#if defined (GL_VERSION_1_3)
# define useext(A) A
...
...
@@ -475,12 +513,12 @@ void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op,
then the default argument is D3DTA_DIFFUSE.
FIXME? If texture added/removed, may need to reset back as well? */
if
(
isAlpha
&&
This
->
stateBlock
->
textures
[
Stage
]
==
NULL
&&
arg1
==
D3DTA_TEXTURE
)
{
GetSrcAndOpFromValue
(
D3DTA_DIFFUSE
,
isAlpha
,
&
src1
,
&
opr1
);
get_src_and_opr
(
D3DTA_DIFFUSE
,
isAlpha
,
&
src1
,
&
opr1
);
}
else
{
GetSrcAndOpFromValue
(
arg1
,
isAlpha
,
&
src1
,
&
opr1
);
get_src_and_opr
(
arg1
,
isAlpha
,
&
src1
,
&
opr1
);
}
GetSrcAndOpFromValue
(
arg2
,
isAlpha
,
&
src2
,
&
opr2
);
GetSrcAndOpFromValue
(
arg3
,
isAlpha
,
&
src3
,
&
opr3
);
get_src_and_opr
(
arg2
,
isAlpha
,
&
src2
,
&
opr2
);
get_src_and_opr
(
arg3
,
isAlpha
,
&
src3
,
&
opr3
);
TRACE
(
"ct(%x), 1:(%x,%x), 2:(%x,%x), 3:(%x,%x)
\n
"
,
comb_target
,
src1
,
opr1
,
src2
,
opr2
,
src3
,
opr3
);
...
...
@@ -1569,72 +1607,6 @@ void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords)
checkGLcall
(
"glLoadMatrixf(mat)"
);
}
void
GetSrcAndOpFromValue
(
DWORD
iValue
,
BOOL
isAlphaArg
,
GLenum
*
source
,
GLenum
*
operand
)
{
BOOL
isAlphaReplicate
=
FALSE
;
BOOL
isComplement
=
FALSE
;
*
operand
=
GL_SRC_COLOR
;
*
source
=
GL_TEXTURE
;
/* Catch alpha replicate */
if
(
iValue
&
D3DTA_ALPHAREPLICATE
)
{
iValue
=
iValue
&
~
D3DTA_ALPHAREPLICATE
;
isAlphaReplicate
=
TRUE
;
}
/* Catch Complement */
if
(
iValue
&
D3DTA_COMPLEMENT
)
{
iValue
=
iValue
&
~
D3DTA_COMPLEMENT
;
isComplement
=
TRUE
;
}
/* Calculate the operand */
if
(
isAlphaReplicate
&&
!
isComplement
)
{
*
operand
=
GL_SRC_ALPHA
;
}
else
if
(
isAlphaReplicate
&&
isComplement
)
{
*
operand
=
GL_ONE_MINUS_SRC_ALPHA
;
}
else
if
(
isComplement
)
{
if
(
isAlphaArg
)
{
*
operand
=
GL_ONE_MINUS_SRC_ALPHA
;
}
else
{
*
operand
=
GL_ONE_MINUS_SRC_COLOR
;
}
}
else
{
if
(
isAlphaArg
)
{
*
operand
=
GL_SRC_ALPHA
;
}
else
{
*
operand
=
GL_SRC_COLOR
;
}
}
/* Calculate the source */
switch
(
iValue
&
D3DTA_SELECTMASK
)
{
case
D3DTA_CURRENT
:
*
source
=
GL_PREVIOUS_EXT
;
break
;
case
D3DTA_DIFFUSE
:
*
source
=
GL_PRIMARY_COLOR_EXT
;
break
;
case
D3DTA_TEXTURE
:
*
source
=
GL_TEXTURE
;
break
;
case
D3DTA_TFACTOR
:
*
source
=
GL_CONSTANT_EXT
;
break
;
case
D3DTA_SPECULAR
:
/*
* According to the GL_ARB_texture_env_combine specs, SPECULAR is
* 'Secondary color' and isn't supported until base GL supports it
* There is no concept of temp registers as far as I can tell
*/
FIXME
(
"Unhandled texture arg D3DTA_SPECULAR
\n
"
);
*
source
=
GL_TEXTURE
;
break
;
default:
FIXME
(
"Unrecognized texture arg %ld
\n
"
,
iValue
);
*
source
=
GL_TEXTURE
;
}
}
#define GLINFO_LOCATION ((IWineD3DImpl *)(This->wineD3D))->gl_info
GLint
D3DFmt2GLIntFmt
(
IWineD3DDeviceImpl
*
This
,
D3DFORMAT
fmt
)
{
GLint
retVal
=
0
;
...
...
dlls/wined3d/wined3d_private.h
View file @
405e11ea
...
...
@@ -1168,7 +1168,6 @@ const char* debug_d3dpool(WINED3DPOOL pool);
GLenum
StencilOp
(
DWORD
op
);
void
set_tex_op
(
IWineD3DDevice
*
iface
,
BOOL
isAlpha
,
int
Stage
,
D3DTEXTUREOP
op
,
DWORD
arg1
,
DWORD
arg2
,
DWORD
arg3
);
void
set_texture_matrix
(
const
float
*
smat
,
DWORD
flags
,
BOOL
calculatedCoords
);
void
GetSrcAndOpFromValue
(
DWORD
iValue
,
BOOL
isAlphaArg
,
GLenum
*
source
,
GLenum
*
operand
);
SHORT
D3DFmtGetBpp
(
IWineD3DDeviceImpl
*
This
,
D3DFORMAT
fmt
);
GLenum
D3DFmt2GLFmt
(
IWineD3DDeviceImpl
*
This
,
D3DFORMAT
fmt
);
...
...
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