2021-12-04 12:33:18 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/custom_data/Tfrag3Data.h"
|
2022-06-22 23:37:46 -04:00
|
|
|
#include "common/math/Vector.h"
|
|
|
|
|
2021-12-04 12:33:18 -05:00
|
|
|
#include "decompiler/data/TextureDB.h"
|
2022-06-22 23:37:46 -04:00
|
|
|
#include "decompiler/level_extractor/BspHeader.h"
|
2021-12-04 12:33:18 -05:00
|
|
|
|
|
|
|
namespace decompiler {
|
|
|
|
|
|
|
|
// the different "kinds" of tfrag. The actual renderers are almost identical and the only different
|
|
|
|
// is in GS setup (alpha blending) and in how the closest object is used.
|
|
|
|
|
|
|
|
// This is the actual tree data, minus the tfrags themselves.
|
|
|
|
struct VisNodeTree {
|
|
|
|
std::vector<tfrag3::VisNode> vis_nodes;
|
|
|
|
u16 first_child_node = 0;
|
|
|
|
u16 last_child_node = 0;
|
|
|
|
u16 first_root = 0;
|
|
|
|
u16 num_roots = 0;
|
|
|
|
bool only_children = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
// will pool textures with others already in out.
|
|
|
|
void extract_tfrag(const level_tools::DrawableTreeTfrag* tree,
|
|
|
|
const std::string& debug_name,
|
|
|
|
const std::vector<level_tools::TextureRemap>& map,
|
|
|
|
const TextureDB& tex_db,
|
|
|
|
const std::vector<std::pair<int, int>>& expected_missing_textures,
|
2021-12-30 18:48:37 -05:00
|
|
|
tfrag3::Level& out,
|
2023-01-14 11:30:58 -05:00
|
|
|
bool dump_level,
|
|
|
|
const std::string& level_name);
|
2021-12-04 12:33:18 -05:00
|
|
|
|
2021-12-30 18:48:37 -05:00
|
|
|
} // namespace decompiler
|