Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added get and set of threshold

  • Loading branch information...
commit 6747b856d839a133ff2ccb8cf968c7140bfa2e6b 1 parent 26e3c04
@elliotwoods authored
Showing with 27 additions and 8 deletions.
  1. +23 −8 src/TweenTraceBuffer.cpp
  2. +4 −0 src/TweenTraceBuffer.h
View
31 src/TweenTraceBuffer.cpp
@@ -197,6 +197,17 @@ void TweenTraceBuffer::clear() {
}
//----------
+void TweenTraceBuffer::flush() {
+ current.start = inputBuffer.getStart();
+ current.end = inputBuffer.getEndMinusOne();
+
+ this->keyframes.insert(current);
+ point endOfLast = this->inputBuffer.getEndMinusOne();
+ this->clearInputBuffer();
+ this->add(endOfLast);
+}
+
+//----------
void TweenTraceBuffer::draw() const {
set<KeyFrame>::const_iterator it;
for (it = this->keyframes.begin(); it != this->keyframes.end(); it++) {
@@ -206,6 +217,17 @@ void TweenTraceBuffer::draw() const {
}
//----------
+float TweenTraceBuffer::getThreshold() const {
+ return this->threshold;
+}
+
+//----------
+void TweenTraceBuffer::setThreshold(float threshold) {
+ this->threshold = threshold;
+}
+
+
+//----------
void TweenTraceBuffer::clearInputBuffer() {
current.function = this->easingFunctions->find("Linear [in]");
this->inputBuffer.clear();
@@ -225,14 +247,7 @@ bool TweenTraceBuffer::traceInputBuffer() {
if (!this->searchFunc()) {
// shave off last value
// keyframe's function fits remaining points
-
- current.start = inputBuffer.getStart();
- current.end = inputBuffer.getEndMinusOne();
-
- this->keyframes.insert(current);
- point endOfLast = this->inputBuffer.getEndMinusOne();
- this->clearInputBuffer();
- this->add(endOfLast);
+ this->flush();
}
}
View
4 src/TweenTraceBuffer.h
@@ -58,9 +58,13 @@ class TweenTraceBuffer {
void add(pair<float, float>);
void clear();
+ void flush(); ///<flush current input buffer into keyframe
void draw() const;
+ float getThreshold() const;
+ void setThreshold(float);
+
protected:
void clearInputBuffer();
bool traceInputBuffer();
Please sign in to comment.
Something went wrong with that request. Please try again.