Fix WorldToScreen
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Common/Common.hpp>
|
#include <Common/Common.hpp>
|
||||||
|
#include <Common/MemoryEngine.hpp>
|
||||||
|
|
||||||
#include <CS2/SDK/SDK.hpp>
|
#include <CS2/SDK/SDK.hpp>
|
||||||
#include <CS2/CBasePattern.hpp>
|
#include <CS2/CBasePattern.hpp>
|
||||||
@@ -18,8 +19,15 @@ class IVEngineToClient
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DECLARATE_CS2_FUNCTION( bool , IsInGame , ( ) , IVEngineToClient , ( IVEngineToClient* ) , ( this ) );
|
DECLARATE_CS2_FUNCTION( bool , IsInGame , ( ) , IVEngineToClient , ( IVEngineToClient* ) , ( this ) );
|
||||||
// Index -> "60"
|
// Index -> "62"
|
||||||
DECLARATE_CS2_FUNCTION( const char* , GetLevelName , ( ) , IVEngineToClient , ( IVEngineToClient* ) , ( this ) );
|
DECLARATE_CS2_FUNCTION( const char* , GetLevelName , ( ) , IVEngineToClient , ( IVEngineToClient* ) , ( this ) );
|
||||||
// Index -> "61"
|
// Index -> "63"
|
||||||
DECLARATE_CS2_FUNCTION( const char* , GetLevelNameShort , ( ) , IVEngineToClient , ( IVEngineToClient* ) , ( this ) );
|
DECLARATE_CS2_FUNCTION( const char* , GetLevelNameShort , ( ) , IVEngineToClient , ( IVEngineToClient* ) , ( this ) );
|
||||||
|
|
||||||
|
public:
|
||||||
|
auto GetScreenSize( int& width , int& height ) -> void
|
||||||
|
{
|
||||||
|
VirtualFn( void )( IVEngineToClient* , int& , int& );
|
||||||
|
return vget< Fn >( this , 59 )( this , width , height );
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <ImGui/imgui_internal.h>
|
#include <ImGui/imgui_internal.h>
|
||||||
|
|
||||||
|
#include <CS2/SDK/SDK.hpp>
|
||||||
|
#include <CS2/SDK/Interface/IEngineToClient.hpp>
|
||||||
#include <CS2/SDK/FunctionListSDK.hpp>
|
#include <CS2/SDK/FunctionListSDK.hpp>
|
||||||
|
|
||||||
namespace Math
|
namespace Math
|
||||||
@@ -15,11 +17,13 @@ namespace Math
|
|||||||
|
|
||||||
ret = !( ScreenTransform( vIn , Out ) );
|
ret = !( ScreenTransform( vIn , Out ) );
|
||||||
|
|
||||||
if ( ImGui::GetCurrentContext() )
|
auto ScreenWidth = 0;
|
||||||
{
|
auto ScreenHeight = 0;
|
||||||
vOut.x = ( ( Out.m_x + 1.0f ) * 0.5f ) * ImGui::GetIO().DisplaySize.x;
|
|
||||||
vOut.y = ImGui::GetIO().DisplaySize.y - ( ( ( Out.m_y + 1.0f ) * 0.5f ) * ImGui::GetIO().DisplaySize.y );
|
SDK::Interfaces::EngineToClient()->GetScreenSize( ScreenWidth , ScreenHeight );
|
||||||
}
|
|
||||||
|
vOut.x = ( ( Out.m_x + 1.0f ) * 0.5f ) * static_cast<float>( ScreenWidth );
|
||||||
|
vOut.y = static_cast<float>( ScreenHeight ) - ( ( ( Out.m_y + 1.0f ) * 0.5f ) * static_cast<float>( ScreenHeight ) );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -32,11 +36,13 @@ namespace Math
|
|||||||
|
|
||||||
ret = !( ScreenTransform( vIn , Out ) );
|
ret = !( ScreenTransform( vIn , Out ) );
|
||||||
|
|
||||||
if ( ImGui::GetCurrentContext() )
|
auto ScreenWidth = 0;
|
||||||
{
|
auto ScreenHeight = 0;
|
||||||
vOut.m_x = ( ( Out.m_x + 1.0f ) * 0.5f ) * ImGui::GetIO().DisplaySize.x;
|
|
||||||
vOut.m_y = ImGui::GetIO().DisplaySize.y - ( ( ( Out.m_y + 1.0f ) * 0.5f ) * ImGui::GetIO().DisplaySize.y );
|
SDK::Interfaces::EngineToClient()->GetScreenSize( ScreenWidth , ScreenHeight );
|
||||||
}
|
|
||||||
|
vOut.m_x = ( ( Out.m_x + 1.0f ) * 0.5f ) * static_cast<float>( ScreenWidth );
|
||||||
|
vOut.m_y = static_cast<float>( ScreenHeight ) - ( ( ( Out.m_y + 1.0f ) * 0.5f ) * static_cast<float>( ScreenHeight ) );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -47,11 +53,13 @@ namespace Math
|
|||||||
|
|
||||||
ret = !( ScreenTransform( vIn , vOut ) );
|
ret = !( ScreenTransform( vIn , vOut ) );
|
||||||
|
|
||||||
if ( ImGui::GetCurrentContext() )
|
auto ScreenWidth = 0;
|
||||||
{
|
auto ScreenHeight = 0;
|
||||||
vOut.m_x = ( ( vOut.m_x + 1.0f ) * 0.5f ) * ImGui::GetIO().DisplaySize.x;
|
|
||||||
vOut.m_y = ImGui::GetIO().DisplaySize.y - ( ( ( vOut.m_y + 1.0f ) * 0.5f ) * ImGui::GetIO().DisplaySize.y );
|
SDK::Interfaces::EngineToClient()->GetScreenSize( ScreenWidth , ScreenHeight );
|
||||||
}
|
|
||||||
|
vOut.m_x = ( ( vOut.m_x + 1.0f ) * 0.5f ) * static_cast<float>( ScreenWidth );
|
||||||
|
vOut.m_y = static_cast<float>( ScreenHeight ) - ( ( ( vOut.m_y + 1.0f ) * 0.5f ) * static_cast<float>( ScreenHeight ) );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@
|
|||||||
#define ENABLE_MANUAL_MAP 0
|
#define ENABLE_MANUAL_MAP 0
|
||||||
#define ENABLE_CPP_EH_EXCEPTION 0
|
#define ENABLE_CPP_EH_EXCEPTION 0
|
||||||
|
|
||||||
#define DISABLE_INVENTORY 0
|
|
||||||
|
|
||||||
#define LOG_SDK 1
|
#define LOG_SDK 1
|
||||||
#define LOG_SDK_PATTERN 1
|
#define LOG_SDK_PATTERN 0
|
||||||
|
|
||||||
#define ENABLE_XOR_STR 0
|
#define ENABLE_XOR_STR 0
|
||||||
#define ENABLE_XOR_VMP_STR 0
|
#define ENABLE_XOR_VMP_STR 0
|
||||||
|
|||||||
Reference in New Issue
Block a user