Crusader_Decomp/rebuild/remorse/include/remorse/shape_archive.h
Maddo a76b071049 Enhance animation and control tests; improve rendering and shape loading validation
- Added tests for player animations in animation_archive_tests to ensure all animations are loaded correctly.
- Updated entity_dispatch_entry_tests to validate animation direction updates and added tests for sixteen-direction animations.
- Expanded isometric_controls_tests with comprehensive key event handling and action requests for various controller states.
- Improved map_renderer_tests by adding viewport rendering tests to compare unbounded and bounded views.
- Enhanced shape_archive_tests to validate shape frame loading and decoding consistency.
2026-10-07 00:18:08 +02:00

36 lines
883 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 ShapeFrame& frame);
std::optional<DecodedShapeFrame> decodeShapeFrame(const ShapeArchive& archive, u32 shapeIndex, u32 frameIndex);
} // namespace remorse