Initial Vectorail GC format library

This commit is contained in:
2026-08-02 17:05:27 +02:00
commit 8c4e1bcacb
28 changed files with 3426 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
#pragma once
#include "gc/RvbScene.hpp"
#include <array>
#include <cstdint>
#include <string>
#include <unordered_map>
#include <vector>
namespace gc {
struct RvbImageDraw {
std::string imageSymbol;
std::string instancePath;
// top-left, top-right, bottom-left, bottom-right in the RVB canvas
std::array<std::array<float, 2>, 4> corners{};
std::array<float, 3> color{1.0f, 1.0f, 1.0f};
float alpha = 1.0f;
uint32_t depth = 0;
};
// A Flash-style MovieClip path mapped to the labeled frame that should be
// visible. Paths are the same absolute paths exported in PREP ("/" is the
// root timeline). Clips not mentioned here remain on their first FRAM.
struct RvbSnapshotState {
std::unordered_map<std::string, std::string> frameByPath;
bool includeRootOther = false;
};
// Builds the display list produced by the first frame of the root timeline
// and the first frame of every placed MovieClip. This is the exact static
// base of the original scene; later timeline frames and ActionScript state
// changes can be layered on top as their opcodes are recovered.
bool BuildRvbInitialSnapshot(const std::vector<uint8_t>& bytes,
const RvbScene& scene,
std::vector<RvbImageDraw>* draws,
std::string* error = nullptr);
// Builds the display list at selected labeled frames. RVB FRAM records are
// deltas, so this applies PLC3/RMOV commands in order through each requested
// frame instead of treating a frame as a self-contained draw list.
bool BuildRvbSnapshot(const std::vector<uint8_t>& bytes,
const RvbScene& scene,
const RvbSnapshotState& state,
std::vector<RvbImageDraw>* draws,
std::string* error = nullptr);
// Builds an exported/linkage MovieClip without requiring it to be placed on
// the root timeline. game471.exe uses this path for the twelve dynamically
// instantiated select-music rows (mc_music_link / mc_index_link).
bool BuildRvbSymbolSnapshot(const std::vector<uint8_t>& bytes,
const RvbScene& scene,
const std::string& symbolName,
const RvbSnapshotState& state,
std::vector<RvbImageDraw>* draws,
std::string* error = nullptr);
} // namespace gc