Advertisement
Guest User

d3dDEV.cpp

a guest
Jun 21st, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 23.03 KB | None | 0 0
  1.  
  2.  
  3. #include <iostream>
  4. #include <windows.h>
  5. #include "main.h"
  6. #include "d3d9.h"
  7. #include <ctime>
  8. #include "Hacks.h"
  9.  
  10. Hacks hacks;
  11.  
  12. HRESULT CD3DManager::Initialize()
  13. {
  14.     /*
  15.     initialize Resources such as textures
  16.     (managed and unmanaged [D3DPOOL]),
  17.     vertex buffers, and other D3D rendering resources
  18.     ...
  19.     m_pD3Ddev->CreateTexture(..., ..., &m_pD3Dtexture);
  20.     */
  21.    
  22.     //create our font
  23.     hacks.CreateFont(m_pD3Ddev, "Moire");
  24.  
  25.     return S_OK;
  26. }
  27.  
  28. HRESULT CD3DManager::PreReset()
  29. {
  30.     /*
  31.     release all UNMANAGED [D3DPOOL_DEFAULT]
  32.     textures, vertex buffers, and other
  33.     volitile resources
  34.     ...
  35.     _SAFE_RELEASE(m_pD3Dtexture);
  36.     */
  37.     return S_OK;
  38. }
  39.  
  40. HRESULT CD3DManager::PostReset()
  41. {
  42.     /*
  43.     re-initialize all UNMANAGED [D3DPOOL_DEFAULT]
  44.     textures, vertex buffers, and other volitile
  45.     resources
  46.     ...
  47.     m_pD3Ddev->CreateTexture(..., ..., &m_pD3Dtexture);
  48.     */
  49.     return S_OK;
  50. }
  51.  
  52. HRESULT CD3DManager::Release()
  53. {
  54.     /*
  55.     Release all textures, vertex buffers, and
  56.     other resources
  57.     ...
  58.     _SAFE_RELEASE(m_pD3Dtexture);
  59.     */
  60.     return S_OK;
  61. }
  62.  
  63. //-----------------------------------------------------------------------------
  64.  
  65. HRESULT APIENTRY hkIDirect3DDevice9::QueryInterface(REFIID riid, LPVOID *ppvObj)
  66. {
  67.     return m_pD3Ddev->QueryInterface(riid, ppvObj);
  68. }
  69.  
  70. ULONG APIENTRY hkIDirect3DDevice9::AddRef()
  71. {
  72.     m_refCount++;
  73.     return m_pD3Ddev->AddRef();
  74. }
  75.  
  76. HRESULT APIENTRY hkIDirect3DDevice9::BeginScene()
  77. {
  78.     static bool RunOnce = true;
  79.     if(RunOnce)
  80.     {
  81.         RunOnce = false;
  82.         hacks.InitializeMenuItems();
  83.     }
  84.  
  85.     return m_pD3Ddev->BeginScene();
  86. }
  87.  
  88. HRESULT APIENTRY hkIDirect3DDevice9::BeginStateBlock()
  89. {
  90.     return m_pD3Ddev->BeginStateBlock();
  91. }
  92.  
  93. HRESULT APIENTRY hkIDirect3DDevice9::Clear(DWORD Count, CONST D3DRECT *pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil)
  94. {
  95.     return m_pD3Ddev->Clear(Count, pRects, Flags, Color, Z, Stencil);
  96. }
  97.  
  98. HRESULT APIENTRY hkIDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect, D3DCOLOR color)
  99. {  
  100.     return m_pD3Ddev->ColorFill(pSurface,pRect,color);
  101. }
  102.  
  103. HRESULT APIENTRY hkIDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain)
  104. {
  105.     return m_pD3Ddev->CreateAdditionalSwapChain(pPresentationParameters, ppSwapChain);
  106. }
  107.  
  108. HRESULT APIENTRY hkIDirect3DDevice9::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle)
  109. {
  110.     return m_pD3Ddev->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture,pSharedHandle);
  111. }
  112.  
  113. HRESULT APIENTRY hkIDirect3DDevice9::CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
  114. {
  115.     return m_pD3Ddev->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality,Discard,ppSurface, pSharedHandle);
  116. }
  117.  
  118. HRESULT APIENTRY hkIDirect3DDevice9::CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle)
  119. {
  120.     return m_pD3Ddev->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer,pSharedHandle);
  121. }
  122.  
  123. HRESULT APIENTRY hkIDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
  124. {
  125.     return m_pD3Ddev->CreateOffscreenPlainSurface(Width,Height,Format,Pool,ppSurface,pSharedHandle);
  126. }
  127.  
  128. HRESULT APIENTRY hkIDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader)
  129. {
  130.     return m_pD3Ddev->CreatePixelShader(pFunction, ppShader);
  131. }
  132.  
  133. HRESULT APIENTRY hkIDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
  134. {
  135.     return m_pD3Ddev->CreateQuery(Type,ppQuery);
  136. }
  137.  
  138. HRESULT APIENTRY hkIDirect3DDevice9::CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
  139. {
  140.     return m_pD3Ddev->CreateRenderTarget(Width, Height, Format, MultiSample,MultisampleQuality, Lockable, ppSurface,pSharedHandle);
  141. }
  142.  
  143. HRESULT APIENTRY hkIDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB)
  144. {
  145.     return m_pD3Ddev->CreateStateBlock(Type, ppSB);
  146. }
  147.  
  148. HRESULT APIENTRY hkIDirect3DDevice9::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle)
  149. {
  150.     HRESULT ret = m_pD3Ddev->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);
  151.  
  152.     #ifdef D3DHOOK_TEXTURES
  153.         if(ret == D3D_OK) { new hkIDirect3DTexture9(ppTexture, this, Width, Height, Format); }
  154.     #endif
  155.  
  156.     return ret;
  157. }
  158.  
  159. HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle)
  160. {
  161.     return m_pD3Ddev->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer,pSharedHandle);
  162. }
  163.  
  164. HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl)
  165. {
  166.     return m_pD3Ddev->CreateVertexDeclaration(pVertexElements,ppDecl);
  167. }
  168.  
  169. HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader)
  170. {
  171.     return m_pD3Ddev->CreateVertexShader(pFunction, ppShader);
  172. }
  173.  
  174. HRESULT APIENTRY hkIDirect3DDevice9::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle)
  175. {
  176.     return m_pD3Ddev->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture,pSharedHandle);
  177. }
  178.  
  179. HRESULT APIENTRY hkIDirect3DDevice9::DeletePatch(UINT Handle)
  180. {
  181.     return m_pD3Ddev->DeletePatch(Handle);
  182. }
  183.  
  184. HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE device,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
  185. {
  186.     HRESULT hRet = m_pD3Ddev->DrawIndexedPrimitive(device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  187.     return hRet;
  188. }
  189.  
  190. HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinIndex, UINT NumVertices, UINT PrimitiveCount, CONST void *pIndexData, D3DFORMAT IndexDataFormat, CONST void *pVertexStreamZeroData, UINT VertexStreamZeroStride)
  191. {  
  192.     return m_pD3Ddev->DrawIndexedPrimitiveUP(PrimitiveType, MinIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
  193. }
  194.  
  195. HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount)
  196. {
  197.     return m_pD3Ddev->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
  198. }
  199.  
  200. HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void *pVertexStreamZeroData, UINT VertexStreamZeroStride)
  201. {
  202.     return m_pD3Ddev->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
  203. }
  204.  
  205. HRESULT APIENTRY hkIDirect3DDevice9::DrawRectPatch(UINT Handle, CONST float *pNumSegs, CONST D3DRECTPATCH_INFO *pRectPatchInfo)
  206. {
  207.     return m_pD3Ddev->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
  208. }
  209.  
  210. HRESULT APIENTRY hkIDirect3DDevice9::DrawTriPatch(UINT Handle, CONST float *pNumSegs, CONST D3DTRIPATCH_INFO *pTriPatchInfo)
  211. {
  212.     return m_pD3Ddev->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
  213. }
  214.  
  215. HRESULT APIENTRY hkIDirect3DDevice9::EndScene()
  216. {
  217.     hacks.KeyboardInput();
  218.     hacks.DrawMenu(m_pD3Ddev);
  219.     return m_pD3Ddev->EndScene();
  220. }
  221.  
  222. HRESULT APIENTRY hkIDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB)
  223. {
  224.     return m_pD3Ddev->EndStateBlock(ppSB);
  225. }
  226.  
  227. HRESULT APIENTRY hkIDirect3DDevice9::EvictManagedResources()
  228. {
  229.     return m_pD3Ddev->EvictManagedResources();
  230. }
  231.  
  232. UINT APIENTRY hkIDirect3DDevice9::GetAvailableTextureMem()
  233. {
  234.     return m_pD3Ddev->GetAvailableTextureMem();
  235. }
  236.  
  237. HRESULT APIENTRY hkIDirect3DDevice9::GetBackBuffer(UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer)
  238. {
  239.     return m_pD3Ddev->GetBackBuffer(iSwapChain,iBackBuffer, Type, ppBackBuffer);
  240. }
  241.  
  242. HRESULT APIENTRY hkIDirect3DDevice9::GetClipPlane(DWORD Index, float *pPlane)
  243. {
  244.     return m_pD3Ddev->GetClipPlane(Index, pPlane);
  245. }
  246.  
  247. HRESULT APIENTRY hkIDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9 *pClipStatus)
  248. {
  249.     return m_pD3Ddev->GetClipStatus(pClipStatus);
  250. }
  251.  
  252. HRESULT APIENTRY hkIDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters)
  253. {
  254.     return m_pD3Ddev->GetCreationParameters(pParameters);
  255. }
  256.  
  257. HRESULT APIENTRY hkIDirect3DDevice9::GetCurrentTexturePalette(UINT *pPaletteNumber)
  258. {
  259.     return m_pD3Ddev->GetCurrentTexturePalette(pPaletteNumber);
  260. }
  261.  
  262. HRESULT APIENTRY hkIDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9 **ppZStencilSurface)
  263. {
  264.     return m_pD3Ddev->GetDepthStencilSurface(ppZStencilSurface);
  265. }
  266.  
  267. HRESULT APIENTRY hkIDirect3DDevice9::GetDeviceCaps(D3DCAPS9 *pCaps)
  268. {
  269.     return m_pD3Ddev->GetDeviceCaps(pCaps);
  270. }
  271.  
  272. HRESULT APIENTRY hkIDirect3DDevice9::GetDirect3D(IDirect3D9 **ppD3D9)
  273. {
  274.     HRESULT hRet = m_pD3Ddev->GetDirect3D(ppD3D9);
  275.     if( SUCCEEDED(hRet) )
  276.         *ppD3D9 = m_pD3Dint;
  277.     return hRet;
  278. }
  279.  
  280. HRESULT APIENTRY hkIDirect3DDevice9::GetDisplayMode(UINT iSwapChain,D3DDISPLAYMODE* pMode)
  281. {
  282.     return m_pD3Ddev->GetDisplayMode(iSwapChain,pMode);
  283. }
  284.  
  285. HRESULT APIENTRY hkIDirect3DDevice9::GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface)
  286. {
  287.     return m_pD3Ddev->GetFrontBufferData(iSwapChain,pDestSurface);
  288. }
  289.  
  290. HRESULT APIENTRY hkIDirect3DDevice9::GetFVF(DWORD* pFVF)
  291. {
  292.     return m_pD3Ddev->GetFVF(pFVF);
  293. }
  294.  
  295. void APIENTRY hkIDirect3DDevice9::GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp)
  296. {
  297.     m_pD3Ddev->GetGammaRamp(iSwapChain,pRamp);
  298. }
  299.  
  300. HRESULT APIENTRY hkIDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData)
  301. {
  302.     return m_pD3Ddev->GetIndices(ppIndexData);
  303. }
  304.  
  305. HRESULT APIENTRY hkIDirect3DDevice9::GetLight(DWORD Index, D3DLIGHT9 *pLight)
  306. {
  307.     return m_pD3Ddev->GetLight(Index, pLight);
  308. }
  309.  
  310. HRESULT APIENTRY hkIDirect3DDevice9::GetLightEnable(DWORD Index, BOOL *pEnable)
  311. {
  312.     return m_pD3Ddev->GetLightEnable(Index, pEnable);
  313. }
  314.  
  315. HRESULT APIENTRY hkIDirect3DDevice9::GetMaterial(D3DMATERIAL9 *pMaterial)
  316. {
  317.     return m_pD3Ddev->GetMaterial(pMaterial);
  318. }
  319.  
  320. float APIENTRY hkIDirect3DDevice9::GetNPatchMode()
  321. {
  322.     return m_pD3Ddev->GetNPatchMode();
  323. }
  324.  
  325. unsigned int APIENTRY hkIDirect3DDevice9::GetNumberOfSwapChains()
  326. {
  327.     return m_pD3Ddev->GetNumberOfSwapChains();
  328. }
  329.  
  330. HRESULT APIENTRY hkIDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY *pEntries)
  331. {
  332.     return m_pD3Ddev->GetPaletteEntries(PaletteNumber, pEntries);
  333. }
  334.  
  335. HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader)
  336. {
  337.     return m_pD3Ddev->GetPixelShader(ppShader);
  338. }
  339.  
  340. HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
  341. {
  342.     return m_pD3Ddev->GetPixelShaderConstantB(StartRegister,pConstantData,BoolCount);
  343. }
  344.  
  345. HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount)
  346. {
  347.     return m_pD3Ddev->GetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount);
  348. }
  349.  
  350. HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount)
  351. {
  352.     return m_pD3Ddev->GetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount);
  353. }
  354.  
  355. HRESULT APIENTRY hkIDirect3DDevice9::GetRasterStatus(UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus)
  356. {
  357.     return m_pD3Ddev->GetRasterStatus(iSwapChain,pRasterStatus);
  358. }
  359.  
  360. HRESULT APIENTRY hkIDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State, DWORD *pValue)
  361. {
  362.     return m_pD3Ddev->GetRenderState(State, pValue);
  363. }
  364.  
  365. HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget)
  366. {
  367.     return m_pD3Ddev->GetRenderTarget(RenderTargetIndex,ppRenderTarget);
  368. }
  369.  
  370. HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface)
  371. {
  372.     return m_pD3Ddev->GetRenderTargetData(pRenderTarget,pDestSurface);
  373. }
  374.  
  375. HRESULT APIENTRY hkIDirect3DDevice9::GetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue)
  376. {
  377.     return m_pD3Ddev->GetSamplerState(Sampler,Type,pValue);
  378. }
  379.  
  380. HRESULT APIENTRY hkIDirect3DDevice9::GetScissorRect(RECT* pRect)
  381. {
  382.     return m_pD3Ddev->GetScissorRect(pRect);
  383. }
  384.  
  385. BOOL APIENTRY hkIDirect3DDevice9::GetSoftwareVertexProcessing()
  386. {
  387.     return m_pD3Ddev->GetSoftwareVertexProcessing();
  388. }
  389.  
  390. HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride)
  391. {
  392.     return m_pD3Ddev->GetStreamSource(StreamNumber, ppStreamData,OffsetInBytes, pStride);
  393. }
  394.  
  395. HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber,UINT* Divider)
  396. {
  397.     return m_pD3Ddev->GetStreamSourceFreq(StreamNumber,Divider);
  398. }
  399.  
  400. HRESULT APIENTRY hkIDirect3DDevice9::GetSwapChain(UINT iSwapChain,IDirect3DSwapChain9** pSwapChain)
  401. {
  402.     return m_pD3Ddev->GetSwapChain(iSwapChain,pSwapChain);
  403. }
  404.  
  405. HRESULT APIENTRY hkIDirect3DDevice9::GetTexture(DWORD Stage, IDirect3DBaseTexture9 **ppTexture)
  406. {
  407.     return m_pD3Ddev->GetTexture(Stage, ppTexture);
  408. }
  409.  
  410. HRESULT APIENTRY hkIDirect3DDevice9::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD *pValue)
  411. {
  412.     return m_pD3Ddev->GetTextureStageState(Stage, Type, pValue);
  413. }
  414.  
  415. HRESULT APIENTRY hkIDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX *pMatrix)
  416. {
  417.     return m_pD3Ddev->GetTransform(State, pMatrix);
  418. }
  419.  
  420. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl)
  421. {
  422.     return m_pD3Ddev->GetVertexDeclaration(ppDecl);
  423. }
  424.  
  425. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader)
  426. {
  427.     return m_pD3Ddev->GetVertexShader(ppShader);
  428. }
  429.  
  430. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
  431. {
  432.     return m_pD3Ddev->GetVertexShaderConstantB(StartRegister,pConstantData,BoolCount);
  433. }
  434.  
  435. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount)
  436. {
  437.     return m_pD3Ddev->GetVertexShaderConstantF(StartRegister,pConstantData,Vector4fCount);
  438. }
  439.  
  440. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount)
  441. {
  442.     return m_pD3Ddev->GetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount);
  443. }
  444.  
  445. HRESULT APIENTRY hkIDirect3DDevice9::GetViewport(D3DVIEWPORT9 *pViewport)
  446. {
  447.     return m_pD3Ddev->GetViewport(pViewport);
  448. }
  449.  
  450. HRESULT APIENTRY hkIDirect3DDevice9::LightEnable(DWORD LightIndex, BOOL bEnable)
  451. {
  452.     return m_pD3Ddev->LightEnable(LightIndex, bEnable);
  453. }
  454.  
  455. HRESULT APIENTRY hkIDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix)
  456. {
  457.     return m_pD3Ddev->MultiplyTransform(State, pMatrix);
  458. }
  459.  
  460. HRESULT APIENTRY hkIDirect3DDevice9::Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
  461. {  
  462.     return m_pD3Ddev->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
  463. }
  464.  
  465. HRESULT APIENTRY hkIDirect3DDevice9::ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags)
  466. {
  467.     return m_pD3Ddev->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer,pVertexDecl, Flags);
  468. }
  469.  
  470. ULONG APIENTRY hkIDirect3DDevice9::Release()
  471. {
  472.     if( --m_refCount == 0 )
  473.         m_pManager->Release();
  474.  
  475.     return m_pD3Ddev->Release();
  476. }
  477.  
  478. HRESULT APIENTRY hkIDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS *pPresentationParameters)
  479. {
  480.     m_pManager->PreReset();
  481.  
  482.     HRESULT hRet = m_pD3Ddev->Reset(pPresentationParameters);
  483.  
  484.     if( SUCCEEDED(hRet) )
  485.     {
  486.         m_PresentParam = *pPresentationParameters;
  487.         m_pManager->PostReset();
  488.     }
  489.  
  490.     return hRet;
  491. }
  492.  
  493. HRESULT APIENTRY hkIDirect3DDevice9::SetClipPlane(DWORD Index, CONST float *pPlane)
  494. {
  495.     return m_pD3Ddev->SetClipPlane(Index, pPlane);
  496. }
  497.  
  498. HRESULT APIENTRY hkIDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9 *pClipStatus)
  499. {
  500.     return m_pD3Ddev->SetClipStatus(pClipStatus);
  501. }
  502.  
  503. HRESULT APIENTRY hkIDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber)
  504. {
  505.     return m_pD3Ddev->SetCurrentTexturePalette(PaletteNumber);
  506. }
  507.  
  508. void APIENTRY hkIDirect3DDevice9::SetCursorPosition(int X, int Y, DWORD Flags)
  509. {
  510.     m_pD3Ddev->SetCursorPosition(X, Y, Flags);
  511. }
  512.  
  513. HRESULT APIENTRY hkIDirect3DDevice9::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9 *pCursorBitmap)
  514. {
  515.     return m_pD3Ddev->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
  516. }
  517.  
  518. HRESULT APIENTRY hkIDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil)
  519. {
  520.     return m_pD3Ddev->SetDepthStencilSurface(pNewZStencil);
  521. }
  522.  
  523. HRESULT APIENTRY hkIDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs)
  524. {
  525.     return m_pD3Ddev->SetDialogBoxMode(bEnableDialogs);
  526. }
  527.  
  528. HRESULT APIENTRY hkIDirect3DDevice9::SetFVF(DWORD FVF)
  529. {
  530.     return m_pD3Ddev->SetFVF(FVF);
  531. }
  532.  
  533. void APIENTRY hkIDirect3DDevice9::SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp)
  534. {
  535.     m_pD3Ddev->SetGammaRamp(iSwapChain,Flags, pRamp);
  536. }
  537.  
  538. HRESULT APIENTRY hkIDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData)
  539. {
  540.     return m_pD3Ddev->SetIndices(pIndexData);
  541. }
  542.  
  543. HRESULT APIENTRY hkIDirect3DDevice9::SetLight(DWORD Index, CONST D3DLIGHT9 *pLight)
  544. {
  545.     return m_pD3Ddev->SetLight(Index, pLight);
  546. }
  547.  
  548. HRESULT APIENTRY hkIDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9 *pMaterial)
  549. {  
  550.     return m_pD3Ddev->SetMaterial(pMaterial);
  551. }
  552.  
  553. HRESULT APIENTRY hkIDirect3DDevice9::SetNPatchMode(float nSegments)
  554. {  
  555.     return m_pD3Ddev->SetNPatchMode(nSegments);
  556. }
  557.  
  558. HRESULT APIENTRY hkIDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY *pEntries)
  559. {
  560.     return m_pD3Ddev->SetPaletteEntries(PaletteNumber, pEntries);
  561. }
  562.  
  563. HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader)
  564. {
  565.     return m_pD3Ddev->SetPixelShader(pShader);
  566. }
  567.  
  568. HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT  BoolCount)
  569. {
  570.     return m_pD3Ddev->SetPixelShaderConstantB(StartRegister,pConstantData,BoolCount);
  571. }
  572.  
  573. HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount)
  574. {
  575.     return m_pD3Ddev->SetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount);
  576. }
  577.  
  578. HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount)
  579. {
  580.     return m_pD3Ddev->SetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount);
  581. }
  582.  
  583. HRESULT APIENTRY hkIDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value)
  584. {
  585.     return m_pD3Ddev->SetRenderState(State, Value);
  586. }
  587.  
  588. HRESULT APIENTRY hkIDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget)
  589. {
  590.     return m_pD3Ddev->SetRenderTarget(RenderTargetIndex,pRenderTarget);
  591. }
  592.  
  593. HRESULT APIENTRY hkIDirect3DDevice9::SetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value)
  594. {
  595.     return m_pD3Ddev->SetSamplerState(Sampler,Type,Value);
  596. }
  597.  
  598. HRESULT APIENTRY hkIDirect3DDevice9::SetScissorRect(CONST RECT* pRect)
  599. {
  600.     return m_pD3Ddev->SetScissorRect(pRect);
  601. }
  602.  
  603. HRESULT APIENTRY hkIDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware)
  604. {
  605.     return m_pD3Ddev->SetSoftwareVertexProcessing(bSoftware);
  606. }
  607.  
  608. HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
  609. {
  610.     //__asm nop
  611.  
  612.     //HERE we find our stride
  613.     if (StreamNumber==0)
  614.     {
  615.         hacks.m_Stride = Stride;
  616.     }
  617.     return m_pD3Ddev->SetStreamSource(StreamNumber, pStreamData,OffsetInBytes, Stride);
  618. }
  619.  
  620. HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber,UINT Divider)
  621. {  
  622.     return m_pD3Ddev->SetStreamSourceFreq(StreamNumber,Divider);
  623. }
  624.  
  625. HRESULT APIENTRY hkIDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9 *pTexture)
  626. {
  627. #ifdef D3DHOOK_TEXTURES
  628.     IDirect3DDevice9 *dev = NULL;
  629.     if(pTexture != NULL && ((hkIDirect3DTexture9*)(pTexture))->GetDevice(&dev) == D3D_OK)
  630.     {
  631.         if(dev == this)
  632.             return m_pD3Ddev->SetTexture(Stage, ((hkIDirect3DTexture9*)(pTexture))->m_D3Dtex);
  633.     }
  634. #endif
  635.    
  636.     return m_pD3Ddev->SetTexture(Stage, pTexture);
  637. }
  638.  
  639. HRESULT APIENTRY hkIDirect3DDevice9::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value)
  640. {
  641.     return m_pD3Ddev->SetTextureStageState(Stage, Type, Value);
  642. }
  643.  
  644. HRESULT APIENTRY hkIDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix)
  645. {
  646.     return m_pD3Ddev->SetTransform(State, pMatrix);
  647. }
  648.  
  649. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl)
  650. {
  651.     return m_pD3Ddev->SetVertexDeclaration(pDecl);
  652. }
  653.  
  654. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader)
  655. {
  656.     return m_pD3Ddev->SetVertexShader(pShader);
  657. }
  658.  
  659. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT  BoolCount)
  660. {
  661.     return m_pD3Ddev->SetVertexShaderConstantB(StartRegister,pConstantData,BoolCount);
  662. }
  663.  
  664. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount)
  665. {
  666.     return m_pD3Ddev->SetVertexShaderConstantF(StartRegister,pConstantData,Vector4fCount);
  667. }
  668.  
  669. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount)
  670. {
  671.     return m_pD3Ddev->SetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount);
  672. }
  673.  
  674. HRESULT APIENTRY hkIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9 *pViewport)
  675. {
  676.     return m_pD3Ddev->SetViewport(pViewport);
  677. }
  678.  
  679. BOOL APIENTRY hkIDirect3DDevice9::ShowCursor(BOOL bShow)
  680. {
  681.     return m_pD3Ddev->ShowCursor(bShow);
  682. }
  683.  
  684. HRESULT APIENTRY hkIDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter)
  685. {
  686.     return m_pD3Ddev->StretchRect(pSourceSurface,pSourceRect,pDestSurface,pDestRect,Filter);
  687. }
  688.  
  689. HRESULT APIENTRY hkIDirect3DDevice9::TestCooperativeLevel()
  690. {
  691.     return m_pD3Ddev->TestCooperativeLevel();
  692. }
  693.  
  694. HRESULT APIENTRY hkIDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint)
  695. {
  696.     return m_pD3Ddev->UpdateSurface(pSourceSurface,pSourceRect,pDestinationSurface,pDestPoint);
  697. }
  698.  
  699. HRESULT APIENTRY hkIDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9 *pSourceTexture, IDirect3DBaseTexture9 *pDestinationTexture)
  700. {
  701.     return m_pD3Ddev->UpdateTexture(pSourceTexture, pDestinationTexture);
  702. }
  703.  
  704. HRESULT APIENTRY hkIDirect3DDevice9::ValidateDevice(DWORD *pNumPasses)
  705. {
  706.     return m_pD3Ddev->ValidateDevice(pNumPasses);
  707. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement