forked from qdsteam/sampmodmobile
-
Notifications
You must be signed in to change notification settings - Fork 7
/
debug.cpp
56 lines (44 loc) · 948 Bytes
/
debug.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "main.h"
#include "game/game.h"
#include "gui/gui.h"
#include "debug.h"
#include "util/armhook.h"
extern CGame *pGame;
CDebug::CDebug()
{
m_dwLastTick = GetTickCount();
}
CDebug::~CDebug()
{
}
uintptr_t (*TextureDatabaseRuntime_GetDatabase)(char *dbname);
uintptr_t TextureDatabaseRuntime_GetDatabase_hook(char *dbname)
{
Log("TextureDatabaseRuntime_GetDatabase: %s", dbname);
return TextureDatabaseRuntime_GetDatabase(dbname);
}
void CDebug::AddMessage(char* msg)
{
std::string str(msg);
m_Messages.push_back(str);
}
void CDebug::Render()
{
ImGui::Begin("Debug", nullptr, ImGuiWindowFlags_NoSavedSettings);
for(auto str : m_Messages)
{
ImGui::Text("%s", str.c_str());
}
ImGui::End();
}
void CDebug::Process()
{
}
void CDebug::SpawnLocalPlayer()
{
Log("CDebug: SpawnLocalPlayer");
CCamera *pGameCamera = pGame->GetCamera();
pGameCamera->Restore();
pGameCamera->SetBehindPlayer();
pGame->SetWorldTime(12, 0);
}