Guest User

theHunter chams

a guest
Mar 11th, 2014
185
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Hacks.h
  2.  
  3. #pragma once
  4.  
  5. #include <Windows.h>
  6. #include "d3d9.h"
  7. #include <ctime> //for the clock
  8. #include <iostream>
  9.  
  10. #define D3DHOOK_TEXTURES //comment this to disable texture hooking
  11. #define MAX_MENU_ITEMS 6 //so you limit up to make sure everything else run smoothly
  12.  
  13. //MOVE THESE to the top
  14. //these are just examples you can do your own
  15. #define WALLHACK 0
  16. #define CUSTOM_CROSSHAIR 1
  17. #define NO_RECOIL 2
  18. #define UNLIM_AMMO 3
  19. #define AUTO_FIRE 4
  20. #define HIDE_MENU 5
  21. const BYTE bRed[60] =
  22.  
  23.  
  24. {
  25. 0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  26. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  27. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  28. 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  29. 0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
  30. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  31. 0x00, 0x00, 0xFF, 0x00, 0x00, 0x50};
  32.  
  33. const BYTE bGreen[60] =
  34. {
  35. 0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  36. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  37. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  38. 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  39. 0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
  40. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  41. 0x20, 0xA0, 0x00, 0x00, 0xFF, 0xFF
  42. };
  43.  
  44. const BYTE bBlue[60] =
  45. {
  46. 0x42, 0x4D, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  47. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  48. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  49. 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  50. 0x00, 0x00, 0x12, 0x0B, 0x00, 0x00, 0x12, 0x0B, 0x00,
  51. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  52. 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00
  53. };
  54.  
  55. const BYTE bWhite[58] =
  56. {
  57. 0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  58. 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
  59. 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  60. 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
  61. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  62. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  63. 0xFF, 0xFF, 0xFF, 0x00
  64. };
  65.  
  66.  
  67.  
  68. //-----------------------------------------------
  69. //primitives and textures to set chams in
  70. #define WHITETAIL_MALE (( NumVertices == 1111 && primCount == 1384))
  71. #define MULE_MALE (( NumVertices == 1141 && primCount == 1666))
  72. #define COYOTE_MALE (( NumVertices == 422 && primCount == 511 ))
  73. #define BEAR_MALE (( NumVertices == 422 && primCount == 649))
  74. #define Animals ((WHITETAIL_MALE || MULE_MALE || COYOTE_MALE || BEAR_MALE))
  75.  
  76. //------------------------------------------------
  77.  
  78.  
  79.  
  80. class Hacks
  81. {
  82. public:
  83.     int m_Stride;
  84.     /*Function prototypes*/
  85.     void Hacks::CreateFont(IDirect3DDevice9 *d3dDevice, std::string choiceFont);
  86.     void Hacks::InitializeMenuItems();
  87.     void Hacks::CreateTexture(IDirect3DDevice9 *d3dDevice, LPCVOID colour, UINT ColourSize, LPDIRECT3DTEXTURE9 *texture);
  88.     void Hacks::Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour);
  89.     void Hacks::DrawMenu(IDirect3DDevice9 *d3dDevice);
  90.     void Hacks::DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* d3dDevice);
  91.     void Hacks::DrawBorderBox( int x, int y, int w, int h, int thickness, D3DCOLOR Colour, IDirect3DDevice9 *d3dDevice);
  92.     void Hacks::KeyboardInput();
  93.     void Hacks::ApllyWallHack(IDirect3DDevice9 *d3dDevice, D3DPRIMITIVETYPE device, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
  94.  
  95.  
  96.     //our colours For the chams textures
  97.     //Spetznas and opfor
  98.     LPDIRECT3DTEXTURE9 texRed;
  99.     LPDIRECT3DTEXTURE9 texGreen;
  100.  
  101.     //Marines and SAS
  102.     LPDIRECT3DTEXTURE9 texBlue;
  103.     LPDIRECT3DTEXTURE9 texWhite;
  104.  
  105.     //used to get window size and other info
  106.     D3DVIEWPORT9 g_ViewPort;
  107.  
  108.     //our font
  109.     LPD3DXFONT m_font;
  110.  
  111.     //everything each hack needs bay bay
  112.     struct d3dMenuHack
  113.     {
  114.         bool on;
  115.         std::string name;
  116.     };
  117.  
  118.     d3dMenuHack hack[MAX_MENU_ITEMS];
  119. };
  120.  
  121.  
  122.  
  123.  
  124.  
  125. -------------------------------------------
  126.  
  127. Hacks.cpp
  128.  
  129.  
  130.  
  131.  
  132. #include "hacks.h";
  133.  
  134.  
  135. /*--------------CHEAT RELATED VARS-------------------*/
  136.  
  137. int MenuIndex = 0;
  138.  
  139. // Create a colour for the text
  140. D3DCOLOR fontRed = D3DCOLOR_ARGB(255, 255, 0, 0);  
  141. D3DCOLOR fontGreen = D3DCOLOR_ARGB(255, 0, 255, 0);    
  142. D3DCOLOR fontBlue = D3DCOLOR_ARGB(255, 0, 42, 255);    
  143. D3DCOLOR fontWhite = D3DCOLOR_ARGB(255, 255, 255, 255);  
  144. D3DCOLOR fontBlack = D3DCOLOR_ARGB(255, 0, 0, 0);  
  145. /*---------------------------------------------------*/
  146.  
  147.  
  148. void Hacks::CreateFont(IDirect3DDevice9 *d3dDevice, std::string choiceFont)
  149. {
  150.         D3DXCreateFont( d3dDevice, 20, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET,
  151.                 OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
  152.                 choiceFont.c_str(), &m_font );
  153. }
  154.  
  155.  
  156. void Hacks::InitializeMenuItems()
  157. {
  158.     hack[WALLHACK].name = " WallHack and chams";
  159.     hack[CUSTOM_CROSSHAIR].name = " Show custom crosshair";
  160.     hack[NO_RECOIL].name = " No Recoil";
  161.     hack[UNLIM_AMMO].name = " Unlimited equipment";
  162.     hack[AUTO_FIRE].name = "All guns Automatic";
  163.     hack[HIDE_MENU].name = " Hide hack [INSERT]";
  164.     //make the hack visible by default
  165.     hack[HIDE_MENU].on = false; //shows hack by default
  166. }
  167.  
  168.  
  169. void Hacks::CreateTexture(IDirect3DDevice9 *d3dDevice, LPCVOID colour, UINT ColourSize, LPDIRECT3DTEXTURE9 *texture);
  170. {
  171.  
  172.     D3DXCreateTextureFromFileInMemory(d3dDevice, colour, ColourSize, texture);
  173.  
  174. }
  175.  
  176. void Hacks::DrawMenu(IDirect3DDevice9 *d3dDevice)
  177. {
  178.     if(!hack[HIDE_MENU].on)
  179.     {
  180.         //Add game name here, and put border around it
  181.         DrawFilledRect( 55, 20, 200, 50, fontBlue, d3dDevice );
  182.         DrawBorderBox(55, 20, 200, 50, 4, fontBlack, d3dDevice );
  183.         Draw_Text("COD 4 MP hack", 190, 30, fontWhite);
  184.  
  185.         //draw back of our hack, transparent black
  186.         DrawFilledRect( 30, 55, 250, (62*MAX_MENU_ITEMS),fontBlue, d3dDevice );
  187.         //draw hack border
  188.         DrawBorderBox(30, 55, 250, (62*MAX_MENU_ITEMS), 6/*was 6*/, fontBlack, d3dDevice );
  189.         //Reset our time and update the text again in 2 secs
  190.         int y = 40;
  191.         for(int i = 0; i < MAX_MENU_ITEMS; i ++)
  192.         {
  193.             //Draw each box's back colour, this will be based on whether the hack is on e.g.
  194.             //red means off and green means on
  195.             DrawFilledRect( 45, 30+y, 220, 40, hack[i].on ? fontGreen : fontRed, d3dDevice );
  196.  
  197.             //draw box Around Each hack item If the item is highlighted it will show with a white border
  198.             DrawBorderBox(45, 30+y, 220, 40, 4, fontBlack, d3dDevice );
  199.  
  200.             //draw White border to show the user which hack item is currently selected
  201.             if(MenuIndex == i)
  202.             {
  203.                 DrawBorderBox(41, 26+y, 228, 48, 4, fontWhite, d3dDevice );
  204.             }
  205.  
  206.             //Ternary at its finest, if the  hack is on we display the text colour in green
  207.             //otherwise its green
  208.             //Draw_Text(hack[i].KeyAssigned.c_str(), 160 , 32+y, fontWhite);
  209.             Draw_Text(hack[i].name.c_str(), 170 , 39+y, fontBlack);
  210.             //Draw_Text(hack[i].state. c_str(), 355 , 32+y, hack[i].on ? fontGreen : fontRed);
  211.             //used to position the next item below by 30 height units
  212.             y+= 50;
  213.         }
  214.         Draw_Text("Select using arrow keys", 170, ((62*MAX_MENU_ITEMS)+7), fontWhite);
  215.         Draw_Text("Turn ON/OFF [END] key", 170, ((62*MAX_MENU_ITEMS)+27), fontWhite);
  216.     }
  217. }
  218.  
  219. void Hacks::DrawBorderBox( int x, int y, int w, int h, int thickness, D3DCOLOR Colour, IDirect3DDevice9 *pDevice)
  220. {
  221.     //Top horiz line
  222.     DrawFilledRect( x, y, w, thickness,  Colour, pDevice );
  223.     //Left vertical line
  224.     DrawFilledRect( x, y, thickness, h, Colour, pDevice );
  225.     //right vertical line
  226.     DrawFilledRect( (x + w), y, thickness, h, Colour, pDevice );
  227.     //bottom horiz line
  228.     DrawFilledRect( x, y + h, w+thickness, thickness, Colour, pDevice );
  229. }
  230.  
  231.  
  232. //We receive the 2-D Coordinates the colour and the device we want to use to draw those colours with
  233. void Hacks::DrawFilledRect(int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* dev)
  234. {
  235.     //We create our rectangle to draw on screen
  236.     D3DRECT BarRect = { x, y, x + w, y + h };
  237.     //We clear that portion of the screen and display our rectangle
  238.     dev->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_TARGET, color, 0, 0);
  239. }
  240.  
  241.  
  242. void Hacks::Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour)
  243. {
  244.     // Create a rectangle to indicate where on the screen it should be drawn
  245.     RECT rct = {x- 120, y, x+ 120, y + 15};
  246.  
  247.     // Draw some text
  248.     m_font->DrawText(NULL, TextToDraw, -1, &rct, DT_NOCLIP, Colour );
  249. }
  250.  
  251.  
  252. void Hacks::KeyboardInput()
  253. {
  254.     if(GetAsyncKeyState(VK_UP)&1)
  255.     {
  256.         if(MenuIndex > 0)
  257.         {
  258.             MenuIndex--;
  259.         }
  260.     }
  261.  
  262.     if(GetAsyncKeyState(VK_DOWN)&1)
  263.     {
  264.         if(MenuIndex < MAX_MENU_ITEMS-1)
  265.         {
  266.             MenuIndex++;
  267.         }
  268.     }
  269.  
  270.     if(GetAsyncKeyState(VK_END)&1)
  271.     {
  272.         hack[MenuIndex].on = !hack[MenuIndex].on;
  273.         if(MenuIndex == NO_RECOIL)
  274.         {
  275.             //this is where we write memory, these are nop values
  276.         }
  277.         if(MenuIndex == UNLIM_AMMO)
  278.         {
  279.             //this is where we write memory
  280.         }
  281.     }
  282.  
  283.     if(GetAsyncKeyState(VK_INSERT)&1)
  284.     {
  285.         //TEXT DOESNT CHANGE as the hack is either hidden or not
  286.         //and if its hidden you cant tell the user to turn hack on(at least we wont)
  287.         hack[HIDE_MENU].on = !hack[HIDE_MENU].on;
  288.     }
  289. }
  290.  
  291.  
  292.  
  293.  
  294.  
  295. void Hacks::ApllyWallHack(IDirect3DDevice9 *d3dDevice, D3DPRIMITIVETYPE device, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
  296. {
  297.     if(WHITETAIL_MALE)
  298.     {
  299.         d3dDevice->SetRenderState(D3DRS_ZENABLE,false);
  300.         d3dDevice->SetTexture(0, texRed);
  301.         d3dDevice->DrawIndexedPrimitive(device, DRAW BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  302.         d3dDevice->SetRenderState(D3DRS_ZENABLE,true);
  303.     }
  304.  
  305.     if(MULE_MALE)
  306.     {
  307.         d3dDevice->SetRenderState(D3DRS_ZENABLE,false);
  308.         d3dDevice->SetTexture(0, texRed);
  309.         d3dDevice->DrawIndexedPrimitive(device, DRAW BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  310.         d3dDevice->SetRenderState(D3DRS_ZENABLE,true);
  311.  
  312.  
  313.     }
  314.  
  315.     if(COYOTE_MALE)
  316.     {
  317.         //d3dDevice->SetRenderState(D3DRS_ZENABLE,false);
  318.         //d3dDevice->SetTexture(0, texRed);
  319.         //d3dDevice->DrawIndexedPrimitive(device, DRAW BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  320.         //d3dDevice->SetRenderState(D3DRS_ZENABLE,true);
  321.  
  322.     }
  323.  
  324.     if(BEAR_MALE)
  325.     {
  326.         d3dDevice->SetRenderState(D3DRS_ZENABLE,false);
  327.         d3dDevice->SetTexture(0, texRed);
  328.         d3dDevice->DrawIndexedPrimitive(device, DRAW BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  329.         d3dDevice->SetRenderState(D3DRS_ZENABLE,true);
  330.  
  331.     }
  332.  
  333.  
  334. };
  335.  
  336.  
  337.  
  338.  
  339.  
  340. ---------------------------------------------
  341.  
  342. d3d9dev.cpp
  343.  
  344.  
  345.  
  346.  
  347.  
  348. #include <iostream>
  349. #include <windows.h>
  350. #include "main.h"
  351. #include "d3d9.h"
  352. #include <ctime> //for the clock
  353. #include "Hacks.h"
  354. Hacks hacks;
  355.  
  356. HRESULT CD3DManager::Initialize()
  357. {
  358.     /*
  359.     initialize Resources such as textures
  360.     (managed and unmanaged [D3DPOOL]),
  361.     vertex buffers, and other D3D rendering resources
  362.     ...
  363.     m_pD3Ddev->CreateTexture(..., ..., &m_pD3Dtexture);
  364.     */
  365.    
  366.     //create our font
  367.     hacks.CreateFont(m_pD3Ddev, "Moire");
  368.  
  369.     return S_OK;
  370. }
  371.  
  372. HRESULT CD3DManager::PreReset()
  373. {
  374.     /*
  375.     release all UNMANAGED [D3DPOOL_DEFAULT]
  376.     textures, vertex buffers, and other
  377.     volitile resources
  378.     ...
  379.     _SAFE_RELEASE(m_pD3Dtexture);
  380.     */
  381.     return S_OK;
  382. }
  383.  
  384. HRESULT CD3DManager::PostReset()
  385. {
  386.     /*
  387.     re-initialize all UNMANAGED [D3DPOOL_DEFAULT]
  388.     textures, vertex buffers, and other volitile
  389.     resources
  390.     ...
  391.     m_pD3Ddev->CreateTexture(..., ..., &m_pD3Dtexture);
  392.     */
  393.     return S_OK;
  394. }
  395.  
  396. HRESULT CD3DManager::Release()
  397. {
  398.     /*
  399.     Release all textures, vertex buffers, and
  400.     other resources
  401.     ...
  402.     _SAFE_RELEASE(m_pD3Dtexture);
  403.     */
  404.     return S_OK;
  405. }
  406.  
  407. //-----------------------------------------------------------------------------
  408.  
  409. HRESULT APIENTRY hkIDirect3DDevice9::QueryInterface(REFIID riid, LPVOID *ppvObj)
  410. {
  411.     return m_pD3Ddev->QueryInterface(riid, ppvObj);
  412. }
  413.  
  414. ULONG APIENTRY hkIDirect3DDevice9::AddRef()
  415. {
  416.     m_refCount++;
  417.     return m_pD3Ddev->AddRef();
  418. }
  419.  
  420. HRESULT APIENTRY hkIDirect3DDevice9::BeginScene()
  421. {
  422.     static bool RunOnce = true;
  423.     if(RunOnce)
  424.     {
  425.         RunOnce = false;
  426.         hacks.CreateTexture(m_pD3Ddev, (LPCVOID)&bRed, sizeof(bRed), &texRed);
  427.         hacks.InitializeMenuItems();
  428.     }
  429.  
  430.     return m_pD3Ddev->BeginScene();
  431. }
  432.  
  433. HRESULT APIENTRY hkIDirect3DDevice9::BeginStateBlock()
  434. {
  435.     return m_pD3Ddev->BeginStateBlock();
  436. }
  437.  
  438. HRESULT APIENTRY hkIDirect3DDevice9::Clear(DWORD Count, CONST D3DRECT *pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil)
  439. {
  440.     return m_pD3Ddev->Clear(Count, pRects, Flags, Color, Z, Stencil);
  441. }
  442.  
  443. HRESULT APIENTRY hkIDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect, D3DCOLOR color)
  444. {  
  445.     return m_pD3Ddev->ColorFill(pSurface,pRect,color);
  446. }
  447.  
  448. HRESULT APIENTRY hkIDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain)
  449. {
  450.     return m_pD3Ddev->CreateAdditionalSwapChain(pPresentationParameters, ppSwapChain);
  451. }
  452.  
  453. HRESULT APIENTRY hkIDirect3DDevice9::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle)
  454. {
  455.     return m_pD3Ddev->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture,pSharedHandle);
  456. }
  457.  
  458. HRESULT APIENTRY hkIDirect3DDevice9::CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
  459. {
  460.     return m_pD3Ddev->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality,Discard,ppSurface, pSharedHandle);
  461. }
  462.  
  463. HRESULT APIENTRY hkIDirect3DDevice9::CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle)
  464. {
  465.     return m_pD3Ddev->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer,pSharedHandle);
  466. }
  467.  
  468. HRESULT APIENTRY hkIDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
  469. {
  470.     return m_pD3Ddev->CreateOffscreenPlainSurface(Width,Height,Format,Pool,ppSurface,pSharedHandle);
  471. }
  472.  
  473. HRESULT APIENTRY hkIDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader)
  474. {
  475.     return m_pD3Ddev->CreatePixelShader(pFunction, ppShader);
  476. }
  477.  
  478. HRESULT APIENTRY hkIDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
  479. {
  480.     return m_pD3Ddev->CreateQuery(Type,ppQuery);
  481. }
  482.  
  483. HRESULT APIENTRY hkIDirect3DDevice9::CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
  484. {
  485.     return m_pD3Ddev->CreateRenderTarget(Width, Height, Format, MultiSample,MultisampleQuality, Lockable, ppSurface,pSharedHandle);
  486. }
  487.  
  488. HRESULT APIENTRY hkIDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB)
  489. {
  490.     return m_pD3Ddev->CreateStateBlock(Type, ppSB);
  491. }
  492.  
  493. HRESULT APIENTRY hkIDirect3DDevice9::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle)
  494. {
  495.     HRESULT ret = m_pD3Ddev->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);
  496.  
  497.     #ifdef D3DHOOK_TEXTURES
  498.         if(ret == D3D_OK) { new hkIDirect3DTexture9(ppTexture, this, Width, Height, Format); }
  499.     #endif
  500.  
  501.     return ret;
  502. }
  503.  
  504. HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle)
  505. {
  506.     return m_pD3Ddev->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer,pSharedHandle);
  507. }
  508.  
  509. HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl)
  510. {
  511.     return m_pD3Ddev->CreateVertexDeclaration(pVertexElements,ppDecl);
  512. }
  513.  
  514. HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader)
  515. {
  516.     return m_pD3Ddev->CreateVertexShader(pFunction, ppShader);
  517. }
  518.  
  519. HRESULT APIENTRY hkIDirect3DDevice9::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle)
  520. {
  521.     return m_pD3Ddev->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture,pSharedHandle);
  522. }
  523.  
  524. HRESULT APIENTRY hkIDirect3DDevice9::DeletePatch(UINT Handle)
  525. {
  526.     return m_pD3Ddev->DeletePatch(Handle);
  527. }
  528.  
  529. HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE device,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
  530. {
  531.     HRESULT hRet = m_pD3Ddev->DrawIndexedPrimitive(device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  532.     hacks.ApllyWallHack(m_pD3Ddev, device, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  533.     return hRet;
  534. }
  535.  
  536. HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinIndex, UINT NumVertices, UINT PrimitiveCount, CONST void *pIndexData, D3DFORMAT IndexDataFormat, CONST void *pVertexStreamZeroData, UINT VertexStreamZeroStride)
  537. {  
  538.     return m_pD3Ddev->DrawIndexedPrimitiveUP(PrimitiveType, MinIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
  539. }
  540.  
  541. HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount)
  542. {
  543.     return m_pD3Ddev->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
  544. }
  545.  
  546. HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void *pVertexStreamZeroData, UINT VertexStreamZeroStride)
  547. {
  548.     return m_pD3Ddev->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
  549. }
  550.  
  551. HRESULT APIENTRY hkIDirect3DDevice9::DrawRectPatch(UINT Handle, CONST float *pNumSegs, CONST D3DRECTPATCH_INFO *pRectPatchInfo)
  552. {
  553.     return m_pD3Ddev->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
  554. }
  555.  
  556. HRESULT APIENTRY hkIDirect3DDevice9::DrawTriPatch(UINT Handle, CONST float *pNumSegs, CONST D3DTRIPATCH_INFO *pTriPatchInfo)
  557. {
  558.     return m_pD3Ddev->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
  559. }
  560.  
  561. HRESULT APIENTRY hkIDirect3DDevice9::EndScene()
  562. {
  563.     //Move our menu through keyboard import
  564.     hacks.KeyboardInput();
  565.     //Draws our menu with a ton of different colours
  566.     hacks.DrawMenu(m_pD3Ddev);
  567.     return m_pD3Ddev->EndScene();
  568. }
  569.  
  570. HRESULT APIENTRY hkIDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB)
  571. {
  572.     return m_pD3Ddev->EndStateBlock(ppSB);
  573. }
  574.  
  575. HRESULT APIENTRY hkIDirect3DDevice9::EvictManagedResources()
  576. {
  577.     return m_pD3Ddev->EvictManagedResources();
  578. }
  579.  
  580. UINT APIENTRY hkIDirect3DDevice9::GetAvailableTextureMem()
  581. {
  582.     return m_pD3Ddev->GetAvailableTextureMem();
  583. }
  584.  
  585. HRESULT APIENTRY hkIDirect3DDevice9::GetBackBuffer(UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer)
  586. {
  587.     return m_pD3Ddev->GetBackBuffer(iSwapChain,iBackBuffer, Type, ppBackBuffer);
  588. }
  589.  
  590. HRESULT APIENTRY hkIDirect3DDevice9::GetClipPlane(DWORD Index, float *pPlane)
  591. {
  592.     return m_pD3Ddev->GetClipPlane(Index, pPlane);
  593. }
  594.  
  595. HRESULT APIENTRY hkIDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9 *pClipStatus)
  596. {
  597.     return m_pD3Ddev->GetClipStatus(pClipStatus);
  598. }
  599.  
  600. HRESULT APIENTRY hkIDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters)
  601. {
  602.     return m_pD3Ddev->GetCreationParameters(pParameters);
  603. }
  604.  
  605. HRESULT APIENTRY hkIDirect3DDevice9::GetCurrentTexturePalette(UINT *pPaletteNumber)
  606. {
  607.     return m_pD3Ddev->GetCurrentTexturePalette(pPaletteNumber);
  608. }
  609.  
  610. HRESULT APIENTRY hkIDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9 **ppZStencilSurface)
  611. {
  612.     return m_pD3Ddev->GetDepthStencilSurface(ppZStencilSurface);
  613. }
  614.  
  615. HRESULT APIENTRY hkIDirect3DDevice9::GetDeviceCaps(D3DCAPS9 *pCaps)
  616. {
  617.     return m_pD3Ddev->GetDeviceCaps(pCaps);
  618. }
  619.  
  620. HRESULT APIENTRY hkIDirect3DDevice9::GetDirect3D(IDirect3D9 **ppD3D9)
  621. {
  622.     HRESULT hRet = m_pD3Ddev->GetDirect3D(ppD3D9);
  623.     if( SUCCEEDED(hRet) )
  624.         *ppD3D9 = m_pD3Dint;
  625.     return hRet;
  626. }
  627.  
  628. HRESULT APIENTRY hkIDirect3DDevice9::GetDisplayMode(UINT iSwapChain,D3DDISPLAYMODE* pMode)
  629. {
  630.     return m_pD3Ddev->GetDisplayMode(iSwapChain,pMode);
  631. }
  632.  
  633. HRESULT APIENTRY hkIDirect3DDevice9::GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface)
  634. {
  635.     return m_pD3Ddev->GetFrontBufferData(iSwapChain,pDestSurface);
  636. }
  637.  
  638. HRESULT APIENTRY hkIDirect3DDevice9::GetFVF(DWORD* pFVF)
  639. {
  640.     return m_pD3Ddev->GetFVF(pFVF);
  641. }
  642.  
  643. void APIENTRY hkIDirect3DDevice9::GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp)
  644. {
  645.     m_pD3Ddev->GetGammaRamp(iSwapChain,pRamp);
  646. }
  647.  
  648. HRESULT APIENTRY hkIDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData)
  649. {
  650.     return m_pD3Ddev->GetIndices(ppIndexData);
  651. }
  652.  
  653. HRESULT APIENTRY hkIDirect3DDevice9::GetLight(DWORD Index, D3DLIGHT9 *pLight)
  654. {
  655.     return m_pD3Ddev->GetLight(Index, pLight);
  656. }
  657.  
  658. HRESULT APIENTRY hkIDirect3DDevice9::GetLightEnable(DWORD Index, BOOL *pEnable)
  659. {
  660.     return m_pD3Ddev->GetLightEnable(Index, pEnable);
  661. }
  662.  
  663. HRESULT APIENTRY hkIDirect3DDevice9::GetMaterial(D3DMATERIAL9 *pMaterial)
  664. {
  665.     return m_pD3Ddev->GetMaterial(pMaterial);
  666. }
  667.  
  668. float APIENTRY hkIDirect3DDevice9::GetNPatchMode()
  669. {
  670.     return m_pD3Ddev->GetNPatchMode();
  671. }
  672.  
  673. unsigned int APIENTRY hkIDirect3DDevice9::GetNumberOfSwapChains()
  674. {
  675.     return m_pD3Ddev->GetNumberOfSwapChains();
  676. }
  677.  
  678. HRESULT APIENTRY hkIDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY *pEntries)
  679. {
  680.     return m_pD3Ddev->GetPaletteEntries(PaletteNumber, pEntries);
  681. }
  682.  
  683. HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader)
  684. {
  685.     return m_pD3Ddev->GetPixelShader(ppShader);
  686. }
  687.  
  688. HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
  689. {
  690.     return m_pD3Ddev->GetPixelShaderConstantB(StartRegister,pConstantData,BoolCount);
  691. }
  692.  
  693. HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount)
  694. {
  695.     return m_pD3Ddev->GetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount);
  696. }
  697.  
  698. HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount)
  699. {
  700.     return m_pD3Ddev->GetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount);
  701. }
  702.  
  703. HRESULT APIENTRY hkIDirect3DDevice9::GetRasterStatus(UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus)
  704. {
  705.     return m_pD3Ddev->GetRasterStatus(iSwapChain,pRasterStatus);
  706. }
  707.  
  708. HRESULT APIENTRY hkIDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State, DWORD *pValue)
  709. {
  710.     return m_pD3Ddev->GetRenderState(State, pValue);
  711. }
  712.  
  713. HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget)
  714. {
  715.     return m_pD3Ddev->GetRenderTarget(RenderTargetIndex,ppRenderTarget);
  716. }
  717.  
  718. HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface)
  719. {
  720.     return m_pD3Ddev->GetRenderTargetData(pRenderTarget,pDestSurface);
  721. }
  722.  
  723. HRESULT APIENTRY hkIDirect3DDevice9::GetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue)
  724. {
  725.     return m_pD3Ddev->GetSamplerState(Sampler,Type,pValue);
  726. }
  727.  
  728. HRESULT APIENTRY hkIDirect3DDevice9::GetScissorRect(RECT* pRect)
  729. {
  730.     return m_pD3Ddev->GetScissorRect(pRect);
  731. }
  732.  
  733. BOOL APIENTRY hkIDirect3DDevice9::GetSoftwareVertexProcessing()
  734. {
  735.     return m_pD3Ddev->GetSoftwareVertexProcessing();
  736. }
  737.  
  738. HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride)
  739. {
  740.     return m_pD3Ddev->GetStreamSource(StreamNumber, ppStreamData,OffsetInBytes, pStride);
  741. }
  742.  
  743. HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber,UINT* Divider)
  744. {
  745.     return m_pD3Ddev->GetStreamSourceFreq(StreamNumber,Divider);
  746. }
  747.  
  748. HRESULT APIENTRY hkIDirect3DDevice9::GetSwapChain(UINT iSwapChain,IDirect3DSwapChain9** pSwapChain)
  749. {
  750.     return m_pD3Ddev->GetSwapChain(iSwapChain,pSwapChain);
  751. }
  752.  
  753. HRESULT APIENTRY hkIDirect3DDevice9::GetTexture(DWORD Stage, IDirect3DBaseTexture9 **ppTexture)
  754. {
  755.     return m_pD3Ddev->GetTexture(Stage, ppTexture);
  756. }
  757.  
  758. HRESULT APIENTRY hkIDirect3DDevice9::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD *pValue)
  759. {
  760.     return m_pD3Ddev->GetTextureStageState(Stage, Type, pValue);
  761. }
  762.  
  763. HRESULT APIENTRY hkIDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX *pMatrix)
  764. {
  765.     return m_pD3Ddev->GetTransform(State, pMatrix);
  766. }
  767.  
  768. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl)
  769. {
  770.     return m_pD3Ddev->GetVertexDeclaration(ppDecl);
  771. }
  772.  
  773. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader)
  774. {
  775.     return m_pD3Ddev->GetVertexShader(ppShader);
  776. }
  777.  
  778. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
  779. {
  780.     return m_pD3Ddev->GetVertexShaderConstantB(StartRegister,pConstantData,BoolCount);
  781. }
  782.  
  783. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount)
  784. {
  785.     return m_pD3Ddev->GetVertexShaderConstantF(StartRegister,pConstantData,Vector4fCount);
  786. }
  787.  
  788. HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount)
  789. {
  790.     return m_pD3Ddev->GetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount);
  791. }
  792.  
  793. HRESULT APIENTRY hkIDirect3DDevice9::GetViewport(D3DVIEWPORT9 *pViewport)
  794. {
  795.     return m_pD3Ddev->GetViewport(pViewport);
  796. }
  797.  
  798. HRESULT APIENTRY hkIDirect3DDevice9::LightEnable(DWORD LightIndex, BOOL bEnable)
  799. {
  800.     return m_pD3Ddev->LightEnable(LightIndex, bEnable);
  801. }
  802.  
  803. HRESULT APIENTRY hkIDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix)
  804. {
  805.     return m_pD3Ddev->MultiplyTransform(State, pMatrix);
  806. }
  807.  
  808. HRESULT APIENTRY hkIDirect3DDevice9::Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
  809. {  
  810.     return m_pD3Ddev->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
  811. }
  812.  
  813. HRESULT APIENTRY hkIDirect3DDevice9::ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags)
  814. {
  815.     return m_pD3Ddev->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer,pVertexDecl, Flags);
  816. }
  817.  
  818. ULONG APIENTRY hkIDirect3DDevice9::Release()
  819. {
  820.     if( --m_refCount == 0 )
  821.         m_pManager->Release();
  822.  
  823.     return m_pD3Ddev->Release();
  824. }
  825.  
  826. HRESULT APIENTRY hkIDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS *pPresentationParameters)
  827. {
  828.     m_pManager->PreReset();
  829.  
  830.     HRESULT hRet = m_pD3Ddev->Reset(pPresentationParameters);
  831.  
  832.     if( SUCCEEDED(hRet) )
  833.     {
  834.         m_PresentParam = *pPresentationParameters;
  835.         m_pManager->PostReset();
  836.     }
  837.  
  838.     return hRet;
  839. }
  840.  
  841. HRESULT APIENTRY hkIDirect3DDevice9::SetClipPlane(DWORD Index, CONST float *pPlane)
  842. {
  843.     return m_pD3Ddev->SetClipPlane(Index, pPlane);
  844. }
  845.  
  846. HRESULT APIENTRY hkIDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9 *pClipStatus)
  847. {
  848.     return m_pD3Ddev->SetClipStatus(pClipStatus);
  849. }
  850.  
  851. HRESULT APIENTRY hkIDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber)
  852. {
  853.     return m_pD3Ddev->SetCurrentTexturePalette(PaletteNumber);
  854. }
  855.  
  856. void APIENTRY hkIDirect3DDevice9::SetCursorPosition(int X, int Y, DWORD Flags)
  857. {
  858.     m_pD3Ddev->SetCursorPosition(X, Y, Flags);
  859. }
  860.  
  861. HRESULT APIENTRY hkIDirect3DDevice9::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9 *pCursorBitmap)
  862. {
  863.     return m_pD3Ddev->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
  864. }
  865.  
  866. HRESULT APIENTRY hkIDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil)
  867. {
  868.     return m_pD3Ddev->SetDepthStencilSurface(pNewZStencil);
  869. }
  870.  
  871. HRESULT APIENTRY hkIDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs)
  872. {
  873.     return m_pD3Ddev->SetDialogBoxMode(bEnableDialogs);
  874. }
  875.  
  876. HRESULT APIENTRY hkIDirect3DDevice9::SetFVF(DWORD FVF)
  877. {
  878.     return m_pD3Ddev->SetFVF(FVF);
  879. }
  880.  
  881. void APIENTRY hkIDirect3DDevice9::SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp)
  882. {
  883.     m_pD3Ddev->SetGammaRamp(iSwapChain,Flags, pRamp);
  884. }
  885.  
  886. HRESULT APIENTRY hkIDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData)
  887. {
  888.     return m_pD3Ddev->SetIndices(pIndexData);
  889. }
  890.  
  891. HRESULT APIENTRY hkIDirect3DDevice9::SetLight(DWORD Index, CONST D3DLIGHT9 *pLight)
  892. {
  893.     return m_pD3Ddev->SetLight(Index, pLight);
  894. }
  895.  
  896. HRESULT APIENTRY hkIDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9 *pMaterial)
  897. {  
  898.     return m_pD3Ddev->SetMaterial(pMaterial);
  899. }
  900.  
  901. HRESULT APIENTRY hkIDirect3DDevice9::SetNPatchMode(float nSegments)
  902. {  
  903.     return m_pD3Ddev->SetNPatchMode(nSegments);
  904. }
  905.  
  906. HRESULT APIENTRY hkIDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY *pEntries)
  907. {
  908.     return m_pD3Ddev->SetPaletteEntries(PaletteNumber, pEntries);
  909. }
  910.  
  911. HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader)
  912. {
  913.     return m_pD3Ddev->SetPixelShader(pShader);
  914. }
  915.  
  916. HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT  BoolCount)
  917. {
  918.     return m_pD3Ddev->SetPixelShaderConstantB(StartRegister,pConstantData,BoolCount);
  919. }
  920.  
  921. HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount)
  922. {
  923.     return m_pD3Ddev->SetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount);
  924. }
  925.  
  926. HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount)
  927. {
  928.     return m_pD3Ddev->SetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount);
  929. }
  930.  
  931. HRESULT APIENTRY hkIDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value)
  932. {
  933.     return m_pD3Ddev->SetRenderState(State, Value);
  934. }
  935.  
  936. HRESULT APIENTRY hkIDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget)
  937. {
  938.     return m_pD3Ddev->SetRenderTarget(RenderTargetIndex,pRenderTarget);
  939. }
  940.  
  941. HRESULT APIENTRY hkIDirect3DDevice9::SetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value)
  942. {
  943.     return m_pD3Ddev->SetSamplerState(Sampler,Type,Value);
  944. }
  945.  
  946. HRESULT APIENTRY hkIDirect3DDevice9::SetScissorRect(CONST RECT* pRect)
  947. {
  948.     return m_pD3Ddev->SetScissorRect(pRect);
  949. }
  950.  
  951. HRESULT APIENTRY hkIDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware)
  952. {
  953.     return m_pD3Ddev->SetSoftwareVertexProcessing(bSoftware);
  954. }
  955.  
  956. HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
  957. {
  958.     return m_pD3Ddev->SetStreamSource(StreamNumber, pStreamData,OffsetInBytes, Stride);
  959. }
  960.  
  961. HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber,UINT Divider)
  962. {  
  963.     return m_pD3Ddev->SetStreamSourceFreq(StreamNumber,Divider);
  964. }
  965.  
  966. HRESULT APIENTRY hkIDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9 *pTexture)
  967. {
  968. #ifdef D3DHOOK_TEXTURES
  969.     IDirect3DDevice9 *dev = NULL;
  970.     if(pTexture != NULL && ((hkIDirect3DTexture9*)(pTexture))->GetDevice(&dev) == D3D_OK)
  971.     {
  972.         if(dev == this)
  973.             return m_pD3Ddev->SetTexture(Stage, ((hkIDirect3DTexture9*)(pTexture))->m_D3Dtex);
  974.     }
  975. #endif
  976.    
  977.     return m_pD3Ddev->SetTexture(Stage, pTexture);
  978. }
  979.  
  980. HRESULT APIENTRY hkIDirect3DDevice9::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value)
  981. {
  982.     return m_pD3Ddev->SetTextureStageState(Stage, Type, Value);
  983. }
  984.  
  985. HRESULT APIENTRY hkIDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix)
  986. {
  987.     return m_pD3Ddev->SetTransform(State, pMatrix);
  988. }
  989.  
  990. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl)
  991. {
  992.     return m_pD3Ddev->SetVertexDeclaration(pDecl);
  993. }
  994.  
  995. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader)
  996. {
  997.     return m_pD3Ddev->SetVertexShader(pShader);
  998. }
  999.  
  1000. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT  BoolCount)
  1001. {
  1002.     return m_pD3Ddev->SetVertexShaderConstantB(StartRegister,pConstantData,BoolCount);
  1003. }
  1004.  
  1005. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount)
  1006. {
  1007.     return m_pD3Ddev->SetVertexShaderConstantF(StartRegister,pConstantData,Vector4fCount);
  1008. }
  1009.  
  1010. HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount)
  1011. {
  1012.     return m_pD3Ddev->SetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount);
  1013. }
  1014.  
  1015. HRESULT APIENTRY hkIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9 *pViewport)
  1016. {
  1017.     return m_pD3Ddev->SetViewport(pViewport);
  1018. }
  1019.  
  1020. BOOL APIENTRY hkIDirect3DDevice9::ShowCursor(BOOL bShow)
  1021. {
  1022.     return m_pD3Ddev->ShowCursor(bShow);
  1023. }
  1024.  
  1025. HRESULT APIENTRY hkIDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter)
  1026. {
  1027.     return m_pD3Ddev->StretchRect(pSourceSurface,pSourceRect,pDestSurface,pDestRect,Filter);
  1028. }
  1029.  
  1030. HRESULT APIENTRY hkIDirect3DDevice9::TestCooperativeLevel()
  1031. {
  1032.     return m_pD3Ddev->TestCooperativeLevel();
  1033. }
  1034.  
  1035. HRESULT APIENTRY hkIDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint)
  1036. {
  1037.     return m_pD3Ddev->UpdateSurface(pSourceSurface,pSourceRect,pDestinationSurface,pDestPoint);
  1038. }
  1039.  
  1040. HRESULT APIENTRY hkIDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9 *pSourceTexture, IDirect3DBaseTexture9 *pDestinationTexture)
  1041. {
  1042.     return m_pD3Ddev->UpdateTexture(pSourceTexture, pDestinationTexture);
  1043. }
  1044.  
  1045. HRESULT APIENTRY hkIDirect3DDevice9::ValidateDevice(DWORD *pNumPasses)
  1046. {
  1047.     return m_pD3Ddev->ValidateDevice(pNumPasses);
  1048. }
  1049.  
  1050.  
  1051. ----------------------------------------------------------------
RAW Paste Data