d3drm: Material object is taken into account when a mesh references it.

This commit is contained in:
Christian Costa 2012-05-22 22:05:40 +02:00 committed by Alexandre Julliard
parent a442fcc9c6
commit 8f86a0bbdd
2 changed files with 12 additions and 14 deletions

View File

@ -1406,17 +1406,7 @@ static HRESULT load_data(IDirect3DRM3* iface, LPDIRECTXFILEDATA data_object, LPI
}
else if (IsEqualGUID(guid, &TID_D3DRMMaterial))
{
TRACE("Found TID_D3DRMMaterial\n");
for (i = 0; i < nb_GUIDs; i++)
if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMaterial) ||
IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMaterial2))
requested = TRUE;
if (requested)
{
FIXME("Processing material not supported yet\n");
}
TRACE("Found TID_D3DRMMaterial => Will be taken into account when a mesh will reference it\n");
}
else if (IsEqualGUID(guid, &TID_D3DRMFrameTransformMatrix))
{

View File

@ -165,6 +165,13 @@ static char data_d3drm_load[] =
"{\n"
" {Object1}\n"
" {Object2}\n"
"}\n"
"Material\n"
"{\n"
" 0.1, 0.2, 0.3, 0.4;;\n"
" 0.5;\n"
" 0.6, 0.7, 0.8;;\n"
" 0.9, 1.0, 1.1;;\n"
"}\n";
static void test_MeshBuilder(void)
@ -858,7 +865,8 @@ static const GUID* refiids[] =
{
&IID_IDirect3DRMMeshBuilder,
&IID_IDirect3DRMMeshBuilder,
&IID_IDirect3DRMFrame
&IID_IDirect3DRMFrame,
&IID_IDirect3DRMMaterial /* Not taken into account and not notified */
};
static void __cdecl object_load_callback(LPDIRECT3DRMOBJECT object, REFIID objectguid, LPVOID arg)
@ -874,14 +882,14 @@ static void test_d3drm_load(void)
HRESULT hr;
LPDIRECT3DRM pD3DRM;
D3DRMLOADMEMORY info;
const GUID* req_refiids[] = { &IID_IDirect3DRMMeshBuilder, &IID_IDirect3DRMFrame };
const GUID* req_refiids[] = { &IID_IDirect3DRMMeshBuilder, &IID_IDirect3DRMFrame, &IID_IDirect3DRMMaterial };
hr = pDirect3DRMCreate(&pD3DRM);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr);
info.lpMemory = data_d3drm_load;
info.dSize = strlen(data_d3drm_load);
hr = IDirect3DRM_Load(pD3DRM, &info, NULL, (GUID**)req_refiids, 2, D3DRMLOAD_FROMMEMORY, object_load_callback, (LPVOID)0xdeadbeef, NULL, NULL, NULL);
hr = IDirect3DRM_Load(pD3DRM, &info, NULL, (GUID**)req_refiids, 3, D3DRMLOAD_FROMMEMORY, object_load_callback, (LPVOID)0xdeadbeef, NULL, NULL, NULL);
ok(hr == D3DRM_OK, "Cannot load data (hr = %x)\n", hr);
ok(nb_objects == 3, "Should have loaded 3 objects (got %d)\n", nb_objects);