@@ -79,9 +79,16 @@ namespace Movie
79
79
using namespace WiimoteCommon ;
80
80
using namespace WiimoteEmu ;
81
81
82
+ enum class PlayMode
83
+ {
84
+ None = 0 ,
85
+ Recording,
86
+ Playing,
87
+ };
88
+
82
89
static bool s_bReadOnly = true ;
83
90
static u32 s_rerecords = 0 ;
84
- static PlayMode s_playMode = MODE_NONE ;
91
+ static PlayMode s_playMode = PlayMode::None ;
85
92
86
93
static std::array<ControllerType, 4 > s_controllers{};
87
94
static std::array<bool , 4 > s_wiimotes{};
@@ -308,7 +315,7 @@ void SetReadOnly(bool bEnabled)
308
315
309
316
bool IsRecordingInput ()
310
317
{
311
- return (s_playMode == MODE_RECORDING );
318
+ return (s_playMode == PlayMode::Recording );
312
319
}
313
320
314
321
bool IsRecordingInputFromSaveState ()
@@ -328,12 +335,12 @@ bool IsJustStartingPlayingInputFromSaveState()
328
335
329
336
bool IsPlayingInput ()
330
337
{
331
- return (s_playMode == MODE_PLAYING );
338
+ return (s_playMode == PlayMode::Playing );
332
339
}
333
340
334
341
bool IsMovieActive ()
335
342
{
336
- return s_playMode != MODE_NONE ;
343
+ return s_playMode != PlayMode::None ;
337
344
}
338
345
339
346
bool IsReadOnly ()
@@ -528,7 +535,7 @@ void ChangeWiiPads(bool instantly)
528
535
bool BeginRecordingInput (const ControllerTypeArray& controllers,
529
536
const WiimoteEnabledArray& wiimotes)
530
537
{
531
- if (s_playMode != MODE_NONE ||
538
+ if (s_playMode != PlayMode::None ||
532
539
(controllers == ControllerTypeArray{} && wiimotes == WiimoteEnabledArray{}))
533
540
return false ;
534
541
@@ -585,7 +592,7 @@ bool BeginRecordingInput(const ControllerTypeArray& controllers,
585
592
Wiimote::ResetAllWiimotes ();
586
593
}
587
594
588
- s_playMode = MODE_RECORDING ;
595
+ s_playMode = PlayMode::Recording ;
589
596
s_author = Config::Get (Config::MAIN_MOVIE_MOVIE_AUTHOR);
590
597
s_temp_input.clear ();
591
598
@@ -937,7 +944,7 @@ void ReadHeader()
937
944
// NOTE: Host Thread
938
945
bool PlayInput (const std::string& movie_path, std::optional<std::string>* savestate_path)
939
946
{
940
- if (s_playMode != MODE_NONE )
947
+ if (s_playMode != PlayMode::None )
941
948
return false ;
942
949
943
950
File::IOFile recording_file (movie_path, " rb" );
@@ -959,7 +966,7 @@ bool PlayInput(const std::string& movie_path, std::optional<std::string>* savest
959
966
s_currentLagCount = 0 ;
960
967
s_currentInputCount = 0 ;
961
968
962
- s_playMode = MODE_PLAYING ;
969
+ s_playMode = PlayMode::Playing ;
963
970
964
971
// Wiimotes cause desync issues if they're not reset before launching the game
965
972
Wiimote::ResetAllWiimotes ();
@@ -1139,18 +1146,18 @@ void LoadInput(const std::string& movie_path)
1139
1146
{
1140
1147
if (s_bReadOnly)
1141
1148
{
1142
- if (s_playMode != MODE_PLAYING )
1149
+ if (s_playMode != PlayMode::Playing )
1143
1150
{
1144
- s_playMode = MODE_PLAYING ;
1151
+ s_playMode = PlayMode::Playing ;
1145
1152
Core::UpdateWantDeterminism ();
1146
1153
Core::DisplayMessage (" Switched to playback" , 2000 );
1147
1154
}
1148
1155
}
1149
1156
else
1150
1157
{
1151
- if (s_playMode != MODE_RECORDING )
1158
+ if (s_playMode != PlayMode::Recording )
1152
1159
{
1153
- s_playMode = MODE_RECORDING ;
1160
+ s_playMode = PlayMode::Recording ;
1154
1161
Core::UpdateWantDeterminism ();
1155
1162
Core::DisplayMessage (" Switched to recording" , 2000 );
1156
1163
}
@@ -1317,18 +1324,18 @@ void EndPlayInput(bool cont)
1317
1324
// If !IsMovieActive(), changing s_playMode requires calling UpdateWantDeterminism
1318
1325
ASSERT (IsMovieActive ());
1319
1326
1320
- s_playMode = MODE_RECORDING ;
1327
+ s_playMode = PlayMode::Recording ;
1321
1328
Core::DisplayMessage (" Reached movie end. Resuming recording." , 2000 );
1322
1329
}
1323
- else if (s_playMode != MODE_NONE )
1330
+ else if (s_playMode != PlayMode::None )
1324
1331
{
1325
1332
// We can be called by EmuThread during boot (CPU::State::PowerDown)
1326
1333
bool was_running = Core::IsRunningAndStarted () && !CPU::IsStepping ();
1327
1334
if (was_running && Config::Get (Config::MAIN_MOVIE_PAUSE_MOVIE))
1328
1335
CPU::Break ();
1329
1336
s_rerecords = 0 ;
1330
1337
s_currentByte = 0 ;
1331
- s_playMode = MODE_NONE ;
1338
+ s_playMode = PlayMode::None ;
1332
1339
Core::DisplayMessage (" Movie End." , 2000 );
1333
1340
s_bRecordingFromSaveState = false ;
1334
1341
// we don't clear these things because otherwise we can't resume playback if we load a movie
0 commit comments