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
53e37121
Commit
53e37121
authored
Dec 14, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Dec 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Handle texture load proc when loading mesh data.
parent
0f0f76ce
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
d3drm.c
dlls/d3drm/d3drm.c
+3
-3
d3drm_private.h
dlls/d3drm/d3drm_private.h
+2
-1
meshbuilder.c
dlls/d3drm/meshbuilder.c
+18
-3
No files found.
dlls/d3drm/d3drm.c
View file @
53e37121
...
...
@@ -1257,8 +1257,8 @@ static HRESULT WINAPI IDirect3DRM3Impl_EnumerateObjects(IDirect3DRM3* iface, D3D
return
E_NOTIMPL
;
}
static
HRESULT
load_data
(
IDirect3DRM3
*
iface
,
LPDIRECTXFILEDATA
data_object
,
LPIID
*
GUIDs
,
DWORD
nb_GUIDs
,
D3DRMLOADCALLBACK
LoadProc
,
LPVOID
ArgLP
,
D3DRMLOADTEXTURECALLBACK
LoadTextureProc
,
LPVOID
ArgLTP
,
LPDIRECT3DRMFRAME3
parent_frame
)
static
HRESULT
load_data
(
IDirect3DRM3
*
iface
,
IDirectXFileData
*
data_object
,
IID
**
GUIDs
,
DWORD
nb_GUIDs
,
D3DRMLOADCALLBACK
LoadProc
,
void
*
ArgLP
,
D3DRMLOADTEXTURECALLBACK
LoadTextureProc
,
void
*
ArgLTP
,
IDirect3DRMFrame3
*
parent_frame
)
{
HRESULT
ret
=
D3DRMERR_BADOBJECT
;
HRESULT
hr
;
...
...
@@ -1296,7 +1296,7 @@ static HRESULT load_data(IDirect3DRM3* iface, LPDIRECTXFILEDATA data_object, LPI
hr
=
IDirect3DRM3_CreateMeshBuilder
(
iface
,
&
meshbuilder
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
load_mesh_data
(
meshbuilder
,
data_object
);
hr
=
load_mesh_data
(
meshbuilder
,
data_object
,
LoadTextureProc
,
ArgLTP
);
if
(
SUCCEEDED
(
hr
))
{
/* Only top level objects are notified */
...
...
dlls/d3drm/d3drm_private.h
View file @
53e37121
...
...
@@ -36,7 +36,8 @@ HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN
HRESULT
Direct3DRMMaterial_create
(
IDirect3DRMMaterial2
**
ret_iface
)
DECLSPEC_HIDDEN
;
HRESULT
Direct3DRMTexture_create
(
REFIID
riid
,
IUnknown
**
ret_iface
)
DECLSPEC_HIDDEN
;
HRESULT
load_mesh_data
(
IDirect3DRMMeshBuilder3
*
iface
,
LPDIRECTXFILEDATA
pData
)
DECLSPEC_HIDDEN
;
HRESULT
load_mesh_data
(
IDirect3DRMMeshBuilder3
*
iface
,
IDirectXFileData
*
data
,
D3DRMLOADTEXTURECALLBACK
load_texture_proc
,
void
*
arg
)
DECLSPEC_HIDDEN
;
typedef
struct
{
WORD
major
;
...
...
dlls/d3drm/meshbuilder.c
View file @
53e37121
...
...
@@ -1129,7 +1129,7 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetClassName(IDirect3DRMMeshBu
return
D3DRM_OK
;
}
HRESULT
load_mesh_data
(
IDirect3DRMMeshBuilder3
*
iface
,
LPDIRECTXFILEDATA
pData
)
HRESULT
load_mesh_data
(
IDirect3DRMMeshBuilder3
*
iface
,
IDirectXFileData
*
pData
,
D3DRMLOADTEXTURECALLBACK
load_texture_proc
,
void
*
arg
)
{
IDirect3DRMMeshBuilderImpl
*
This
=
impl_from_IDirect3DRMMeshBuilder3
(
iface
);
LPDIRECTXFILEOBJECT
pObject
=
NULL
;
...
...
@@ -1372,6 +1372,19 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
hr
=
IDirectXFileData_GetData
(
data
,
NULL
,
&
size
,
(
void
**
)
&
filename
);
if
(
SUCCEEDED
(
hr
))
{
if
(
load_texture_proc
)
{
IDirect3DRMTexture
*
texture
;
hr
=
load_texture_proc
(
*
filename
,
arg
,
&
texture
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DTexture_QueryInterface
(
texture
,
&
IID_IDirect3DRMTexture3
,
(
void
**
)
&
This
->
materials
[
i
].
texture
);
IDirect3DTexture_Release
(
texture
);
}
}
else
{
HANDLE
file
;
/* If the texture file is not found, no texture is associated with the material */
...
...
@@ -1380,7 +1393,7 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
{
CloseHandle
(
file
);
hr
=
Direct3DRMTexture_create
(
&
IID_IDirect3DRMTexture3
,
(
LPUNKNOWN
*
)
&
This
->
materials
[
i
].
texture
);
hr
=
Direct3DRMTexture_create
(
&
IID_IDirect3DRMTexture3
,
(
IUnknown
*
*
)
&
This
->
materials
[
i
].
texture
);
if
(
FAILED
(
hr
))
{
IDirectXFileData_Release
(
data
);
...
...
@@ -1389,6 +1402,7 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, LPDIRECTXFILEDATA pData)
}
}
}
}
else
if
(
hr
!=
DXFILEERR_NOMOREOBJECTS
)
{
goto
end
;
...
...
@@ -1630,7 +1644,8 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Load(IDirect3DRMMeshBuilder3*
goto
end
;
}
hr
=
load_mesh_data
(
iface
,
pData
);
/* We don't care about the texture interface version since we rely on QueryInterface */
hr
=
load_mesh_data
(
iface
,
pData
,
(
D3DRMLOADTEXTURECALLBACK
)
cb
,
arg
);
if
(
hr
==
S_OK
)
ret
=
D3DRM_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