mirror of
https://github.com/qwertyuiop3/Storm.git
synced 2024-12-22 14:47:24 +08:00
2dc81b9839
also explicitly specifying value type seems to be good practice to prevent unintended fraction down-rounding (just what've happened in paint.hpp with color 128 -> 127) also remove scope check i've competely forgot about in draw_crosshair.hpp
61 lines
3.0 KiB
C++
Executable File
61 lines
3.0 KiB
C++
Executable File
void Redirected_Draw_Crosshair()
|
|
{
|
|
static float Rotation_Angle;
|
|
|
|
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);
|
|
|
|
void* Surface = *(void**)((unsigned __int32)Client_Module + 8960244);
|
|
|
|
(*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 0, 0, 0, 255);
|
|
|
|
using Draw_Circle_Type = void(__thiscall**)(void* Surface, __int32 X, __int32 Y, __int32 Radius, __int32 Segments);
|
|
|
|
X += Interface_Storm_Rotation_Radius.Integer * __builtin_cosf(__builtin_remainderf(Rotation_Angle + Additional_Rotation_Angle, 360.f) * 3.1415927f / 180.f);
|
|
|
|
Y += Interface_Storm_Rotation_Radius.Integer * __builtin_sinf(__builtin_remainderf(Rotation_Angle + Additional_Rotation_Angle, 360.f) * 3.1415927f / 180.f);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X - 1, Y, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X, Y - 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X + 1, Y, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X, Y + 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X - 1, Y - 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X + 1, Y - 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X - 1, Y + 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X + 1, Y + 1, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
|
|
(*Set_Color_Type(*(unsigned __int32*)Surface + 44))(Surface, 0, 128, 255, 255);
|
|
|
|
(*Draw_Circle_Type(*(unsigned __int32*)Surface + 384))(Surface, X, Y, Interface_Storm_Radius.Integer, Interface_Storm_Segments.Integer);
|
|
};
|
|
|
|
__int32 Storm_Number = 0;
|
|
|
|
using Get_Screen_Size_Type = __int32(__cdecl*)();
|
|
|
|
__int32 Screen_Width = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738576)() / 2;
|
|
|
|
__int32 Screen_Height = Get_Screen_Size_Type((unsigned __int32)Client_Module + 738544)() / 2;
|
|
|
|
Draw_Storm_Label:
|
|
{
|
|
if (Storm_Number < Interface_Storm_Iterations.Integer)
|
|
{
|
|
Draw_Storm(Screen_Width, Screen_Height, Storm_Number * 360 / Interface_Storm_Iterations.Integer);
|
|
|
|
Storm_Number += 1;
|
|
|
|
goto Draw_Storm_Label;
|
|
}
|
|
}
|
|
|
|
Rotation_Angle = __builtin_remainderf(Rotation_Angle + (*(Global_Variables_Structure**)((unsigned __int32)Client_Module + 7096744))->Frame_Time * Interface_Storm_Speed.Integer, 360.f);
|
|
} |