![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Represents a compiled animations file. More...
#include <DaFile.h>
Classes | |
struct | Animation |
struct | Frame |
Information for a frame. More... | |
struct | TriValue |
A three-coordinate value. More... | |
Public Member Functions | |
DaFile (File file) | |
Constructor. More... | |
std::vector< std::string > | GenerateAFiles (std::string model_id, std::string path) |
Generates .a files from the da file. More... | |
Private Member Functions | |
void | Read () |
Reads the Da file and extracts all the data. More... | |
Animation | ReadAnimation () |
Reads an animation from the *da file. More... | |
Frame | ReadFirstFrame (u32 bones, u8 key) |
Reads the first, uncompressed frame. More... | |
Frame | ReadFrame (u32 bones, u8 key, Frame prev) |
Reads a compressed frame. More... | |
int | GetDynamicOffsetFromStream () |
Retrieves a positional offset value of dynamic size from the file. More... | |
int | GetBitsU (int bits) |
Read an arbitrary number of bits from the da contents as unsigned. More... | |
int | GetBitsS (int bits) |
Read an arbitrary number of bits from the da contents as signed. More... | |
int | GetCompressedDeltaFromStream (int lowered_precision_bits) |
Decodes a delta rotation read from the stream. More... | |
Static Private Member Functions | |
static int | ExtendSignInteger (int val, int len) |
Extends the sign for an integer value for a specified bit length. More... | |
static int | GetSignExtendedShort (int val, int len) |
Extends the sign for a short value for a specified bit length. More... | |
Private Attributes | |
File | da_file_ |
The da file. More... | |
u8 * | da_bytes_ |
Contents of the da file as a byte array. More... | |
std::vector< Animation > | animations_ |
List of animations. More... | |
u32 | bit_offset_ |
Number of bits already read from the da file. More... | |
Static Private Attributes | |
static const float | OFFSET_SCALE = 0.0070312473867f |
Scale for bone offsets. More... | |
Represents a compiled animations file.
Da files are bundled into battle.lgp. They contain information about a skeleton animation. They are heavily compressed, and involve a lot of bit reading to decompile.
DaFile::DaFile | ( | File | file | ) |
Constructor.
Reads the file.
[in,out] | file | The file to read from. The file contents will not be altered, but it's offset will be changed while reading it. |
|
staticprivate |
Extends the sign for an integer value for a specified bit length.
[in] | val | The value to extend. |
[in] | len | Number of bytes to extend the value to. |
std::vector< std::string > DaFile::GenerateAFiles | ( | std::string | model_id, |
std::string | path | ||
) |
Generates .a files from the da file.
A file will be generated for each animation in the da file. See {
[in] | model_id | ID of the model the animation belongs to, usually a two letter code. Used to generate the file name. |
[in] | path | Path to the directory where the files will be saved. |
|
private |
Read an arbitrary number of bits from the da contents as signed.
Bits will be read from {
[in] | bits | Number of bits. |
|
private |
Read an arbitrary number of bits from the da contents as unsigned.
Bits will be read from {
[in] | bits | Number of bits. |
|
private |
Decodes a delta rotation read from the stream.
Requires {
lowered_precision_bits | How many bits to sift the read value. The animation key. |
|
private |
Retrieves a positional offset value of dynamic size from the file.
Requires {
|
staticprivate |
Extends the sign for a short value for a specified bit length.
[in] | val | The value to extend. |
[in] | len | Number of bytes to extend the value to. |
|
private |
Reads the Da file and extracts all the data.
|
private |
Reads an animation from the *da file.
Requires {
If the read animation is invalid (i.e. with a size less than 11 bytes), the {
|
private |
Reads the first, uncompressed frame.
Requires {
[in] | bones | The number of bones involved in the animation. |
[in] | key | Key for decoding the animation (fifth byte in the animation second header). |
|
private |
Reads a compressed frame.
Requires {
[in] | bones | The number of bones involved in the animation. |
[in] | key | Key for decoding the animation (fifth byte in the animation second header). |
[in] | prev | Previous frame. |
|
private |
List of animations.
|
private |
Number of bits already read from the da file.
|
private |
Contents of the da file as a byte array.
|
private |
The da file.
|
staticprivate |
Scale for bone offsets.