rework tc and move tcs out of cg into main screen, rework render pp

now respecting animation timing
This commit is contained in:
2024-02-05 16:05:45 +01:00
parent 139db5b03b
commit cc3f430bab
6 changed files with 193 additions and 54 deletions

View File

@ -2,8 +2,9 @@
#include <chrono>
#include <array>
#include <limits>
void TextureEntry::doAnimation(const int64_t ts_now) {
int64_t TextureEntry::doAnimation(const int64_t ts_now) {
if (frame_duration.size() > 1) { // is animation
do { // why is this loop so ugly
const int64_t duration = getDuration();
@ -11,11 +12,13 @@ void TextureEntry::doAnimation(const int64_t ts_now) {
timestamp_last_rendered += duration;
next();
} else {
break;
// return ts for next frame
return timestamp_last_rendered + duration;
}
} while(true);
} while (true);
} else {
timestamp_last_rendered = ts_now;
return std::numeric_limits<int64_t>::max(); // static image
}
}