-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModuleDebug.h
86 lines (70 loc) · 1.53 KB
/
ModuleDebug.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
#ifndef __MODULE_DEBUG_H__
#define __MODULE_DEBUG_H__
#include "Module.h"
#include "Ball.h"
#include "Bumper.h"
#include "Slingshot.h"
#include "Spring.h"
#include "Flipper.h"
#include <chrono>
using namespace std::chrono;
enum class Screen
{
HOME,
TIME,
GRAVITY,
SPRITES,
COEFFICIENTS,
COLLIDERS,
C_BALLRESTITUTION,
C_BUMPERFORCE,
C_SLINGSHOTFORCE,
C_SPRINGFORCE,
C_FLIPPERFORCE,
NONE
};
class ModuleDebug : public Module {
public:
// Constructor
ModuleDebug(Application* app, bool start_enabled = true);
// Destructor
~ModuleDebug();
bool Start() override;
// Called at the middle of the application loop
// Switches the debug mode on/off
update_status Update();
// Called at the end of the application loop
// Draw all functionality (if debug mode is enabled)
update_status PostUpdate();
// Draws all existing colliders with some transparency
void DebugDraw();
public:
microseconds elapsedCycle;
microseconds elapsedFrame;
int targetFPS = 60;
double FPS;
Ball* ball;
Bumper* bumperU;
Bumper* bumperL;
Bumper* bumperR;
Slingshot* slingshotL;
Slingshot* slingshotR;
Spring* spring;
Flipper* flipperL;
Flipper* flipperR;
// Simple debugging flag
bool debug;
private:
Screen currentScreen = Screen::HOME;
bool time = false;
bool gravity = false;
bool sprites = false;
bool coefficients = false;
bool colliders = false;
bool c_ballRestitution = false;
bool c_bumperforce = false;
bool c_slingshotforce = false;
bool c_springforce = false;
bool c_flipperforce = false;
};
#endif // __MODULE_DEBUG_H__