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.

91 lines
3.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: d3drmlightobj.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // d3drmLightObj.cpp : Implementation of CDirectApp and DLL registration.
  11. #include "stdafx.h"
  12. #include "Direct.h"
  13. #include "dms.h"
  14. #include "d3drmFrame3Obj.h"
  15. #include "d3drmLightObj.h"
  16. CONSTRUCTOR(_dxj_Direct3dRMLight, {});
  17. DESTRUCTOR(_dxj_Direct3dRMLight, {});
  18. GETSET_OBJECT(_dxj_Direct3dRMLight);
  19. CLONE_R(_dxj_Direct3dRMLight,Direct3DRMLight);
  20. GETNAME_R(_dxj_Direct3dRMLight);
  21. SETNAME_R(_dxj_Direct3dRMLight);
  22. GETCLASSNAME_R(_dxj_Direct3dRMLight);
  23. ADDDESTROYCALLBACK_R(_dxj_Direct3dRMLight);
  24. DELETEDESTROYCALLBACK_R(_dxj_Direct3dRMLight);
  25. GET_DIRECT_R(_dxj_Direct3dRMLight, getAppData, GetAppData, long);
  26. GET_DIRECT_R(_dxj_Direct3dRMLight, getColor, GetColor, d3dcolor);
  27. GET_DIRECT_R(_dxj_Direct3dRMLight, getRange, GetRange, d3dvalue);
  28. GET_DIRECT_R(_dxj_Direct3dRMLight, getUmbra, GetUmbra, d3dvalue);
  29. GET_DIRECT_R(_dxj_Direct3dRMLight, getPenumbra, GetPenumbra, d3dvalue);
  30. GET_DIRECT_R(_dxj_Direct3dRMLight, getConstantAttenuation, GetConstantAttenuation, d3dvalue);
  31. GET_DIRECT_R(_dxj_Direct3dRMLight, getLinearAttenuation, GetLinearAttenuation, d3dvalue);
  32. GET_DIRECT_R(_dxj_Direct3dRMLight, getQuadraticAttenuation, GetQuadraticAttenuation, d3dvalue);
  33. GET_DIRECT_R(_dxj_Direct3dRMLight, getType, GetType, d3drmLightType);
  34. PASS_THROUGH_CAST_1_R(_dxj_Direct3dRMLight, setAppData, SetAppData, long,(DWORD));
  35. PASS_THROUGH1_R(_dxj_Direct3dRMLight, setColor, SetColor, d3dcolor);
  36. PASS_THROUGH1_R(_dxj_Direct3dRMLight, setRange, SetRange, d3dvalue);
  37. PASS_THROUGH1_R(_dxj_Direct3dRMLight, setUmbra, SetUmbra, d3dvalue);
  38. PASS_THROUGH1_R(_dxj_Direct3dRMLight, setPenumbra, SetPenumbra, d3dvalue);
  39. PASS_THROUGH1_R(_dxj_Direct3dRMLight, setConstantAttenuation, SetConstantAttenuation, d3dvalue);
  40. PASS_THROUGH1_R(_dxj_Direct3dRMLight, setLinearAttenuation, SetLinearAttenuation, d3dvalue);
  41. PASS_THROUGH1_R(_dxj_Direct3dRMLight, setQuadraticAttenuation, SetQuadraticAttenuation, d3dvalue);
  42. PASS_THROUGH3_R(_dxj_Direct3dRMLight, setColorRGB, SetColorRGB, d3dvalue, d3dvalue, d3dvalue);
  43. PASS_THROUGH_CAST_1_R(_dxj_Direct3dRMLight, setType, SetType, d3drmLightType, (enum _D3DRMLIGHTTYPE));
  44. //RETURN_NEW_ITEM_R(_dxj_Direct3dRMLight, getEnableFrame, GetEnableFrame, _dxj_Direct3dRMFrame);
  45. HRESULT C_dxj_Direct3dRMLightObject::getEnableFrame(I_dxj_Direct3dRMFrame3 **frame){
  46. HRESULT hr;
  47. IDirect3DRMFrame *realframe1=NULL;
  48. IDirect3DRMFrame3 *realframe=NULL;
  49. hr=m__dxj_Direct3dRMLight->GetEnableFrame(&realframe1);
  50. *frame=NULL;
  51. if FAILED(hr) return hr;
  52. if (realframe1){
  53. hr=realframe1->QueryInterface(IID_IDirect3DRMFrame3,(void**)&realframe);
  54. if FAILED(hr) return hr;
  55. INTERNAL_CREATE(_dxj_Direct3dRMFrame3,(IDirect3DRMFrame3*)realframe,frame);
  56. }
  57. return S_OK;
  58. }
  59. HRESULT C_dxj_Direct3dRMLightObject::setEnableFrame(I_dxj_Direct3dRMFrame3 *frame){
  60. HRESULT hr;
  61. IDirect3DRMFrame3 *realframe=NULL;
  62. IDirect3DRMFrame *realframe1=NULL;
  63. if (frame){
  64. frame->InternalGetObject((IUnknown**)&realframe);
  65. hr=realframe->QueryInterface(IID_IDirect3DRMFrame,(void**)&realframe1);
  66. if FAILED(hr) return hr;
  67. }
  68. hr=m__dxj_Direct3dRMLight->SetEnableFrame(realframe1);
  69. if (realframe1) realframe1->Release();
  70. return hr;
  71. }