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
67dadeb7
Commit
67dadeb7
authored
Nov 07, 2008
by
Tony Wasserka
Committed by
Alexandre Julliard
Nov 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement ID3DXSprite_Flush.
parent
6fae43c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
2 deletions
+52
-2
sprite.c
dlls/d3dx9_36/sprite.c
+52
-2
No files found.
dlls/d3dx9_36/sprite.c
View file @
67dadeb7
...
...
@@ -302,10 +302,60 @@ static HRESULT WINAPI ID3DXSpriteImpl_Draw(LPD3DXSPRITE iface, LPDIRECT3DTEXTURE
static
HRESULT
WINAPI
ID3DXSpriteImpl_Flush
(
LPD3DXSPRITE
iface
)
{
ID3DXSpriteImpl
*
This
=
(
ID3DXSpriteImpl
*
)
iface
;
SPRITEVERTEX
*
vertices
;
int
i
;
FIXME
(
"(%p): stub
\n
"
,
This
);
TRACE
(
"(%p): relay
\n
"
,
This
);
if
(
!
This
->
ready
)
return
D3DERR_INVALIDCALL
;
if
(
!
This
->
sprite_count
)
return
D3D_OK
;
/* TODO: use of a vertex buffer here */
vertices
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
SPRITEVERTEX
)
*
4
*
This
->
sprite_count
);
for
(
i
=
0
;
i
<
This
->
sprite_count
;
i
++
)
{
float
spritewidth
=
(
float
)
This
->
sprites
[
i
].
rect
.
right
-
(
float
)
This
->
sprites
[
i
].
rect
.
left
;
float
spriteheight
=
(
float
)
This
->
sprites
[
i
].
rect
.
bottom
-
(
float
)
This
->
sprites
[
i
].
rect
.
top
;
vertices
[
4
*
i
].
pos
.
x
=
This
->
sprites
[
i
].
pos
.
x
-
This
->
sprites
[
i
].
center
.
x
;
vertices
[
4
*
i
].
pos
.
y
=
This
->
sprites
[
i
].
pos
.
y
-
This
->
sprites
[
i
].
center
.
y
;
vertices
[
4
*
i
].
pos
.
z
=
This
->
sprites
[
i
].
pos
.
z
-
This
->
sprites
[
i
].
center
.
z
;
vertices
[
4
*
i
+
1
].
pos
.
x
=
spritewidth
+
This
->
sprites
[
i
].
pos
.
x
-
This
->
sprites
[
i
].
center
.
x
;
vertices
[
4
*
i
+
1
].
pos
.
y
=
This
->
sprites
[
i
].
pos
.
y
-
This
->
sprites
[
i
].
center
.
y
;
vertices
[
4
*
i
+
1
].
pos
.
z
=
This
->
sprites
[
i
].
pos
.
z
-
This
->
sprites
[
i
].
center
.
z
;
vertices
[
4
*
i
+
2
].
pos
.
x
=
spritewidth
+
This
->
sprites
[
i
].
pos
.
x
-
This
->
sprites
[
i
].
center
.
x
;
vertices
[
4
*
i
+
2
].
pos
.
y
=
spriteheight
+
This
->
sprites
[
i
].
pos
.
y
-
This
->
sprites
[
i
].
center
.
y
;
vertices
[
4
*
i
+
2
].
pos
.
z
=
This
->
sprites
[
i
].
pos
.
z
-
This
->
sprites
[
i
].
center
.
z
;
vertices
[
4
*
i
+
3
].
pos
.
x
=
This
->
sprites
[
i
].
pos
.
x
-
This
->
sprites
[
i
].
center
.
x
;
vertices
[
4
*
i
+
3
].
pos
.
y
=
spriteheight
+
This
->
sprites
[
i
].
pos
.
y
-
This
->
sprites
[
i
].
center
.
y
;
vertices
[
4
*
i
+
3
].
pos
.
z
=
This
->
sprites
[
i
].
pos
.
z
-
This
->
sprites
[
i
].
center
.
z
;
vertices
[
4
*
i
].
col
=
This
->
sprites
[
i
].
color
;
vertices
[
4
*
i
+
1
].
col
=
This
->
sprites
[
i
].
color
;
vertices
[
4
*
i
+
2
].
col
=
This
->
sprites
[
i
].
color
;
vertices
[
4
*
i
+
3
].
col
=
This
->
sprites
[
i
].
color
;
vertices
[
4
*
i
].
tex
.
x
=
(
float
)
This
->
sprites
[
i
].
rect
.
left
/
(
float
)
This
->
sprites
[
i
].
texw
;
vertices
[
4
*
i
].
tex
.
y
=
(
float
)
This
->
sprites
[
i
].
rect
.
top
/
(
float
)
This
->
sprites
[
i
].
texh
;
vertices
[
4
*
i
+
1
].
tex
.
x
=
(
float
)
This
->
sprites
[
i
].
rect
.
right
/
(
float
)
This
->
sprites
[
i
].
texw
;
vertices
[
4
*
i
+
1
].
tex
.
y
=
(
float
)
This
->
sprites
[
i
].
rect
.
top
/
(
float
)
This
->
sprites
[
i
].
texh
;
vertices
[
4
*
i
+
2
].
tex
.
x
=
(
float
)
This
->
sprites
[
i
].
rect
.
right
/
(
float
)
This
->
sprites
[
i
].
texw
;
vertices
[
4
*
i
+
2
].
tex
.
y
=
(
float
)
This
->
sprites
[
i
].
rect
.
bottom
/
(
float
)
This
->
sprites
[
i
].
texh
;
vertices
[
4
*
i
+
3
].
tex
.
x
=
(
float
)
This
->
sprites
[
i
].
rect
.
left
/
(
float
)
This
->
sprites
[
i
].
texw
;
vertices
[
4
*
i
+
3
].
tex
.
y
=
(
float
)
This
->
sprites
[
i
].
rect
.
bottom
/
(
float
)
This
->
sprites
[
i
].
texh
;
}
D3DXVec3TransformCoordArray
(
&
vertices
[
0
].
pos
,
sizeof
(
SPRITEVERTEX
),
&
vertices
[
0
].
pos
,
sizeof
(
SPRITEVERTEX
),
&
This
->
transform
,
4
*
This
->
sprite_count
);
D3DXVec3TransformCoordArray
(
&
vertices
[
0
].
pos
,
sizeof
(
SPRITEVERTEX
),
&
vertices
[
0
].
pos
,
sizeof
(
SPRITEVERTEX
),
&
This
->
view
,
4
*
This
->
sprite_count
);
IDirect3DDevice9_SetVertexDeclaration
(
This
->
device
,
This
->
vdecl
);
for
(
i
=
0
;
i
<
This
->
sprite_count
;
i
++
)
{
if
(
!
i
)
IDirect3DDevice9_SetTexture
(
This
->
device
,
0
,
(
LPDIRECT3DBASETEXTURE9
)(
This
->
sprites
[
i
].
texture
));
else
if
(
This
->
sprites
[
i
].
texture
!=
This
->
sprites
[
i
-
1
].
texture
)
IDirect3DDevice9_SetTexture
(
This
->
device
,
0
,
(
LPDIRECT3DBASETEXTURE9
)(
This
->
sprites
[
i
].
texture
));
IDirect3DDevice9_DrawPrimitiveUP
(
This
->
device
,
D3DPT_TRIANGLEFAN
,
2
,
vertices
+
4
*
i
,
sizeof
(
SPRITEVERTEX
));
}
HeapFree
(
GetProcessHeap
(),
0
,
vertices
);
for
(
i
=
0
;
i
<
This
->
sprite_count
;
i
++
)
if
(
This
->
sprites
[
i
].
texture
)
...
...
@@ -315,7 +365,7 @@ static HRESULT WINAPI ID3DXSpriteImpl_Flush(LPD3DXSPRITE iface)
/* Flush may be called more than once, so we don't reset This->ready here */
return
E_NOTIMPL
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXSpriteImpl_End
(
LPD3DXSPRITE
iface
)
...
...
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