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
95433ccd
Commit
95433ccd
authored
Dec 25, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Dec 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Implement D3DXFileCreate with stubbed ID3DXFile interface + basic tests.
parent
f5abeb84
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
190 additions
and
3 deletions
+190
-3
Makefile.in
dlls/d3dx9_36/Makefile.in
+2
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
Makefile.in
dlls/d3dx9_36/tests/Makefile.in
+2
-1
xfile.c
dlls/d3dx9_36/tests/xfile.c
+35
-0
xfile.c
dlls/d3dx9_36/xfile.c
+150
-0
No files found.
dlls/d3dx9_36/Makefile.in
View file @
95433ccd
...
...
@@ -17,7 +17,8 @@ C_SRCS = \
surface.c
\
texture.c
\
util.c
\
volume.c
volume.c
\
xfile.c
RC_SRCS
=
version.rc
...
...
dlls/d3dx9_36/d3dx9_36.spec
View file @
95433ccd
...
...
@@ -121,7 +121,7 @@
@ stdcall D3DXDeclaratorFromFVF(long ptr)
@ stub D3DXDisassembleEffect(ptr long ptr)
@ stub D3DXDisassembleShader(ptr long ptr ptr)
@ st
ub
D3DXFileCreate(ptr)
@ st
dcall
D3DXFileCreate(ptr)
@ stdcall D3DXFillCubeTexture(ptr ptr ptr)
@ stub D3DXFillCubeTextureTX(ptr ptr)
@ stdcall D3DXFillTexture(ptr ptr ptr)
...
...
dlls/d3dx9_36/tests/Makefile.in
View file @
95433ccd
...
...
@@ -11,7 +11,8 @@ C_SRCS = \
shader.c
\
surface.c
\
texture.c
\
volume.c
volume.c
\
xfile.c
RC_SRCS
=
rsrc.rc
...
...
dlls/d3dx9_36/tests/xfile.c
0 → 100644
View file @
95433ccd
/*
* Copyright 2012 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/test.h"
#include "d3dx9.h"
#include "d3dx9xof.h"
START_TEST
(
xfile
)
{
ID3DXFile
*
file
;
HRESULT
ret
;
ret
=
D3DXFileCreate
(
NULL
);
ok
(
ret
==
E_POINTER
,
"D3DXCreateFile returned %#x, expected %#x
\n
"
,
ret
,
E_POINTER
);
ret
=
D3DXFileCreate
(
&
file
);
ok
(
ret
==
S_OK
,
"D3DXCreateFile failed with %#x
\n
"
,
ret
);
file
->
lpVtbl
->
Release
(
file
);
}
dlls/d3dx9_36/xfile.c
0 → 100644
View file @
95433ccd
/*
* Copyright (C) 2012 Christian Costa
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include "wine/debug.h"
#include "d3dx9.h"
#include "d3dx9xof.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx
);
typedef
struct
{
ID3DXFile
ID3DXFile_iface
;
LONG
ref
;
}
ID3DXFileImpl
;
static
inline
ID3DXFileImpl
*
impl_from_ID3DXFile
(
ID3DXFile
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ID3DXFileImpl
,
ID3DXFile_iface
);
}
/*** IUnknown methods ***/
static
HRESULT
WINAPI
ID3DXFileImpl_QueryInterface
(
ID3DXFile
*
iface
,
REFIID
riid
,
void
**
ret_iface
)
{
TRACE
(
"(%p)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ret_iface
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ID3DXFile
))
{
iface
->
lpVtbl
->
AddRef
(
iface
);
*
ret_iface
=
iface
;
return
S_OK
;
}
WARN
(
"(%p)->(%s, %p), not found
\n
"
,
iface
,
debugstr_guid
(
riid
),
ret_iface
);
*
ret_iface
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ID3DXFileImpl_AddRef
(
ID3DXFile
*
iface
)
{
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref %d
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
ID3DXFileImpl_Release
(
ID3DXFile
*
iface
)
{
ID3DXFileImpl
*
This
=
impl_from_ID3DXFile
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(): new ref %d
\n
"
,
iface
,
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ref
;
}
/*** ID3DXFile methods ***/
static
HRESULT
WINAPI
ID3DXFileImpl_CreateEnumObject
(
ID3DXFile
*
iface
,
const
void
*
source
,
D3DXF_FILELOADOPTIONS
options
,
ID3DXFileEnumObject
**
enum_object
)
{
FIXME
(
"(%p)->(%p, %x, %p): stub
\n
"
,
iface
,
source
,
options
,
enum_object
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileImpl_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
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileImpl_RegisterTemplates
(
ID3DXFile
*
iface
,
const
void
*
data
,
SIZE_T
size
)
{
FIXME
(
"(%p)->(%p, %lu): stub
\n
"
,
iface
,
data
,
size
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ID3DXFileImpl_RegisterEnumTemplates
(
ID3DXFile
*
iface
,
ID3DXFileEnumObject
*
enum_object
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
enum_object
);
return
E_NOTIMPL
;
}
static
const
ID3DXFileVtbl
ID3DXFile_Vtbl
=
{
ID3DXFileImpl_QueryInterface
,
ID3DXFileImpl_AddRef
,
ID3DXFileImpl_Release
,
ID3DXFileImpl_CreateEnumObject
,
ID3DXFileImpl_CreateSaveObject
,
ID3DXFileImpl_RegisterTemplates
,
ID3DXFileImpl_RegisterEnumTemplates
};
HRESULT
WINAPI
D3DXFileCreate
(
ID3DXFile
**
d3dxfile
)
{
ID3DXFileImpl
*
object
;
TRACE
(
"(%p)
\n
"
,
d3dxfile
);
if
(
!
d3dxfile
)
return
E_POINTER
;
*
d3dxfile
=
NULL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
ID3DXFile_iface
.
lpVtbl
=
&
ID3DXFile_Vtbl
;
object
->
ref
=
1
;
*
d3dxfile
=
&
object
->
ID3DXFile_iface
;
return
S_OK
;
}
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