diff options
author | segfault <toni@impl.cc> | 2020-05-23 01:16:23 +0200 |
---|---|---|
committer | segfault <toni@impl.cc> | 2020-05-23 01:16:23 +0200 |
commit | 375a94c2709021e04be7edaaf06134e6aa756ed7 (patch) | |
tree | 1c4126a7a9c363bbad9b6c4f1fbe19df2b7be666 | |
parent | 84e7ec39812c0a8bfca954c523b4dbb0608714ea (diff) |
fixed several compile warnings
-rw-r--r-- | Core.cpp | 4 | ||||
-rw-r--r-- | ESP.cpp | 6 | ||||
-rw-r--r-- | ESP.h | 4 | ||||
-rw-r--r-- | Engine.cpp | 10 | ||||
-rw-r--r-- | Engine.h | 2 | ||||
-rw-r--r-- | Renderer.cpp | 2 | ||||
-rw-r--r-- | Source.cpp | 2 | ||||
-rw-r--r-- | Utility.h | 2 |
8 files changed, 16 insertions, 16 deletions
@@ -48,7 +48,7 @@ void __fastcall OnCreateUnitHook(Registers* registers) __try { const auto objectManager = reinterpret_cast<ObjectManager*>(registers->rcx); - const int totalPlayers = Engine::Get()->GetTotalPlayers(); + const int64_t totalPlayers = Engine::Get()->GetTotalPlayers(); bool foundArray = false; PlayerArray* playerArray = Engine::Get()->GetPlayerArray(); @@ -199,7 +199,7 @@ void Core::OnPresent() return; } //printf(" playerArray %p", playerArray); - int totalPlayers = Engine::Get()->GetTotalPlayers(); + int64_t totalPlayers = Engine::Get()->GetTotalPlayers(); static bool openOverlay = true; if (GetAsyncKeyState(VK_INSERT) & 1) { openOverlay = !openOverlay; } @@ -80,9 +80,9 @@ void ESP::DrawBox(Vector3 position, Vector2 edgeSize, int32_t color) Renderer::Get()->RenderRect(ivOne, ivFour, ivTwo, ivThree, color); } -void ESP::DrawCircle(Unit* unit, int radius, int32_t color, int smoothness = 16, int thickness = 1, bool drawName = false) +void ESP::DrawCircle(Unit* unit, int radius, int32_t color, int smoothness = 16, float thickness = 1.f, bool drawName = false) { - static const float PI = 3.14159265358979323846; + static const float PI = 3.14159265358979323846f; int32_t tileSize = Engine::Get()->GetWorld()->pMap->GetTileSize(); Vector3 center = unit->position; @@ -97,7 +97,7 @@ void ESP::DrawCircle(Unit* unit, int radius, int32_t color, int smoothness = 16, Vector2 screenPos = Engine::Get()->worldToScreen(Vector3(x, y, center.z)); screeenPoints.push_back(ImVec2(screenPos.x, screenPos.y)); } - for (int i = 1; i < screeenPoints.size(); i++) + for (size_t i = 1; i < screeenPoints.size(); i++) { Renderer::Get()->RenderLine(screeenPoints[i], screeenPoints[i - 1], color, thickness); } @@ -17,7 +17,7 @@ class ESP : public Feature bool playerUnitNameEsp[8] = { false,false,false,false,false,false,false,false }; //bool playerBuildingEsp[8] = { false,true,true,true,true,true,true,true }; //bool playerBuildingNameEsp[8] = { false,true,true,true,true,true,true,true }; - float colors[8][3]; + float colors[8][3] = { 0 }; static uint32_t colors_hex[8]; //Callbacks @@ -31,5 +31,5 @@ class ESP : public Feature void DrawBox(Unit* unit, int32_t color, bool drawName); void DrawBox(Vector3 position, Vector2 edgeSize, int32_t color); - void DrawCircle(Unit* unit, int radius, int32_t color, int smoothness , int thickness, bool drawName); + void DrawCircle(Unit* unit, int radius, int32_t color, int smoothness , float thickness, bool drawName); };
\ No newline at end of file @@ -42,7 +42,7 @@ MainScreen* Engine::GetMainScreen() const return reinterpret_cast<MainScreen*>(base + Offsets::mainScreen); } -int Engine::GetTotalPlayers() const +int64_t Engine::GetTotalPlayers() const { World* world = GetWorld(); if (!world) @@ -73,8 +73,8 @@ Vector2 Engine::worldToScreen(Vector3 position) const { MainScreen* mainScreen = GetMainScreen(); static int tileSize = GetWorld()->pMap->GetTileSize(); - int tile_width = tileSize * mainScreen->pGameScreen->pMainView->ScreenPosZ; - int tile_height = tileSize * mainScreen->pGameScreen->pMainView->ScreenPosZ; + float tile_width = tileSize * mainScreen->pGameScreen->pMainView->ScreenPosZ; + float tile_height = tileSize * mainScreen->pGameScreen->pMainView->ScreenPosZ; float xDelta = position.x - mainScreen->pGameScreen->pMainView->ScreenPosX ; float yDelta = position.y - mainScreen->pGameScreen->pMainView->ScreenPosY; @@ -135,7 +135,7 @@ ImVec4 Engine::GetPlayerColorImGUI(int colorIndex) const Player* Engine::GetPlayer(int index) const { - const int totalPlayers = GetTotalPlayers(); + const int64_t totalPlayers = GetTotalPlayers(); if (index > totalPlayers) { return nullptr; @@ -181,7 +181,7 @@ Player* Engine::GetPlayerByName(char* playerName) const { return nullptr; } - int totalPlayers = GetTotalPlayers(); + int64_t totalPlayers = GetTotalPlayers(); for (int i = 0; i <= totalPlayers; i++) { @@ -29,7 +29,7 @@ public: Game* GetGame() const; MainScreen* GetMainScreen() const; - int GetTotalPlayers() const; + int64_t GetTotalPlayers() const; PlayerArray* GetPlayerArray() const; Vector2 worldToScreen(Vector3 position) const; diff --git a/Renderer.cpp b/Renderer.cpp index 67ba879..ea539fa 100644 --- a/Renderer.cpp +++ b/Renderer.cpp @@ -6,7 +6,7 @@ Renderer* Renderer::_instance = NULL; -Renderer::Renderer() +Renderer::Renderer() : inFrame(false) { } @@ -136,7 +136,7 @@ HRESULT __stdcall hookD3D11Present(IDXGISwapChain* pSwapChain, UINT SyncInterval //nrasterizer_desc.CullMode = D3D11_CULL_BACK; //flickering nrasterizer_desc.CullMode = D3D11_CULL_NONE; nrasterizer_desc.FrontCounterClockwise = false; - nrasterizer_desc.DepthBias = 0.0f; + nrasterizer_desc.DepthBias = 0; nrasterizer_desc.SlopeScaledDepthBias = 0.0f; nrasterizer_desc.DepthBiasClamp = 0.0f; nrasterizer_desc.DepthClipEnable = true; @@ -65,7 +65,7 @@ public: static void CopyToClipboard(uint64_t addy) { char szBuffer[2048]; - sprintf(szBuffer, "0x%llx", addy); + sprintf_s(szBuffer, "0x%llx", addy); const char* output = szBuffer; const size_t len = strlen(output) + 1; HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, len); |