Team Fortress 2:Entity Outline Glow (With RGBA)

From UnKnoWnCheaTs Game Hacking Wiki
Jump to: navigation, search

Posted by:Tamimego


A5ut2.jpg


Classes:


class CGlowObject
{
public:
	CBaseHandle entityHandle;
	float flRed;
	float flGreen;
	float flBlue;
	float flAlpha;
	unsigned char Unknown0x0014[ 0x0020 - 0x0014 ];
};

class CGlowManager
{
public:
	CGlowObject m_glowObjects[ 1 ];
};

class CBaseEntity : public IClientEntity
{
public:
	unsigned char Unknown0x000C[ 0x0D1C - 0x000C ];
	bool m_bGlowEnabled;
	unsigned int* m_puiGlowIndex;
};


Init:

g_ppGlowManager = ( CGlowManager** )( dwClientBase + 0x850F70 );


or

dwResult = Util::FindPattern( dwClientBase, dwSize, ( PBYTE ) "\x8b\x3d\x00\x00\x00\x00\x8b\xc2\xc1\xe0\x05", "xx????xxxxx" );
if ( dwResult )
	g_ppGlowManager = *( CGlowManager*** )( dwResult + 2 );


Functions:

void SetEntityGlow( CBaseEntity* pEntity, bool bEnabled )
{
	if ( pEntity->m_bGlowEnabled )
	{
		if ( bEnabled ) // Glow already active
			return;
	} else {
		if ( !bEnabled ) // Glow already removed
			return;
	}

	pEntity->m_bGlowEnabled = bEnabled;

	typedef void ( __thiscall* UpdateGlowEffect_t )( CBaseEntity* pEntity );
	( ( UpdateGlowEffect_t )( *( PDWORD* ) pEntity )[ 0x35C / 4 ] )( pEntity );
}

void SetGlowColor( CBaseEntity* pEntity, const CColor& colGlowColor )
{
	CGlowManager* pGlowManager = *g_ppGlowManager;
	if ( pGlowManager == nullptr || pEntity->m_bGlowEnabled == false || pEntity->m_puiGlowIndex == nullptr )
		return;

	CGlowObject* pGlowObject = &pGlowManager->m_glowObjects[ *pEntity->m_puiGlowIndex ];

	pGlowObject->flRed = float( colGlowColor.r ) / 255.0f;
	pGlowObject->flGreen = float( colGlowColor.g ) / 255.0f;
	pGlowObject->flBlue = float( colGlowColor.b ) / 255.0f;
	pGlowObject->flAlpha = float( colGlowColor.a ) / 255.0f;
}


Entity Iteration:


bool bDormant = pEntity->IsDormant();
SetEntityGlow( pEntity, !bDormant );

if ( bDormant )
	continue;

SetGlowColor( pEntity, colGlowColor );


Source:http://www.unknowncheats.me/forum/team-fortress-2/74694-tf2-entity-outline-glow-rgba.html