sasho648 0 Newbie Poster

How this function works? What is the LPCVOID pSrcData. I pass this function with char* string with a one of D3DFORMAT Format and size the size of string. What I'm doing wrong. Here's my code - it gives an error from the function call:

void Gmx::ExtrTextur(unsigned long ptrMap) {
        unsigned long ptr=GetF<DWORD>(0, ptrMap+4, 4)+ptrMap;
        unsigned long All=GetF<DWORD>(0, ptr+8, 4);
        ptr=ptr+GetF<DWORD>(0, ptr, 4)*24+16;
        MyText=new LPDIRECT3DTEXTURE9[All+1];
        MyText[All]=NULL;
        for(unsigned long PtrTdat(All*40+ptr), Curr(0); Curr<All; PtrTdat+=GetF<DWORD>(0, Curr++*40+28+ptr, 4)) {
            char* Data=new char[GetF<DWORD>(0, Curr*40+28+ptr, 4)];
            GetF(0, PtrTdat, GetF<DWORD>(0, Curr*40+28+ptr, 4), Data);
            HRESULT CSurr=
                D3DXCreateTextureFromFileInMemoryEx(d3ddev, Data, GetF<DWORD>(0, Curr*40+28+ptr, 4), 
                GetF<DWORD>(0, Curr*40+20+ptr, 4), GetF<DWORD>(0, Curr*40+24+ptr, 4), GetF<DWORD>(0, Curr*40+16+ptr, 4),
                0, D3DFORMAT(GetF<DWORD>(0, Curr*40+ptr, 4)), D3DPOOL_SYSTEMMEM,  D3DX_FILTER_LINEAR, D3DX_FILTER_LINEAR, 0xFF000000, NULL,
                NULL, &MyText[Curr]);
                    //CSurr 0x8876086c  HRESULT

            if(D3D_OK!=CSurr)
                MessageBoxA(0,"Error", 0, IDOK);
            delete[] Data;
        }
    }