Advertisement
dcomicboy

my DIP stuff

Mar 5th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.43 KB | None | 0 0
  1. HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE pType D3DparamX ,UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount )
  2. {
  3. if(pDevice->GetStreamSource(0,&Stream_Data,&OffsetInBytes,&m_Stride) == D3D_OK)
  4. Stream_Data->Release();
  5.  
  6. DWORD dwOldZEnable = D3DZB_TRUE;
  7.  
  8. if(Color)
  9. {
  10. GenerateTexture(pDevice, &texGreen , D3DCOLOR_ARGB(255,0,255,0));
  11. GenerateTexture(pDevice, &texRed , D3DCOLOR_ARGB(255,255,0,0));
  12. GenerateTexture(pDevice, &texBlue , D3DCOLOR_ARGB(255,0,0,255));
  13. GenerateTexture(pDevice, &texOrange , D3DCOLOR_ARGB(255,255,165,0));
  14. GenerateTexture(pDevice, &texYellow , D3DCOLOR_ARGB(255,255,255,0));
  15. GenerateTexture(pDevice, &texPink , D3DCOLOR_ARGB(255,255,192,203));
  16. GenerateTexture(pDevice, &texCyan , D3DCOLOR_ARGB(255,0,255,255));
  17. GenerateTexture(pDevice, &texPurple , D3DCOLOR_ARGB(255,160,32,240));
  18. GenerateTexture(pDevice, &texBlack , D3DCOLOR_ARGB(255,0,0,0));
  19. GenerateTexture(pDevice, &texWhite , D3DCOLOR_ARGB(255,255,255,255));
  20. GenerateTexture(pDevice, &texSteelBlue , D3DCOLOR_ARGB(255,33,104,140));
  21. GenerateTexture(pDevice, &texLightSteelBlue, D3DCOLOR_ARGB(255,201,255,255));
  22. GenerateTexture(pDevice, &texLightBlue , D3DCOLOR_ARGB(255,26,140,306));
  23. GenerateTexture(pDevice, &texSalmon , D3DCOLOR_ARGB(255,196,112,112));
  24. GenerateTexture(pDevice, &texBrown , D3DCOLOR_ARGB(255,168,99,20));
  25. GenerateTexture(pDevice, &texTeal , D3DCOLOR_ARGB(255,38,140,140));
  26. GenerateTexture(pDevice, &texLime , D3DCOLOR_ARGB(255,50,205,50));
  27. GenerateTexture(pDevice, &texElectricLime , D3DCOLOR_ARGB(255,204,255,0));
  28. GenerateTexture(pDevice, &texGold , D3DCOLOR_ARGB(255,255, 215, 0));
  29. GenerateTexture(pDevice, &texOrangeRed , D3DCOLOR_ARGB(255,255,69,0));
  30. GenerateTexture(pDevice, &texGreenYellow , D3DCOLOR_ARGB(255,173,255,47));
  31. GenerateTexture(pDevice, &texAquaMarine , D3DCOLOR_ARGB(255,127,255,212));
  32. GenerateTexture(pDevice, &texSkyBlue , D3DCOLOR_ARGB(255,0,191,255));
  33. GenerateTexture(pDevice, &texSlateBlue , D3DCOLOR_ARGB(255,132, 112, 255));
  34. GenerateTexture(pDevice, &texCrimson , D3DCOLOR_ARGB(255,220,20,60));
  35. GenerateTexture(pDevice, &texDarkOliveGreen, D3DCOLOR_ARGB(255,188,238,104 ));
  36. GenerateTexture(pDevice, &texPaleGreen , D3DCOLOR_ARGB(255,154,255, 154));
  37. GenerateTexture(pDevice, &texDarkGoldenRod , D3DCOLOR_ARGB(255,255, 185, 15 ));
  38. GenerateTexture(pDevice, &texFireBrick , D3DCOLOR_ARGB(255,255,48,48));
  39. GenerateTexture(pDevice, &texDarkBlue , D3DCOLOR_ARGB(255,0,0,204));
  40. GenerateTexture(pDevice, &texDarkerBlue , D3DCOLOR_ARGB(255,0,0,153));
  41. GenerateTexture(pDevice, &texDarkYellow , D3DCOLOR_ARGB(255,255,204,0));
  42. GenerateTexture(pDevice, &texLightYellow , D3DCOLOR_ARGB(255,255,255,153));
  43. Color = false;
  44.  
  45.  
  46. }
  47.  
  48.  
  49.  
  50. if(opt.d3d.ChamsCT)
  51. {
  52. if((m_Stride == 48 || m_Stride == 52 || m_Stride == 64))
  53. {
  54. pDevice->SetRenderState(D3DRS_ZENABLE, false);
  55. pDevice->SetTexture(0, texGreen);
  56. pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
  57. pDevice->SetTexture(0, texRed);
  58. pDevice->SetRenderState(D3DRS_ZENABLE, true);
  59. }
  60. }
  61. if(opt.d3d.ChamsTERO)
  62. {
  63. if((m_Stride == 48 || m_Stride == 52 || m_Stride == 64))
  64. {
  65. pDevice->SetRenderState(D3DRS_ZENABLE, false);
  66. pDevice->SetTexture(0, texGreenYellow);
  67. pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
  68.  
  69. }
  70. }
  71.  
  72. if(opt.d3d.WHGlass)
  73. {
  74. if((m_Stride == 48 || m_Stride == 52 || m_Stride == 64))
  75. {
  76. SumStride=SumStride+4;
  77. pDevice->SetRenderState(D3DRS_ZENABLE,false);
  78. pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,false);
  79. pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVDESTCOLOR);
  80. pDevice->SetRenderState(D3DRS_ZENABLE,false);
  81.  
  82. }
  83. }
  84. if(opt.hacks.panic)
  85. {
  86. if( GetAsyncKeyState( VK_END )&1)
  87. {
  88. ExitProcess(0);
  89. }
  90. }
  91.  
  92. if(opt.d3d.HD)
  93. {
  94. pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR);
  95. pDevice->SetRenderState(D3DRS_SPECULARENABLE, FALSE);
  96. }
  97.  
  98.  
  99. if(opt.d3d.WhiteWalls)
  100. {
  101. pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR);
  102. }
  103.  
  104. if(opt.d3d.NoGun)
  105. {
  106. pDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_EQUAL);
  107. }
  108. return pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement