animation length now is correctly variable

master
Jake 2025-11-02 17:49:18 +08:00
parent 4f376eaa1b
commit 8ad8589cf5
1 changed files with 7 additions and 5 deletions

View File

@ -153,10 +153,12 @@ void setup() {
// PLAY ANIMATION // PLAY ANIMATION
// anim.loadFromFile("/asdf.anim"); anim.loadFromFile("/aa.anim");
// currentAnimation = &anim; currentAnimation = &anim;
// currentAnimation->setActive(true); currentAnimation->setActive(true);
// playMode = PLAY_ONCE; playMode = PLAY_ONCE;
//Serial.println(anim.header.frameCount);
//Serial.println(anim.printCurves());
} }
void SetID(uint8_t oldID, uint8_t newID) { void SetID(uint8_t oldID, uint8_t newID) {
@ -681,7 +683,7 @@ bool parseAnimationPayload(const uint8_t* payload, uint16_t length, Animation& a
} }
animation.header.frameCount = ptr[5] << 8 | ptr[4]; // little-endian ✅ animation.header.frameCount = ptr[5] << 8 | ptr[4]; // little-endian ✅
sendMessage(String(animation.header.frameCount));
animation.header.version = ptr[6]; animation.header.version = ptr[6];
animation.header.frameRate = ptr[7]; animation.header.frameRate = ptr[7];
memcpy(animation.header.reserved, ptr + 8, 8); memcpy(animation.header.reserved, ptr + 8, 8);