you resetting the sprite when the device changes?
Hey guys
Hope someone of you can help me with this problem!
I made an awesome menu with photoshop, and I wanted to put it as my hackmenu.
I searched for drawing sprites with scale function, and I found a cool working method:
But sometimes, my menu keeps crashing!Code:void CDirectx::DrawSprite(LPDIRECT3DDEVICE9 pDevice, LPDIRECT3DTEXTURE9 pTexture, int x, int y, int w, int h) { if(!cHacks.ValidPointer(pDevice) || !cHacks.ValidPointer(pTexture)) return; struct tVertex { float X, Y, Z, RHW; float IU, IV; enum FVF { FVF_Flags = (D3DFVF_XYZRHW | D3DFVF_TEX1) }; }; tVertex Veri[4] = { {(float)x ,(float)y , 0.0f, 1.0f, 0.0f, 0.0f }, {(float)(x+w) ,(float)y , 0.0f, 1.0f, 1.0f, 0.0f }, {(float)x ,(float)(y+h) , 0.0f, 1.0f, 0.0f, 1.0f }, {(float)(x+w) ,(float)(y+h) , 0.0f, 1.0f, 1.0f, 1.0f }, }; pDevice->SetTexture( 0, pTexture ); pDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 ); pDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); pDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_TEXTURE ); pDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); pDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE ); pDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE ); pDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE ); pDevice->SetRenderState( D3DRS_LIGHTING, FALSE); pDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW); pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA ); pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE ); pDevice->SetRenderState( D3DRS_FOGENABLE, false ); pDevice->SetFVF( tVertex::FVF_Flags ); pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(tVertex)); }
Its not detected, if I comment all my spritedrawing out it works, my old d3d-menu works too!
Could it be, that this function is crashing me, because Im drawing too much sprites?
Is there a fix for it?
Please help me
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
you resetting the sprite when the device changes?
Thank you for replying, but as you see in the code, there is no sprite.
Its using the device directly to draw, thats the good thing!
But something is crashing me :/
EDIT: I know why it crashed. I hooked soemthing with mc detours. Using now selfmade detours and works fine. But what I dont know is, why it crashed just with my new menu o_0
Thanks for help
Last edited by Ch40zz-C0d3r; 07-11-2012 at 09:35 AM.
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
So it's solved then?
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
:3 Closed.