Heya.
I converted the d3d class to d3d9. Mostly did find/replace, but did try to change a few functions that didn't exist in d3d9 anymore. Finally got it to compile without error, but the overlay doesn't display ingame, and sometimes crashes when entering the world.
The way I see it, there's 2 possible things wrong here:
1. I fucked up when replacing d3d8 functions with d3d9,
2. Structures are out of date.
According to dumbfcks post, the sendPacket function is now at 0x63AA80, and the base is 0xA521C0.
Does you have / intend to update the structures? Or do you have any suggestions on what I do next?
EDIT:
Right, so converting from dx8 to dx9 wasn't nearly as hard as I thought it would be. :)
Just did find/replace on most of the stuff. For drawing text, you don't need the Begin() and End() stuff anymore, just DrawText.
Code:
pFont->DrawTextA( NULL, text, -1, &Rectangle, 0, color );
Also removed calls to SetVertexShader() and used SetFVF instead.
Code:
//pDevice->SetVertexShader( NULL /*D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1*/);
pDevice->SetFVF( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 );
No longer using CreateImageSurface(). Using CreateOffscreenPlainSurface() now:
Code:
//pDevice->CreateImageSurface(surfDesc.Width, surfDesc.Height, surfDesc.Format, &pCleanSurface);
pDevice->CreateOffscreenPlainSurface( surfDesc.Width, surfDesc.Height, surfDesc.Format, D3DPOOL_MANAGED , &pCleanSurface, NULL );
Replaced CopyRects() with UpdateSurface():
Code:
//pDevice->CopyRects(pCleanSurface, NULL, 0, pTexSurface, NULL);
pDevice->UpdateSurface( pCleanSurface, NULL, pTexSurface, NULL );
Code:
//pDevice->CopyRects(pSurface, pSrcRect, 1, pTexSurface, &destPoint);
pDevice->UpdateSurface( pSurface, pSrcRect, pTexSurface, &destPoint );
Think that about sums up my changes. I don't know much about D3D programming, but it seems to work so w/e. xD
Below are the d3d changes I've made that I'm not sure about:
- several changes like this
Code:
pDevice->SetVertexShader( NULL /*D3DFVF_XYZRHW|D3DFVF_TEX1*/);
pDevice->SetFVF( D3DFVF_XYZRHW|D3DFVF_TEX1 );
- 2 or 3 like this
Code:
//pDevice->CreateImageSurface(surfDesc.Width, surfDesc.Height, surfDesc.Format, &pCleanSurface);
pDevice->CreateOffscreenPlainSurface( surfDesc.Width, surfDesc.Height, surfDesc.Format, D3DPOOL_DEFAULT, &pCleanSurface, NULL );
- some of these
Code:
//pDevice->CopyRects(pSurface, pSrcRect, 1, pTexSurface, &destPoint);
// apparently, the 2 possible replacements are UpdateSurface() and GetRenderTargetData()
pDevice->UpdateSurface( pSurface, pSrcRect, pTexSurface, &destPoint );
and finally
Code:
pDevice->CreateImageSurface(width, height, SURFACE_FORMAT, ppSurface);
pDevice->CreateOffscreenPlainSurface( width, height, SURFACE_FORMAT, D3DPOOL_DEFAULT, ppSurface, NULL );
I'm not very good with d3d, so any help would be appreciated.