Leaked source code of windows server 2003
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.

99 lines
2.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: d3drmwrapobj.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // d3drmWrapObj.cpp : Implementation of CDirectApp and DLL registration.
  11. #include "stdafx.h"
  12. #include "Direct.h"
  13. #include "dms.h"
  14. #include "d3drmWrapObj.h"
  15. CONSTRUCTOR(_dxj_Direct3dRMWrap, {});
  16. DESTRUCTOR(_dxj_Direct3dRMWrap, {});
  17. GETSET_OBJECT(_dxj_Direct3dRMWrap );
  18. CLONE_R(_dxj_Direct3dRMWrap,Direct3DRMWrap);
  19. GETNAME_R(_dxj_Direct3dRMWrap);
  20. SETNAME_R(_dxj_Direct3dRMWrap);
  21. GETCLASSNAME_R(_dxj_Direct3dRMWrap);
  22. DELETEDESTROYCALLBACK_R(_dxj_Direct3dRMWrap)
  23. ADDDESTROYCALLBACK_R(_dxj_Direct3dRMWrap)
  24. PASS_THROUGH_CAST_1_R(_dxj_Direct3dRMWrap, setAppData, SetAppData, long,(DWORD));
  25. GET_DIRECT_R(_dxj_Direct3dRMWrap, getAppData, GetAppData, long);
  26. /////////////////////////////////////////////////////////////////////////////
  27. STDMETHODIMP C_dxj_Direct3dRMWrapObject::applyRelative(I_dxj_Direct3dRMFrame3 *ref, I_dxj_Direct3dRMObject *mesh)
  28. {
  29. DO_GETOBJECT_NOTNULL( LPDIRECT3DRMFRAME3, lpf, ref);
  30. DO_GETOBJECT_NOTNULL( IUnknown*, lpU, mesh);
  31. IDirect3DRMFrame *realf=NULL;
  32. HRESULT hr = S_OK;
  33. LPDIRECT3DRMOBJECT lpObject=NULL;
  34. if (lpf) lpf->QueryInterface(IID_IDirect3DRMFrame,(void**)&realf);
  35. if (lpU) hr=lpU->QueryInterface(IID_IDirect3DRMObject,(void**)&lpObject);
  36. if FAILED(hr) return E_FAIL;
  37. hr= m__dxj_Direct3dRMWrap->ApplyRelative(realf, (LPDIRECT3DRMOBJECT)lpObject);
  38. if(lpObject) lpObject->Release();
  39. if (realf) realf->Release();
  40. return hr;
  41. }
  42. /////////////////////////////////////////////////////////////////////////////
  43. STDMETHODIMP C_dxj_Direct3dRMWrapObject::apply(I_dxj_Direct3dRMObject *mesh)
  44. {
  45. DO_GETOBJECT_NOTNULL( IUnknown*, lpU, mesh);
  46. HRESULT hr = S_OK;
  47. LPDIRECT3DRMOBJECT lpObject=NULL;
  48. if (lpU) hr=lpU->QueryInterface(IID_IDirect3DRMObject,(void**)&lpObject);
  49. if FAILED(hr) return E_FAIL;
  50. hr= m__dxj_Direct3dRMWrap->Apply((LPDIRECT3DRMOBJECT)lpObject);
  51. if(lpObject) lpObject->Release();
  52. return hr;
  53. }
  54. /////////////////////////////////////////////////////////////////////////////
  55. STDMETHODIMP C_dxj_Direct3dRMWrapObject::init( d3drmWrapType t, I_dxj_Direct3dRMFrame3 *ref,
  56. d3dvalue ox, d3dvalue oy, d3dvalue oz,
  57. d3dvalue dx, d3dvalue dy, d3dvalue dz,
  58. d3dvalue ux, d3dvalue uy, d3dvalue uz,
  59. d3dvalue ou , d3dvalue ov, d3dvalue su, d3dvalue sv)
  60. {
  61. _D3DRMWRAPTYPE value = (enum _D3DRMWRAPTYPE)t;
  62. HRESULT hr;
  63. LPDIRECT3DRMFRAME lpf2=NULL;
  64. DO_GETOBJECT_NOTNULL( LPDIRECT3DRMFRAME3, lpf, ref);
  65. if (lpf)
  66. {
  67. hr=lpf->QueryInterface(IID_IDirect3DRMFrame,(void**)&lpf2);
  68. if FAILED(hr) return hr;
  69. }
  70. hr= m__dxj_Direct3dRMWrap->Init(value,lpf2,
  71. ox, oy, oz, dx, dy, dz, ux, uy, uz, ou , ov, su, sv);
  72. if (lpf2) lpf2->Release();
  73. return hr;
  74. }