aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsegfault <toni@impl.cc>2020-05-23 01:16:23 +0200
committersegfault <toni@impl.cc>2020-05-23 01:16:23 +0200
commit375a94c2709021e04be7edaaf06134e6aa756ed7 (patch)
tree1c4126a7a9c363bbad9b6c4f1fbe19df2b7be666
parent84e7ec39812c0a8bfca954c523b4dbb0608714ea (diff)
fixed several compile warnings
-rw-r--r--Core.cpp4
-rw-r--r--ESP.cpp6
-rw-r--r--ESP.h4
-rw-r--r--Engine.cpp10
-rw-r--r--Engine.h2
-rw-r--r--Renderer.cpp2
-rw-r--r--Source.cpp2
-rw-r--r--Utility.h2
8 files changed, 16 insertions, 16 deletions
diff --git a/Core.cpp b/Core.cpp
index ee5714c..484ccec 100644
--- a/Core.cpp
+++ b/Core.cpp
@@ -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; }
diff --git a/ESP.cpp b/ESP.cpp
index adfb2af..43f57b6 100644
--- a/ESP.cpp
+++ b/ESP.cpp
@@ -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);
}
diff --git a/ESP.h b/ESP.h
index 21699de..a083348 100644
--- a/ESP.h
+++ b/ESP.h
@@ -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
diff --git a/Engine.cpp b/Engine.cpp
index ba11576..1597e11 100644
--- a/Engine.cpp
+++ b/Engine.cpp
@@ -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++)
{
diff --git a/Engine.h b/Engine.h
index ad48249..ca427de 100644
--- a/Engine.h
+++ b/Engine.h
@@ -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)
{
}
diff --git a/Source.cpp b/Source.cpp
index 8d329ad..e4459e4 100644
--- a/Source.cpp
+++ b/Source.cpp
@@ -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;
diff --git a/Utility.h b/Utility.h
index a943bc1..a67938e 100644
--- a/Utility.h
+++ b/Utility.h
@@ -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);