Moved shape shorthand constants into their own file

This commit is contained in:
Daniel Wolf 2016-11-26 21:03:30 +01:00
parent 4614939183
commit f7d4a70d3d
4 changed files with 16 additions and 20 deletions

View File

@ -222,6 +222,7 @@ add_library(rhubarb-animation
src/animation/animationRules.h
src/animation/mouthAnimation.cpp
src/animation/mouthAnimation.h
src/animation/shapeShorthands.h
src/animation/Viseme.cpp
src/animation/Viseme.h
)

View File

@ -1,20 +1,11 @@
#include "animationRules.h"
#include <boost/algorithm/clamp.hpp>
#include "shapeShorthands.h"
using std::chrono::duration_cast;
using boost::algorithm::clamp;
using boost::optional;
constexpr Shape A = Shape::A;
constexpr Shape B = Shape::B;
constexpr Shape C = Shape::C;
constexpr Shape D = Shape::D;
constexpr Shape E = Shape::E;
constexpr Shape F = Shape::F;
constexpr Shape G = Shape::G;
constexpr Shape H = Shape::H;
constexpr Shape X = Shape::X;
ShapeRule::ShapeRule(const ShapeSet& regularShapes, const ShapeSet& alternativeShapes) :
regularShapes(regularShapes),
alternativeShapes(alternativeShapes)

View File

@ -5,6 +5,7 @@
#include <boost/algorithm/clamp.hpp>
#include "Viseme.h"
#include "timedLogging.h"
#include "shapeShorthands.h"
using std::map;
using std::unordered_set;
@ -16,16 +17,6 @@ using boost::algorithm::clamp;
using std::pair;
using std::tuple;
constexpr Shape A = Shape::A;
constexpr Shape B = Shape::B;
constexpr Shape C = Shape::C;
constexpr Shape D = Shape::D;
constexpr Shape E = Shape::E;
constexpr Shape F = Shape::F;
constexpr Shape G = Shape::G;
constexpr Shape H = Shape::H;
constexpr Shape X = Shape::X;
Timeline<Viseme> animate(optional<Phone> phone, centiseconds duration, centiseconds previousPhoneDuration) {
auto single = [&](Viseme viseme) {
return Timeline<Viseme>{

View File

@ -0,0 +1,13 @@
#pragma once
#include "Shape.h"
constexpr Shape A = Shape::A;
constexpr Shape B = Shape::B;
constexpr Shape C = Shape::C;
constexpr Shape D = Shape::D;
constexpr Shape E = Shape::E;
constexpr Shape F = Shape::F;
constexpr Shape G = Shape::G;
constexpr Shape H = Shape::H;
constexpr Shape X = Shape::X;