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
4eced8ea
Commit
4eced8ea
authored
Oct 29, 2006
by
Ivan Gyurdiev
Committed by
Alexandre Julliard
Oct 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add D3DFOGMODE to the WINED3D namespace.
parent
69550f2c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
16 deletions
+29
-16
device.c
dlls/wined3d/device.c
+14
-10
drawprim.c
dlls/wined3d/drawprim.c
+4
-4
stateblock.c
dlls/wined3d/stateblock.c
+2
-2
wined3d_types.h
include/wine/wined3d_types.h
+9
-0
No files found.
dlls/wined3d/device.c
View file @
4eced8ea
...
...
@@ -3891,14 +3891,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case
WINED3DRS_FOGVERTEXMODE
:
{
/* DX 7 sdk: "If both render states(vertex and table fog) are set to valid modes, the system will apply only pixel(=table) fog effects." */
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGTABLEMODE
]
==
D3DFOG_NONE
)
{
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGTABLEMODE
]
==
WINE
D3DFOG_NONE
)
{
glHint
(
GL_FOG_HINT
,
GL_FASTEST
);
checkGLcall
(
"glHint(GL_FOG_HINT, GL_FASTEST)"
);
switch
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
])
{
/* Processed vertices have their fog factor stored in the specular value. Fall too the none case.
* If we are drawing untransformed vertices atm, d3ddevice_set_ortho will update the fog
*/
case
D3DFOG_EXP
:
{
case
WINE
D3DFOG_EXP
:
{
if
(
!
This
->
last_was_rhw
)
{
glFogi
(
GL_FOG_MODE
,
GL_EXP
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_EXP"
);
...
...
@@ -3911,7 +3911,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
break
;
}
}
case
D3DFOG_EXP2
:
{
case
WINE
D3DFOG_EXP2
:
{
if
(
!
This
->
last_was_rhw
)
{
glFogi
(
GL_FOG_MODE
,
GL_EXP2
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_EXP2"
);
...
...
@@ -3924,7 +3924,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
break
;
}
}
case
D3DFOG_LINEAR
:
{
case
WINE
D3DFOG_LINEAR
:
{
if
(
!
This
->
last_was_rhw
)
{
glFogi
(
GL_FOG_MODE
,
GL_LINEAR
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_LINEAR"
);
...
...
@@ -3937,7 +3937,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
break
;
}
}
case
D3DFOG_NONE
:
{
case
WINE
D3DFOG_NONE
:
{
/* Both are none? According to msdn the alpha channel of the specular
* color contains a fog factor. Set it in drawStridedSlow.
* Same happens with Vertexfog on transformed vertices
...
...
@@ -3964,7 +3964,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
glHint
(
GL_FOG_HINT
,
GL_NICEST
);
checkGLcall
(
"glHint(GL_FOG_HINT, GL_NICEST)"
);
switch
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGTABLEMODE
])
{
case
D3DFOG_EXP
:
glFogi
(
GL_FOG_MODE
,
GL_EXP
);
case
WINED3DFOG_EXP
:
glFogi
(
GL_FOG_MODE
,
GL_EXP
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_EXP"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
))
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
...
...
@@ -3973,7 +3974,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
IWineD3DDevice_SetRenderState
(
iface
,
WINED3DRS_FOGEND
,
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGEND
]);
}
break
;
case
D3DFOG_EXP2
:
glFogi
(
GL_FOG_MODE
,
GL_EXP2
);
case
WINED3DFOG_EXP2
:
glFogi
(
GL_FOG_MODE
,
GL_EXP2
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_EXP2"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
))
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
...
...
@@ -3982,7 +3984,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
IWineD3DDevice_SetRenderState
(
iface
,
WINED3DRS_FOGEND
,
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGEND
]);
}
break
;
case
D3DFOG_LINEAR
:
glFogi
(
GL_FOG_MODE
,
GL_LINEAR
);
case
WINED3DFOG_LINEAR
:
glFogi
(
GL_FOG_MODE
,
GL_LINEAR
);
checkGLcall
(
"glFogi(GL_FOG_MODE, GL_LINEAR"
);
if
(
GL_SUPPORT
(
EXT_FOG_COORD
))
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
...
...
@@ -3991,8 +3994,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
IWineD3DDevice_SetRenderState
(
iface
,
WINED3DRS_FOGEND
,
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGEND
]);
}
break
;
case
D3DFOG_NONE
:
/* Won't happen */
default:
FIXME
(
"Unexpected WINED3DRS_FOGTABLEMODE %d
\n
"
,
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGTABLEMODE
]);
case
WINED3DFOG_NONE
:
default:
/* Won't happen */
FIXME
(
"Unexpected WINED3DRS_FOGTABLEMODE %d
\n
"
,
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGTABLEMODE
]);
}
}
if
(
GL_SUPPORT
(
NV_FOG_DISTANCE
))
{
...
...
dlls/wined3d/drawprim.c
View file @
4eced8ea
...
...
@@ -201,7 +201,7 @@ void d3ddevice_set_ortho(IWineD3DDeviceImpl *This) {
}
/* Vertex fog on transformed vertices? Use the calculated fog factor stored in the specular color */
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGENABLE
]
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
!=
D3DFOG_NONE
)
{
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGENABLE
]
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
!=
WINE
D3DFOG_NONE
)
{
if
(
GL_SUPPORT
(
EXT_FOG_COORD
))
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FOG_COORDINATE_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT)"
);
...
...
@@ -326,7 +326,7 @@ static void primitiveInitState(
glFogf
(
GL_FOG_END
,
0
.
0
f
);
}
else
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGENABLE
]
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
!=
D3DFOG_NONE
)
{
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
!=
WINE
D3DFOG_NONE
)
{
if
(
GL_SUPPORT
(
EXT_FOG_COORD
))
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
...
...
@@ -1508,8 +1508,8 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
if
(
sd
->
u
.
s
.
specular
.
lpData
!=
NULL
)
{
/* special case where the fog density is stored in the diffuse alpha channel */
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGENABLE
]
&&
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
==
D3DFOG_NONE
||
sd
->
u
.
s
.
position
.
dwType
==
WINED3DDECLTYPE_FLOAT4
)
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGTABLEMODE
]
==
D3DFOG_NONE
)
{
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
==
WINE
D3DFOG_NONE
||
sd
->
u
.
s
.
position
.
dwType
==
WINED3DDECLTYPE_FLOAT4
)
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGTABLEMODE
]
==
WINE
D3DFOG_NONE
)
{
if
(
GL_SUPPORT
(
EXT_FOG_COORD
))
{
GL_EXTCALL
(
glFogCoordfEXT
(
specularColor
>>
24
));
}
else
{
...
...
dlls/wined3d/stateblock.c
View file @
4eced8ea
...
...
@@ -863,7 +863,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_SPECULARENABLE
,
FALSE
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_ZVISIBLE
,
0
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_FOGCOLOR
,
0
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_FOGTABLEMODE
,
D3DFOG_NONE
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_FOGTABLEMODE
,
WINE
D3DFOG_NONE
);
tmpfloat
.
f
=
0
.
0
f
;
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_FOGSTART
,
tmpfloat
.
d
);
tmpfloat
.
f
=
1
.
0
f
;
...
...
@@ -900,7 +900,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_CLIPPING
,
TRUE
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_LIGHTING
,
TRUE
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_AMBIENT
,
0
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_FOGVERTEXMODE
,
D3DFOG_NONE
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_FOGVERTEXMODE
,
WINE
D3DFOG_NONE
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_COLORVERTEX
,
TRUE
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_LOCALVIEWER
,
TRUE
);
IWineD3DDevice_SetRenderState
(
device
,
WINED3DRS_NORMALIZENORMALS
,
FALSE
);
...
...
include/wine/wined3d_types.h
View file @
4eced8ea
...
...
@@ -478,6 +478,15 @@ typedef enum _WINED3DZBUFFERTYPE {
WINED3DZB_FORCE_DWORD
=
0x7fffffff
}
WINED3DZBUFFERTYPE
;
typedef
enum
_WINED3DFOGMODE
{
WINED3DFOG_NONE
=
0
,
WINED3DFOG_EXP
=
1
,
WINED3DFOG_EXP2
=
2
,
WINED3DFOG_LINEAR
=
3
,
WINED3DFOG_FORCE_DWORD
=
0x7fffffff
}
WINED3DFOGMODE
;
typedef
struct
_WINED3DDISPLAYMODE
{
UINT
Width
;
UINT
Height
;
...
...
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