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
332d1495
Commit
332d1495
authored
Jun 20, 2007
by
Marcus Meissner
Committed by
Alexandre Julliard
Jun 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fixed pointer casting and additions.
parent
5c8b83c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
vertexbuffer.c
dlls/wined3d/vertexbuffer.c
+17
-10
No files found.
dlls/wined3d/vertexbuffer.c
View file @
332d1495
...
...
@@ -104,13 +104,20 @@ static DWORD WINAPI IWineD3DVertexBufferImpl_GetPriority(IWineD3DVertexBuffer
return
IWineD3DResourceImpl_GetPriority
((
IWineD3DResource
*
)
iface
);
}
static
void
fixup_vertices
(
BYTE
*
src
,
BYTE
*
dst
,
int
stride
,
int
num
,
BYTE
*
pos
,
BOOL
haspos
,
BYTE
*
diffuse
,
BOOL
hasdiffuse
,
BYTE
*
specular
,
BOOL
hasspecular
)
{
static
void
fixup_vertices
(
BYTE
*
src
,
BYTE
*
dst
,
int
stride
,
int
num
,
int
pos
,
BOOL
haspos
,
int
diffuse
,
BOOL
hasdiffuse
,
int
specular
,
BOOL
hasspecular
)
{
int
i
;
float
x
,
y
,
z
,
w
;
for
(
i
=
num
-
1
;
i
>=
0
;
i
--
)
{
if
(
haspos
)
{
float
*
p
=
(
float
*
)
((
(
int
)
src
+
(
int
)
pos
)
+
i
*
stride
);
float
*
p
=
(
float
*
)
((
src
+
pos
)
+
i
*
stride
);
/* rhw conversion like in drawStridedSlow */
if
(
p
[
3
]
==
1
.
0
||
((
p
[
3
]
<
eps
)
&&
(
p
[
3
]
>
-
eps
)))
{
...
...
@@ -124,15 +131,15 @@ static void fixup_vertices(BYTE *src, BYTE *dst, int stride, int num, BYTE *pos,
y
=
p
[
1
]
*
w
;
z
=
p
[
2
]
*
w
;
}
p
=
(
float
*
)
(
(
int
)
dst
+
i
*
stride
+
(
int
)
pos
);
p
=
(
float
*
)
(
dst
+
i
*
stride
+
pos
);
p
[
0
]
=
x
;
p
[
1
]
=
y
;
p
[
2
]
=
z
;
p
[
3
]
=
w
;
}
if
(
hasdiffuse
)
{
DWORD
srcColor
,
*
dstColor
=
(
DWORD
*
)
(
dst
+
i
*
stride
+
(
int
)
diffuse
);
srcColor
=
*
(
DWORD
*
)
(
(
(
int
)
src
+
(
int
)
diffuse
)
+
i
*
stride
);
DWORD
srcColor
,
*
dstColor
=
(
DWORD
*
)
(
dst
+
i
*
stride
+
diffuse
);
srcColor
=
*
(
DWORD
*
)
(
(
src
+
diffuse
)
+
i
*
stride
);
/* Color conversion like in drawStridedSlow. watch out for little endianity
* If we want that stuff to work on big endian machines too we have to consider more things
...
...
@@ -149,8 +156,8 @@ static void fixup_vertices(BYTE *src, BYTE *dst, int stride, int num, BYTE *pos,
*
dstColor
|=
(
srcColor
&
0x000000ff
)
<<
16
;
/* Blue */
}
if
(
hasspecular
)
{
DWORD
srcColor
,
*
dstColor
=
(
DWORD
*
)
(
dst
+
i
*
stride
+
(
int
)
specular
);
srcColor
=
*
(
DWORD
*
)
(
(
(
int
)
src
+
(
int
)
specular
)
+
i
*
stride
);
DWORD
srcColor
,
*
dstColor
=
(
DWORD
*
)
(
dst
+
i
*
stride
+
specular
);
srcColor
=
*
(
DWORD
*
)
(
(
src
+
specular
)
+
i
*
stride
);
/* Similar to diffuse
* TODO: Write the alpha value out for fog coords
...
...
@@ -365,13 +372,13 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if
fixup_vertices
(
data
,
data
,
stride
,
(
end
-
start
)
/
stride
,
/* Position */
This
->
strided
.
u
.
s
.
position
.
lpData
,
/* Data location */
(
int
)
This
->
strided
.
u
.
s
.
position
.
lpData
,
/* Data location */
This
->
strided
.
u
.
s
.
position_transformed
,
/* Do convert? */
/* Diffuse color */
This
->
strided
.
u
.
s
.
diffuse
.
lpData
,
/* Location */
(
int
)
This
->
strided
.
u
.
s
.
diffuse
.
lpData
,
/* Location */
This
->
strided
.
u
.
s
.
diffuse
.
dwType
==
WINED3DDECLTYPE_SHORT4
||
This
->
strided
.
u
.
s
.
diffuse
.
dwType
==
WINED3DDECLTYPE_D3DCOLOR
,
/* Convert? */
/* specular color */
This
->
strided
.
u
.
s
.
specular
.
lpData
,
/* location */
(
int
)
This
->
strided
.
u
.
s
.
specular
.
lpData
,
/* location */
This
->
strided
.
u
.
s
.
specular
.
dwType
==
WINED3DDECLTYPE_SHORT4
||
This
->
strided
.
u
.
s
.
specular
.
dwType
==
WINED3DDECLTYPE_D3DCOLOR
);
ENTER_GL
();
...
...
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