start recorder animation in game constructor after config fully loads
This commit is contained in:
parent
355ab4d8c4
commit
e3941707e3
|
@ -36,10 +36,11 @@ Game::Game()
|
|||
SDL_LogSetPriority(sb::Log::DEFAULT_CATEGORY, SDL_LOG_PRIORITY_INFO);
|
||||
}
|
||||
|
||||
/* If recording is disabled by configuration, deactive it. */
|
||||
if (!configuration()["recording"]["enabled"])
|
||||
/* If recording is enabled by configuration, activate it. */
|
||||
if (configuration()["recording"]["enabled"])
|
||||
{
|
||||
deactivate();
|
||||
recorder.animation.play();
|
||||
activate();
|
||||
}
|
||||
|
||||
/* Log the current working directory as seen by std::filesystem */
|
||||
|
|
|
@ -3,13 +3,10 @@
|
|||
#include "extension.hpp"
|
||||
#include "Recorder.hpp"
|
||||
|
||||
/* Create a Recorder instance. Subscribe to command input and set audio callback.
|
||||
* Only will be active if enabled by the configuration, in which case frames will
|
||||
* automatically begin to be stashed */
|
||||
/* Create a Recorder instance. Subscribe to command input and set audio callback. */
|
||||
Recorder::Recorder(Node* parent) : Node(parent)
|
||||
{
|
||||
get_delegate().subscribe(&Recorder::respond, this);
|
||||
animation.play();
|
||||
Mix_SetPostMix(Recorder::process_audio, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ private:
|
|||
std::list<Stash> in_game_stashes;
|
||||
std::list<Stash> video_stashes;
|
||||
fs::path current_video_directory, current_audio_path;
|
||||
Animation animation = Animation(&Recorder::add_frame, this);
|
||||
bool is_recording = false, writing_recording = false, writing_most_recent = false;
|
||||
std::ofstream audio_file;
|
||||
|
||||
|
@ -59,6 +58,8 @@ private:
|
|||
|
||||
public:
|
||||
|
||||
Animation animation = Animation(&Recorder::add_frame, this);
|
||||
|
||||
Recorder(Node*);
|
||||
void respond(SDL_Event&);
|
||||
void capture_screen();
|
||||
|
|
Loading…
Reference in New Issue