-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.h
More file actions
76 lines (71 loc) · 2.15 KB
/
global.h
File metadata and controls
76 lines (71 loc) · 2.15 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include <SDL.h>
#include <SDL_ttf.h>
#include <SDL_image.h>
#include <nlohmann/json.hpp>
#include <vector>
#include "texture.h"
#include "rustplus.pb.h"
#include "rustsocket.h"
#include "GUI.h"
#define MAX_FPS 60
#define DEG2RAD(deg) ((deg) * 0.01745329238474369049072265625f)
#define RAD2DEG(x) ((x) * 180.0 / M_PI)
#define PIXEL_SIZE 2
class GlobalVars
{
public:
//Files
nlohmann::json json;
std::string jIP;
std::string jPort;
uint64_t jID;
int32_t jToken;
bool bRunning = true;
bool bFocus = false;
bool connected = false;
std::string connectedServerName = "";
std::string connectedServerFile = "servers\\unconnected";
//SDL
SDL_Window* mainWindow;
SDL_Renderer* mainRenderer;
TTF_Font* fontPermanentMarker;
TTF_Font* fontTahoma;
TTF_Font* fontTahomaBold;
//GAME STUFF
float fWindowWidth = 1280.f, fWindowHeight=720.f;
float fMapZoom = 1.f, fMapX = fWindowWidth/2.f, fMapY = fWindowHeight/2.f;
int lastX = 0, lastY = 0;
std::vector<std::pair<int, int>> vecMyMarkers;
std::vector<rustplus::AppMarker> vecVendings;
std::vector<rustplus::AppMarker_SellOrder> vecOrders;
std::map<std::string, Texture> nametags;
std::map<std::string, Texture> nametagsCam;
rustplus::AppTeamInfo_Member localPlayer;
SDL_Texture* mapTexture;
std::vector<std::string> servers;
//APP STUFF
rustplus::AppMap appMap;
rustplus::AppInfo appInfo;
rustplus::AppMapMarkers appMapMarkers;
rustplus::AppTeamInfo appTeamInfo;
rustplus::AppCameraInfo appCameraInfo;
Events curEvents;
Events lastEvents;
rustplus::AppTeamChat curTeamChat;
rustplus::AppTeamChat lastTeamChat;
//Networking
void* socket;
NStatus NSmapMarkers;
NStatus NSTeamChat;
NStatus NSTeamInfo;
NMessageType msgType;
std::chrono::high_resolution_clock::time_point tLastCamera = std::chrono::high_resolution_clock::now();
std::chrono::high_resolution_clock::time_point tLast = std::chrono::high_resolution_clock::now();
std::chrono::high_resolution_clock::time_point tNow = std::chrono::high_resolution_clock::now();
//Experimental
bool skipRender = false;
std::string input;
std::string activeCamera;
};
extern GlobalVars g;