-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.h
131 lines (106 loc) · 2.41 KB
/
structs.h
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#pragma once
#include <vector>
#include "constants.h"
enum SerialStatus
{
Status_Idle,
Status_WaitingForResult,
Status_AudioReadying,
Status_WaitingForPing,
};
enum InputMode
{
InputMode_Normal,
InputMode_ModdedMouse,
InputMode_Internal,
};
inline const char* GetInputModeName(InputMode im) {
switch (im)
{
case InputMode_Normal:
return "Normal";
break;
case InputMode_ModdedMouse:
return "Modded Mouse";
break;
case InputMode_Internal:
return "Internal";
break;
default:
break;
}
}
struct LatencyReading
{
unsigned int timeExternal; // in micros
unsigned int timeInternal; // in micros
unsigned int timePing; // in micros
unsigned int index;
};
struct LatencyParameters
{
float average;
unsigned int highest;
unsigned int lowest;
};
struct LatencyStats
{
LatencyParameters externalLatency;
LatencyParameters internalLatency;
LatencyParameters inputLatency;
};
struct LatencyData
{
std::vector<LatencyReading> measurements;
char note[1000]{ 0 };
};
#define TAB_NAME_MAX_SIZE 64
struct TabInfo
{
LatencyData latencyData {};
LatencyStats latencyStats {};
bool isSaved = true;
char savePath[260]{ 0 };
char savePathPack[260]{ 0 };
int saved_ver = json_version;
char name[TAB_NAME_MAX_SIZE]{ "Tab " };
};
struct StyleData
{
float mainColor[4];
float mainColorBrightness;
float fontColor[4];
float fontColorBrightness;
float internalPlotColor[4]{ 0.1f, 0.8f, 0.2f, 1.f };
float externalPlotColor[4]{ 0.3f, 0.3f, 0.9f, 1.f };
float inputPlotColor[4]{ 0.8f, 0.1f, 0.2f, 1.f };
int selectedFont;
float fontSize;
};
struct PerformanceData
{
bool lockGuiFps = true;
int guiLockedFps = 60;
bool showPlots;
//float maxSerialReadFrequency = 600;
unsigned int VSync;
};
struct MiscData
{
bool localUserData = false;
};
struct UserData
{
StyleData style;
PerformanceData performance;
MiscData misc;
};
enum JSON_HANDLE_INFO {
JSON_HANDLE_INFO_SUCCESS = 0,
JSON_HANDLE_INFO_ERROR = 1,
JSON_HANDLE_INFO_BAD_VERSION = (1 << 1),
};
inline JSON_HANDLE_INFO operator |(JSON_HANDLE_INFO a, JSON_HANDLE_INFO b) { return static_cast<JSON_HANDLE_INFO>(a + b); }
inline JSON_HANDLE_INFO operator &(JSON_HANDLE_INFO a, JSON_HANDLE_INFO b) { return static_cast<JSON_HANDLE_INFO>(a * b); }
inline JSON_HANDLE_INFO& operator |=(JSON_HANDLE_INFO& a, JSON_HANDLE_INFO b) { return a = a | b; }
inline JSON_HANDLE_INFO& operator &=(JSON_HANDLE_INFO& a, JSON_HANDLE_INFO b) { return a = a & b; }