Add a lock on bind items

09/11/2016 21:24 sebariio#1
It's this :
[Only registered and activated users can see links. Click Here To Register...]

Code:
#ifdef __GAMEGUARD
			if( pItemElem->IsBinds() )
			{
				CTexture* pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, "lock.dds" ), 0xffff00ff );
				if( pTexture )
				{
					if( pItemElem->GetProp()->dwParts == PARTS_CAP || pItemElem->GetProp()->dwParts == PARTS_UPPER_BODY || pItemElem->GetProp()->dwParts == PARTS_HAND || pItemElem->GetProp()->dwParts == PARTS_FOOT 
					||	pItemElem->GetProp()->dwParts == PARTS_LWEAPON || pItemElem->GetProp()->dwParts == PARTS_RWEAPON || pItemElem->GetProp()->dwParts == PARTS_SHIELD || pItemElem->GetProp()->dwParts == PARTS_BULLET 	
					||	pItemElem->GetProp()->dwParts == PARTS_CLOAK || pItemElem->GetProp()->dwParts == PARTS_MASK || pItemElem->GetProp()->dwParts == PARTS_RIDE )
					{
						cpAdd = CPoint( 29, 2 );
						p2DRender->RenderTexture2( DrawRect.TopLeft()+cpAdd, pTexture, sx, sy, D3DCOLOR_XRGB( 255, 255, 255 ) );
					}
					else if( pItemElem->GetProp()->dwParts == PARTS_EARRING1 || pItemElem->GetProp()->dwParts == PARTS_RING1 || pItemElem->GetProp()->dwParts == PARTS_NECKLACE1 || pItemElem->GetProp()->dwParts == PARTS_RING2 || pItemElem->GetProp()->dwParts == PARTS_EARRING2
					|| pItemElem->GetProp()->dwParts == PARTS_HAT || pItemElem->GetProp()->dwParts == PARTS_CLOTH || pItemElem->GetProp()->dwParts == PARTS_GLOVE || pItemElem->GetProp()->dwParts == PARTS_BOOTS )
					{
						cpAdd = CPoint( 15, 2 );
						p2DRender->RenderTexture2( DrawRect.TopLeft()+cpAdd, pTexture, sx, sy, D3DCOLOR_XRGB( 255, 255, 255 ) );
					}
				}
			}
#endif // __GAMEGUARD
lock image : [Only registered and activated users can see links. Click Here To Register...]

if you use my code, pute a thank ! :)
09/11/2016 21:30 Rhyder`#2
damn. your inventory is now like a shop :D
09/11/2016 21:43 Mike Oxmaul#3
It is silly to load the Texture every damn frame
09/11/2016 22:07 ZeroTwo02#4
Well, edit ->

Code:
#ifdef __CLIENT
			if( pItemElem && pItemElem->IsBinds() )
			{
				CTexture* pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, "lock.dds" ), 0xffff00ff );
				if( pItemElem->GetProp()->dwParts == PARTS_CAP || pItemElem->GetProp()->dwParts == PARTS_UPPER_BODY || pItemElem->GetProp()->dwParts == PARTS_HAND || pItemElem->GetProp()->dwParts == PARTS_FOOT 
				||	pItemElem->GetProp()->dwParts == PARTS_LWEAPON || pItemElem->GetProp()->dwParts == PARTS_RWEAPON || pItemElem->GetProp()->dwParts == PARTS_SHIELD || pItemElem->GetProp()->dwParts == PARTS_BULLET 	
				||	pItemElem->GetProp()->dwParts == PARTS_CLOAK || pItemElem->GetProp()->dwParts == PARTS_MASK || pItemElem->GetProp()->dwParts == PARTS_RIDE )
				{
					cpAdd = CPoint( 29, 2 );
					if(pTexture)
					p2DRender->RenderTexture2( DrawRect.TopLeft()+cpAdd, pTexture, sx, sy, D3DCOLOR_XRGB( 255, 255, 255 ) );
				}
				else if( pItemElem->GetProp()->dwParts == PARTS_EARRING1 || pItemElem->GetProp()->dwParts == PARTS_RING1 || pItemElem->GetProp()->dwParts == PARTS_NECKLACE1 || pItemElem->GetProp()->dwParts == PARTS_RING2 || pItemElem->GetProp()->dwParts == PARTS_EARRING2
				|| pItemElem->GetProp()->dwParts == PARTS_HAT || pItemElem->GetProp()->dwParts == PARTS_CLOTH || pItemElem->GetProp()->dwParts == PARTS_GLOVE || pItemElem->GetProp()->dwParts == PARTS_BOOTS )
				{
					cpAdd = CPoint( 15, 2 );
					if(pTexture)
					p2DRender->RenderTexture2( DrawRect.TopLeft()+cpAdd, pTexture, sx, sy, D3DCOLOR_XRGB( 255, 255, 255 ) );
				}
			}
#endif // __CLIENT
09/11/2016 22:13 Mognakor#5
Quote:
Originally Posted by Jupsi332 View Post
It is silly to load the Texture every damn frame
I'm not completly sure, but i think what actually happens is this:

We can see he uses textureManager so there probably is some caching involved. But because he asks the textureManager for the image and never tells the manager to free it, the manager increases the count of active copies and never reduces them, so the image doesn't leave the cache (maybe it even causes a memory leak)
09/11/2016 22:17 Mike Oxmaul#6
Quote:
Originally Posted by Mognakor View Post
I'm not completly sure, but i think what actually happens is this:

We can see he uses textureManager so there probably is some caching involved. But because he asks the textureManager for the image and never tells the manager to free it, the manager increases the count of active copies and never reduces them, so the image doesn't leave the cache (maybe it even causes a memory leak)
It needs CPU to fill the pointer, search through the Cache etc

And i think you dont need such big if cases when using pItemElem->GetProp()->dwItemKind2 == IK2_CLOTHING
09/11/2016 22:43 ZeroTwo02#7
Well... Just us the function "CWndQueryEquip::OnDraw"
09/11/2016 23:45 sebariio#8
Quote:
Originally Posted by naruto66620 View Post
Well, edit ->

Code:
#ifdef __CLIENT
			if( pItemElem && pItemElem->IsBinds() )
			{
				CTexture* pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, "lock.dds" ), 0xffff00ff );
				if( pItemElem->GetProp()->dwParts == PARTS_CAP || pItemElem->GetProp()->dwParts == PARTS_UPPER_BODY || pItemElem->GetProp()->dwParts == PARTS_HAND || pItemElem->GetProp()->dwParts == PARTS_FOOT 
				||	pItemElem->GetProp()->dwParts == PARTS_LWEAPON || pItemElem->GetProp()->dwParts == PARTS_RWEAPON || pItemElem->GetProp()->dwParts == PARTS_SHIELD || pItemElem->GetProp()->dwParts == PARTS_BULLET 	
				||	pItemElem->GetProp()->dwParts == PARTS_CLOAK || pItemElem->GetProp()->dwParts == PARTS_MASK || pItemElem->GetProp()->dwParts == PARTS_RIDE )
				{
					cpAdd = CPoint( 29, 2 );
					if(pTexture)
					p2DRender->RenderTexture2( DrawRect.TopLeft()+cpAdd, pTexture, sx, sy, D3DCOLOR_XRGB( 255, 255, 255 ) );
				}
				else if( pItemElem->GetProp()->dwParts == PARTS_EARRING1 || pItemElem->GetProp()->dwParts == PARTS_RING1 || pItemElem->GetProp()->dwParts == PARTS_NECKLACE1 || pItemElem->GetProp()->dwParts == PARTS_RING2 || pItemElem->GetProp()->dwParts == PARTS_EARRING2
				|| pItemElem->GetProp()->dwParts == PARTS_HAT || pItemElem->GetProp()->dwParts == PARTS_CLOTH || pItemElem->GetProp()->dwParts == PARTS_GLOVE || pItemElem->GetProp()->dwParts == PARTS_BOOTS )
				{
					cpAdd = CPoint( 15, 2 );
					if(pTexture)
					p2DRender->RenderTexture2( DrawRect.TopLeft()+cpAdd, pTexture, sx, sy, D3DCOLOR_XRGB( 255, 255, 255 ) );
				}
			}
#endif // __CLIENT
#ifdef __CLIENT, for WndField? :D
don't need to verify pItemElem...
if( pItemBase && pItemBase->GetTexture() )
CItemElem *pItemElem = (CItemElem *)pItemBase;
09/12/2016 11:08 Dark®©#9
Quote:
Originally Posted by sebariio View Post
It's this :
[Only registered and activated users can see links. Click Here To Register...]

Code:
#ifdef __GAMEGUARD
			if( pItemElem->IsBinds() )
			{
				CTexture* pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_ICON, "lock.dds" ), 0xffff00ff );
				if( pTexture )
				{
					if( pItemElem->GetProp()->dwParts == PARTS_CAP || pItemElem->GetProp()->dwParts == PARTS_UPPER_BODY || pItemElem->GetProp()->dwParts == PARTS_HAND || pItemElem->GetProp()->dwParts == PARTS_FOOT 
					||	pItemElem->GetProp()->dwParts == PARTS_LWEAPON || pItemElem->GetProp()->dwParts == PARTS_RWEAPON || pItemElem->GetProp()->dwParts == PARTS_SHIELD || pItemElem->GetProp()->dwParts == PARTS_BULLET 	
					||	pItemElem->GetProp()->dwParts == PARTS_CLOAK || pItemElem->GetProp()->dwParts == PARTS_MASK || pItemElem->GetProp()->dwParts == PARTS_RIDE )
					{
						cpAdd = CPoint( 29, 2 );
						p2DRender->RenderTexture2( DrawRect.TopLeft()+cpAdd, pTexture, sx, sy, D3DCOLOR_XRGB( 255, 255, 255 ) );
					}
					else if( pItemElem->GetProp()->dwParts == PARTS_EARRING1 || pItemElem->GetProp()->dwParts == PARTS_RING1 || pItemElem->GetProp()->dwParts == PARTS_NECKLACE1 || pItemElem->GetProp()->dwParts == PARTS_RING2 || pItemElem->GetProp()->dwParts == PARTS_EARRING2
					|| pItemElem->GetProp()->dwParts == PARTS_HAT || pItemElem->GetProp()->dwParts == PARTS_CLOTH || pItemElem->GetProp()->dwParts == PARTS_GLOVE || pItemElem->GetProp()->dwParts == PARTS_BOOTS )
					{
						cpAdd = CPoint( 15, 2 );
						p2DRender->RenderTexture2( DrawRect.TopLeft()+cpAdd, pTexture, sx, sy, D3DCOLOR_XRGB( 255, 255, 255 ) );
					}
				}
			}
#endif // __GAMEGUARD
lock image : [Only registered and activated users can see links. Click Here To Register...]

if you use my code, pute a thank ! :)

where should i put that code? under what func. ..BTW thanks for this..
09/12/2016 11:13 alfredico#10
Quote:
Originally Posted by Dark®© View Post
where should i put that code? under what func. ..BTW thanks for this..
::OnDraw?
And load texture in constructor.

I'm only curious about what is each add-on in inventory.
09/12/2016 13:26 - DK#11
Little Detail :) Sweet release :) Nice Work :)
09/12/2016 13:28 jericho2nd#12
where should i put that code? under what function ..thanks for this..
09/12/2016 14:34 Lodelight#13
Quote:
Originally Posted by jericho2nd View Post
where should i put that code? under what function ..thanks for this..
[Only registered and activated users can see links. Click Here To Register...]

To lazy to read 2 posts above yours? :rolleyes:
09/30/2016 23:40 Pradaa#14
nice release but W.T.F #ifdef __GAMEGUARD ? i still don't understand why you defined that ._.
10/01/2016 17:32 Nortix#15
The define doesn't matter anyways?