Thread: making a Cham

Results 1 to 5 of 5
  1. #1
    Andyklk2009's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Location
    Red Dots
    Posts
    178
    Reputation
    10
    Thanks
    38

    Cool making a Cham

    yo i have a question any exprect or any one who knows much about Chams tell me if this is right


    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 CD3DManager::Initialize()
    {
    /*
    initialize Resources such as textures
    (managed and unmanaged [D3DPOOL]),
    vertex buffers, and other D3D rendering resources
    ...
    m_pD3Ddev->CreateTexture(..., ..., &m_pD3Dtexture);
    */


    GenerateTexture(m_pD3Ddev, &texRed,D3DCOLOR_ARGB(255,255,0,0));
    GenerateTexture(m_pD3Ddev, &texPurple,D3DCOLOR_ARGB(255,160,32,240));
    GenerateTexture(m_pD3Ddev, &texGreen,D3DCOLOR_ARGB(255,0,255,0));
    GenerateTexture(m_pD3Ddev, &texYellow,D3DCOLOR_ARGB(255,255,255,0));
    GenerateTexture(m_pD3Ddev, &texOrange,D3DCOLOR_ARGB(255,255,140,0));
    GenerateTexture(m_pD3Ddev, &texPink,D3DCOLOR_ARGB(255,255,192,203));
    GenerateTexture(m_pD3Ddev, &texBlue,D3DCOLOR_ARGB(255,0,0,255));
    GenerateTexture(m_pD3Ddev, &texViolet,D3DCOLOR_ARGB(208,32,144,0));
    GenerateTexture(m_pD3Ddev, &texSea,D3DCOLOR_XRGB( 32, 178, 170 ));
    GenerateTexture(m_pD3Ddev, &texBlack,D3DCOLOR_XRGB( 0, 0, 0 ));
    GenerateTexture(m_pD3Ddev, &texSlate,D3DCOLOR_XRGB( 47, 79, 79 ));
    GenerateTexture(m_pD3Ddev, &texCoral,D3DCOLOR_XRGB( 255, 127, 80 ));
    GenerateTexture(m_pD3Ddev, &texDOrange,D3DCOLOR_XRGB( 255, 140, 0 ));
    GenerateTexture(m_pD3Ddev, &texGrey,D3DCOLOR_XRGB( 190, 190, 190 ));

    return S_OK;
    }

  2. #2
    kingpop91770's Avatar
    Join Date
    Jul 2007
    Gender
    male
    Location
    The Other Dimension! >:D
    Posts
    264
    Reputation
    20
    Thanks
    98
    Didn't you post this thread already? Eh...

  3. #3
    pureskillx33's Avatar
    Join Date
    Aug 2008
    Posts
    26
    Reputation
    10
    Thanks
    10
    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 CD3DManager::Initialize()
    {
    /*
    initialize Resources such as textures
    (managed and unmanaged [D3DPOOL]),
    vertex buffers, and other D3D rendering resources
    ...
    m_pD3Ddev->CreateTexture(..., ..., &m_pD3Dtexture);
    */


    GenerateTexture(m_pD3Ddev, &texRed,D3DCOLOR_ARGB(255,255,0,0));
    GenerateTexture(m_pD3Ddev, &texPurple,D3DCOLOR_ARGB(255,160,32,240));
    GenerateTexture(m_pD3Ddev, &texGreen,D3DCOLOR_ARGB(255,0,255,0));
    GenerateTexture(m_pD3Ddev, &texYellow,D3DCOLOR_ARGB(666,666,666,666));
    GenerateTexture(m_pD3Ddev, &texOrange,D3DCOLOR_ARGB(666,666,666,666));
    GenerateTexture(m_pD3Ddev, &texPink,D3DCOLOR_ARGB(666,666,666,666));
    GenerateTexture(m_pD3Ddev, &texBlue,D3DCOLOR_ARGB(666,666,666,666));
    GenerateTexture(m_pD3Ddev, &texViolet,D3DCOLOR_ARGB(666,666,666,666));
    GenerateTexture(m_pD3Ddev, &texSea,D3DCOLOR_XRGB( 666, 666, 666 ));
    GenerateTexture(m_pD3Ddev, &texBlack,D3DCOLOR_XRGB( 666, 666, 666 ));
    GenerateTexture(m_pD3Ddev, &texSlate,D3DCOLOR_XRGB( 666, 666, 666 ));
    GenerateTexture(m_pD3Ddev, &texCoral,D3DCOLOR_XRGB( 666, 666, 666 ));
    GenerateTexture(m_pD3Ddev, &texDOrange,D3DCOLOR_XRGB( 255, 140, 0 ));
    GenerateTexture(m_pD3Ddev, &texGrey,D3DCOLOR_XRGB( 190, 190, 190 ));

    return S_OK;
    }

  4. #4
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    http://mpgh.net MPGHCash: $442,596,199
    Posts
    5,649
    Reputation
    26
    Thanks
    894
    My Mood
    Happy
    hope u release it though

  5. #5
    Andyklk2009's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Location
    Red Dots
    Posts
    178
    Reputation
    10
    Thanks
    38
    I don't know maybe but i still getting Error bu tmy friend is goign to help me add more feature like a VIP but meybe i will release it for free

Similar Threads

  1. How To Make Mini-Chams
    By NuB_GhOsT in forum Combat Arms Discussions
    Replies: 25
    Last Post: 03-17-2010, 08:46 AM
  2. PLEASE MAKE A CHAMS FOR CFPH
    By karlkenneth in forum CrossFire Hacks & Cheats
    Replies: 4
    Last Post: 11-14-2009, 02:02 AM
  3. [TuT]How to make TnT chams never DC
    By mariofan901 in forum Combat Arms Discussions
    Replies: 8
    Last Post: 09-04-2009, 06:19 PM
  4. I want to learn how to make CA chams
    By Dillonz in forum C++/C Programming
    Replies: 9
    Last Post: 08-31-2009, 06:13 PM
  5. How to make simple chams in C++ pictures (COMING SOON)
    By L96A1_ghille in forum Combat Arms Hacks & Cheats
    Replies: 3
    Last Post: 08-05-2009, 10:28 PM

Tags for this Thread