Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

637 lines
25 KiB

//+-------------------------------------------------------------------------
//
// Microsoft Windows
//
// Copyright (C) Microsoft Corporation, 1998 - 1999
//
// File: dpmsgobj.cpp
//
//--------------------------------------------------------------------------
#include "stdafx.h"
#include "Direct.h"
#include "dms.h"
#include "dxfile.h"
//#include "rmxftmpl.h"
#include "rmxfguid.h"
unsigned char D3DRM_XTEMPLATES2[] = {
0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62,
0x69, 0x6e, 0x20, 0x30, 0x30, 0x36, 0x34, 0x1f, 0, 0x1,
0, 0x6, 0, 0, 0, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0xa, 0, 0x5, 0, 0x43, 0xab, 0x82, 0x3d, 0xda,
0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
0x33, 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x6d,
0x61, 0x6a, 0x6f, 0x72, 0x14, 0, 0x28, 0, 0x1, 0,
0x5, 0, 0, 0, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14,
0, 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x66,
0x6c, 0x61, 0x67, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
0x6f, 0x72, 0xa, 0, 0x5, 0, 0x5e, 0xab, 0x82, 0x3d,
0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71,
0xe4, 0x33, 0x2a, 0, 0x1, 0, 0x1, 0, 0, 0,
0x78, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
0, 0x79, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
0, 0, 0x7a, 0x14, 0, 0xb, 0, 0x1f, 0, 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x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e,
0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29,
0, 0x1, 0, 0x11, 0, 0, 0, 0x66, 0x61, 0x63,
0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64,
0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, 0, 0x12, 0,
0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72,
0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73,
0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xd, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61,
0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x73, 0xa, 0, 0x5,
0, 0xc0, 0xc5, 0x1e, 0xed, 0xa8, 0xc0, 0xd0, 0x11, 0x94,
0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1,
0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73,
0x14, 0, 0x34, 0, 0x1, 0, 0x9, 0, 0, 0,
0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x1,
0, 0xe, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x57,
0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0xe,
0, 0x1, 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61,
0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x11, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f,
0x72, 0x64, 0x73, 0xa, 0, 0x5, 0, 0x40, 0x3f, 0xf2,
0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xe, 0, 0,
0, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43,
0x6f, 0x6f, 0x72, 0x64, 0x73, 0x14, 0, 0x34, 0, 0x1,
0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
0x73, 0x32, 0x64, 0x1, 0, 0xd, 0, 0, 0, 0x74,
0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72,
0x64, 0x73, 0xe, 0, 0x1, 0, 0xe, 0, 0, 0,
0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f,
0x6f, 0x72, 0x64, 0x73, 0xf, 0, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x4d, 0x65,
0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c,
0x4c, 0x69, 0x73, 0x74, 0xa, 0, 0x5, 0, 0x42, 0x3f,
0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, 0,
0, 0, 0x6e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61,
0x6c, 0x73, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, 0,
0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, 0,
0x1, 0, 0xb, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
0x49, 0x6e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1, 0, 0xb, 0, 0, 0, 0x50,
0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67,
0xa, 0, 0x5, 0, 0xe1, 0x21, 0xf, 0x7f, 0xe1, 0xbf,
0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71,
0xe, 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74,
0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
0x74, 0x79, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xe, 0, 0, 0, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0xa, 0,
0x5, 0, 0xa0, 0x6a, 0x11, 0x98, 0xba, 0xbd, 0xd1, 0x11,
0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x1, 0,
0x4, 0, 0, 0, 0x47, 0x75, 0x69, 0x64, 0x1, 0,
0x12, 0, 0, 0, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75,
0x61, 0x6c, 0x14, 0, 0xe, 0, 0x12, 0, 0x12, 0,
0x12, 0, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xb, 0, 0, 0, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
0x61, 0x6e, 0x64, 0x65, 0x64, 0xa, 0, 0x5, 0, 0xa0,
0x5e, 0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0,
0xa0, 0xc9, 0x69, 0x72, 0x71, 0x29, 0, 0x1, 0, 0xc,
0, 0, 0, 0x62, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0, 0xb, 0
};
#define D3DRM_XTEMPLATE_BYTES 3278
#include "rmxfguid.h"
#include "XfileObj.h"
#include "XfileSaveObj.h"
#include "XfileEnumObj.h"
WCHAR *szXFileGuids[]={
L"TID_D3DRMInfo",
L"TID_D3DRMMesh",
L"TID_D3DRMVector",
L"TID_D3DRMMeshFace",
L"TID_D3DRMMaterial",
L"TID_D3DRMMaterialArray",
L"TID_D3DRMFrame",
L"TID_D3DRMFrameTransformMatrix",
L"TID_D3DRMMeshMaterialList",
L"TID_D3DRMMeshTextureCoords",
L"TID_D3DRMMeshNormals",
L"TID_D3DRMCoords2d",
L"TID_D3DRMMatrix4x4",
L"TID_D3DRMAnimation",
L"TID_D3DRMAnimationSet",
L"TID_D3DRMAnimationKey",
L"TID_D3DRMFloatKeys",
L"TID_D3DRMMaterialAmbientColor",
L"TID_D3DRMMaterialDiffuseColor",
L"TID_D3DRMMaterialSpecularColor",
L"TID_D3DRMMaterialEmissiveColor",
L"TID_D3DRMMaterialPower",
L"TID_D3DRMColorRGBA",
L"TID_D3DRMColorRGB",
L"TID_D3DRMGuid",
L"TID_D3DRMTextureFilename",
L"TID_D3DRMTextureReference",
L"TID_D3DRMIndexedColor",
L"TID_D3DRMMeshVertexColors",
L"TID_D3DRMMaterialWrap",
L"TID_D3DRMBoolean",
L"TID_D3DRMMeshFaceWraps",
L"TID_D3DRMBoolean2d",
L"TID_D3DRMTimedFloatKeys",
L"TID_D3DRMAnimationOptions",
L"TID_D3DRMFramePosition",
L"TID_D3DRMFrameVelocity",
L"TID_D3DRMFrameRotation",
L"TID_D3DRMLight",
L"TID_D3DRMCamera",
L"TID_D3DRMAppData",
L"TID_D3DRMLightUmbra",
L"TID_D3DRMLightRange",
L"TID_D3DRMLightPenumbra",
L"TID_D3DRMLightAttenuation",
L"TID_D3DRMInlineData",
L"TID_D3DRMUrl",
L"TID_D3DRMProgressiveMesh",
L"TID_D3DRMExternalVisual",
L"TID_D3DRMStringProperty",
L"TID_D3DRMPropertyBag",
L"TID_D3DRMRightHanded"
};
const GUID *XFileGuids[]={
&TID_D3DRMInfo,
&TID_D3DRMMesh,
&TID_D3DRMVector,
&TID_D3DRMMeshFace,
&TID_D3DRMMaterial,
&TID_D3DRMMaterialArray,
&TID_D3DRMFrame,
&TID_D3DRMFrameTransformMatrix,
&TID_D3DRMMeshMaterialList,
&TID_D3DRMMeshTextureCoords,
&TID_D3DRMMeshNormals,
&TID_D3DRMCoords2d,
&TID_D3DRMMatrix4x4,
&TID_D3DRMAnimation,
&TID_D3DRMAnimationSet,
&TID_D3DRMAnimationKey,
&TID_D3DRMFloatKeys,
&TID_D3DRMMaterialAmbientColor,
&TID_D3DRMMaterialDiffuseColor,
&TID_D3DRMMaterialSpecularColor,
&TID_D3DRMMaterialEmissiveColor,
&TID_D3DRMMaterialPower,
&TID_D3DRMColorRGBA,
&TID_D3DRMColorRGB,
&TID_D3DRMGuid,
&TID_D3DRMTextureFilename,
&TID_D3DRMTextureReference,
&TID_D3DRMIndexedColor,
&TID_D3DRMMeshVertexColors,
&TID_D3DRMMaterialWrap,
&TID_D3DRMBoolean,
&TID_D3DRMMeshFaceWraps,
&TID_D3DRMBoolean2d,
&TID_D3DRMTimedFloatKeys,
&TID_D3DRMAnimationOptions,
&TID_D3DRMFramePosition,
&TID_D3DRMFrameVelocity,
&TID_D3DRMFrameRotation,
&TID_D3DRMLight,
&TID_D3DRMCamera,
&TID_D3DRMAppData,
&TID_D3DRMLightUmbra,
&TID_D3DRMLightRange,
&TID_D3DRMLightPenumbra,
&TID_D3DRMLightAttenuation,
&TID_D3DRMInlineData,
&TID_D3DRMUrl,
&TID_D3DRMProgressiveMesh,
&TID_D3DRMExternalVisual,
&TID_D3DRMStringProperty,
&TID_D3DRMPropertyBag,
&TID_D3DRMRightHanded
};
#define NUM_XFILE_GUIDS 52
extern HRESULT BSTRtoGUID(LPGUID,BSTR);
extern BSTR GUIDtoBSTR(LPGUID);
HRESULT XFILEBSTRtoGUID(LPGUID lpG,BSTR strG)
{
if (!strG) {
ZeroMemory(lpG,sizeof(GUID));
return S_OK;
}
if (strG[0]==0) {
ZeroMemory(lpG,sizeof(GUID));
return S_OK;
}
for(int i=0;i<NUM_XFILE_GUIDS;i++){
if (0==_wcsicmp((WCHAR*)strG,szXFileGuids[i]))
{
memcpy(lpG,XFileGuids[i],sizeof(GUID));
return S_OK;
}
}
return BSTRtoGUID (lpG,strG);
}
#define GUIDS_EQUAL2(g,g2) (\
(g->Data1==g2->Data1) && \
(g->Data2==g2->Data2) && \
(g->Data3==g2->Data3) && \
(g->Data4[0]==g2->Data4[0]) && \
(g->Data4[1]==g2->Data4[1]) && \
(g->Data4[2]==g2->Data4[2]) && \
(g->Data4[3]==g2->Data4[3]) && \
(g->Data4[4]==g2->Data4[4]) && \
(g->Data4[5]==g2->Data4[5]) && \
(g->Data4[6]==g2->Data4[6]) && \
(g->Data4[7]==g2->Data4[7]) )
BSTR XFILEGUIDtoBSTR(LPGUID lpG)
{
if (!lpG) return NULL;
for(int i=0;i<NUM_XFILE_GUIDS;i++)
{
//
if (GUIDS_EQUAL2(XFileGuids[i],lpG)){
return SysAllocString(szXFileGuids[i]);
}
}
return GUIDtoBSTR(lpG);
}
C_dxj_DirectXFileObject::C_dxj_DirectXFileObject()
{
m_pDirectXFile=NULL;
}
C_dxj_DirectXFileObject::~C_dxj_DirectXFileObject()
{
if (m_pDirectXFile) m_pDirectXFile->Release();
}
HRESULT C_dxj_DirectXFileObject::create( I_dxj_DirectXFile **ret)
{
HRESULT hr;
if (!ret) return E_INVALIDARG;
C_dxj_DirectXFileObject *c=NULL;
c=new CComObject<C_dxj_DirectXFileObject>;
if( c == NULL ) return E_OUTOFMEMORY;
hr=c->Init();
if FAILED(hr) {
delete c;
return hr;
}
hr=c->QueryInterface(IID_I_dxj_DirectXFile, (void**)ret);
return hr;
}
HRESULT C_dxj_DirectXFileObject::Init ()
{
HRESULT hr;
hr=DirectXFileCreate(&m_pDirectXFile);
return hr;
}
HRESULT C_dxj_DirectXFileObject::CreateEnumObject(
/* [in] */ BSTR __RPC_FAR filename,
/* [retval][out] */ I_dxj_DirectXFileEnum __RPC_FAR *__RPC_FAR *ret)
{
USES_CONVERSION;
HRESULT hr;
LPSTR szName=W2T(filename);
LPDIRECTXFILEENUMOBJECT pEnum=NULL;
hr=m_pDirectXFile->CreateEnumObject(szName,DXFILELOAD_FROMFILE ,&pEnum);
if FAILED(hr) return hr;
hr=C_dxj_DirectXFileEnumObject::create (pEnum,ret);
if FAILED(hr) {
pEnum->Release();
}
return hr;
}
HRESULT C_dxj_DirectXFileObject::CreateSaveObject(
/* [in] */ BSTR filename,
/* [in] */ long flags,
/* [retval][out] */ I_dxj_DirectXFileSave __RPC_FAR *__RPC_FAR *ret)
{
USES_CONVERSION;
HRESULT hr;
LPSTR szName=W2T(filename);
LPDIRECTXFILESAVEOBJECT pSave=NULL;
hr=m_pDirectXFile->CreateSaveObject(szName,(DWORD)flags, &pSave);
if FAILED(hr) return hr;
//Note ::create does addref pSave on success
hr=C_dxj_DirectXFileSaveObject::create (pSave,ret);
if (pSave) pSave->Release();
return hr;
}
HRESULT C_dxj_DirectXFileObject::RegisterTemplates(
/* [in] */ void __RPC_FAR *temp,
/* [in] */ long size)
{
HRESULT hr;
__try{
hr=m_pDirectXFile->RegisterTemplates(temp,(DWORD)size);
if FAILED(hr) return hr;
}
__except(1,1){
return E_INVALIDARG;
}
return hr;
}
HRESULT C_dxj_DirectXFileObject::RegisterDefaultTemplates( void)
{
HRESULT hr;
hr=m_pDirectXFile->RegisterTemplates(D3DRM_XTEMPLATES2,D3DRM_XTEMPLATE_BYTES );
return hr;
}