d3dxof: Add some preliminary support for binary objects.
This commit is contained in:
parent
40c5c8ad7c
commit
76d52393e8
|
@ -1347,6 +1347,27 @@ static const IDirectXFileVtbl IDirectXFile_Vtbl =
|
||||||
IDirectXFileImpl_RegisterTemplates
|
IDirectXFileImpl_RegisterTemplates
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static HRESULT IDirectXFileBinaryImpl_Create(IDirectXFileBinaryImpl** ppObj)
|
||||||
|
{
|
||||||
|
IDirectXFileBinaryImpl* object;
|
||||||
|
|
||||||
|
TRACE("(%p)\n", ppObj);
|
||||||
|
|
||||||
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileBinaryImpl));
|
||||||
|
if (!object)
|
||||||
|
{
|
||||||
|
ERR("Out of memory\n");
|
||||||
|
return DXFILEERR_BADALLOC;
|
||||||
|
}
|
||||||
|
|
||||||
|
object->lpVtbl.lpVtbl = &IDirectXFileBinary_Vtbl;
|
||||||
|
object->ref = 1;
|
||||||
|
|
||||||
|
*ppObj = object;
|
||||||
|
|
||||||
|
return DXFILE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*** IUnknown methods ***/
|
/*** IUnknown methods ***/
|
||||||
static HRESULT WINAPI IDirectXFileBinaryImpl_QueryInterface(IDirectXFileBinary* iface, REFIID riid, void** ppvObject)
|
static HRESULT WINAPI IDirectXFileBinaryImpl_QueryInterface(IDirectXFileBinary* iface, REFIID riid, void** ppvObject)
|
||||||
{
|
{
|
||||||
|
@ -1606,7 +1627,17 @@ static HRESULT WINAPI IDirectXFileDataImpl_GetNextObject(IDirectXFileData* iface
|
||||||
return DXFILEERR_NOMOREOBJECTS;
|
return DXFILEERR_NOMOREOBJECTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (This->pobj->childs[This->cur_enum_object]->ptarget)
|
if (This->pobj->childs[This->cur_enum_object]->binary)
|
||||||
|
{
|
||||||
|
IDirectXFileBinaryImpl *object;
|
||||||
|
|
||||||
|
hr = IDirectXFileBinaryImpl_Create(&object);
|
||||||
|
if (FAILED(hr))
|
||||||
|
return hr;
|
||||||
|
|
||||||
|
*ppChildObj = (LPDIRECTXFILEOBJECT)object;
|
||||||
|
}
|
||||||
|
else if (This->pobj->childs[This->cur_enum_object]->ptarget)
|
||||||
{
|
{
|
||||||
IDirectXFileDataReferenceImpl *object;
|
IDirectXFileDataReferenceImpl *object;
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ typedef struct {
|
||||||
char name[MAX_NAME_LEN];
|
char name[MAX_NAME_LEN];
|
||||||
GUID class_id;
|
GUID class_id;
|
||||||
BOOL open;
|
BOOL open;
|
||||||
|
BOOL binary;
|
||||||
ULONG nb_childs;
|
ULONG nb_childs;
|
||||||
char childs[MAX_CHILDS][MAX_NAME_LEN];
|
char childs[MAX_CHILDS][MAX_NAME_LEN];
|
||||||
ULONG nb_members;
|
ULONG nb_members;
|
||||||
|
@ -68,6 +69,7 @@ typedef struct {
|
||||||
} xobject_member;
|
} xobject_member;
|
||||||
|
|
||||||
struct _xobject {
|
struct _xobject {
|
||||||
|
BOOL binary;
|
||||||
struct _xobject* ptarget;
|
struct _xobject* ptarget;
|
||||||
char name[MAX_NAME_LEN];
|
char name[MAX_NAME_LEN];
|
||||||
GUID class_id;
|
GUID class_id;
|
||||||
|
|
Loading…
Reference in New Issue