Some Questions

02/17/2012 23:58 boredsauce#31
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


So all thats left is to update the structs. Woohoo! ....
02/18/2012 10:17 Interest07#32
I guess I'll have to give it a go when I have time. I do love my autopot lol.
02/22/2012 12:21 Interest07#33
had to change

Code:
pDevice->CreateOffscreenPlainSurface( surfDesc.Width, surfDesc.Height, surfDesc.Format, D3DPOOL_MANAGED , &pCleanSurface, NULL );
to
Code:
pDevice->CreateOffscreenPlainSurface( surfDesc.Width, surfDesc.Height, surfDesc.Format, D3DPOOL_SCRATCH , &pCleanSurface, NULL );
for the same effect as d3d8 surfaces. Cutting up surfaces didn't work very well with D3DPOOL_MANAGED. (i.e. crashes) But the rest worked well for me, thanks :) Saved me some looking around... autoPot all functional and pretty again.

Mind giving an update on your progress? I'm kinda intrigued about what exactly you're doing :D (perhaps a screenshot or so lol)

edit: damn it doesn't actually work... it only stops my program from crashing, but it doesn't make it display the dragged items properly :o
02/22/2012 19:26 boredsauce#34
The Descent update changed the structs a bit, need to update them. I haven't tried yet, been taking advantage of the 2x drop/exp on the servers xD

Some of the new entries are probably the Orders they added (Corona, Shroud, etc.).
02/23/2012 10:23 Interest07#35
The structs weren't very hard to update, just stupid d3d9. I'll have to either cut the icons out in advance or figure a different way to cut them runtime :p

For now I'm rewriting my d3d framework a little and gonna see how hard it is to add 3D objects to the game.