aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager/ReplayManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/manager/ReplayManager.cpp')
-rw-r--r--src/crepe/manager/ReplayManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/crepe/manager/ReplayManager.cpp b/src/crepe/manager/ReplayManager.cpp
index ab8a5a0..db6acb0 100644
--- a/src/crepe/manager/ReplayManager.cpp
+++ b/src/crepe/manager/ReplayManager.cpp
@@ -38,6 +38,9 @@ void ReplayManager::release(recording_t handle) {
}
void ReplayManager::frame_record() {
+ if (this->state != RECORDING)
+ throw runtime_error("ReplayManager: frame_step called while not playing");
+
ComponentManager & components = this->mediator.component_manager;
Recording & recording = this->recording;
@@ -46,6 +49,9 @@ void ReplayManager::frame_record() {
}
bool ReplayManager::frame_step() {
+ if (this->state != PLAYING)
+ throw runtime_error("ReplayManager: frame_step called while not playing");
+
ComponentManager & components = this->mediator.component_manager;
Recording & recording = this->recording;
@@ -58,6 +64,7 @@ bool ReplayManager::frame_step() {
// end of recording
recording.frame = 0;
this->state = IDLE;
+ this->recording.clear();
return true;
}