Results 1 to 9 of 9
  1. #1
    Admin King-OrgY's Avatar
    Join Date
    Nov 2007
    Posts
    4,537

    Perfect cod2 chams

    modelrec using RB_TessXModel : P

    Code:
    bool OneTime = true;
    bool PlayerSkinnedModels = false;
    
    HRESULT (WINAPI *orig_DrawIndexedPrimitive) (  LPDIRECT3DDEVICE9,D3DPRIMITIVETYPE ,INT ,UINT ,UINT ,UINT ,UINT  );
    HRESULT WINAPI DrawIndexedPrimitive_det(LPDIRECT3DDEVICE9  pDevice,D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT  MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
    {
        if(OneTime)
        {
            GenerateShader( pDevice, &re_Red, 255, 0, 0 );
            GenerateShader( pDevice, &re_Green, 0, 255, 0 );
            OneTime=false;
        }       
        if( PlayerSkinnedModels   )
        {
            pDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
            pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
    
            pDevice->SetPixelShader(re_Red);
            orig_DrawIndexedPrimitive(pDevice, Type, BaseVertexIndex,  MinVertexIndex, NumVertices, startIndex,primCount );
            pDevice->SetPixelShader(re_Green);
        
            pDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
            pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
        }   
        PlayerSkinnedModels = false;
        return orig_DrawIndexedPrimitive(pDevice, Type, BaseVertexIndex,  MinVertexIndex, NumVertices, startIndex,primCount );
    }
    
    typedef struct{
    char z_crap[24];
    }Skinned_t;
    
    void ( *orig_RB_TessXModelSkinnedCached )( );
    void RB_TessXModelSkinnedCached( )
    {    
        Skinned_t *    Skin            = NULL;
        __asm mov Skin, eax
            
            PlayerSkinnedModels = true;
        
        __asm mov eax, Skin 
            orig_RB_TessXModelSkinnedCached( );    
    }
        if(GFX_DLL)
        {
    
            DetourFunction( (PBYTE) DIP_Addresse,  (PBYTE)&DrawIndexedPrimitive_det );
            __asm mov [ orig_DrawIndexedPrimitive ], eax;
    
            DetourFunction( (PBYTE)GFX_DLL+0x41590,  (PBYTE)&RB_TessXModelSkinnedCached );
               __asm mov [ orig_RB_TessXModelSkinnedCached ], eax;
    
    }
    Attached Images Attached Images

  2. #2
    Admin King-OrgY's Avatar
    Join Date
    Nov 2007
    Posts
    4,537

    Re: Perfect cod2 chams

    little fix

    Code:
    HRESULT (  APIENTRY *orig_DrawIndexedPrimitive) ( LPDIRECT3DDEVICE9,D3DPRIMITIVETYPE ,INT ,UINT ,UINT ,UINT ,UINT  ) = (HRESULT ( APIENTRY *) ( LPDIRECT3DDEVICE9,D3DPRIMITIVETYPE ,INT ,UINT ,UINT ,UINT ,UINT ))DIP_F;    
    HRESULT  APIENTRY DrawIndexedPrimitive_det(LPDIRECT3DDEVICE9 pDevice,D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
    {
        if(OneTime)
        {
            GenerateShader( pDevice, &re_Red, 255, 0, 0 );
            GenerateShader( pDevice, &re_Green, 0, 255, 0 );
            
            OneTime=false;
        }       
    
        pDevice->SetPixelShader( NULL );
        
        if( PlayerSkinnedModels )
        {
            pDevice->SetPixelShader(re_Red);
            pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
            
            orig_DrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex,primCount );
            
            pDevice->SetPixelShader(re_Green);
            pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
        }  
        PlayerSkinnedModels = false;
    
        return orig_DrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex,primCount );
    }

    Code:
    typedef struct{
        int Indices;
        char z_crap[20];
    }Skinned_t;
    
    void (*orig_RB_TessXModelSkinnedCached) ( ) = (void ( *) (  ))DW_XModel;
    void RB_TessXModelSkinnedCached( )
    {    
        Skinned_t *    Skin            = NULL;
        __asm mov Skin, eax        
        
        if(  Skin->Indices )
        {
            PlayerSkinnedModels = true;
        }
        else
        PlayerSkinnedModels = false;
    
        __asm mov eax, Skin 
            orig_RB_TessXModelSkinnedCached( );    
    }

  3. #3
    Banned
    Join Date
    Jun 2010
    Location
    In The Toilet
    Posts
    39

    Re: Perfect cod2 chams

    um how to install that?

  4. #4
    Semi-Coder learn_more's Avatar
    Join Date
    Sep 2009
    Posts
    247

    Re: Perfect cod2 chams

    Quote Originally Posted by jackass673 View Post
    um how to install that?
    not being lazy and retarded helps
    - "Double the gun, double the fun!"

  5. #5
    Banned
    Join Date
    Jun 2010
    Location
    In The Toilet
    Posts
    39

    Re: Perfect cod2 chams

    Quote Originally Posted by learn_more View Post
    not being lazy and retarded helps
    pls tell me

  6. #6
    Junior Member
    Join Date
    Feb 2010
    Posts
    15

    Re: Perfect cod2 chams

    lol

  7. #7
    Admin King-OrgY's Avatar
    Join Date
    Nov 2007
    Posts
    4,537

    Re: Perfect cod2 chams

    Quote Originally Posted by jackass673 View Post
    um how to install that?
    if you has no idea what's source code then you should dont go inside coding forums.

  8. #8
    Banned
    Join Date
    Jun 2010
    Location
    In The Toilet
    Posts
    39

    Re: Perfect cod2 chams

    i dont know please guys tell me

  9. #9
    Admin King-OrgY's Avatar
    Join Date
    Nov 2007
    Posts
    4,537

    Re: Perfect cod2 chams

    there should be infraction for guys without brain

Similar Threads

  1. Cod2 1.2 Chams
    By Evilhard in forum Call of Duty 2 Cheats
    Replies: 5
    Last Post: August 4th, 2011, 12:45
  2. I Need CoD2 v1.0 Chams !!! pls..
    By 4dm1n55 in forum Call of Duty 2 Cheats
    Replies: 5
    Last Post: March 7th, 2011, 07:29
  3. Cod2 Grenade Chams
    By Seraphim in forum Gallery
    Replies: 9
    Last Post: July 15th, 2009, 23:28
  4. sexy cod2 chams
    By King-OrgY in forum Gallery
    Replies: 6
    Last Post: February 25th, 2008, 18:23
  5. Cod2 kill Stats done works perfect now
    By King-OrgY in forum Gallery
    Replies: 4
    Last Post: February 6th, 2008, 00:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •