Introducing MPGH's AIGA. The latest advancement in artificial intelligence. Click here now to learn more!
Results 1 to 3 of 3
  1. #1
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky

    [D3D]Best stride/numver/primcount logger

    Please note that this is not my code, just wanted to share since some people still use the old&crappy method.

    To demonstrate how fast this is:
    For 0-10000 it takes 14 steps to get the correct number
    For 0-20000 it takes 15 steps.
    For 0-1000000 it takes 20 steps.
    And you'll never skip a frame while logging =D
    globals:
    Code:
    int iCurNum = 5000;
    int iLastHigh = 10000;
    int iLastLow = 0; 
    bool LogEnabled=false;
    
    IDirect3DTexture9 *pTexBlue;
    IDirect3DTexture9 *pTexGreen;
    IDirect3DTexture9 *pTexRed;
    functions needed(answers why's question I think) :
    Code:
    int OMGZ(int X, int Y)
    {
    	return (X+Y)/2;
    }
    
    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;
    }
    During initialization(CD3DManager::Initialize() in Azo's base)
    Code:
    	GenerateTexture(m_pD3Ddev, &pTexBlue, D3DCOLOR_ARGB(255,0,0,255));
    	GenerateTexture(m_pD3Ddev, &pTexRed, D3DCOLOR_ARGB(255,255,0,0));
    	GenerateTexture(m_pD3Ddev, &pTexGreen, D3DCOLOR_ARGB(255,0,255,0));
    in DrawIndexedPrimitive(hkIDirect3DDevice9:rawIndexedPrimitive in azos base)
    Code:
    	if(LogEnabled==true)
    	{
    		if(NumVertices < (UINT)iCurNum&&NumVertices>=(UINT)iLastLow)
    		{
    		    m_pD3Ddev->SetTexture(0, pTexBlue);
    		}
    		else if(NumVertices > (UINT)iCurNum&&NumVertices<=(UINT)iLastHigh)
    		{
    			m_pD3Ddev->SetTexture(0, pTexRed);
    		}
    		else if(NumVertices == (UINT)iCurNum)
    		{
    			m_pD3Ddev->SetTexture(0, pTexGreen);  
    		}
    	}
    in present(hkIDirect3DDevice9::Present in azos base)
    Code:
    	int iTemp = iCurNum;
    
    	if(GetAsyncKeyState(VK_NUMPAD4)&1)
    	{
    		iCurNum = OMGZ(iCurNum, iLastHigh);
    		iLastLow = iTemp;
    	}
    	else if(GetAsyncKeyState(VK_NUMPAD6)&1)
    	{
    	    iCurNum = OMGZ(iCurNum, iLastLow);
    	    iLastHigh = iTemp;
    	}
    	if(GetAsyncKeyState(VK_NUMPAD0)&1)
    	{
    		add_log("/*========================");
    		add_log("  Logged: %d", iCurNum);
    		add_log("========================*/");
    	}
    	if(GetAsyncKeyState(VK_NUMPAD5)&1)
    	{
    		iCurNum = 5000;
    		iLastHigh = 10000;
    		iLastLow = 0; 
    	}
    	if(GetAsyncKeyState(VK_NUMPAD1)&1)
    	{
    		LogEnabled =! LogEnabled;
    	}
    Credits: Azorbix

    Note that the code posted here is for NumVerts, if you want to do primcounts or strides you'll have to change DrawIndexedPrimitive
    Ah we-a blaze the fyah, make it bun dem!

  2. #2
    why06jz's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    295
    Reputation
    14
    Thanks
    54
    Yeh you answered my question and gave me about a million others....

    I'm confused. But then again I do not know D3d. I'm not even able to say: "Oh that was well done." because I have no idea what strides are o-O ... but thanks for sharing HD.

  3. #3
    LegendaryAbbo's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    5,243
    Reputation
    23
    Thanks
    546
    My Mood
    Relaxed
    I know what it's doing and what it is finding and how strides and such work. But I do not know how to use the program. I gotta learn though I want to be able to make chams and such for games that I can't find the player strides for on google

Similar Threads

  1. Stride | Prim | Num Logger?
    By Zoom in forum Combat Arms EU Discussions
    Replies: 2
    Last Post: 07-26-2010, 09:53 AM
  2. Replies: 6
    Last Post: 04-22-2010, 02:56 AM
  3. [Release] Stride Logger
    By [Jesuz] in forum K.O.S. Secret Operation Hacks
    Replies: 13
    Last Post: 01-30-2010, 12:30 AM
  4. Best CG Menu D3D
    By Razorr5 in forum WarRock - International Hacks
    Replies: 11
    Last Post: 10-10-2009, 08:27 AM
  5. BEST D3D injector ever!
    By unborned in forum WarRock - International Hacks
    Replies: 7
    Last Post: 11-06-2008, 08:32 AM

Tags for this Thread