Code:
#include "stdafx.h"
#include <stdio.h>
#include <d3dx9.h>
#include <Windows.h>
#include <d3d9.h>
#pragma comment (lib, "d3d9.lib")
HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
{
if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL)) )
return E_FAIL;
WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
|(WORD)(((colour32>>20)&0xF)<<8)
|(WORD)(((colour32>>12)&0xF)<<4)
|(WORD)(((colour32>>4)&0xF)<<0);
D3DLOCKED_RECT d3dlr;
(*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
WORD *pDst16 = (WORD*)d3dlr.pBits;
for(int xy=0; xy < 8*8; xy++)
*pDst16++ = colour16;
(*ppD3Dtex)->UnlockRect(0);
return S_OK;
}
HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseIndex,
UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{
LPDIRECT3DVERTEXBUFFER9 Stream_Data;
UINT Offset,iStride;
if(pDevice->GetStreamSource(0, &Stream_Data, &Offset, &iStride) == D3D_OK)
Stream_Data->Release();
DWORD WINAPI thread( LPVOID param )
{
while(True)
{
LPDIRECT3DTEXTURE9 Red,Yellow,Green,Blue,Purple,Pink,Orange,White,Black;
GenerateTexture(pDevice, &Red, D3DCOLOR_ARGB (255,255,0 ,0 ));
GenerateTexture(pDevice, &Yellow, D3DCOLOR_ARGB (255,255,255,0 ));
GenerateTexture(pDevice, &Green, D3DCOLOR_ARGB (255,0 ,255,0 ));
GenerateTexture(pDevice, &Blue, D3DCOLOR_ARGB (255,0 ,0 ,255));
GenerateTexture(pDevice, &Purple, D3DCOLOR_ARGB (255,102,0 ,153));
GenerateTexture(pDevice, &Pink, D3DCOLOR_ARGB (255,255,20 ,147));
GenerateTexture(pDevice, &Orange, D3DCOLOR_ARGB (255,255,165,0 ));
GenerateTexture(pDevice, &Black, D3DCOLOR_ARGB (255,0 ,0 ,0 ));
GenerateTexture(pDevice, &White, D3DCOLOR_ARGB (255,255,255,255));
if (chams)
{
if (iStride == 40)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
pDevice->SetTexture(0, Red);
pDrawIndexedPrimitive(pDevice, Type, BaseIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESSEQUAL);
pDevice->SetTexture(0, Blue );
}
if (iStride == 32)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
pDevice->SetTexture(0, Red);
pDrawIndexedPrimitive(pDevice, Type, BaseIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESSEQUAL);
pDevice->SetTexture(0, Blue );
{
if(naked)
{
if(iStride==44)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
}
if(iStride==40)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
}
if(iStride==32)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
}
if (swire)
{
if (iStride==44)
{
pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
}
if (iStride==40)
{
pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
}
if (iStride==32)
{
pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
}
}
}
{
if (fullwire)
{
if (iStride==44)
{
pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
}
if (iStride==40)
{
pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
}
if (iStride==32)
{
pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
}
if (iStride==28)
{
pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
}
if (iStride==16)
{
pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
}
if(fbright)
{
if(iStride==44)
{
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetRenderState(D3DRS_AMBIENT,D3DCOLOR_ARGB(255,255,255,255));
}
if(iStride==40)
{
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetRenderState(D3DRS_AMBIENT,D3DCOLOR_ARGB(255,255,255,255));
}
if(iStride==32)
{
pDevice->SetRenderState(D3DRS_LIGHTING, false);
pDevice->SetRenderState(D3DRS_AMBIENT,D3DCOLOR_ARGB(255,255,255,255));
}
}
if(asus)
if(iStride==28)
{
pDevice->SetRenderState( D3DRS_SRCBLEND, 3 );
pDevice->SetRenderState( D3DRS_DESTBLEND, 4 );
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
}
if(iStride==44)
{
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
}
if(iStride==40)
{
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_NEVER);
}
if(xray)
{
if(iStride==28)
{
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
}
if(nofog)
{
pDevice->SetRenderState(D3DRS_FOGENABLE, false);
}
Sleep(50);
}
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
MessageBoxA(0, "Credits- STILL TRYING GUYS>>","Hope CF SECTION HELPS!!", 0);
CreateThread(0,0,(LPTHREAD_START_ROUTINE)Wait,0,0, 0);
}
return 1;
}