void otheresp::hitmarker_paint()
{
if (!g_cfg.esp.hitmarker[0] && !g_cfg.esp.hitmarker[1])
{
hitmarker.hurt_time = FLT_MIN;
hitmarker.point = ZERO;
return;
}
if (!g_ctx.local()->is_alive())
{
hitmarker.hurt_time = FLT_MIN;
hitmarker.point = ZERO;
return;
}
if (hitmarker.hurt_time + 2.0f > m_globals()->m_curtime)
{
auto hitmark_col = Color(240, 240, 240, 240);
if (g_cfg.esp.hitmarker[0])
{
static int width, height;
m_engine()->GetScreenSize(width, height);
auto alpha = (int)((hitmarker.hurt_time + 2.0f - m_globals()->m_curtime) * 127.5f);
hitmark_col.SetAlpha(alpha);
auto offset = 1.0f - (float)alpha / 255.0f * 1.0f;
render::get().line(width / 2 + 4 + offset, height / 2 - 4 - offset, width / 2 + 8 + offset, height / 2 - 8 - offset, hitmark_col);
render::get().line(width / 2 + 4 + offset, height / 2 + 4 + offset, width / 2 + 8 + offset, height / 2 + 8 + offset, hitmark_col);
render::get().line(width / 2 - 4 - offset, height / 2 + 4 + offset, width / 2 - 8 - offset, height / 2 + 8 + offset, hitmark_col);
render::get().line(width / 2 - 4 - offset, height / 2 - 4 - offset, width / 2 - 8 - offset, height / 2 - 8 - offset, hitmark_col);
}
if (g_cfg.esp.hitmarker[1])
{
Vector world;
if (math::world_to_screen(hitmarker.point, world))
{
auto alpha = (int)((hitmarker.hurt_time + 2.0f - m_globals()->m_curtime) * 127.5f);
hitmark_col.SetAlpha(alpha);
auto offset = 1.0f - (float)alpha / 255.0f * 1.0f;
render::get().line(world.x + 4 + offset, world.y - 4 - offset, world.x + 8 + offset, world.y - 8 - offset, hitmark_col);
render::get().line(world.x + 4 + offset, world.y + 4 + offset, world.x + 8 + offset, world.y + 8 + offset, hitmark_col);
render::get().line(world.x - 4 - offset, world.y + 4 + offset, world.x - 8 - offset, world.y + 8 + offset, hitmark_col);
render::get().line(world.x - 4 - offset, world.y - 4 - offset, world.x - 8 - offset, world.y - 8 - offset, hitmark_col);
}
}
}
}