- Implemented palette loading from binary files in `palette.cpp`. - Added runtime utilities for reading text and JSON files in `runtime.cpp`. - Created shape archive handling in `shape_archive.cpp`, including frame parsing and pixel decoding. - Introduced type flag loading functionality in `type_flags.cpp`. - Developed tests for combat tactics, entity dispatch entries, file system operations, fixed maps, flex archives, glob archives, map rendering, palette loading, shape archives, and type flags. - Added a Python script for importing Ghidra-exported function slices with reporting capabilities.
35 lines
807 B
C++
35 lines
807 B
C++
#pragma once
|
|
|
|
#include <filesystem>
|
|
#include <optional>
|
|
#include <vector>
|
|
|
|
#include "remorse/compat.h"
|
|
#include "remorse/flex_archive.h"
|
|
|
|
namespace remorse {
|
|
|
|
struct ShapeFrame {
|
|
bool compressed = false;
|
|
u32 width = 0;
|
|
u32 height = 0;
|
|
s32 xOffset = 0;
|
|
s32 yOffset = 0;
|
|
std::vector<u32> lineOffsets;
|
|
std::vector<u8> rleData;
|
|
};
|
|
|
|
struct DecodedShapeFrame {
|
|
ShapeFrame frame;
|
|
std::vector<s16> pixels;
|
|
};
|
|
|
|
struct ShapeArchive {
|
|
FlexArchive archive;
|
|
};
|
|
|
|
std::optional<ShapeArchive> loadShapeArchive(const std::filesystem::path& path);
|
|
std::optional<std::vector<ShapeFrame>> loadShapeFrames(const ShapeArchive& archive, u32 shapeIndex);
|
|
std::optional<DecodedShapeFrame> decodeShapeFrame(const ShapeArchive& archive, u32 shapeIndex, u32 frameIndex);
|
|
|
|
} // namespace remorse
|