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
d0fd93ef
Commit
d0fd93ef
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 D3DXCreateSprite.
parent
5ddcedff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
1 deletion
+56
-1
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+26
-0
sprite.c
dlls/d3dx9_36/sprite.c
+30
-1
No files found.
dlls/d3dx9_36/d3dx9_36_private.h
View file @
d0fd93ef
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "d3dx9.h"
#include "d3dx9.h"
/* ID3DXFont */
typedef
struct
ID3DXFontImpl
typedef
struct
ID3DXFontImpl
{
{
/* IUnknown fields */
/* IUnknown fields */
...
@@ -36,6 +37,17 @@ typedef struct ID3DXFontImpl
...
@@ -36,6 +37,17 @@ typedef struct ID3DXFontImpl
/* ID3DXFont fields */
/* ID3DXFont fields */
}
ID3DXFontImpl
;
}
ID3DXFontImpl
;
/*ID3DXSprite */
typedef
struct
_SPRITE
{
LPDIRECT3DTEXTURE9
texture
;
UINT
texw
,
texh
;
RECT
rect
;
D3DXVECTOR3
center
;
D3DXVECTOR3
pos
;
D3DCOLOR
color
;
}
SPRITE
;
typedef
struct
ID3DXSpriteImpl
typedef
struct
ID3DXSpriteImpl
{
{
/* IUnknown fields */
/* IUnknown fields */
...
@@ -43,6 +55,20 @@ typedef struct ID3DXSpriteImpl
...
@@ -43,6 +55,20 @@ typedef struct ID3DXSpriteImpl
LONG
ref
;
LONG
ref
;
/* ID3DXSprite fields */
/* ID3DXSprite fields */
IDirect3DDevice9
*
device
;
IDirect3DVertexDeclaration9
*
vdecl
;
IDirect3DStateBlock9
*
stateblock
;
D3DXMATRIX
transform
;
D3DXMATRIX
view
;
DWORD
flags
;
/* Store the relevant caps to prevent multiple GetDeviceCaps calls */
DWORD
texfilter_caps
;
DWORD
maxanisotropy
;
DWORD
alphacmp_caps
;
SPRITE
*
sprites
;
int
sprite_count
;
}
ID3DXSpriteImpl
;
}
ID3DXSpriteImpl
;
...
...
dlls/d3dx9_36/sprite.c
View file @
d0fd93ef
...
@@ -51,6 +51,9 @@ static ULONG WINAPI ID3DXSpriteImpl_Release(LPD3DXSPRITE iface)
...
@@ -51,6 +51,9 @@ static ULONG WINAPI ID3DXSpriteImpl_Release(LPD3DXSPRITE iface)
TRACE
(
"(%p): ReleaseRef to %d
\n
"
,
This
,
ref
);
TRACE
(
"(%p): ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
if
(
ref
==
0
)
{
if
(
This
->
stateblock
)
IDirect3DStateBlock9_Release
(
This
->
stateblock
);
if
(
This
->
vdecl
)
IDirect3DVertexDeclaration9_Release
(
This
->
vdecl
);
if
(
This
->
device
)
IDirect3DDevice9_Release
(
This
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
return
ref
;
return
ref
;
...
@@ -157,8 +160,16 @@ static const ID3DXSpriteVtbl D3DXSprite_Vtbl =
...
@@ -157,8 +160,16 @@ static const ID3DXSpriteVtbl D3DXSprite_Vtbl =
HRESULT
WINAPI
D3DXCreateSprite
(
LPDIRECT3DDEVICE9
device
,
LPD3DXSPRITE
*
sprite
)
HRESULT
WINAPI
D3DXCreateSprite
(
LPDIRECT3DDEVICE9
device
,
LPD3DXSPRITE
*
sprite
)
{
{
ID3DXSpriteImpl
*
object
;
ID3DXSpriteImpl
*
object
;
D3DCAPS9
caps
;
static
const
D3DVERTEXELEMENT9
elements
[]
=
{
{
0
,
0
,
D3DDECLTYPE_FLOAT3
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
0
,
12
,
D3DDECLTYPE_D3DCOLOR
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_COLOR
,
0
},
{
0
,
16
,
D3DDECLTYPE_FLOAT2
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_TEXCOORD
,
0
},
D3DDECL_END
()
};
FIXME
(
"stub
\n
"
);
TRACE
(
"(void): relay
\n
"
);
if
(
device
==
NULL
||
sprite
==
NULL
)
return
D3DERR_INVALIDCALL
;
if
(
device
==
NULL
||
sprite
==
NULL
)
return
D3DERR_INVALIDCALL
;
...
@@ -169,6 +180,24 @@ HRESULT WINAPI D3DXCreateSprite(LPDIRECT3DDEVICE9 device, LPD3DXSPRITE *sprite)
...
@@ -169,6 +180,24 @@ HRESULT WINAPI D3DXCreateSprite(LPDIRECT3DDEVICE9 device, LPD3DXSPRITE *sprite)
}
}
object
->
lpVtbl
=&
D3DXSprite_Vtbl
;
object
->
lpVtbl
=&
D3DXSprite_Vtbl
;
object
->
ref
=
1
;
object
->
ref
=
1
;
object
->
device
=
device
;
IUnknown_AddRef
(
device
);
IDirect3DDevice9_CreateVertexDeclaration
(
object
->
device
,
elements
,
&
object
->
vdecl
);
object
->
stateblock
=
NULL
;
D3DXMatrixIdentity
(
&
object
->
transform
);
D3DXMatrixIdentity
(
&
object
->
view
);
object
->
flags
=
0
;
IDirect3DDevice9_GetDeviceCaps
(
device
,
&
caps
);
object
->
texfilter_caps
=
caps
.
TextureFilterCaps
;
object
->
maxanisotropy
=
caps
.
MaxAnisotropy
;
object
->
alphacmp_caps
=
caps
.
AlphaCmpCaps
;
object
->
sprites
=
NULL
;
object
->
sprite_count
=
0
;
*
sprite
=
(
ID3DXSprite
*
)
object
;
*
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