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

View File

@@ -11,95 +11,100 @@ void psxsplash::Renderer::initialize() {
psyqo::GTE::clear<psyqo::GTE::Register::TRY, 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::OFY, psyqo::GTE::Unsafe>(psyqo::FixedPoint<16>(120.0).raw());
psyqo::GTE::write<psyqo::GTE::Register::OFX, psyqo::GTE::Unsafe>(
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::ZSF3, psyqo::GTE::Unsafe>(ORDERING_TABLE_SIZE / 3);
psyqo::GTE::write<psyqo::GTE::Register::ZSF4, psyqo::GTE::Unsafe>(ORDERING_TABLE_SIZE / 4);
psyqo::GTE::write<psyqo::GTE::Register::ZSF3, psyqo::GTE::Unsafe>(
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) {
uint8_t parity = m_gpu.getParity();
uint8_t parity = m_gpu.getParity();
auto &ot = m_ots[parity];
auto &clear = m_clear[parity];
auto &balloc = m_ballocs[parity];
auto &ot = m_ots[parity];
auto &clear = m_clear[parity];
auto &balloc = m_ballocs[parity];
eastl::array<psyqo::Vertex, 3> projected;
eastl::array<psyqo::Vertex, 3> projected;
m_gpu.getNextClear(clear.primitive, m_clearcolor);
m_gpu.chain(clear);
m_gpu.getNextClear(clear.primitive, m_clearcolor);
m_gpu.chain(clear);
balloc.reset();
balloc.reset();
for (auto &obj : objects) {
for (auto &obj : objects) {
auto &mesh = obj.m_mesh;
auto &texture = mesh.m_texture;
auto &mesh = obj.m_mesh;
auto &texture = mesh.m_texture;
psyqo::GTE::write<psyqo::GTE::Register::TRX, psyqo::GTE::Unsafe>(
obj.m_pos.x.raw());
psyqo::GTE::write<psyqo::GTE::Register::TRY, psyqo::GTE::Unsafe>(
obj.m_pos.y.raw());
psyqo::GTE::write<psyqo::GTE::Register::TRZ, psyqo::GTE::Unsafe>(
obj.m_pos.z.raw());
psyqo::GTE::write<psyqo::GTE::Register::TRX, psyqo::GTE::Unsafe>(
obj.m_pos.x.raw());
psyqo::GTE::write<psyqo::GTE::Register::TRY, psyqo::GTE::Unsafe>(
obj.m_pos.y.raw());
psyqo::GTE::write<psyqo::GTE::Register::TRZ, psyqo::GTE::Unsafe>(
obj.m_pos.z.raw());
auto transform = psyqo::SoftMath::generateRotationMatrix33(
obj.m_rot[0], psyqo::SoftMath::Axis::X, m_trig);
auto rot = psyqo::SoftMath::generateRotationMatrix33(
obj.m_rot[1], psyqo::SoftMath::Axis::Y, m_trig);
auto transform = psyqo::SoftMath::generateRotationMatrix33(
obj.m_rot[0], psyqo::SoftMath::Axis::X, m_trig);
auto rot = psyqo::SoftMath::generateRotationMatrix33(
obj.m_rot[1], psyqo::SoftMath::Axis::Y, m_trig);
psyqo::SoftMath::multiplyMatrix33(transform, rot, &transform);
psyqo::SoftMath::multiplyMatrix33(transform, rot, &transform);
auto rotZ = psyqo::SoftMath::generateRotationMatrix33(
obj.m_rot[2], psyqo::SoftMath::Axis::Z, m_trig);
auto rotZ = psyqo::SoftMath::generateRotationMatrix33(
obj.m_rot[2], psyqo::SoftMath::Axis::Z, m_trig);
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) {
psyqo::GTE::writeUnsafe<psyqo::GTE::PseudoRegister::V0>(tri.v0);
psyqo::GTE::writeUnsafe<psyqo::GTE::PseudoRegister::V1>(tri.v1);
psyqo::GTE::writeUnsafe<psyqo::GTE::PseudoRegister::V2>(tri.v2);
psyqo::GTE::writeUnsafe<psyqo::GTE::PseudoRegister::V0>(tri.v0);
psyqo::GTE::writeUnsafe<psyqo::GTE::PseudoRegister::V1>(tri.v1);
psyqo::GTE::writeUnsafe<psyqo::GTE::PseudoRegister::V2>(tri.v2);
psyqo::GTE::Kernels::rtpt();
psyqo::GTE::Kernels::nclip();
psyqo::GTE::Kernels::rtpt();
psyqo::GTE::Kernels::nclip();
int32_t mac0 = 0;
psyqo::GTE::read<psyqo::GTE::Register::MAC0>(
reinterpret_cast<uint32_t *>(&mac0));
if (mac0 <= 0)
continue;
int32_t mac0 = 0;
psyqo::GTE::read<psyqo::GTE::Register::MAC0>(
reinterpret_cast<uint32_t *>(&mac0));
if (mac0 <= 0)
continue;
psyqo::GTE::Kernels::avsz4();
int32_t zIndex = 0;
psyqo::GTE::read<psyqo::GTE::Register::OTZ>(
reinterpret_cast<uint32_t *>(&zIndex));
if (zIndex < 0 || zIndex >= ORDERING_TABLE_SIZE)
continue;
psyqo::GTE::Kernels::avsz4();
int32_t zIndex = 0;
psyqo::GTE::read<psyqo::GTE::Register::OTZ>(
reinterpret_cast<uint32_t *>(&zIndex));
if (zIndex < 0 || zIndex >= ORDERING_TABLE_SIZE)
continue;
psyqo::GTE::read<psyqo::GTE::Register::SXY0>(&projected[1].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::SXY0>(&projected[1].packed);
psyqo::GTE::read<psyqo::GTE::Register::SXY1>(&projected[2].packed);
psyqo::GTE::read<psyqo::GTE::Register::SXY2>(&projected[3].packed);
auto &prim = balloc.allocate<
psyqo::Fragments::SimpleFragment<psyqo::Prim::TexturedTriangle>>();
auto &prim = balloc.allocate<psyqo::Fragments::SimpleFragment<
psyqo::Prim::TexturedTriangle>>();
prim.primitive.pointA = projected[0];
prim.primitive.pointB = projected[1];
prim.primitive.pointC = projected[2];
prim.primitive.uvA = tri.uvA;
prim.primitive.uvB = tri.uvB;
prim.primitive.uvC = tri.uvC;
prim.primitive.tpage = texture.m_tpage;
prim.primitive.pointA = projected[0];
prim.primitive.pointB = projected[1];
prim.primitive.pointC = projected[2];
prim.primitive.uvA = tri.uvA;
prim.primitive.uvB = tri.uvB;
prim.primitive.uvC = tri.uvC;
prim.primitive.tpage = texture.m_tpage;
ot.insert(prim, zIndex);
ot.insert(prim, zIndex);
}
}
}
m_gpu.chain(ot);
m_gpu.chain(ot);
}