mirror of
https://github.com/open-goal/jak-project
synced 2026-06-27 10:52:59 -04:00
[graphics] TIE extractor (#1026)
* temp * temp * wip * more progress on the instance asm * first half of tie extraction, up to dma lists * more tie extraction * first part figured out maybe * bp1 loop seems to work, bp2 loop does not * bp1 and bp2 appear working. sadly ip is needed * ip1 outline, not working ip2 * just kidding, ip2 seems to work * extraction seems to work * basic rendering working * tie fixes * performance optimization of tie renderer * hook up tie to engine * fix more bugs * cleanup and perf improvements * fix tests * ref tests * mm256i for gcc * CLANG * windows * more compile fixes * fix fast time of day * small fixes * fix after merge * clang
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
namespace tfrag3 {
|
||||
|
||||
void Draw::serialize(Serializer& ser) {
|
||||
void StripDraw::serialize(Serializer& ser) {
|
||||
ser.from_ptr(&mode);
|
||||
ser.from_ptr(&tree_tex_id);
|
||||
ser.from_pod_vector(&vertex_index_stream);
|
||||
@@ -11,7 +11,7 @@ void Draw::serialize(Serializer& ser) {
|
||||
ser.from_ptr(&num_triangles);
|
||||
}
|
||||
|
||||
void Tree::serialize(Serializer& ser) {
|
||||
void TfragTree::serialize(Serializer& ser) {
|
||||
ser.from_ptr(&kind);
|
||||
|
||||
if (ser.is_saving()) {
|
||||
@@ -24,14 +24,32 @@ void Tree::serialize(Serializer& ser) {
|
||||
}
|
||||
|
||||
ser.from_pod_vector(&vertices);
|
||||
ser.from_pod_vector(&color_indices_per_vertex);
|
||||
ser.from_pod_vector(&vis_nodes);
|
||||
ser.from_pod_vector(&colors);
|
||||
bvh.serialize(ser);
|
||||
}
|
||||
|
||||
void TieTree::serialize(Serializer& ser) {
|
||||
if (ser.is_saving()) {
|
||||
ser.save<size_t>(static_draws.size());
|
||||
} else {
|
||||
static_draws.resize(ser.load<size_t>());
|
||||
}
|
||||
for (auto& draw : static_draws) {
|
||||
draw.serialize(ser);
|
||||
}
|
||||
|
||||
ser.from_pod_vector(&vertices);
|
||||
ser.from_pod_vector(&colors);
|
||||
bvh.serialize(ser);
|
||||
}
|
||||
|
||||
void BVH::serialize(Serializer& ser) {
|
||||
ser.from_ptr(&first_leaf_node);
|
||||
ser.from_ptr(&last_leaf_node);
|
||||
ser.from_ptr(&first_root);
|
||||
ser.from_ptr(&num_roots);
|
||||
ser.from_ptr(&only_children);
|
||||
ser.from_pod_vector(&vis_nodes);
|
||||
}
|
||||
|
||||
void Texture::serialize(Serializer& ser) {
|
||||
@@ -62,11 +80,20 @@ void Level::serialize(Serializer& ser) {
|
||||
}
|
||||
|
||||
if (ser.is_saving()) {
|
||||
ser.save<size_t>(trees.size());
|
||||
ser.save<size_t>(tfrag_trees.size());
|
||||
} else {
|
||||
trees.resize(ser.load<size_t>());
|
||||
tfrag_trees.resize(ser.load<size_t>());
|
||||
}
|
||||
for (auto& tree : trees) {
|
||||
for (auto& tree : tfrag_trees) {
|
||||
tree.serialize(ser);
|
||||
}
|
||||
|
||||
if (ser.is_saving()) {
|
||||
ser.save<size_t>(tie_trees.size());
|
||||
} else {
|
||||
tie_trees.resize(ser.load<size_t>());
|
||||
}
|
||||
for (auto& tree : tie_trees) {
|
||||
tree.serialize(ser);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user