

#include "xanimdynamicframes.h"

XAnimDynamicFrames::XAnimDynamicFrames()
    : XAsset() {
}

void XAnimDynamicFrames::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        aStream->read((char*)&mFramesPtr, sizeof(quint32));
        aStream->read((char*)mFrames, 3 * sizeof(quint8));
    }
}

quint32 XAnimDynamicFrames::GetFramesPtr() const {
    return mFramesPtr;
}

void XAnimDynamicFrames::SetFramesPtr(quint32 ptr) {
    mFramesPtr = ptr;
}

const quint8* XAnimDynamicFrames::GetFrames() const {
    return mFrames;
}

void XAnimDynamicFrames::SetFrames(const quint8* frames, size_t count) {
    if (count <= 3) {
        memcpy(mFrames, frames, count * sizeof(quint8));
    }
}

