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
c6f5f104
Commit
c6f5f104
authored
Jun 07, 2011
by
Dylan Smith
Committed by
Alexandre Julliard
Jun 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement D3DXLoadMeshFromX and D3DXLoadMeshFromXResource.
parent
fe8615f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
3 deletions
+95
-3
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+3
-3
mesh.c
dlls/d3dx9_36/mesh.c
+92
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
c6f5f104
...
...
@@ -168,10 +168,10 @@
@ stub D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr)
@ stub D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr)
@ stdcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr)
@ st
ub D3DXLoadMeshFromXA(p
tr long ptr ptr ptr ptr ptr ptr)
@ st
dcall D3DXLoadMeshFromXA(s
tr long ptr ptr ptr ptr ptr ptr)
@ stdcall D3DXLoadMeshFromXInMemory(ptr long long ptr ptr ptr ptr ptr ptr)
@ st
ub D3DXLoadMeshFromXResource(long ptr p
tr long ptr ptr ptr ptr ptr ptr)
@ st
ub D3DXLoadMeshFromXW(p
tr long ptr ptr ptr ptr ptr ptr)
@ st
dcall D3DXLoadMeshFromXResource(long str s
tr long ptr ptr ptr ptr ptr ptr)
@ st
dcall D3DXLoadMeshFromXW(ws
tr long ptr ptr ptr ptr ptr ptr)
@ stub D3DXLoadMeshFromXof(ptr long ptr ptr ptr ptr ptr ptr)
@ stdcall D3DXLoadMeshHierarchyFromXA(str long ptr ptr ptr ptr ptr)
@ stdcall D3DXLoadMeshHierarchyFromXInMemory(ptr long long ptr ptr ptr ptr ptr)
...
...
dlls/d3dx9_36/mesh.c
View file @
c6f5f104
...
...
@@ -3066,6 +3066,98 @@ HRESULT WINAPI D3DXFrameDestroy(LPD3DXFRAME frame, LPD3DXALLOCATEHIERARCHY alloc
return
D3D_OK
;
}
HRESULT
WINAPI
D3DXLoadMeshFromXA
(
LPCSTR
filename
,
DWORD
options
,
LPDIRECT3DDEVICE9
device
,
LPD3DXBUFFER
*
adjacency
,
LPD3DXBUFFER
*
materials
,
LPD3DXBUFFER
*
effect_instances
,
DWORD
*
num_materials
,
LPD3DXMESH
*
mesh
)
{
HRESULT
hr
;
int
len
;
LPWSTR
filenameW
;
TRACE
(
"(%s, %x, %p, %p, %p, %p, %p, %p)
\n
"
,
debugstr_a
(
filename
),
options
,
device
,
adjacency
,
materials
,
effect_instances
,
num_materials
,
mesh
);
if
(
!
filename
)
return
D3DERR_INVALIDCALL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
NULL
,
0
);
filenameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
filenameW
)
return
E_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
filenameW
,
len
);
hr
=
D3DXLoadMeshFromXW
(
filenameW
,
options
,
device
,
adjacency
,
materials
,
effect_instances
,
num_materials
,
mesh
);
HeapFree
(
GetProcessHeap
(),
0
,
filenameW
);
return
hr
;
}
HRESULT
WINAPI
D3DXLoadMeshFromXW
(
LPCWSTR
filename
,
DWORD
options
,
LPDIRECT3DDEVICE9
device
,
LPD3DXBUFFER
*
adjacency
,
LPD3DXBUFFER
*
materials
,
LPD3DXBUFFER
*
effect_instances
,
DWORD
*
num_materials
,
LPD3DXMESH
*
mesh
)
{
HRESULT
hr
;
DWORD
size
;
LPVOID
buffer
;
TRACE
(
"(%s, %x, %p, %p, %p, %p, %p, %p)
\n
"
,
debugstr_w
(
filename
),
options
,
device
,
adjacency
,
materials
,
effect_instances
,
num_materials
,
mesh
);
if
(
!
filename
)
return
D3DERR_INVALIDCALL
;
hr
=
map_view_of_file
(
filename
,
&
buffer
,
&
size
);
if
(
FAILED
(
hr
))
return
D3DXERR_INVALIDDATA
;
hr
=
D3DXLoadMeshFromXInMemory
(
buffer
,
size
,
options
,
device
,
adjacency
,
materials
,
effect_instances
,
num_materials
,
mesh
);
UnmapViewOfFile
(
buffer
);
return
hr
;
}
HRESULT
WINAPI
D3DXLoadMeshFromXResource
(
HMODULE
module
,
LPCSTR
name
,
LPCSTR
type
,
DWORD
options
,
LPDIRECT3DDEVICE9
device
,
LPD3DXBUFFER
*
adjacency
,
LPD3DXBUFFER
*
materials
,
LPD3DXBUFFER
*
effect_instances
,
DWORD
*
num_materials
,
LPD3DXMESH
*
mesh
)
{
HRESULT
hr
;
HRSRC
resinfo
;
DWORD
size
;
LPVOID
buffer
;
TRACE
(
"(%p, %s, %s, %x, %p, %p, %p, %p, %p, %p)
\n
"
,
module
,
debugstr_a
(
name
),
debugstr_a
(
type
),
options
,
device
,
adjacency
,
materials
,
effect_instances
,
num_materials
,
mesh
);
resinfo
=
FindResourceA
(
module
,
name
,
type
);
if
(
!
resinfo
)
return
D3DXERR_INVALIDDATA
;
hr
=
load_resource_into_memory
(
module
,
resinfo
,
&
buffer
,
&
size
);
if
(
!
FAILED
(
hr
))
return
D3DXERR_INVALIDDATA
;
return
D3DXLoadMeshFromXInMemory
(
buffer
,
size
,
options
,
device
,
adjacency
,
materials
,
effect_instances
,
num_materials
,
mesh
);
}
struct
mesh_container
{
struct
list
entry
;
...
...
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