summaryrefslogtreecommitdiff
path: root/src/factories/MtxFactory.cpp
diff options
context:
space:
mode:
authorLywx <kiritodev01@gmail.com>2026-07-02 20:42:38 -0600
committerGitHub <noreply@github.com>2026-07-02 20:42:38 -0600
commit58527d7bf8778bc67179454a19ad8c84a74aff13 (patch)
tree37df9df3eb558977b84b5a33b8143f3859c5d057 /src/factories/MtxFactory.cpp
parentb42a4fa16f7a75e2a96a7c107e6359c80b685863 (diff)
Implemented UI Framework (#225)
* Implemented base renderer among main UI framework implementation * Implemented basic geo layout rendering * Implemented animation support among fixing lightning among other things * Implemented multiple ui factories for sm64 * Implemented first iteration of the custom sequence driver * Added export buttons on multiple factories * More sequence player fixes among f3dex2 working correctly * Implemented pm64 viewers * Implemented audio support for pm64 * Fully implemented pm64 factories * Implemented more sm64 factories * Added tons of missing sf64 factories * Implemented all assets among sf64 wrong padding * Run formatting * Fixed wrong spacing on gfx too * Fixed CI * Fixed bad pipeline
Diffstat (limited to 'src/factories/MtxFactory.cpp')
-rw-r--r--src/factories/MtxFactory.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/factories/MtxFactory.cpp b/src/factories/MtxFactory.cpp
index b6ff955..33c5a07 100644
--- a/src/factories/MtxFactory.cpp
+++ b/src/factories/MtxFactory.cpp
@@ -112,9 +112,9 @@ ExportResult MtxBinaryExporter::Export(std::ostream& write, std::shared_ptr<IPar
WriteHeader(writer, Torch::ResourceType::Matrix, 0);
- if(floats){
- for(size_t i = 0; i < 4; i++){
- for(size_t j = 0; j < 4; j++){
+ if (floats) {
+ for (size_t i = 0; i < 4; i++) {
+ for (size_t j = 0; j < 4; j++) {
writer.Write(mtx->mMtxs[0].mtx[i * 4 + j]);
}
}
@@ -124,15 +124,15 @@ ExportResult MtxBinaryExporter::Export(std::ostream& write, std::shared_ptr<IPar
// N64 format: each int32 packs two adjacent columns as (col_even << 16) | col_odd.
auto& mt = mtx->mMtxs[0].mt;
// First 8 words: integer parts (4 rows × 2 column-pairs)
- for(size_t i = 0; i < 4; i++){
- for(size_t j = 0; j < 2; j++){
+ for (size_t i = 0; i < 4; i++) {
+ for (size_t j = 0; j < 2; j++) {
int32_t packed = ((int32_t)mt.intPart[i][j * 2] << 16) | mt.intPart[i][j * 2 + 1];
writer.Write(packed);
}
}
// Next 8 words: fractional parts (4 rows × 2 column-pairs)
- for(size_t i = 0; i < 4; i++){
- for(size_t j = 0; j < 2; j++){
+ for (size_t i = 0; i < 4; i++) {
+ for (size_t j = 0; j < 2; j++) {
int32_t packed = ((int32_t)mt.fracPart[i][j * 2] << 16) | mt.fracPart[i][j * 2 + 1];
writer.Write(packed);
}