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
b02a166c
Commit
b02a166c
authored
Jun 05, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Jun 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a get_fog_start_end() function.
parent
53ff3279
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
40 deletions
+48
-40
state.c
dlls/wined3d/state.c
+1
-40
utils.c
dlls/wined3d/utils.c
+45
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/state.c
View file @
b02a166c
...
@@ -1006,47 +1006,8 @@ void state_fogstartend(struct wined3d_context *context, const struct wined3d_sta
...
@@ -1006,47 +1006,8 @@ void state_fogstartend(struct wined3d_context *context, const struct wined3d_sta
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
float
fogstart
,
fogend
;
float
fogstart
,
fogend
;
union
{
DWORD
d
;
float
f
;
}
tmpvalue
;
switch
(
context
->
fog_source
)
{
case
FOGSOURCE_VS
:
fogstart
=
1
.
0
f
;
fogend
=
0
.
0
f
;
break
;
case
FOGSOURCE_COORD
:
fogstart
=
255
.
0
f
;
fogend
=
0
.
0
f
;
break
;
case
FOGSOURCE_FFP
:
get_fog_start_end
(
context
,
state
,
&
fogstart
,
&
fogend
);
tmpvalue
.
d
=
state
->
render_states
[
WINED3D_RS_FOGSTART
];
fogstart
=
tmpvalue
.
f
;
tmpvalue
.
d
=
state
->
render_states
[
WINED3D_RS_FOGEND
];
fogend
=
tmpvalue
.
f
;
/* Special handling for fogstart == fogend. In d3d with vertex
* fog, everything is fogged. With table fog, everything with
* fog_coord < fog_start is unfogged, and fog_coord > fog_start
* is fogged. Windows drivers disagree when fog_coord == fog_start. */
if
(
state
->
render_states
[
WINED3D_RS_FOGTABLEMODE
]
==
WINED3D_FOG_NONE
&&
fogstart
==
fogend
)
{
fogstart
=
-
INFINITY
;
fogend
=
0
.
0
f
;
}
break
;
default:
/* This should not happen.context->fog_source is set in wined3d, not the app.
* Still this is needed to make the compiler happy
*/
ERR
(
"Unexpected fog coordinate source
\n
"
);
fogstart
=
0
.
0
f
;
fogend
=
0
.
0
f
;
}
gl_info
->
gl_ops
.
gl
.
p_glFogf
(
GL_FOG_START
,
fogstart
);
gl_info
->
gl_ops
.
gl
.
p_glFogf
(
GL_FOG_START
,
fogstart
);
checkGLcall
(
"glFogf(GL_FOG_START, fogstart)"
);
checkGLcall
(
"glFogf(GL_FOG_START, fogstart)"
);
...
...
dlls/wined3d/utils.c
View file @
b02a166c
...
@@ -3654,6 +3654,51 @@ void get_pointsize(const struct wined3d_context *context, const struct wined3d_s
...
@@ -3654,6 +3654,51 @@ void get_pointsize(const struct wined3d_context *context, const struct wined3d_s
*
out_pointsize
=
pointsize
.
f
;
*
out_pointsize
=
pointsize
.
f
;
}
}
void
get_fog_start_end
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
*
start
,
float
*
end
)
{
union
{
DWORD
d
;
float
f
;
}
tmpvalue
;
switch
(
context
->
fog_source
)
{
case
FOGSOURCE_VS
:
*
start
=
1
.
0
f
;
*
end
=
0
.
0
f
;
break
;
case
FOGSOURCE_COORD
:
*
start
=
255
.
0
f
;
*
end
=
0
.
0
f
;
break
;
case
FOGSOURCE_FFP
:
tmpvalue
.
d
=
state
->
render_states
[
WINED3D_RS_FOGSTART
];
*
start
=
tmpvalue
.
f
;
tmpvalue
.
d
=
state
->
render_states
[
WINED3D_RS_FOGEND
];
*
end
=
tmpvalue
.
f
;
/* Special handling for fog_start == fog_end. In d3d with vertex
* fog, everything is fogged. With table fog, everything with
* fog_coord < fog_start is unfogged, and fog_coord > fog_start
* is fogged. Windows drivers disagree when fog_coord == fog_start. */
if
(
state
->
render_states
[
WINED3D_RS_FOGTABLEMODE
]
==
WINED3D_FOG_NONE
&&
*
start
==
*
end
)
{
*
start
=
-
INFINITY
;
*
end
=
0
.
0
f
;
}
break
;
default:
/* This should not happen, context->fog_source is set in wined3d, not the app. */
ERR
(
"Unexpected fog coordinate source.
\n
"
);
*
start
=
0
.
0
f
;
*
end
=
0
.
0
f
;
}
}
/* This small helper function is used to convert a bitmask into the number of masked bits */
/* This small helper function is used to convert a bitmask into the number of masked bits */
unsigned
int
count_bits
(
unsigned
int
mask
)
unsigned
int
count_bits
(
unsigned
int
mask
)
{
{
...
...
dlls/wined3d/wined3d_private.h
View file @
b02a166c
...
@@ -3074,6 +3074,8 @@ void get_pointsize_minmax(const struct wined3d_context *context, const struct wi
...
@@ -3074,6 +3074,8 @@ void get_pointsize_minmax(const struct wined3d_context *context, const struct wi
float
*
out_min
,
float
*
out_max
)
DECLSPEC_HIDDEN
;
float
*
out_min
,
float
*
out_max
)
DECLSPEC_HIDDEN
;
void
get_pointsize
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
void
get_pointsize
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
*
out_pointsize
,
float
*
out_att
)
DECLSPEC_HIDDEN
;
float
*
out_pointsize
,
float
*
out_att
)
DECLSPEC_HIDDEN
;
void
get_fog_start_end
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
*
start
,
float
*
end
)
DECLSPEC_HIDDEN
;
/* Using additional shader constants (uniforms in GLSL / program environment
/* Using additional shader constants (uniforms in GLSL / program environment
* or local parameters in ARB) is costly:
* or local parameters in ARB) is costly:
...
...
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