-
Notifications
You must be signed in to change notification settings - Fork 1
/
enums.h
223 lines (202 loc) · 4.87 KB
/
enums.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#pragma once
#include <SDL.h>
#include <vector>
#include <bass.h>
#include <functional>
#include <list>
namespace enums
{
enum gameStates {
STARTING_SCREEN,
MUSIC_SELECTION,
MAIN_GAME,
TOTAL_STATES
};
enum motions {
LINEAR_SLIDE,
HALF_SINE_SLIDE,
FULL_SINE_SLIDE,
//https:// www.wolframalpha.com/input/?i=plot+y+%3D+(sin(x-pi%2F2)+%2B+1)
REVERSE_HALF_SINE_SLIDE
};
enum noteType {
SINGLE_HIT,
SINGLE_HOLD
};
enum noteHit {
PERFECT,
OKAY,
BREAK,
NO_HIT
};
enum beatMapDifficulty {
EASY,
NORMAL,
HARD,
EXTREME,
TOTAL_DIFFICULTIES
};
//Used within MusicSelection exclusively at the moment
enum gameKeys {
FOUR_KEYS,
SIX_KEYS,
TOTAL_KEYS
};
}
struct Instruction {
int nextState;
bool quit = false;
std::string beatMapSongToLoad;
int gameKeys = 4;
std::string songDifficulty;
std::string beatMapRootFolder;
std::string beatMapBGtoLoad;
};
struct RGB {
int r;
int g;
int b;
};
struct InitVariables {
int screen_height;
int screen_width;
int screen_fps;
int startup_screen_delay;
float musicSelection_albumArt_x;
//Also used as anchor for difficulty buttons
float musicSelection_albumArt_y;
//With respect to screen width
float musicSelection_albumArt_width_and_height;
//With respect to album art height;
float musicSelection_albumArt_errorText_height;
float musicSelection_albumArt_shadow;
float musicSelection_bar_minimized_x;
float musicSelection_bar_maximized_x;
double musicSelection_bar_transition_time;
float musicSelection_panel_width;
float musicSelection_panel_separation;
std::string musicSelection_font;
int musicSelection_panel_thickness;
float musicSelection_panel_text_right_padding;
int musicSelection_bar_thickness;
float musicSelection_startGame_button_x;
float musicSelection_startGame_button_y;
float musicSelection_startGame_button_width;
float musicSelection_startGame_button_height;
float musicSelection_gameKeys_button_x;
float musicSelection_gameKeys_button_y;
float musicSelection_gameKeys_button_height;
float musicSelection_gameKeys_button_width;
float musicSelection_gameKeys_button_separation;
float musicSelection_difficulty_button_x;
float musicSelection_difficulty_button_width;
float musicSelection_difficulty_button_height;
float musicSelection_difficulty_button_shadow;
RGB musicSelection_color_easy;
RGB musicSelection_color_normal;
RGB musicSelection_color_hard;
RGB musicSelection_color_extreme;
int maingame_startup_fadein_time;
int mainGame_bg_alpha;
int mainGame_ui_transition_time;
int timeBar_thickness;
float timeBar_position;
std::string combo_font;
std::string note_hit_font;
double combo_and_note_hit_update_buffer;
float combo_and_note_hit_separator;
double combo_and_note_hit_animation_time;
float combo_max_height;
float note_hit_max_height;
//The amount to raise the combo square by so that it isn't too far from the notehit indicator
float combo_offset_height;
int keySeparation_thickness;
Uint8 path_highlight_alpha;
float note_radius_ratio;
double note_buffer_time;
std::vector<int> keyBinds;
double okay_hit_buffer_time;
double perfect_hit_buffer_time;
};
struct StartEnd {
std::vector<double> start;
std::vector<double> end;
};
struct ColorMotion {
enums::motions motion;
double start_position;
double end_position;
RGB startColor;
RGB endColor;
};
struct PathMotion {
enums::motions motion;
double start_position;
double end_position;
float start_x;
float end_x;
float amplitude;
//Don't forget to update parsing function in BeatMap.cpp when you add more variables here!
};
struct BeatNote {
enums::noteType note_type;
double start_position;
double end_position;
};
//To be used exclusively by BeatMap to keep track of key presses
struct KeyStatus {
int key;
bool already_pressed;
int linked_path;
};
//To be used exclusively for MainGame to keep track of combo/notehit blits
struct MostRecentNoteHit {
bool comboHasBeenUpdated;
enums::noteHit hit;
double comboUpdateTime;
int combo;
};
struct TextureWithVariables {
SDL_Texture *texture;
int height;
int width;
};
struct BeatMapKeyAndDifficulty {
int numberOfKeys;
enums::beatMapDifficulty difficulty;
};
//For MusicSelection
struct MusicFileSystem {
std::string songName;
std::string bgFileName;
std::string musicFileName;
std::string albumArtFileName;
double musicStartPosition;
double musicEndPosition;
std::string beatMapRootFolder;
std::vector<BeatMapKeyAndDifficulty> difficultyAndKeys;
};
struct MusicSelectionPanel {
TextureWithVariables songTitleTexture;
int musicIndex;
int centerY;
//Used when dragging panels
int previousCenterY;
int width;
};
struct ListOfPanels {
std::list<MusicSelectionPanel> panels;
//Relative to beatMapsWithKeys
int front;
//Relative to beatMapsWithKeys
int back;
};
struct MusicSelectionClickableButton {
int x;
int y;
int width;
int height;
std::string text;
TextureWithVariables backgroundTexture;
TextureWithVariables fontTexture;
};