Fixed some bugs with the new Keyframe system, and now it generates the correct values.

This commit is contained in:
Jonathan Thomas
2012-10-19 21:50:50 -05:00
parent f291700701
commit 19612f63bd
3 changed files with 10 additions and 13 deletions

View File

@@ -257,10 +257,9 @@ void Keyframe::PrintPoints() {
if (needs_update)
Process();
int x = 0;
for (vector<Point>::iterator it = Points.begin(); it != Points.end(); it++) {
cout << it->co.X << "\t" << it->co.Y << endl;
x++;
Point p = *it;
cout << p.co.X << "\t" << p.co.Y << endl;
}
}
@@ -271,9 +270,9 @@ void Keyframe::PrintValues() {
cout << " PRINT ALL VALUES " << endl;
for (int x = 0; x < Values.size(); x++) {
Coordinate c = Values[x];
cout << c.X << "\t" << int(round(c.Y)) << "\t" << c.increasing << "\t" << c.repeated.num << "\t" << c.repeated.den << endl;
for (vector<Coordinate>::iterator it = Values.begin() + 1; it != Values.end(); it++) {
Coordinate c = *it;
cout << int(round(c.X)) << "\t" << int(round(c.Y)) << "\t" << c.increasing << "\t" << c.repeated.num << "\t" << c.repeated.den << endl;
}
}
@@ -318,7 +317,7 @@ void Keyframe::Process() {
bool increasing = true;
int repeat_count = 1;
int last_value = 0;
for (vector<Coordinate>::iterator it = Values.begin(); it != Values.end(); it++) {
for (vector<Coordinate>::iterator it = Values.begin() + 1; it != Values.end(); it++) {
int current_value = int(round((*it).Y));
int next_value = int(round((*it).Y));
int prev_value = int(round((*it).Y));