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
1db9fb90
Commit
1db9fb90
authored
Jan 08, 2013
by
Christian Costa
Committed by
Alexandre Julliard
Jan 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Avoid LP stuff and rename some variables.
parent
5c5deb34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
25 deletions
+26
-25
meshbuilder.c
dlls/d3drm/meshbuilder.c
+26
-25
No files found.
dlls/d3drm/meshbuilder.c
View file @
1db9fb90
...
...
@@ -1137,14 +1137,13 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetClassName(IDirect3DRMMeshBu
return
D3DRM_OK
;
}
HRESULT
load_mesh_data
(
IDirect3DRMMeshBuilder3
*
iface
,
IDirectXFileData
*
pData
,
D3DRMLOADTEXTURECALLBACK
load_texture_proc
,
void
*
arg
)
HRESULT
load_mesh_data
(
IDirect3DRMMeshBuilder3
*
iface
,
IDirectXFileData
*
pData
,
D3DRMLOADTEXTURECALLBACK
load_texture_proc
,
void
*
arg
)
{
IDirect3DRMMeshBuilderImpl
*
This
=
impl_from_IDirect3DRMMeshBuilder3
(
iface
);
LPDIRECTXFILEOBJECT
pObject
=
NULL
;
LPDIRECTXFILEDATA
pData2
=
NULL
;
const
GUID
*
pGuid
;
IDirectXFileData
*
pData2
=
NULL
;
const
GUID
*
guid
;
DWORD
size
;
LPBYTE
ptr
;
BYTE
*
ptr
;
HRESULT
hr
;
HRESULT
ret
=
D3DRMERR_BADOBJECT
;
DWORD
*
faces_vertex_idx_data
=
NULL
;
...
...
@@ -1194,12 +1193,14 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, IDirectXFileData *pData,
memcpy
(
faces_vertex_idx_data
,
ptr
+
sizeof
(
DWORD
)
+
This
->
nb_vertices
*
sizeof
(
D3DVECTOR
)
+
sizeof
(
DWORD
),
faces_vertex_idx_size
);
/* Each vertex index will have its normal index counterpart so just allocate twice the size */
This
->
pFaceData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
faces_vertex_idx_size
*
2
);
This
->
pFaceData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
faces_vertex_idx_size
*
2
);
faces_data_ptr
=
(
DWORD
*
)
This
->
pFaceData
;
while
(
1
)
{
hr
=
IDirectXFileData_GetNextObject
(
pData
,
&
pObject
);
IDirectXFileObject
*
object
;
hr
=
IDirectXFileData_GetNextObject
(
pData
,
&
object
);
if
(
hr
==
DXFILEERR_NOMOREOBJECTS
)
{
TRACE
(
"No more object
\n
"
);
...
...
@@ -1208,18 +1209,18 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, IDirectXFileData *pData,
if
(
hr
!=
DXFILE_OK
)
goto
end
;
hr
=
IDirectXFileObject_QueryInterface
(
pO
bject
,
&
IID_IDirectXFileData
,
(
void
**
)
&
pData2
);
IDirectXFileObject_Release
(
pO
bject
);
hr
=
IDirectXFileObject_QueryInterface
(
o
bject
,
&
IID_IDirectXFileData
,
(
void
**
)
&
pData2
);
IDirectXFileObject_Release
(
o
bject
);
if
(
hr
!=
DXFILE_OK
)
goto
end
;
hr
=
IDirectXFileData_GetType
(
pData2
,
&
pG
uid
);
hr
=
IDirectXFileData_GetType
(
pData2
,
&
g
uid
);
if
(
hr
!=
DXFILE_OK
)
goto
end
;
TRACE
(
"Found object type whose GUID = %s
\n
"
,
debugstr_guid
(
pG
uid
));
TRACE
(
"Found object type whose GUID = %s
\n
"
,
debugstr_guid
(
g
uid
));
if
(
IsEqualGUID
(
pG
uid
,
&
TID_D3DRMMeshNormals
))
if
(
IsEqualGUID
(
g
uid
,
&
TID_D3DRMMeshNormals
))
{
DWORD
nb_faces_normals
;
DWORD
faces_normal_idx_size
;
...
...
@@ -1238,11 +1239,11 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, IDirectXFileData *pData,
This
->
pNormals
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
nb_normals
*
sizeof
(
D3DVECTOR
));
memcpy
(
This
->
pNormals
,
ptr
+
sizeof
(
DWORD
),
This
->
nb_normals
*
sizeof
(
D3DVECTOR
));
faces_normal_idx_size
=
size
-
(
2
*
sizeof
(
DWORD
)
+
This
->
nb_normals
*
sizeof
(
D3DVECTOR
));
faces_normal_idx_size
=
size
-
(
2
*
sizeof
(
DWORD
)
+
This
->
nb_normals
*
sizeof
(
D3DVECTOR
));
faces_normal_idx_ptr
=
faces_normal_idx_data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
faces_normal_idx_size
);
memcpy
(
faces_normal_idx_data
,
ptr
+
sizeof
(
DWORD
)
+
This
->
nb_normals
*
sizeof
(
D3DVECTOR
)
+
sizeof
(
DWORD
),
faces_normal_idx_size
);
}
else
if
(
IsEqualGUID
(
pG
uid
,
&
TID_D3DRMMeshTextureCoords
))
else
if
(
IsEqualGUID
(
g
uid
,
&
TID_D3DRMMeshTextureCoords
))
{
hr
=
IDirectXFileData_GetData
(
pData2
,
NULL
,
&
size
,
(
void
**
)
&
ptr
);
if
(
hr
!=
DXFILE_OK
)
...
...
@@ -1256,12 +1257,12 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, IDirectXFileData *pData,
memcpy
(
This
->
pCoords2d
,
ptr
+
sizeof
(
DWORD
),
This
->
nb_coords2d
*
sizeof
(
Coords2d
));
}
else
if
(
IsEqualGUID
(
pG
uid
,
&
TID_D3DRMMeshMaterialList
))
else
if
(
IsEqualGUID
(
g
uid
,
&
TID_D3DRMMeshMaterialList
))
{
DWORD
nb_materials
;
DWORD
nb_face_indices
;
DWORD
data_size
;
LPDIRECTXFILEOBJECT
child
;
IDirectXFileObject
*
child
;
DWORD
i
=
0
;
float
*
values
;
...
...
@@ -1295,9 +1296,9 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, IDirectXFileData *pData,
while
(
SUCCEEDED
(
hr
=
IDirectXFileData_GetNextObject
(
pData2
,
&
child
))
&&
(
i
<
nb_materials
))
{
LPDIRECTXFILEDATA
data
;
LPDIRECTXFILEDATAREFERENCE
reference
;
LPDIRECTXFILEOBJECT
material_child
;
IDirectXFileData
*
data
;
IDirectXFileDataReference
*
reference
;
IDirectXFileObject
*
material_child
;
hr
=
IDirectXFileObject_QueryInterface
(
child
,
&
IID_IDirectXFileData
,
(
void
**
)
&
data
);
if
(
FAILED
(
hr
))
...
...
@@ -1349,13 +1350,13 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, IDirectXFileData *pData,
hr
=
IDirectXFileData_GetNextObject
(
data
,
&
material_child
);
if
(
hr
==
S_OK
)
{
LPDIRECTXFILEDATA
data
;
char
**
filename
;
IDirectXFileData
*
data
;
char
**
filename
;
hr
=
IDirectXFileObject_QueryInterface
(
material_child
,
&
IID_IDirectXFileData
,
(
void
**
)
&
data
);
if
(
FAILED
(
hr
))
{
LPDIRECTXFILEDATAREFERENCE
reference
;
IDirectXFileDataReference
*
reference
;
hr
=
IDirectXFileObject_QueryInterface
(
material_child
,
&
IID_IDirectXFileDataReference
,
(
void
**
)
&
reference
);
if
(
FAILED
(
hr
))
...
...
@@ -1367,10 +1368,10 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, IDirectXFileData *pData,
goto
end
;
}
hr
=
IDirectXFileData_GetType
(
data
,
&
pG
uid
);
hr
=
IDirectXFileData_GetType
(
data
,
&
g
uid
);
if
(
hr
!=
DXFILE_OK
)
goto
end
;
if
(
!
IsEqualGUID
(
pG
uid
,
&
TID_D3DRMTextureFilename
))
if
(
!
IsEqualGUID
(
g
uid
,
&
TID_D3DRMTextureFilename
))
{
WARN
(
"Not a texture filename
\n
"
);
goto
end
;
...
...
@@ -1433,7 +1434,7 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3* iface, IDirectXFileData *pData,
}
else
{
FIXME
(
"Unknown GUID %s, ignoring...
\n
"
,
debugstr_guid
(
pG
uid
));
FIXME
(
"Unknown GUID %s, ignoring...
\n
"
,
debugstr_guid
(
g
uid
));
}
IDirectXFileData_Release
(
pData2
);
...
...
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