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
177aa5c2
Commit
177aa5c2
authored
Sep 26, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Get rid of the ID3DXFileImpl typedef.
parent
4a9da034
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
59 deletions
+52
-59
xfile.c
dlls/d3dx9_36/xfile.c
+52
-59
No files found.
dlls/d3dx9_36/xfile.c
View file @
177aa5c2
...
...
@@ -46,11 +46,12 @@ static HRESULT error_dxfile_to_d3dxfile(HRESULT error)
}
}
typedef
struct
{
struct
d3dx9_file
{
ID3DXFile
ID3DXFile_iface
;
LONG
ref
;
IDirectXFile
*
dxfile
;
}
ID3DXFileImpl
;
};
typedef
struct
{
ID3DXFileEnumObject
ID3DXFileEnumObject_iface
;
...
...
@@ -69,9 +70,9 @@ typedef struct {
}
ID3DXFileDataImpl
;
static
inline
ID3DXFileImpl
*
impl_from_ID3DXFile
(
ID3DXFile
*
iface
)
static
inline
struct
d3dx9_file
*
impl_from_ID3DXFile
(
ID3DXFile
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ID3DXFileImpl
,
ID3DXFile_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3dx9_file
,
ID3DXFile_iface
);
}
static
inline
ID3DXFileEnumObjectImpl
*
impl_from_ID3DXFileEnumObject
(
ID3DXFileEnumObject
*
iface
)
...
...
@@ -493,60 +494,54 @@ static const ID3DXFileEnumObjectVtbl ID3DXFileEnumObject_Vtbl =
ID3DXFileEnumObjectImpl_GetDataObjectByName
};
/*** IUnknown methods ***/
static
HRESULT
WINAPI
ID3DXFileImpl_QueryInterface
(
ID3DXFile
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
static
HRESULT
WINAPI
d3dx9_file_QueryInterface
(
ID3DXFile
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"
(%p)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ret_iface
);
TRACE
(
"
iface %p, riid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_I
Unknown
)
||
IsEqualGUID
(
riid
,
&
IID_ID3DXFile
))
if
(
IsEqualGUID
(
riid
,
&
IID_I
D3DXFile
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
iface
->
lpVtbl
->
AddRef
(
iface
);
*
ret_iface
=
iface
;
*
out
=
iface
;
return
S_OK
;
}
WARN
(
"(%p)->(%s, %p), not found
\n
"
,
iface
,
debugstr_guid
(
riid
),
ret_iface
);
*
ret_iface
=
NULL
;
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ID3DXFileImpl_AddRef
(
ID3DXFile
*
iface
)
static
ULONG
WINAPI
d3dx9_file_AddRef
(
ID3DXFile
*
iface
)
{
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
d3dx9_file
*
file
=
impl_from_ID3DXFile
(
iface
);
ULONG
ref
count
=
InterlockedIncrement
(
&
file
->
ref
);
TRACE
(
"
(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
TRACE
(
"
%p increasing refcount to %u.
\n
"
,
file
,
refcount
);
return
ref
;
return
ref
count
;
}
static
ULONG
WINAPI
ID3DXFileImpl_Release
(
ID3DXFile
*
iface
)
static
ULONG
WINAPI
d3dx9_file_Release
(
ID3DXFile
*
iface
)
{
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
d3dx9_file
*
file
=
impl_from_ID3DXFile
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
file
->
ref
);
TRACE
(
"
(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
TRACE
(
"
%p decreasing refcount to %u.
\n
"
,
file
,
refcount
);
if
(
!
ref
)
if
(
!
ref
count
)
{
IDirectXFile_Release
(
This
->
dxfile
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
IDirectXFile_Release
(
file
->
dxfile
);
HeapFree
(
GetProcessHeap
(),
0
,
file
);
}
return
ref
;
return
ref
count
;
}
/*** ID3DXFile methods ***/
static
HRESULT
WINAPI
ID3DXFileImpl_CreateEnumObject
(
ID3DXFile
*
iface
,
const
void
*
source
,
D3DXF_FILELOADOPTIONS
options
,
ID3DXFileEnumObject
**
enum_object
)
static
HRESULT
WINAPI
d3dx9_file_CreateEnumObject
(
ID3DXFile
*
iface
,
const
void
*
source
,
D3DXF_FILELOADOPTIONS
options
,
ID3DXFileEnumObject
**
enum_object
)
{
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
struct
d3dx9_file
*
file
=
impl_from_ID3DXFile
(
iface
);
ID3DXFileEnumObjectImpl
*
object
;
IDirectXFileEnumObject
*
dxfile_enum_object
;
void
*
dxfile_source
;
...
...
@@ -556,7 +551,7 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi
IDirectXFileData
*
data_object
;
HRESULT
ret
;
TRACE
(
"
(%p)->(%p, %x, %p)
\n
"
,
iface
,
source
,
options
,
enum_object
);
TRACE
(
"
iface %p, source %p, options %#x, enum_object %p.
\n
"
,
iface
,
source
,
options
,
enum_object
);
if
(
!
enum_object
)
return
E_POINTER
;
...
...
@@ -600,7 +595,7 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi
object
->
ID3DXFileEnumObject_iface
.
lpVtbl
=
&
ID3DXFileEnumObject_Vtbl
;
object
->
ref
=
1
;
ret
=
IDirectXFile_CreateEnumObject
(
This
->
dxfile
,
dxfile_source
,
dxfile_options
,
&
dxfile_enum_object
);
ret
=
IDirectXFile_CreateEnumObject
(
file
->
dxfile
,
dxfile_source
,
dxfile_options
,
&
dxfile_enum_object
);
if
(
ret
!=
S_OK
)
{
...
...
@@ -638,23 +633,23 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi
return
S_OK
;
}
static
HRESULT
WINAPI
ID3DXFileImpl_CreateSaveObject
(
ID3DXFile
*
iface
,
const
void
*
data
,
D3DXF_FILESAVEOPTIONS
options
,
D3DXF_FILEFORMAT
format
,
ID3DXFileSaveObject
**
save_object
)
static
HRESULT
WINAPI
d3dx9_file_CreateSaveObject
(
ID3DXFile
*
iface
,
const
void
*
data
,
D3DXF_FILESAVEOPTIONS
options
,
D3DXF_FILEFORMAT
format
,
ID3DXFileSaveObject
**
save_object
)
{
FIXME
(
"(%p)->(%p, %x, %u, %p): stub
\n
"
,
iface
,
data
,
options
,
format
,
save_object
);
FIXME
(
"iface %p, data %p, options %#x, format %#x, save_object %p stub!
\n
"
,
iface
,
data
,
options
,
format
,
save_object
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileImpl_RegisterTemplates
(
ID3DXFile
*
iface
,
const
void
*
data
,
SIZE_T
size
)
static
HRESULT
WINAPI
d3dx9_file_RegisterTemplates
(
ID3DXFile
*
iface
,
const
void
*
data
,
SIZE_T
size
)
{
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
struct
d3dx9_file
*
file
=
impl_from_ID3DXFile
(
iface
);
HRESULT
ret
;
TRACE
(
"
(%p)->(%p, %lu)
\n
"
,
iface
,
data
,
size
);
TRACE
(
"
iface %p, data %p, size %lu.
\n
"
,
iface
,
data
,
size
);
ret
=
IDirectXFile_RegisterTemplates
(
This
->
dxfile
,
(
void
*
)
data
,
size
);
ret
=
IDirectXFile_RegisterTemplates
(
file
->
dxfile
,
(
void
*
)
data
,
size
);
if
(
ret
!=
DXFILE_OK
)
{
WARN
(
"Error %#x
\n
"
,
ret
);
...
...
@@ -664,32 +659,30 @@ static HRESULT WINAPI ID3DXFileImpl_RegisterTemplates(ID3DXFile *iface, const vo
return
S_OK
;
}
static
HRESULT
WINAPI
ID3DXFileImpl_RegisterEnumTemplates
(
ID3DXFile
*
iface
,
ID3DXFileEnumObject
*
enum_object
)
static
HRESULT
WINAPI
d3dx9_file_RegisterEnumTemplates
(
ID3DXFile
*
iface
,
ID3DXFileEnumObject
*
enum_object
)
{
FIXME
(
"
(%p)->(%p): stub
\n
"
,
iface
,
enum_object
);
FIXME
(
"
iface %p, enum_object %p stub!
\n
"
,
iface
,
enum_object
);
return
E_NOTIMPL
;
}
static
const
ID3DXFileVtbl
ID3DXFile_Vtbl
=
static
const
ID3DXFileVtbl
d3dx9_file_vtbl
=
{
ID3DXFileImpl
_QueryInterface
,
ID3DXFileImpl
_AddRef
,
ID3DXFileImpl
_Release
,
ID3DXFileImpl
_CreateEnumObject
,
ID3DXFileImpl
_CreateSaveObject
,
ID3DXFileImpl
_RegisterTemplates
,
ID3DXFileImpl_RegisterEnumTemplates
d3dx9_file
_QueryInterface
,
d3dx9_file
_AddRef
,
d3dx9_file
_Release
,
d3dx9_file
_CreateEnumObject
,
d3dx9_file
_CreateSaveObject
,
d3dx9_file
_RegisterTemplates
,
d3dx9_file_RegisterEnumTemplates
,
};
HRESULT
WINAPI
D3DXFileCreate
(
ID3DXFile
**
d3dxfile
)
{
ID3DXFileImpl
*
object
;
struct
d3dx9_file
*
object
;
HRESULT
ret
;
TRACE
(
"
(%p)
\n
"
,
d3dxfile
);
TRACE
(
"
d3dxfile %p.
\n
"
,
d3dxfile
);
if
(
!
d3dxfile
)
return
E_POINTER
;
...
...
@@ -709,7 +702,7 @@ HRESULT WINAPI D3DXFileCreate(ID3DXFile **d3dxfile)
return
E_FAIL
;
}
object
->
ID3DXFile_iface
.
lpVtbl
=
&
ID3DXFile_V
tbl
;
object
->
ID3DXFile_iface
.
lpVtbl
=
&
d3dx9_file_v
tbl
;
object
->
ref
=
1
;
*
d3dxfile
=
&
object
->
ID3DXFile_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