fix glow, chams and various other issues
This commit is contained in:
parent
c086775131
commit
7cd5a6414d
@ -17,20 +17,7 @@ class EffectGlow : public IScreenSpaceEffect
|
||||
{
|
||||
public:
|
||||
virtual void Init();
|
||||
virtual void Shutdown()
|
||||
{
|
||||
if (init)
|
||||
{
|
||||
mat_unlit.Shutdown();
|
||||
mat_unlit_z.Shutdown();
|
||||
mat_blit.Shutdown();
|
||||
mat_unlit.Shutdown();
|
||||
mat_unlit_z.Shutdown();
|
||||
mat_blur_x.Shutdown();
|
||||
mat_blur_y.Shutdown();
|
||||
init = false;
|
||||
}
|
||||
}
|
||||
virtual void Shutdown();
|
||||
|
||||
inline virtual void SetParameters(KeyValues *params)
|
||||
{
|
||||
|
@ -130,7 +130,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
|
||||
#define TICKS_TO_TIME(t) (TICK_INTERVAL * (t))
|
||||
#define ROUND_TO_TICKS(t) (TICK_INTERVAL * TIME_TO_TICKS(t))
|
||||
uintptr_t **fp;
|
||||
__asm__("mov %%ebp, %0" : "=r"(fp));
|
||||
__asm__ volatile("mov %%ebp, %0" : "=r"(fp));
|
||||
bSendPackets = reinterpret_cast<bool *>(**fp - 8);
|
||||
|
||||
g_Settings.is_create_move = true;
|
||||
|
@ -44,7 +44,7 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
|
||||
logging::Info("Loaded Skybox: %s", succ ? "true" : "false");
|
||||
}
|
||||
ConVar *holiday = g_ICvar->FindVar("tf_forced_holiday");
|
||||
|
||||
effect_chams::g_EffectChams.Init();
|
||||
if (halloween_mode)
|
||||
holiday->SetValue(2);
|
||||
else if (holiday->m_nValue == 2)
|
||||
|
@ -43,6 +43,8 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
|
||||
if (autoabandon)
|
||||
tfmm::disconnectAndAbandon();
|
||||
hacks::shared::autojoin::onShutdown();
|
||||
effect_glow::g_EffectGlow.Shutdown();
|
||||
effect_chams::g_EffectChams.Shutdown();
|
||||
if (*random_name)
|
||||
{
|
||||
static TextFile file;
|
||||
|
@ -344,7 +344,7 @@ void EffectChams::Render(int x, int y, int w, int h)
|
||||
{
|
||||
IClientEntity *entity = g_IEntityList->GetClientEntity(i);
|
||||
if (!entity || entity->IsDormant() || CE_BAD(ENTITY(i)))
|
||||
return;
|
||||
continue;
|
||||
RenderChams(entity);
|
||||
}
|
||||
EndRenderChams();
|
||||
|
@ -204,6 +204,25 @@ void EffectGlow::Init()
|
||||
init = true;
|
||||
}
|
||||
|
||||
void EffectGlow::Shutdown()
|
||||
{
|
||||
if (init)
|
||||
{
|
||||
mat_unlit.Shutdown();
|
||||
mat_unlit_z.Shutdown();
|
||||
mat_blit.Shutdown();
|
||||
mat_blur_x.Shutdown();
|
||||
mat_blur_y.Shutdown();
|
||||
SS_NeverSolid.Reset();
|
||||
SS_SolidInvisible.Reset();
|
||||
SS_Drawing.Reset();
|
||||
GetBuffer(1)->Release();
|
||||
GetBuffer(2)->Release();
|
||||
init = false;
|
||||
logging::Info("Shutdown glow");
|
||||
}
|
||||
}
|
||||
|
||||
rgba_t EffectGlow::GlowColor(IClientEntity *entity)
|
||||
{
|
||||
static CachedEntity *ent;
|
||||
@ -415,13 +434,13 @@ void EffectGlow::Render(int x, int y, int w, int h)
|
||||
{
|
||||
if (!enable)
|
||||
return;
|
||||
if (!isHackActive() || (clean_screenshots && g_IEngine->IsTakingScreenshot()) || g_Settings.bInvalid)
|
||||
return;
|
||||
static ITexture *orig;
|
||||
static IClientEntity *ent;
|
||||
static IMaterialVar *blury_bloomamount;
|
||||
if (!init)
|
||||
Init();
|
||||
if (!isHackActive() || (g_IEngine->IsTakingScreenshot() && clean_screenshots) || g_Settings.bInvalid)
|
||||
return;
|
||||
CMatRenderContextPtr ptr(GET_RENDER_CONTEXT);
|
||||
orig = ptr->GetRenderTarget();
|
||||
BeginRenderGlow();
|
||||
@ -454,7 +473,7 @@ void EffectGlow::Render(int x, int y, int w, int h)
|
||||
ptr->DrawScreenSpaceRectangle(mat_blur_x, x, y, w, h, 0, 0, w - 1, h - 1, w, h);
|
||||
ptr->SetRenderTarget(GetBuffer(1));
|
||||
blury_bloomamount = mat_blur_y->FindVar("$bloomamount", nullptr);
|
||||
blury_bloomamount->SetIntValue((int) blur_scale);
|
||||
blury_bloomamount->SetIntValue(*blur_scale);
|
||||
ptr->DrawScreenSpaceRectangle(mat_blur_y, x, y, w, h, 0, 0, w - 1, h - 1, w, h);
|
||||
ptr->Viewport(x, y, w, h);
|
||||
ptr->SetRenderTarget(orig);
|
||||
|
Reference in New Issue
Block a user