Commit b987a84 1 parent 0d39709 commit b987a84 Copy full SHA for b987a84
File tree 5 files changed +22
-13
lines changed
5 files changed +22
-13
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ namespace FileFinder {
50
50
* Type of the project. Used to differentiate between supported games (2kX or EasyRPG)
51
51
* and known but unsupported (i.e. newer RPG Makers).
52
52
*/
53
- enum ProjectType {
53
+ enum class ProjectType {
54
54
Unknown,
55
55
// 2kX or EasyRPG
56
56
Supported,
@@ -62,7 +62,8 @@ namespace FileFinder {
62
62
WolfRpgEditor,
63
63
Encrypted2k3Maniacs,
64
64
RpgMaker95,
65
- SimRpgMaker95
65
+ SimRpgMaker95,
66
+ LAST
66
67
};
67
68
68
69
constexpr auto kProjectType = lcf::makeEnumTags<ProjectType>(
@@ -77,6 +78,7 @@ namespace FileFinder {
77
78
" RPG Maker 95" ,
78
79
" Sim RPG Maker 95"
79
80
);
81
+ static_assert (kProjectType .size() == static_cast<size_t>(ProjectType::LAST));
80
82
81
83
/* *
82
84
* Helper struct combining the project's directory and its type (used by Game Browser)
Original file line number Diff line number Diff line change @@ -33,14 +33,16 @@ namespace Game_Interpreter_Shared {
33
33
None = 0 ,
34
34
MapEvent,
35
35
CommonEvent,
36
- BattleEvent
36
+ BattleEvent,
37
+ LAST
37
38
};
38
39
static constexpr auto kEventType = lcf::makeEnumTags<EventType>(
39
40
" None" ,
40
41
" MapEvent" ,
41
42
" CommonEvent" ,
42
43
" BattleEvent"
43
44
);
45
+ static_assert (kEventType .size() == static_cast <size_t >(EventType::LAST));
44
46
45
47
enum class ExecutionType {
46
48
/*
@@ -64,7 +66,8 @@ namespace Game_Interpreter_Shared {
64
66
/* Event code was dynamically evaluated. (ManiacCallCommand) */
65
67
Eval,
66
68
DebugCall,
67
- ManiacHook
69
+ ManiacHook,
70
+ LAST
68
71
};
69
72
static constexpr auto kExecutionType = lcf::makeEnumTags<ExecutionType>(
70
73
" Action" ,
@@ -79,8 +82,10 @@ namespace Game_Interpreter_Shared {
79
82
" ---" ,
80
83
" DeathHandler" ,
81
84
" Eval" ,
82
- " DebugCall"
85
+ " DebugCall" ,
86
+ " ManiacHook"
83
87
);
88
+ static_assert (kExecutionType .size() == static_cast <size_t >(ExecutionType::LAST));
84
89
85
90
/*
86
91
* Indicates how the target of an interpreter operation (lvalue) should be evaluated.
Original file line number Diff line number Diff line change @@ -130,8 +130,8 @@ namespace Input {
130
130
" FAST_FORWARD_A" ,
131
131
" FAST_FORWARD_B" ,
132
132
" TOGGLE_FULLSCREEN" ,
133
- " TOGGLE_ZOOM" ,
134
- " BUTTON_COUNT" );
133
+ " TOGGLE_ZOOM" );
134
+ static_assert ( kInputButtonNames .size() == static_cast < size_t >( BUTTON_COUNT) );
135
135
136
136
constexpr auto kInputButtonHelp = lcf::makeEnumTags<InputButton>(
137
137
" Up Direction" ,
@@ -175,8 +175,8 @@ namespace Input {
175
175
" Run the game at x{} speed" ,
176
176
" Run the game at x{} speed" ,
177
177
" Toggle Fullscreen mode" ,
178
- " Toggle Window Zoom level" ,
179
- " Total Button Count " );
178
+ " Toggle Window Zoom level" );
179
+ static_assert ( kInputButtonHelp .size() == static_cast < size_t >(BUTTON_COUNT) );
180
180
181
181
/* *
182
182
* Return true if the given button is a system button.
@@ -241,8 +241,8 @@ namespace Input {
241
241
" RIGHT" ,
242
242
" UPLEFT" ,
243
243
" UP" ,
244
- " UPRIGHT" ,
245
- " NUM_DIRECTIONS" );
244
+ " UPRIGHT" );
245
+ static_assert ( kInputDirectionNames .size() == static_cast < size_t >( NUM_DIRECTIONS) );
246
246
};
247
247
248
248
using ButtonMappingArray = FlatUniqueMultiMap<InputButton,Keys::InputKey>;
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ namespace RTP {
50
50
RPG2003_VladRussian,
51
51
RPG2003_RpgUniverseSpanishPortuguese,
52
52
RPG2003_Korean,
53
- RPG2003_OfficialTraditionalChinese
53
+ RPG2003_OfficialTraditionalChinese,
54
+ LAST
54
55
};
55
56
56
57
constexpr auto kTypes = lcf::makeEnumTags<Type>(
@@ -66,6 +67,7 @@ namespace RTP {
66
67
" Korean Translation" ,
67
68
" Official Traditional Chinese"
68
69
);
70
+ static_assert (kTypes .size() == static_cast <size_t >(Type::LAST));
69
71
70
72
struct RtpHitInfo {
71
73
RTP::Type type;
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ void Window_GameList::DrawItem(int index) {
118
118
119
119
#ifndef USE_CUSTOM_FILEBUF
120
120
auto color = Font::ColorDefault;
121
- if (ge.type == FileFinder::Unknown) {
121
+ if (ge.type == FileFinder::ProjectType:: Unknown) {
122
122
color = Font::ColorHeal;
123
123
} else if (ge.type > FileFinder::ProjectType::Supported) {
124
124
color = Font::ColorKnockout;
You can’t perform that action at this time.
0 commit comments