Reset Sprites the Easiest Basic way !

Posts 115 of 21 · Page 1 of 2
Reset Sprites the Easiest Basic way !
..::Information::..
This "snipped" is very basic, i've tested it and it worked,
but sometimes the menu is just getting recreated ingame.
You can easily fix it, if you know how to work with reset and sprites.
:/
Out of my view, i wouldn't give a fuck xD, since hack-users should be thankful to me because of creating a hack for them, isn't that so? :P


Hello guys,
i decided to show you a method to reset your sprites, because a lot of people were asking me how, but when i tried to help them they were like "wtf r u talkin 'bout??" yep, that's the most spread desease here, isn't it?

It's very basic, easy and there are alot of ways.

The way i like the best is this one:
(Easy for beginners)

First of all collect the names of your Textures you've created.
[In order to do this you may need to use a drawtexture function, it makes no sense if it's loaded from bytes or file]
In globals:
Code:
bool recreate = false;
In Present or Endscene Put this (I recommended to make it easy to find for me -> above hacking stuff)
Code:
if(recreate){
D3DXCreateTextureFromFileInMemory(pDevice, &_Page1, sizeof(_Page1), &Page1);// Your Texture. Do not Put a If Zero infront of the creation.
// Do the stuff above with all your Textures!
D3DXCreateSprite(pDevice, &SpriteMenu);// Your Sprite SpriteMenu = Your //LPD3DXSPRITE
recreate = false;
}
After you finished doing this, add this into your Reset
[Recommended you have a working reset in your Base|Source|C&P'ed thingy what ever.]
For example:
Code:
HRESULT WINAPI hkReset(PREMETERS = Example){
SpriteMenu->OnLostDevice();
recreate =! recreate ;
}
// This is an example reset!
This is the easiest method i could find.
I tested it and it worked for me..
Give me Feedback.
Nice . /
Recreation I Think This Too Is Needed. Don't Flame.

Code:
LPDIRECT3DDEVICE9 g_pDevice = 0;
Code:
HRESULT WINAPI gellPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
    if (g_pDevice != pDevice)
{
    g_pDevice = pDevice;
    try
    {
        if (SpriteMenu != 0)
            SpriteMenu->Release();
    } catch (...) {}
    SpriteMenu = 0;
    D3DXCreateTextureFromFileInMemory(pDevice,&_Page1,sizeof(&_Page1),&Page1);
    D3DXCreateSprite(pDevice,&SpriteMenu);
    }
------ rep
Quote Originally Posted by MrSkafighter View Post
Recreation I Think This Too Is Needed. Don't Flame.

Code:
LPDIRECT3DDEVICE9 g_pDevice = 0;
Code:
HRESULT WINAPI gellPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
    if (g_pDevice != pDevice)
{
    g_pDevice = pDevice;
    try
    {
        if (SpriteMenu != 0)
            SpriteMenu->Release();
    } catch (...) {}
    SpriteMenu = 0;
    D3DXCreateTextureFromFileInMemory(pDevice,&_Page1,sizeof(&_Page1),&Page1);
    D3DXCreateSprite(pDevice,&SpriteMenu);
    }
Am i looking like a flamer ^-^, thanked for that one.
Quote Originally Posted by dean-wingess View Post
Am i looking like a flamer ^-^, thanked for that one.
I'm Just Saying If Any Coder Comes In And Suddenly Start Flaming Me That If The Code is Wrong Lol Anyway This Works Tested As You Can See I Released My Hack You Can Try And See That It Will Not Disappear.
Quote Originally Posted by MrSkafighter View Post

I'm Just Saying If Any Coder Comes In And Suddenly Start Flaming Me That If The Code is Wrong Lol Anyway This Works Tested As You Can See I Released My Hack You Can Try And See That It Will Not Disappear.
ahh dude Nice sprite.

Why didn't you use a simple renderstate to not get it being overdrawn?
Code:
DEVICENAME->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
//Sprites and Tex Drawing here
DEVICENAME->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
Quote Originally Posted by MrSkafighter View Post
Recreation I Think This Too Is Needed. Don't Flame.

Code:
LPDIRECT3DDEVICE9 g_pDevice = 0;
Code:
HRESULT WINAPI gellPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
    if (g_pDevice != pDevice)
{
    g_pDevice = pDevice;
    try
    {
        if (SpriteMenu != 0)
            SpriteMenu->Release();
    } catch (...) {}
    SpriteMenu = 0;
    D3DXCreateTextureFromFileInMemory(pDevice,&_Page1,sizeof(&_Page1),&Page1);
    D3DXCreateSprite(pDevice,&SpriteMenu);
    }
give credits to mmbob

Quote Originally Posted by dean-wingess View Post
ahh dude Nice sprite.

Why didn't you use a simple renderstate to not get it being overdrawn?
Code:
DEVICENAME->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
//Sprites and Tex Drawing here
DEVICENAME->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
you can use the SetRenderState only if your menu is being covered by the game GUI it won't fix the text or sprite from being disappeared
Quote Originally Posted by GodHack2 View Post
give credits to mmbob



you can use the SetRenderState only if your menu is being covered by the game GUI it won't fix the text or sprite from being disappeared
Could you tell me why mine isn't disappearing then?
Quote Originally Posted by dean-wingess View Post
Could you tell me why mine isn't disappearing then?
ok umm
if you exit a match and enter another with the SetRenderState ZENABLE off then on
or if you minimize the game and go back on it with the same thing
your text or sprite should disappear

if not well then that means am wrong :/
Quote Originally Posted by MrSkafighter View Post
Recreation I Think This Too Is Needed. Don't Flame.
Why Do You Type Like This? /
Quote Originally Posted by MrSkafighter View Post
Recreation I Think This Too Is Needed. Don't Flame.

Code:
LPDIRECT3DDEVICE9 g_pDevice = 0;
Code:
HRESULT WINAPI gellPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
    if (g_pDevice != pDevice)
{
    g_pDevice = pDevice;
    try
    {
        if (SpriteMenu != 0)
            SpriteMenu->Release();
    } catch (...) {}
    SpriteMenu = 0;
    D3DXCreateTextureFromFileInMemory(pDevice,&_Page1,sizeof(&_Page1),&Page1);
    D3DXCreateSprite(pDevice,&SpriteMenu);
    }
Give creds to mmbob for the recreate source
Quote Originally Posted by NOOB View Post


Why Do You Type Like This? /

maybe that's how they write in singapore?
Quote Originally Posted by whit View Post


Give creds to mmbob for the recreate source
He Didn't Help Me For The Recreate Source I Do It My Own.
Recreate your Sprite with your font -.- i see many wasted lines on this method :O even tho C++ is allreadt 10-20 times slower than assembly + wasted lines ur hack is laggy
Posts 115 of 21 · Page 1 of 2
This thread is closed for replies.

Tags for this Thread

None

Need help?