Refactor the story->camera converter to be a part of the camera.
This commit is contained in:
parent
024d0cfae7
commit
088f9e022e
3 changed files with 19 additions and 14 deletions
|
|
@ -17,20 +17,7 @@ namespace storyboard {
|
|||
auto config = settings::get("stories");
|
||||
$story = components::convert<components::Storyboard>(config[story_name]);
|
||||
$audio = sound::get_sound_pair($story.audio).sound;
|
||||
config_camera($camera);
|
||||
}
|
||||
|
||||
void UI::config_camera(cinematic::Camera &camera) {
|
||||
camera.anim.sequences.clear();
|
||||
camera.anim.forms.clear();
|
||||
|
||||
for(auto& [timecode, cell, transform] : $story.beats) {
|
||||
animate2::Sequence seq{.frames={0}, .durations={60}};
|
||||
camera.anim.sequences.try_emplace(timecode, seq);
|
||||
|
||||
animate2::Form form{timecode, transform};
|
||||
camera.anim.forms.try_emplace(timecode, form);
|
||||
}
|
||||
$camera.from_story($story);
|
||||
}
|
||||
|
||||
void UI::init() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue