Storm/Draw_Crosshair.hpp

61 lines
3.0 KiB
C++
Raw Normal View History

2024-04-04 03:17:09 +08:00
void Redirected_Draw_Crosshair()
{
static float Rotation_Angle;
2024-04-04 03:17:09 +08:00
auto Draw_Storm = [&](__int32 X, __int32 Y, __int32 Additional_Rotation_Angle)
{
using Set_Color_Type = void(__thiscall**)(void* Surface, unsigned __int8 Red, unsigned __int8 Green, unsigned __int8 Blue, unsigned __int8 Alpha);
2024-04-04 03:17:09 +08:00
void* Surface = *(void**)((unsigned __int32)Client_Module + 8960244);
2024-04-04 03:17:09 +08:00
(*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 0, 0, 0, 255);
2024-04-04 03:17:09 +08:00
using Draw_Circle_Type = void(__thiscall**)(void* Surface, __int32 X, __int32 Y, __int32 Radius, __int32 Segments);
2024-04-04 03:17:09 +08:00
X += Interface_Storm_Rotation_Radius.Integer * __builtin_cosf(__builtin_remainderf(Rotation_Angle + Additional_Rotation_Angle, 360.f) * 3.1415927f / 180.f);
2024-04-04 03:17:09 +08:00
Y += Interface_Storm_Rotation_Radius.Integer * __builtin_sinf(__builtin_remainderf(Rotation_Angle + Additional_Rotation_Angle, 360.f) * 3.1415927f / 180.f);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X - 1, Y, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X, Y - 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X + 1, Y, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X, Y + 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X - 1, Y - 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X + 1, Y - 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X - 1, Y + 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X + 1, Y + 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
2024-04-04 03:17:09 +08:00
(*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 0, 128, 255, 255);
2024-04-04 03:17:09 +08:00
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X, Y, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
};
2024-04-04 03:17:09 +08:00
__int32 Storm_Number = 0;
2024-04-04 03:17:09 +08:00
using Get_Screen_Size_Type = __int32(__cdecl*)();
2024-04-04 03:17:09 +08:00
__int32 Screen_Width = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738576)() / 2;
2024-04-04 03:17:09 +08:00
__int32 Screen_Height = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738544)() / 2;
2024-04-04 03:17:09 +08:00
Draw_Storm_Label:
{
if (Storm_Number < Interface_Storm_Iterations.Integer)
2024-04-04 03:17:09 +08:00
{
Draw_Storm(Screen_Width, Screen_Height, Storm_Number * 360 / Interface_Storm_Iterations.Integer);
2024-04-04 03:17:09 +08:00
Storm_Number += 1;
2024-04-04 03:17:09 +08:00
goto Draw_Storm_Label;
2024-04-04 03:17:09 +08:00
}
}
Rotation_Angle = __builtin_remainderf(Rotation_Angle + (*(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744))->Frame_Time * Interface_Storm_Speed.Integer, 360.f);
2024-04-04 03:17:09 +08:00
}