jak-project/decompiler/level_extractor/extract_tfrag.h
ManDude 9ff71412e5
[runtime] pckernel implementation (#1032)
* toggle for ripping level models

* Create pckernel.gc

* builds and works

* fix defs

* resolution info works

* native letterboxing

* menu

* Fullscreen buttons

* Update glfw

* fix fullscreen taking over everything for some reason

* fix screenshots and add more menu options

* Cleanup DMA mess in load boundary render code (first try!!)

* Update default-menu.gc

* clang

* fix accidental macros in pairs

* refs

* fix null reference bugs

* add lavatube

* custom aspect ratios work (3D only)

* custom aspect ratios work (3D only)

* fix aspect ratio and non-4x3 debug text

* change `sceOpen`

* deadzone setting

* merge fixes

* check out `debug-pad-display`

* update readme imgs

* settings save works

* oops

* settings read/load (incomplete)

* add `:stop` to debugger and fix detach on Windows

* settings load works

* fullscreen and aspect ratio setting fixes

* swap menu options for convenience

* settings loads automatically properly

* fix panic and font hack edge case

* add rolling, ogre, snow, swamp, sunken b, jungle b

* Fixed borderless on windows please work

* Update fake_iso.txt

* remove error from opengl debug filter

* update refs

* minor tfrag tod palette lookup change

* accidentally nuked all opengl errors
2021-12-30 18:48:37 -05:00

42 lines
1.3 KiB
C++

#pragma once
#include "decompiler/level_extractor/BspHeader.h"
#include "common/math/Vector.h"
#include "common/custom_data/Tfrag3Data.h"
#include "decompiler/data/TextureDB.h"
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;
};
// The final result
struct ExtractedTFragmentTree {
// TFragmentKind kind = TFragmentKind::INVALID;
VisNodeTree vis_nodes;
u16 num_tfrags = 0;
u16 tfrag_base_idx = 0;
};
// 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,
tfrag3::Level& out,
bool dump_level);
} // namespace decompiler