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
edae5d54
Commit
edae5d54
authored
Nov 05, 2008
by
Tony Wasserka
Committed by
Alexandre Julliard
Nov 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement ID3DXSprite_Draw.
parent
d0fd93ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
3 deletions
+73
-3
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+2
-1
sprite.c
dlls/d3dx9_36/sprite.c
+71
-2
No files found.
dlls/d3dx9_36/d3dx9_36_private.h
View file @
edae5d54
...
...
@@ -68,7 +68,8 @@ typedef struct ID3DXSpriteImpl
DWORD
alphacmp_caps
;
SPRITE
*
sprites
;
int
sprite_count
;
int
sprite_count
;
/* number of sprites to be drawn */
int
allocated_sprites
;
/* number of (pre-)allocated sprites */
}
ID3DXSpriteImpl
;
...
...
dlls/d3dx9_36/sprite.c
View file @
edae5d54
...
...
@@ -51,6 +51,14 @@ static ULONG WINAPI ID3DXSpriteImpl_Release(LPD3DXSPRITE iface)
TRACE
(
"(%p): ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
if
(
This
->
sprites
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
sprite_count
;
i
++
)
if
(
This
->
sprites
[
i
].
texture
)
IDirect3DTexture9_Release
(
This
->
sprites
[
i
].
texture
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
sprites
);
}
if
(
This
->
stateblock
)
IDirect3DStateBlock9_Release
(
This
->
stateblock
);
if
(
This
->
vdecl
)
IDirect3DVertexDeclaration9_Release
(
This
->
vdecl
);
if
(
This
->
device
)
IDirect3DDevice9_Release
(
This
->
device
);
...
...
@@ -105,14 +113,71 @@ static HRESULT WINAPI ID3DXSpriteImpl_Draw(LPD3DXSPRITE iface, LPDIRECT3DTEXTURE
CONST
D3DXVECTOR3
*
position
,
D3DCOLOR
color
)
{
ID3DXSpriteImpl
*
This
=
(
ID3DXSpriteImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
E_NOTIMPL
;
D3DSURFACE_DESC
texdesc
;
TRACE
(
"(%p): relay
\n
"
,
This
);
if
(
texture
==
NULL
)
return
D3DERR_INVALIDCALL
;
if
(
This
->
allocated_sprites
==
0
)
{
This
->
sprites
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
32
*
sizeof
(
SPRITE
));
This
->
allocated_sprites
=
32
;
}
else
if
(
This
->
allocated_sprites
<=
This
->
sprite_count
)
{
This
->
allocated_sprites
=
This
->
allocated_sprites
*
3
/
2
;
This
->
sprites
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
This
->
sprites
,
This
->
allocated_sprites
*
sizeof
(
SPRITE
));
}
This
->
sprites
[
This
->
sprite_count
].
texture
=
texture
;
IUnknown_AddRef
(
texture
);
/* Reuse the texture desc if possible */
if
(
This
->
sprite_count
)
{
if
(
This
->
sprites
[
This
->
sprite_count
-
1
].
texture
!=
texture
)
{
IDirect3DTexture9_GetLevelDesc
(
texture
,
0
,
&
texdesc
);
}
else
{
texdesc
.
Width
=
This
->
sprites
[
This
->
sprite_count
-
1
].
texw
;
texdesc
.
Height
=
This
->
sprites
[
This
->
sprite_count
-
1
].
texh
;
}
}
else
IDirect3DTexture9_GetLevelDesc
(
texture
,
0
,
&
texdesc
);
This
->
sprites
[
This
->
sprite_count
].
texw
=
texdesc
.
Width
;
This
->
sprites
[
This
->
sprite_count
].
texh
=
texdesc
.
Height
;
if
(
rect
==
NULL
)
{
This
->
sprites
[
This
->
sprite_count
].
rect
.
left
=
0
;
This
->
sprites
[
This
->
sprite_count
].
rect
.
top
=
0
;
This
->
sprites
[
This
->
sprite_count
].
rect
.
right
=
texdesc
.
Width
;
This
->
sprites
[
This
->
sprite_count
].
rect
.
bottom
=
texdesc
.
Height
;
}
else
This
->
sprites
[
This
->
sprite_count
].
rect
=*
rect
;
if
(
center
==
NULL
)
{
This
->
sprites
[
This
->
sprite_count
].
center
.
x
=
0
.
0
f
;
This
->
sprites
[
This
->
sprite_count
].
center
.
y
=
0
.
0
f
;
This
->
sprites
[
This
->
sprite_count
].
center
.
z
=
0
.
0
f
;
}
else
This
->
sprites
[
This
->
sprite_count
].
center
=*
center
;
if
(
position
==
NULL
)
{
This
->
sprites
[
This
->
sprite_count
].
pos
.
x
=
0
.
0
f
;
This
->
sprites
[
This
->
sprite_count
].
pos
.
y
=
0
.
0
f
;
This
->
sprites
[
This
->
sprite_count
].
pos
.
z
=
0
.
0
f
;
}
else
This
->
sprites
[
This
->
sprite_count
].
pos
=*
position
;
This
->
sprites
[
This
->
sprite_count
].
color
=
color
;
This
->
sprite_count
++
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXSpriteImpl_Flush
(
LPD3DXSPRITE
iface
)
{
ID3DXSpriteImpl
*
This
=
(
ID3DXSpriteImpl
*
)
iface
;
int
i
;
FIXME
(
"(%p): stub
\n
"
,
This
);
for
(
i
=
0
;
i
<
This
->
sprite_count
;
i
++
)
if
(
This
->
sprites
[
i
].
texture
)
IDirect3DTexture9_Release
(
This
->
sprites
[
i
].
texture
);
This
->
sprite_count
=
0
;
return
E_NOTIMPL
;
}
...
...
@@ -120,6 +185,9 @@ static HRESULT WINAPI ID3DXSpriteImpl_End(LPD3DXSPRITE iface)
{
ID3DXSpriteImpl
*
This
=
(
ID3DXSpriteImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
ID3DXSprite_Flush
(
iface
);
return
E_NOTIMPL
;
}
...
...
@@ -198,6 +266,7 @@ HRESULT WINAPI D3DXCreateSprite(LPDIRECT3DDEVICE9 device, LPD3DXSPRITE *sprite)
object
->
sprites
=
NULL
;
object
->
sprite_count
=
0
;
object
->
allocated_sprites
=
0
;
*
sprite
=
(
ID3DXSprite
*
)
object
;
...
...
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