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
d0f15692
Commit
d0f15692
authored
Jan 03, 2003
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jan 03, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- light improvements
- misc. fixes
parent
939ebca8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
11 deletions
+80
-11
d3dcommon.c
dlls/ddraw/d3dcommon.c
+7
-7
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+57
-4
mesa.c
dlls/ddraw/mesa.c
+16
-0
No files found.
dlls/ddraw/d3dcommon.c
View file @
d0f15692
...
...
@@ -208,13 +208,13 @@ dump_D3DLIGHT7(LPD3DLIGHT7 lpLight)
void
dump_DPFLAGS
(
DWORD
dwFlags
)
{
static
const
flag_info
flags
[]
=
{
FE
(
D3DDP_WAIT
),
FE
(
D3DDP_OUTOFORDER
),
FE
(
D3DDP_DONOTCLIP
),
FE
(
D3DDP_DONOTUPDATEEXTENTS
),
FE
(
D3DDP_DONOTLIGHT
)
static
const
flag_info
flags
[]
=
{
FE
(
D3DDP_WAIT
),
FE
(
D3DDP_OUTOFORDER
),
FE
(
D3DDP_DONOTCLIP
),
FE
(
D3DDP_DONOTUPDATEEXTENTS
),
FE
(
D3DDP_DONOTLIGHT
)
};
DDRAW_dump_flags
(
dwFlags
,
flags
,
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]));
...
...
dlls/ddraw/d3ddevice/mesa.c
View file @
d0f15692
...
...
@@ -912,6 +912,8 @@ void dump_flexible_vertex(DWORD d3dvtVertexType)
FE
(
D3DFVF_DIFFUSE
),
FE
(
D3DFVF_SPECULAR
)
};
int
i
;
if
(
d3dvtVertexType
&
D3DFVF_RESERVED0
)
DPRINTF
(
"D3DFVF_RESERVED0 "
);
switch
(
d3dvtVertexType
&
D3DFVF_POSITION_MASK
)
{
#define GEN_CASE(a) case a: DPRINTF(#a " "); break
...
...
@@ -936,6 +938,9 @@ void dump_flexible_vertex(DWORD d3dvtVertexType)
GEN_CASE
(
D3DFVF_TEX8
);
}
#undef GEN_CASE
for
(
i
=
0
;
i
<
((
d3dvtVertexType
&
D3DFVF_TEXCOUNT_MASK
)
>>
D3DFVF_TEXCOUNT_SHIFT
);
i
++
)
{
DPRINTF
(
" T%d-s%ld"
,
i
+
1
,
(((
d3dvtVertexType
>>
(
16
+
(
2
*
i
)))
+
1
)
&
0x03
)
+
1
);
}
DPRINTF
(
"
\n
"
);
}
...
...
@@ -1627,21 +1632,69 @@ GL_IDirect3DDeviceImpl_7_SetLight(LPDIRECT3DDEVICE7 iface,
This
->
light_parameters
[
dwLightIndex
]
=
*
lpLight
;
switch
(
lpLight
->
dltType
)
{
case
D3DLIGHT_DIRECTIONAL
:
{
/* 3 */
case
D3DLIGHT_DIRECTIONAL
:
{
float
direction
[
4
];
float
cut_off
=
180
.
0
;
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_AMBIENT
,
(
float
*
)
&
(
lpLight
->
dcvAmbient
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_DIFFUSE
,
(
float
*
)
&
(
lpLight
->
dcvDiffuse
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_SPECULAR
,
(
float
*
)
&
(
lpLight
->
dcvSpecular
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_SPOT_CUTOFF
,
&
cut_off
);
direction
[
0
]
=
lpLight
->
dvDirection
.
u1
.
x
;
direction
[
1
]
=
lpLight
->
dvDirection
.
u2
.
y
;
direction
[
2
]
=
lpLight
->
dvDirection
.
u3
.
z
;
direction
[
3
]
=
0
.
0
;
/* This is a directional light */
direction
[
3
]
=
0
.
0
;
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_POSITION
,
(
float
*
)
direction
);
}
break
;
case
D3DLIGHT_POINT
:
{
float
position
[
4
];
float
cut_off
=
180
.
0
;
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_AMBIENT
,
(
float
*
)
&
(
lpLight
->
dcvAmbient
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_DIFFUSE
,
(
float
*
)
&
(
lpLight
->
dcvDiffuse
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_SPECULAR
,
(
float
*
)
&
(
lpLight
->
dcvSpecular
));
position
[
0
]
=
lpLight
->
dvPosition
.
u1
.
x
;
position
[
1
]
=
lpLight
->
dvPosition
.
u2
.
y
;
position
[
2
]
=
lpLight
->
dvPosition
.
u3
.
z
;
position
[
3
]
=
1
.
0
;
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_POSITION
,
(
float
*
)
position
);
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_CONSTANT_ATTENUATION
,
&
(
lpLight
->
dvAttenuation0
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_LINEAR_ATTENUATION
,
&
(
lpLight
->
dvAttenuation1
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_QUADRATIC_ATTENUATION
,
&
(
lpLight
->
dvAttenuation2
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_SPOT_CUTOFF
,
&
cut_off
);
}
break
;
case
D3DLIGHT_SPOT
:
{
float
direction
[
4
];
float
position
[
4
];
float
cut_off
=
90
.
0
*
(
lpLight
->
dvPhi
/
M_PI
);
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_AMBIENT
,
(
float
*
)
&
(
lpLight
->
dcvAmbient
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_DIFFUSE
,
(
float
*
)
&
(
lpLight
->
dcvDiffuse
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_SPECULAR
,
(
float
*
)
&
(
lpLight
->
dcvSpecular
));
direction
[
0
]
=
lpLight
->
dvDirection
.
u1
.
x
;
direction
[
1
]
=
lpLight
->
dvDirection
.
u2
.
y
;
direction
[
2
]
=
lpLight
->
dvDirection
.
u3
.
z
;
direction
[
3
]
=
0
.
0
;
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_SPOT_DIRECTION
,
(
float
*
)
direction
);
position
[
0
]
=
lpLight
->
dvPosition
.
u1
.
x
;
position
[
1
]
=
lpLight
->
dvPosition
.
u2
.
y
;
position
[
2
]
=
lpLight
->
dvPosition
.
u3
.
z
;
position
[
3
]
=
1
.
0
;
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_POSITION
,
(
float
*
)
position
);
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_CONSTANT_ATTENUATION
,
&
(
lpLight
->
dvAttenuation0
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_LINEAR_ATTENUATION
,
&
(
lpLight
->
dvAttenuation1
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_QUADRATIC_ATTENUATION
,
&
(
lpLight
->
dvAttenuation2
));
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_SPOT_CUTOFF
,
&
cut_off
);
glLightfv
(
GL_LIGHT0
+
dwLightIndex
,
GL_SPOT_EXPONENT
,
&
(
lpLight
->
dvFalloff
));
if
((
lpLight
->
dvTheta
!=
0
.
0
)
||
(
lpLight
->
dvTheta
!=
lpLight
->
dvPhi
))
{
WARN
(
"dvTheta not fully supported yet !
\n
"
);
}
}
break
;
default
:
WARN
(
" light type not handled yet...
\n
"
);
}
...
...
dlls/ddraw/mesa.c
View file @
d0f15692
...
...
@@ -503,6 +503,22 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
}
break
;
case
D3DRENDERSTATE_DIFFUSEMATERIALSOURCE
:
/* 145 */
rs
->
color_diffuse
=
dwRenderState
;
break
;
case
D3DRENDERSTATE_SPECULARMATERIALSOURCE
:
/* 146 */
rs
->
color_specular
=
dwRenderState
;
break
;
case
D3DRENDERSTATE_AMBIENTMATERIALSOURCE
:
/* 147 */
rs
->
color_ambient
=
dwRenderState
;
break
;
case
D3DRENDERSTATE_EMISSIVEMATERIALSOURCE
:
/* 148 */
rs
->
color_emissive
=
dwRenderState
;
break
;
default:
ERR
(
"Unhandled dwRenderStateType %s (%08x) !
\n
"
,
_get_renderstate
(
dwRenderStateType
),
dwRenderStateType
);
}
...
...
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