Indentation errors

This commit is contained in:
2025-03-19 02:07:35 +01:00
parent 4b37731a97
commit 4b7389da8d
7 changed files with 93 additions and 93 deletions

1
.gitignore vendored
View File

@@ -10,4 +10,5 @@ PSX.Dev-README.md
.cache/ .cache/
.vscode/ .vscode/
.editorconfig .editorconfig
.clang-format
compile_commands.json compile_commands.json

View File

@@ -7,11 +7,11 @@
namespace psxsplash { namespace psxsplash {
class GameObject final { class GameObject final {
public: public:
psyqo::Vec3 m_pos; psyqo::Vec3 m_pos;
psyqo::Angle m_rot[3]; psyqo::Angle m_rot[3];
Mesh m_mesh; Mesh m_mesh;
bool m_is_static; bool m_is_static;
}; };
} } // namespace psxsplash

View File

@@ -24,17 +24,13 @@ class PSXSplash final : public psyqo::Application {
class MainScene final : public psyqo::Scene { class MainScene final : public psyqo::Scene {
void frame() override; void frame() override;
uint8_t m_anim = 0;
bool m_direction = true;
eastl::array<psxsplash::GameObject> objects; eastl::array<psxsplash::GameObject> objects;
}; };
PSXSplash psxSplash; PSXSplash psxSplash;
MainScene mainScene; MainScene mainScene;
} } // namespace
void PSXSplash::prepare() { void PSXSplash::prepare() {
psyqo::GPU::Configuration config; psyqo::GPU::Configuration config;
@@ -51,8 +47,6 @@ void PSXSplash::createScene() {
pushScene(&mainScene); pushScene(&mainScene);
} }
void MainScene::frame() { void MainScene::frame() { psxSplash.m_renderer.render(objects); }
psxSplash.m_renderer.render(objects);
}
int main() { return psxSplash.run(); } int main() { return psxSplash.run(); }

View File

@@ -9,8 +9,8 @@ namespace psxsplash {
class Tri final { class Tri final {
public: public:
psyqo::GTE::PackedVec3 v0,v1,v2; psyqo::GTE::PackedVec3 v0, v1, v2;
psyqo::GTE::PackedVec3 n0,n1,n2; psyqo::GTE::PackedVec3 n0, n1, n2;
psyqo::PrimPieces::UVCoords uvA, uvB; psyqo::PrimPieces::UVCoords uvA, uvB;
psyqo::PrimPieces::UVCoordsPadded uvC; psyqo::PrimPieces::UVCoordsPadded uvC;
psyqo::Color colorA, colorB, colorC; psyqo::Color colorA, colorB, colorC;
@@ -21,4 +21,4 @@ class Mesh final {
Texture m_texture; Texture m_texture;
eastl::array<Tri> m_polygons; eastl::array<Tri> m_polygons;
}; };
} } // namespace psxsplash

View File

@@ -11,13 +11,17 @@ void psxsplash::Renderer::initialize() {
psyqo::GTE::clear<psyqo::GTE::Register::TRY, psyqo::GTE::Unsafe>(); psyqo::GTE::clear<psyqo::GTE::Register::TRY, psyqo::GTE::Unsafe>();
psyqo::GTE::clear<psyqo::GTE::Register::TRZ, psyqo::GTE::Unsafe>(); psyqo::GTE::clear<psyqo::GTE::Register::TRZ, psyqo::GTE::Unsafe>();
psyqo::GTE::write<psyqo::GTE::Register::OFX, psyqo::GTE::Unsafe>(psyqo::FixedPoint<16>(160.0).raw()); psyqo::GTE::write<psyqo::GTE::Register::OFX, psyqo::GTE::Unsafe>(
psyqo::GTE::write<psyqo::GTE::Register::OFY, psyqo::GTE::Unsafe>(psyqo::FixedPoint<16>(120.0).raw()); psyqo::FixedPoint<16>(160.0).raw());
psyqo::GTE::write<psyqo::GTE::Register::OFY, psyqo::GTE::Unsafe>(
psyqo::FixedPoint<16>(120.0).raw());
psyqo::GTE::write<psyqo::GTE::Register::H, psyqo::GTE::Unsafe>(120); psyqo::GTE::write<psyqo::GTE::Register::H, psyqo::GTE::Unsafe>(120);
psyqo::GTE::write<psyqo::GTE::Register::ZSF3, psyqo::GTE::Unsafe>(ORDERING_TABLE_SIZE / 3); psyqo::GTE::write<psyqo::GTE::Register::ZSF3, psyqo::GTE::Unsafe>(
psyqo::GTE::write<psyqo::GTE::Register::ZSF4, psyqo::GTE::Unsafe>(ORDERING_TABLE_SIZE / 4); ORDERING_TABLE_SIZE / 3);
psyqo::GTE::write<psyqo::GTE::Register::ZSF4, psyqo::GTE::Unsafe>(
ORDERING_TABLE_SIZE / 4);
} }
void psxsplash::Renderer::render(eastl::array<GameObject> &objects) { void psxsplash::Renderer::render(eastl::array<GameObject> &objects) {
@@ -58,7 +62,8 @@ void psxsplash::Renderer::render(eastl::array<GameObject> &objects) {
psyqo::SoftMath::multiplyMatrix33(transform, rotZ, &transform); psyqo::SoftMath::multiplyMatrix33(transform, rotZ, &transform);
psyqo::GTE::writeUnsafe<psyqo::GTE::PseudoRegister::Rotation>(transform); psyqo::GTE::writeUnsafe<psyqo::GTE::PseudoRegister::Rotation>(
transform);
for (auto &tri : mesh.m_polygons) { for (auto &tri : mesh.m_polygons) {
@@ -86,8 +91,8 @@ void psxsplash::Renderer::render(eastl::array<GameObject> &objects) {
psyqo::GTE::read<psyqo::GTE::Register::SXY1>(&projected[2].packed); psyqo::GTE::read<psyqo::GTE::Register::SXY1>(&projected[2].packed);
psyqo::GTE::read<psyqo::GTE::Register::SXY2>(&projected[3].packed); psyqo::GTE::read<psyqo::GTE::Register::SXY2>(&projected[3].packed);
auto &prim = balloc.allocate< auto &prim = balloc.allocate<psyqo::Fragments::SimpleFragment<
psyqo::Fragments::SimpleFragment<psyqo::Prim::TexturedTriangle>>(); psyqo::Prim::TexturedTriangle>>();
prim.primitive.pointA = projected[0]; prim.primitive.pointA = projected[0];
prim.primitive.pointB = projected[1]; prim.primitive.pointB = projected[1];

View File

@@ -2,12 +2,12 @@
#include "EASTL/array.h" #include "EASTL/array.h"
#include "gameobject.hh" #include "gameobject.hh"
#include "psyqo/bump-allocator.hh"
#include "psyqo/fragments.hh" #include "psyqo/fragments.hh"
#include "psyqo/gpu.hh" #include "psyqo/gpu.hh"
#include "psyqo/ordering-table.hh" #include "psyqo/ordering-table.hh"
#include "psyqo/primitives/common.hh" #include "psyqo/primitives/common.hh"
#include "psyqo/primitives/misc.hh" #include "psyqo/primitives/misc.hh"
#include "psyqo/bump-allocator.hh"
#include "psyqo/trigonometry.hh" #include "psyqo/trigonometry.hh"
namespace psxsplash { namespace psxsplash {
@@ -16,7 +16,7 @@ class Renderer final {
static constexpr size_t ORDERING_TABLE_SIZE = 1024; static constexpr size_t ORDERING_TABLE_SIZE = 1024;
static constexpr size_t BUMP_ALLOCATOR_SIZE = 100000; static constexpr size_t BUMP_ALLOCATOR_SIZE = 100000;
psyqo::GPU& m_gpu; psyqo::GPU &m_gpu;
psyqo::Trig<> m_trig; psyqo::Trig<> m_trig;
public: public:
@@ -25,9 +25,9 @@ class Renderer final {
psyqo::Color m_clearcolor = {.r = 63, .g = 63, .b = 63}; psyqo::Color m_clearcolor = {.r = 63, .g = 63, .b = 63};
psyqo::BumpAllocator<BUMP_ALLOCATOR_SIZE> m_ballocs[2]; psyqo::BumpAllocator<BUMP_ALLOCATOR_SIZE> m_ballocs[2];
Renderer(psyqo::GPU& gpuInstance) : m_gpu(gpuInstance) {} Renderer(psyqo::GPU &gpuInstance) : m_gpu(gpuInstance) {}
void initialize(); void initialize();
void render(eastl::array<GameObject>& objects); void render(eastl::array<GameObject> &objects);
}; };
} } // namespace psxsplash

View File

@@ -11,4 +11,4 @@ class Texture final {
psyqo::PrimPieces::TPageAttr m_tpage; psyqo::PrimPieces::TPageAttr m_tpage;
uint8_t m_width, m_height; uint8_t m_width, m_height;
}; };
} } // namespace psxsplash