Counter Strike : Global Offensive Source Code
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.

809 lines
25 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef STUBD3DDEVICE_H
  8. #define STUBD3DDEVICE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #ifdef STUBD3D
  13. #include "locald3dtypes.h"
  14. #include "filesystem.h"
  15. #ifdef USE_FOPEN
  16. #include <stdio.h>
  17. #define FPRINTF fprintf
  18. #else
  19. #define FPRINTF s_pFileSystem->FPrintf
  20. #endif
  21. #ifdef USE_FOPEN
  22. static FILE *s_FileHandle;
  23. #else
  24. static IFileSystem *s_pFileSystem;
  25. static FileHandle_t s_FileHandle;
  26. #endif
  27. class CStubD3DTexture : public IDirect3DTexture8
  28. {
  29. private:
  30. IDirect3DTexture8 *m_pTexture;
  31. IDirect3DDevice8 *m_pDevice;
  32. public:
  33. CStubD3DTexture( IDirect3DTexture8 *pTexture, IDirect3DDevice8 *pDevice )
  34. {
  35. m_pTexture = pTexture;
  36. m_pDevice = pDevice;
  37. }
  38. /*** IUnknown methods ***/
  39. HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj)
  40. {
  41. FPRINTF( s_FileHandle, "IDirect3DTexture8::QueryInterface\n" );
  42. return m_pTexture->QueryInterface( riid, ppvObj );
  43. }
  44. ULONG __stdcall AddRef()
  45. {
  46. FPRINTF( s_FileHandle, "IDirect3DTexture8::AddRef\n" );
  47. return m_pTexture->AddRef();
  48. }
  49. ULONG __stdcall Release()
  50. {
  51. FPRINTF( s_FileHandle, "IDirect3DTexture8::Release\n" );
  52. return m_pTexture->Release();
  53. }
  54. /*** IDirect3DBaseTexture8 methods ***/
  55. HRESULT __stdcall GetDevice( IDirect3DDevice8** ppDevice )
  56. {
  57. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetDevice\n" );
  58. #if 0
  59. *ppDevice = m_pDevice;
  60. return D3D_OK;
  61. #else
  62. return m_pTexture->GetDevice( ppDevice );
  63. #endif
  64. }
  65. HRESULT __stdcall SetPrivateData( REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags)
  66. {
  67. FPRINTF( s_FileHandle, "IDirect3DTexture8::SetPrivateData\n" );
  68. return m_pTexture->SetPrivateData( refguid, pData, SizeOfData, Flags );
  69. }
  70. HRESULT __stdcall GetPrivateData( REFGUID refguid,void* pData,DWORD* pSizeOfData )
  71. {
  72. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetPrivateData\n" );
  73. return m_pTexture->GetPrivateData( refguid, pData, pSizeOfData );
  74. }
  75. HRESULT __stdcall FreePrivateData( REFGUID refguid )
  76. {
  77. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetPrivateData\n" );
  78. return m_pTexture->FreePrivateData( refguid );
  79. }
  80. DWORD __stdcall SetPriority( DWORD PriorityNew )
  81. {
  82. FPRINTF( s_FileHandle, "IDirect3DTexture8::SetPriority\n" );
  83. return m_pTexture->SetPriority( PriorityNew );
  84. }
  85. DWORD __stdcall GetPriority()
  86. {
  87. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetPriority\n" );
  88. return m_pTexture->GetPriority();
  89. }
  90. void __stdcall PreLoad()
  91. {
  92. FPRINTF( s_FileHandle, "IDirect3DTexture8::PreLoad\n" );
  93. m_pTexture->PreLoad();
  94. }
  95. D3DRESOURCETYPE __stdcall GetType()
  96. {
  97. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetType\n" );
  98. return m_pTexture->GetType();
  99. }
  100. DWORD __stdcall SetLOD( DWORD LODNew )
  101. {
  102. FPRINTF( s_FileHandle, "IDirect3DTexture8::SetLOD\n" );
  103. return m_pTexture->SetLOD( LODNew );
  104. }
  105. DWORD __stdcall GetLOD()
  106. {
  107. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetLOD\n" );
  108. return m_pTexture->GetLOD();
  109. }
  110. DWORD __stdcall GetLevelCount()
  111. {
  112. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetLevelCount\n" );
  113. return m_pTexture->GetLevelCount();
  114. }
  115. HRESULT __stdcall GetLevelDesc(UINT Level,D3DSURFACE_DESC *pDesc)
  116. {
  117. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetLevelCount\n" );
  118. return m_pTexture->GetLevelDesc( Level, pDesc );
  119. }
  120. HRESULT __stdcall GetSurfaceLevel(UINT Level,IDirect3DSurface8** ppSurfaceLevel)
  121. {
  122. FPRINTF( s_FileHandle, "IDirect3DTexture8::GetSurfaceLevel\n" );
  123. return m_pTexture->GetSurfaceLevel( Level, ppSurfaceLevel );
  124. }
  125. HRESULT __stdcall LockRect(UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags)
  126. {
  127. FPRINTF( s_FileHandle, "IDirect3DTexture8::LockRect\n" );
  128. return m_pTexture->LockRect( Level, pLockedRect, pRect, Flags );
  129. }
  130. HRESULT __stdcall UnlockRect(UINT Level)
  131. {
  132. FPRINTF( s_FileHandle, "IDirect3DTexture8::UnlockRect\n" );
  133. return m_pTexture->UnlockRect( Level );
  134. }
  135. HRESULT __stdcall AddDirtyRect( CONST RECT* pDirtyRect )
  136. {
  137. FPRINTF( s_FileHandle, "IDirect3DTexture8::AddDirtyRect\n" );
  138. return m_pTexture->AddDirtyRect( pDirtyRect );
  139. }
  140. };
  141. class CStubD3DDevice : public IDirect3DDevice8
  142. {
  143. public:
  144. CStubD3DDevice( IDirect3DDevice8 *pD3DDevice, IFileSystem *pFileSystem )
  145. {
  146. Assert( pD3DDevice );
  147. m_pD3DDevice = pD3DDevice;
  148. #ifdef USE_FOPEN
  149. s_FileHandle = fopen( "stubd3d.txt", "w" );
  150. #else
  151. Assert( pFileSystem );
  152. s_pFileSystem = pFileSystem;
  153. s_FileHandle = pFileSystem->Open( "stubd3d.txt", "w" );
  154. #endif
  155. }
  156. ~CStubD3DDevice()
  157. {
  158. #ifdef USE_FOPEN
  159. fclose( s_FileHandle );
  160. #else
  161. s_pFileSystem->Close( s_FileHandle );
  162. #endif
  163. }
  164. private:
  165. IDirect3DDevice8 *m_pD3DDevice;
  166. public:
  167. /*** IUnknown methods ***/
  168. HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj)
  169. {
  170. FPRINTF( s_FileHandle, "QueryInterface\n" );
  171. return m_pD3DDevice->QueryInterface( riid, ppvObj );
  172. }
  173. ULONG __stdcall AddRef()
  174. {
  175. FPRINTF( s_FileHandle, "AddRef\n" );
  176. return m_pD3DDevice->AddRef();
  177. }
  178. ULONG __stdcall Release()
  179. {
  180. FPRINTF( s_FileHandle, "Release\n" );
  181. return m_pD3DDevice->Release();
  182. delete this;
  183. }
  184. /*** IDirect3DDevice8 methods ***/
  185. HRESULT __stdcall TestCooperativeLevel()
  186. {
  187. FPRINTF( s_FileHandle, "TestCooperativeLevel\n" );
  188. return m_pD3DDevice->TestCooperativeLevel();
  189. }
  190. UINT __stdcall GetAvailableTextureMem()
  191. {
  192. FPRINTF( s_FileHandle, "GetAvailableTextureMem\n" );
  193. return m_pD3DDevice->GetAvailableTextureMem();
  194. }
  195. HRESULT __stdcall ResourceManagerDiscardBytes(DWORD Bytes)
  196. {
  197. FPRINTF( s_FileHandle, "ResourceManagerDiscardBytes\n" );
  198. return m_pD3DDevice->ResourceManagerDiscardBytes( Bytes );
  199. }
  200. HRESULT __stdcall GetDirect3D(IDirect3D8** ppD3D8)
  201. {
  202. FPRINTF( s_FileHandle, "GetDirect3D\n" );
  203. return m_pD3DDevice->GetDirect3D( ppD3D8 );
  204. }
  205. HRESULT __stdcall GetDeviceCaps(D3DCAPS8* pCaps)
  206. {
  207. FPRINTF( s_FileHandle, "GetDeviceCaps\n" );
  208. return m_pD3DDevice->GetDeviceCaps( pCaps );
  209. }
  210. HRESULT __stdcall GetDisplayMode(D3DDISPLAYMODE* pMode)
  211. {
  212. FPRINTF( s_FileHandle, "GetDisplayMode\n" );
  213. return m_pD3DDevice->GetDisplayMode( pMode );
  214. }
  215. HRESULT __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters)
  216. {
  217. FPRINTF( s_FileHandle, "GetCreationParameters\n" );
  218. return m_pD3DDevice->GetCreationParameters( pParameters );
  219. }
  220. HRESULT __stdcall SetCursorProperties(UINT XHotSpot,UINT YHotSpot,IDirect3DSurface8* pCursorBitmap)
  221. {
  222. FPRINTF( s_FileHandle, "SetCursorProperties\n" );
  223. return m_pD3DDevice->SetCursorProperties( XHotSpot, YHotSpot, pCursorBitmap );
  224. }
  225. void __stdcall SetCursorPosition(UINT XScreenSpace,UINT YScreenSpace,DWORD Flags)
  226. {
  227. FPRINTF( s_FileHandle, "SetCursorPosition\n" );
  228. m_pD3DDevice->SetCursorPosition( XScreenSpace, YScreenSpace, Flags );
  229. }
  230. BOOL __stdcall ShowCursor(BOOL bShow)
  231. {
  232. FPRINTF( s_FileHandle, "ShowCursor\n" );
  233. return m_pD3DDevice->ShowCursor( bShow );
  234. }
  235. HRESULT __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain8** pSwapChain)
  236. {
  237. FPRINTF( s_FileHandle, "CreateAdditionalSwapChain\n" );
  238. return m_pD3DDevice->CreateAdditionalSwapChain( pPresentationParameters, pSwapChain );
  239. }
  240. HRESULT __stdcall Reset(D3DPRESENT_PARAMETERS* pPresentationParameters)
  241. {
  242. FPRINTF( s_FileHandle, "Reset\n" );
  243. return m_pD3DDevice->Reset( pPresentationParameters );
  244. }
  245. HRESULT __stdcall Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
  246. {
  247. FPRINTF( s_FileHandle, "Present\n" );
  248. return m_pD3DDevice->Present( pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion );
  249. }
  250. HRESULT __stdcall GetBackBuffer(UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer)
  251. {
  252. FPRINTF( s_FileHandle, "GetBackBuffer\n" );
  253. return m_pD3DDevice->GetBackBuffer( BackBuffer, Type, ppBackBuffer );
  254. }
  255. HRESULT __stdcall GetRasterStatus(D3DRASTER_STATUS* pRasterStatus)
  256. {
  257. FPRINTF( s_FileHandle, "GetRasterStatus\n" );
  258. return m_pD3DDevice->GetRasterStatus( pRasterStatus );
  259. }
  260. void __stdcall SetGammaRamp(DWORD Flags,CONST D3DGAMMARAMP* pRamp)
  261. {
  262. FPRINTF( s_FileHandle, "SetGammaRamp\n" );
  263. m_pD3DDevice->SetGammaRamp( Flags, pRamp );
  264. }
  265. void __stdcall GetGammaRamp(D3DGAMMARAMP* pRamp)
  266. {
  267. FPRINTF( s_FileHandle, "GetGammaRamp\n" );
  268. m_pD3DDevice->GetGammaRamp( pRamp );
  269. }
  270. HRESULT __stdcall CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture8** ppTexture)
  271. {
  272. FPRINTF( s_FileHandle, "CreateTexture\n" );
  273. #if 0
  274. HRESULT ret = m_pD3DDevice->CreateTexture( Width, Height, Levels, Usage, Format, Pool, ppTexture );
  275. if( ret == D3D_OK )
  276. {
  277. *ppTexture = new CStubD3DTexture( *ppTexture, this );
  278. return ret;
  279. }
  280. else
  281. {
  282. return ret;
  283. }
  284. #else
  285. return m_pD3DDevice->CreateTexture( Width, Height, Levels, Usage, Format, Pool, ppTexture );
  286. #endif
  287. }
  288. HRESULT __stdcall CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture8** ppVolumeTexture)
  289. {
  290. FPRINTF( s_FileHandle, "CreateVolumeTexture\n" );
  291. return m_pD3DDevice->CreateVolumeTexture( Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture );
  292. }
  293. HRESULT __stdcall CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture8** ppCubeTexture)
  294. {
  295. FPRINTF( s_FileHandle, "CreateCubeTexture\n" );
  296. return m_pD3DDevice->CreateCubeTexture( EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture );
  297. }
  298. HRESULT __stdcall CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer8** ppVertexBuffer)
  299. {
  300. FPRINTF( s_FileHandle, "CreateVertexBuffer\n" );
  301. return m_pD3DDevice->CreateVertexBuffer( Length, Usage, FVF, Pool, ppVertexBuffer );
  302. }
  303. HRESULT __stdcall CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer8** ppIndexBuffer)
  304. {
  305. FPRINTF( s_FileHandle, "CreateIndexBuffer\n" );
  306. return m_pD3DDevice->CreateIndexBuffer( Length, Usage, Format, Pool, ppIndexBuffer );
  307. }
  308. HRESULT __stdcall CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,IDirect3DSurface8** ppSurface)
  309. {
  310. FPRINTF( s_FileHandle, "CreateRenderTarget\n" );
  311. return m_pD3DDevice->CreateRenderTarget( Width, Height, Format, MultiSample, Lockable, ppSurface );
  312. }
  313. HRESULT __stdcall CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,IDirect3DSurface8** ppSurface)
  314. {
  315. FPRINTF( s_FileHandle, "CreateDepthStencilSurface\n" );
  316. return m_pD3DDevice->CreateDepthStencilSurface( Width, Height, Format, MultiSample, ppSurface );
  317. }
  318. HRESULT __stdcall CreateImageSurface(UINT Width,UINT Height,D3DFORMAT Format,IDirect3DSurface8** ppSurface)
  319. {
  320. FPRINTF( s_FileHandle, "CreateImageSurface\n" );
  321. return m_pD3DDevice->CreateImageSurface( Width, Height, Format, ppSurface );
  322. }
  323. HRESULT __stdcall CopyRects(IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray)
  324. {
  325. FPRINTF( s_FileHandle, "CopyRects\n" );
  326. return m_pD3DDevice->CopyRects( pSourceSurface, pSourceRectsArray, cRects, pDestinationSurface, pDestPointsArray );
  327. }
  328. HRESULT __stdcall UpdateTexture(IDirect3DBaseTexture8* pSourceTexture,IDirect3DBaseTexture8* pDestinationTexture)
  329. {
  330. FPRINTF( s_FileHandle, "UpdateTexture\n" );
  331. return m_pD3DDevice->UpdateTexture( pSourceTexture, pDestinationTexture );
  332. }
  333. HRESULT __stdcall GetFrontBuffer(IDirect3DSurface8* pDestSurface)
  334. {
  335. FPRINTF( s_FileHandle, "GetFrontBuffer\n" );
  336. return m_pD3DDevice->GetFrontBuffer( pDestSurface );
  337. }
  338. HRESULT __stdcall SetRenderTarget(IDirect3DSurface8* pRenderTarget,IDirect3DSurface8* pNewZStencil)
  339. {
  340. FPRINTF( s_FileHandle, "SetRenderTarget\n" );
  341. return m_pD3DDevice->SetRenderTarget( pRenderTarget, pNewZStencil );
  342. }
  343. HRESULT __stdcall GetRenderTarget(IDirect3DSurface8** ppRenderTarget)
  344. {
  345. FPRINTF( s_FileHandle, "GetRenderTarget\n" );
  346. return m_pD3DDevice->GetRenderTarget( ppRenderTarget );
  347. }
  348. HRESULT __stdcall GetDepthStencilSurface(IDirect3DSurface8** ppZStencilSurface)
  349. {
  350. FPRINTF( s_FileHandle, "GetDepthStencilSurface\n" );
  351. return m_pD3DDevice->GetDepthStencilSurface( ppZStencilSurface );
  352. }
  353. HRESULT __stdcall BeginScene( void )
  354. {
  355. FPRINTF( s_FileHandle, "BeginScene\n" );
  356. return m_pD3DDevice->BeginScene();
  357. }
  358. HRESULT __stdcall EndScene()
  359. {
  360. FPRINTF( s_FileHandle, "EndScene\n" );
  361. return m_pD3DDevice->EndScene();
  362. }
  363. HRESULT __stdcall Clear(DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil)
  364. {
  365. FPRINTF( s_FileHandle, "Clear\n" );
  366. return m_pD3DDevice->Clear( Count, pRects, Flags, Color, Z, Stencil );
  367. }
  368. HRESULT __stdcall SetTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix)
  369. {
  370. FPRINTF( s_FileHandle, "SetTransform\n" );
  371. return m_pD3DDevice->SetTransform( State, pMatrix );
  372. }
  373. HRESULT __stdcall GetTransform(D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix)
  374. {
  375. FPRINTF( s_FileHandle, "GetTransform\n" );
  376. return m_pD3DDevice->GetTransform( State, pMatrix );
  377. }
  378. HRESULT __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE transformState,CONST D3DMATRIX* pMatrix)
  379. {
  380. FPRINTF( s_FileHandle, "MultiplyTransform\n" );
  381. return m_pD3DDevice->MultiplyTransform( transformState, pMatrix );
  382. }
  383. HRESULT __stdcall SetViewport(CONST D3DVIEWPORT8* pViewport)
  384. {
  385. FPRINTF( s_FileHandle, "SetViewport\n" );
  386. return m_pD3DDevice->SetViewport( pViewport );
  387. }
  388. HRESULT __stdcall GetViewport(D3DVIEWPORT8* pViewport)
  389. {
  390. FPRINTF( s_FileHandle, "GetViewport\n" );
  391. return m_pD3DDevice->GetViewport( pViewport );
  392. }
  393. HRESULT __stdcall SetMaterial(CONST D3DMATERIAL8* pMaterial)
  394. {
  395. FPRINTF( s_FileHandle, "SetMaterial\n" );
  396. return m_pD3DDevice->SetMaterial( pMaterial );
  397. }
  398. HRESULT __stdcall GetMaterial(D3DMATERIAL8* pMaterial)
  399. {
  400. FPRINTF( s_FileHandle, "GetMaterial\n" );
  401. return m_pD3DDevice->GetMaterial( pMaterial );
  402. }
  403. HRESULT __stdcall SetLight(DWORD Index,CONST D3DLIGHT8* pLight)
  404. {
  405. FPRINTF( s_FileHandle, "SetLight\n" );
  406. return m_pD3DDevice->SetLight( Index, pLight );
  407. }
  408. HRESULT __stdcall GetLight(DWORD Index,D3DLIGHT8* pLight)
  409. {
  410. FPRINTF( s_FileHandle, "GetLight\n" );
  411. return m_pD3DDevice->GetLight( Index, pLight );
  412. }
  413. HRESULT __stdcall LightEnable(DWORD Index,BOOL Enable)
  414. {
  415. FPRINTF( s_FileHandle, "LightEnable\n" );
  416. return m_pD3DDevice->LightEnable( Index, Enable );
  417. }
  418. HRESULT __stdcall GetLightEnable(DWORD Index,BOOL* pEnable)
  419. {
  420. FPRINTF( s_FileHandle, "GetLightEnable\n" );
  421. return m_pD3DDevice->GetLightEnable( Index, pEnable );
  422. }
  423. HRESULT __stdcall SetClipPlane(DWORD Index,CONST float* pPlane)
  424. {
  425. FPRINTF( s_FileHandle, "SetClipPlane\n" );
  426. return m_pD3DDevice->SetClipPlane( Index, pPlane );
  427. }
  428. HRESULT __stdcall GetClipPlane(DWORD Index,float* pPlane)
  429. {
  430. FPRINTF( s_FileHandle, "GetClipPlane\n" );
  431. return m_pD3DDevice->GetClipPlane( Index, pPlane );
  432. }
  433. HRESULT __stdcall SetRenderState(D3DRENDERSTATETYPE State,DWORD Value)
  434. {
  435. FPRINTF( s_FileHandle, "SetRenderState\n" );
  436. return m_pD3DDevice->SetRenderState( State, Value );
  437. }
  438. HRESULT __stdcall GetRenderState(D3DRENDERSTATETYPE State,DWORD* pValue)
  439. {
  440. FPRINTF( s_FileHandle, "GetRenderState\n" );
  441. return m_pD3DDevice->GetRenderState( State, pValue );
  442. }
  443. HRESULT __stdcall BeginStateBlock(void)
  444. {
  445. FPRINTF( s_FileHandle, "BeginStateBlock\n" );
  446. return m_pD3DDevice->BeginStateBlock();
  447. }
  448. HRESULT __stdcall EndStateBlock(DWORD* pToken)
  449. {
  450. FPRINTF( s_FileHandle, "EndStateBlock\n" );
  451. return m_pD3DDevice->EndStateBlock( pToken );
  452. }
  453. HRESULT __stdcall ApplyStateBlock(DWORD Token)
  454. {
  455. FPRINTF( s_FileHandle, "ApplyStateBlock\n" );
  456. return m_pD3DDevice->ApplyStateBlock( Token );
  457. }
  458. HRESULT __stdcall CaptureStateBlock(DWORD Token)
  459. {
  460. FPRINTF( s_FileHandle, "CaptureStateBlock\n" );
  461. return m_pD3DDevice->CaptureStateBlock( Token );
  462. }
  463. HRESULT __stdcall DeleteStateBlock(DWORD Token)
  464. {
  465. FPRINTF( s_FileHandle, "DeleteStateBlock\n" );
  466. return m_pD3DDevice->DeleteStateBlock( Token );
  467. }
  468. HRESULT __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE Type,DWORD* pToken)
  469. {
  470. FPRINTF( s_FileHandle, "CreateStateBlock\n" );
  471. return m_pD3DDevice->CreateStateBlock( Type, pToken );
  472. }
  473. HRESULT __stdcall SetClipStatus(CONST D3DCLIPSTATUS8* pClipStatus)
  474. {
  475. FPRINTF( s_FileHandle, "SetClipStatus\n" );
  476. return m_pD3DDevice->SetClipStatus( pClipStatus );
  477. }
  478. HRESULT __stdcall GetClipStatus(D3DCLIPSTATUS8* pClipStatus)
  479. {
  480. FPRINTF( s_FileHandle, "GetClipStatus\n" );
  481. return m_pD3DDevice->GetClipStatus( pClipStatus );
  482. }
  483. HRESULT __stdcall GetTexture(DWORD Stage,IDirect3DBaseTexture8** ppTexture)
  484. {
  485. FPRINTF( s_FileHandle, "GetTexture\n" );
  486. return m_pD3DDevice->GetTexture( Stage, ppTexture );
  487. }
  488. HRESULT __stdcall SetTexture(DWORD Stage,IDirect3DBaseTexture8* pTexture)
  489. {
  490. FPRINTF( s_FileHandle, "SetTexture\n" );
  491. return m_pD3DDevice->SetTexture( Stage, pTexture );
  492. }
  493. HRESULT __stdcall GetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue)
  494. {
  495. FPRINTF( s_FileHandle, "GetTextureStageState\n" );
  496. return m_pD3DDevice->GetTextureStageState( Stage, Type, pValue );
  497. }
  498. HRESULT __stdcall SetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value)
  499. {
  500. FPRINTF( s_FileHandle, "SetTextureStageState\n" );
  501. return m_pD3DDevice->SetTextureStageState( Stage, Type, Value );
  502. }
  503. HRESULT __stdcall ValidateDevice(DWORD* pNumPasses)
  504. {
  505. FPRINTF( s_FileHandle, "ValidateDevice\n" );
  506. #if 0
  507. return m_pD3DDevice->ValidateDevice( pNumPasses );
  508. #else
  509. return D3D_OK;
  510. #endif
  511. }
  512. HRESULT __stdcall GetInfo(DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize)
  513. {
  514. FPRINTF( s_FileHandle, "GetInfo\n" );
  515. return m_pD3DDevice->GetInfo( DevInfoID, pDevInfoStruct, DevInfoStructSize );
  516. }
  517. HRESULT __stdcall SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries)
  518. {
  519. FPRINTF( s_FileHandle, "SetPaletteEntries\n" );
  520. return m_pD3DDevice->SetPaletteEntries( PaletteNumber, pEntries );
  521. }
  522. HRESULT __stdcall GetPaletteEntries(UINT PaletteNumber,PALETTEENTRY* pEntries)
  523. {
  524. FPRINTF( s_FileHandle, "GetPaletteEntries\n" );
  525. return m_pD3DDevice->GetPaletteEntries( PaletteNumber, pEntries );
  526. }
  527. HRESULT __stdcall SetCurrentTexturePalette(UINT PaletteNumber)
  528. {
  529. FPRINTF( s_FileHandle, "SetCurrentTexturePalette\n" );
  530. return m_pD3DDevice->SetCurrentTexturePalette( PaletteNumber );
  531. }
  532. HRESULT __stdcall GetCurrentTexturePalette(UINT *PaletteNumber)
  533. {
  534. FPRINTF( s_FileHandle, "GetCurrentTexturePalette\n" );
  535. return m_pD3DDevice->GetCurrentTexturePalette( PaletteNumber );
  536. }
  537. HRESULT __stdcall DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount)
  538. {
  539. FPRINTF( s_FileHandle, "DrawPrimitive\n" );
  540. return m_pD3DDevice->DrawPrimitive( PrimitiveType, StartVertex, PrimitiveCount );
  541. }
  542. HRESULT __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE primitiveType,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount)
  543. {
  544. FPRINTF( s_FileHandle, "DrawIndexedPrimitive\n" );
  545. return m_pD3DDevice->DrawIndexedPrimitive( primitiveType,minIndex,NumVertices,startIndex,primCount );
  546. }
  547. HRESULT __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride)
  548. {
  549. FPRINTF( s_FileHandle, "DrawPrimitiveUP\n" );
  550. return m_pD3DDevice->DrawPrimitiveUP( PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride );
  551. }
  552. HRESULT __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride)
  553. {
  554. FPRINTF( s_FileHandle, "DrawIndexedPrimitiveUP\n" );
  555. return m_pD3DDevice->DrawIndexedPrimitiveUP( PrimitiveType, MinVertexIndex, NumVertexIndices, PrimitiveCount, pIndexData, IndexDataFormat,pVertexStreamZeroData, VertexStreamZeroStride );
  556. }
  557. HRESULT __stdcall ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags)
  558. {
  559. FPRINTF( s_FileHandle, "ProcessVertices\n" );
  560. return m_pD3DDevice->ProcessVertices( SrcStartIndex, DestIndex, VertexCount, pDestBuffer, Flags );
  561. }
  562. HRESULT __stdcall CreateVertexShader(CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage)
  563. {
  564. FPRINTF( s_FileHandle, "CreateVertexShader\n" );
  565. return m_pD3DDevice->CreateVertexShader( pDeclaration, pFunction, pHandle, Usage );
  566. }
  567. HRESULT __stdcall SetVertexShader(DWORD Handle)
  568. {
  569. FPRINTF( s_FileHandle, "SetVertexShader\n" );
  570. return m_pD3DDevice->SetVertexShader( Handle );
  571. }
  572. HRESULT __stdcall GetVertexShader(DWORD* pHandle)
  573. {
  574. FPRINTF( s_FileHandle, "GetVertexShader\n" );
  575. return m_pD3DDevice->GetVertexShader( pHandle );
  576. }
  577. HRESULT __stdcall DeleteVertexShader(DWORD Handle)
  578. {
  579. FPRINTF( s_FileHandle, "DeleteVertexShader\n" );
  580. return m_pD3DDevice->DeleteVertexShader( Handle );
  581. }
  582. HRESULT __stdcall SetVertexShaderConstant(DWORD Register,CONST void* pConstantData,DWORD ConstantCount)
  583. {
  584. FPRINTF( s_FileHandle, "SetVertexShaderConstant\n" );
  585. return m_pD3DDevice->SetVertexShaderConstant( Register, pConstantData, ConstantCount );
  586. }
  587. HRESULT __stdcall GetVertexShaderConstant(DWORD Register,void* pConstantData,DWORD ConstantCount)
  588. {
  589. FPRINTF( s_FileHandle, "GetVertexShaderConstant\n" );
  590. return m_pD3DDevice->GetVertexShaderConstant( Register, pConstantData, ConstantCount );
  591. }
  592. HRESULT __stdcall GetVertexShaderDeclaration(DWORD Handle,void* pData,DWORD* pSizeOfData)
  593. {
  594. FPRINTF( s_FileHandle, "GetVertexShaderDeclaration\n" );
  595. return m_pD3DDevice->GetVertexShaderDeclaration( Handle, pData, pSizeOfData );
  596. }
  597. HRESULT __stdcall GetVertexShaderFunction(DWORD Handle,void* pData,DWORD* pSizeOfData)
  598. {
  599. FPRINTF( s_FileHandle, "GetVertexShaderFunction\n" );
  600. return m_pD3DDevice->GetVertexShaderFunction( Handle, pData, pSizeOfData );
  601. }
  602. HRESULT __stdcall SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride)
  603. {
  604. FPRINTF( s_FileHandle, "SetStreamSource\n" );
  605. return m_pD3DDevice->SetStreamSource( StreamNumber, pStreamData, Stride );
  606. }
  607. HRESULT __stdcall GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride)
  608. {
  609. FPRINTF( s_FileHandle, "GetStreamSource\n" );
  610. return m_pD3DDevice->GetStreamSource( StreamNumber, ppStreamData, pStride );
  611. }
  612. HRESULT __stdcall SetIndices(IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex)
  613. {
  614. FPRINTF( s_FileHandle, "SetIndices\n" );
  615. return m_pD3DDevice->SetIndices( pIndexData, BaseVertexIndex );
  616. }
  617. HRESULT __stdcall GetIndices(IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex)
  618. {
  619. FPRINTF( s_FileHandle, "GetIndices\n" );
  620. return m_pD3DDevice->GetIndices( ppIndexData, pBaseVertexIndex );
  621. }
  622. HRESULT __stdcall CreatePixelShader(CONST DWORD* pFunction,DWORD* pHandle)
  623. {
  624. FPRINTF( s_FileHandle, "CreatePixelShader\n" );
  625. return m_pD3DDevice->CreatePixelShader( pFunction, pHandle );
  626. }
  627. HRESULT __stdcall SetPixelShader(DWORD Handle)
  628. {
  629. FPRINTF( s_FileHandle, "SetPixelShader\n" );
  630. return m_pD3DDevice->SetPixelShader( Handle );
  631. }
  632. HRESULT __stdcall GetPixelShader(DWORD* pHandle)
  633. {
  634. FPRINTF( s_FileHandle, "GetPixelShader\n" );
  635. return m_pD3DDevice->GetPixelShader( pHandle );
  636. }
  637. HRESULT __stdcall DeletePixelShader(DWORD Handle)
  638. {
  639. FPRINTF( s_FileHandle, "DeletePixelShader\n" );
  640. return m_pD3DDevice->DeletePixelShader( Handle );
  641. }
  642. HRESULT __stdcall SetPixelShaderConstant(DWORD Register,CONST void* pConstantData,DWORD ConstantCount)
  643. {
  644. FPRINTF( s_FileHandle, "SetPixelShaderConstant\n" );
  645. return m_pD3DDevice->SetPixelShaderConstant( Register, pConstantData, ConstantCount );
  646. }
  647. HRESULT __stdcall GetPixelShaderConstant(DWORD Register,void* pConstantData,DWORD ConstantCount)
  648. {
  649. FPRINTF( s_FileHandle, "GetPixelShaderConstant\n" );
  650. return m_pD3DDevice->GetPixelShaderConstant( Register, pConstantData, ConstantCount );
  651. }
  652. HRESULT __stdcall GetPixelShaderFunction(DWORD Handle,void* pData,DWORD* pSizeOfData)
  653. {
  654. FPRINTF( s_FileHandle, "GetPixelShaderFunction\n" );
  655. return m_pD3DDevice->GetPixelShaderFunction( Handle, pData, pSizeOfData );
  656. }
  657. HRESULT __stdcall DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo)
  658. {
  659. FPRINTF( s_FileHandle, "DrawRectPatch\n" );
  660. return m_pD3DDevice->DrawRectPatch( Handle, pNumSegs, pRectPatchInfo );
  661. }
  662. HRESULT __stdcall DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo)
  663. {
  664. FPRINTF( s_FileHandle, "DrawTriPatch\n" );
  665. return m_pD3DDevice->DrawTriPatch( Handle, pNumSegs, pTriPatchInfo );
  666. }
  667. HRESULT __stdcall DeletePatch(UINT Handle)
  668. {
  669. FPRINTF( s_FileHandle, "DeletePatch\n" );
  670. return m_pD3DDevice->DeletePatch( Handle );
  671. }
  672. };
  673. #endif // STUBD3D
  674. #endif // STUBD3DDEVICE_H