mirror of
https://github.com/isledecomp/SIEdit.git
synced 2024-11-23 15:48:03 -05:00
lib: insert empty flic frame where necessary
This commit is contained in:
parent
80820263ac
commit
1bf42f72b0
2 changed files with 18 additions and 1 deletions
|
@ -217,7 +217,12 @@ bool Object::ExtractToFile(FileBase *f) const
|
||||||
// Subsequent chunks are FLIC frames with an additional 20 byte header that needs to be stripped
|
// Subsequent chunks are FLIC frames with an additional 20 byte header that needs to be stripped
|
||||||
const int CUSTOM_HEADER_SZ = 20;
|
const int CUSTOM_HEADER_SZ = 20;
|
||||||
for (size_t i=1; i<data_.size(); i++) {
|
for (size_t i=1; i<data_.size(); i++) {
|
||||||
f->WriteData(data_.at(i).data() + CUSTOM_HEADER_SZ, data_.at(i).size() - CUSTOM_HEADER_SZ);
|
if (data_.at(i).size() == CUSTOM_HEADER_SZ) {
|
||||||
|
static const char *empty_hdr = "\x10\x00\x00\x00\xfa\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||||
|
f->WriteData(empty_hdr, 16);
|
||||||
|
} else {
|
||||||
|
f->WriteData(data_.at(i).data() + CUSTOM_HEADER_SZ, data_.at(i).size() - CUSTOM_HEADER_SZ);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,18 @@ public:
|
||||||
uint8_t reserved3[40]; // Set to zerodesc << "
|
uint8_t reserved3[40]; // Set to zerodesc << "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class FLICFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
uint32_t size; // Size of the chunk, including subchunks
|
||||||
|
uint16_t type; // Chunk type: 0xF1FA
|
||||||
|
uint16_t chunks; // Number of subchunks
|
||||||
|
uint16_t delay; // Delay in milliseconds
|
||||||
|
int16_t reserved; // Always zero
|
||||||
|
uint16_t width; // Frame width override (if non-zero)
|
||||||
|
uint16_t height; // Frame height override (if non-zero)
|
||||||
|
};
|
||||||
|
|
||||||
// Copied from https://wiki.multimedia.cx/index.php/Smacker#Header
|
// Copied from https://wiki.multimedia.cx/index.php/Smacker#Header
|
||||||
class SMK2
|
class SMK2
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue