Skip to content

Commit

Permalink
Merge pull request #1508 from grumpycoders/psyqo-prim-fixes
Browse files Browse the repository at this point in the history
Fixing textured primitives in psyqo.
  • Loading branch information
nicolasnoble authored Dec 26, 2023
2 parents 16302dc + 556faa0 commit 9a8b33f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/mips/psyqo/primitives/quads.hh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static_assert(sizeof(Quad) == (sizeof(uint32_t) * 5), "Quad is not 5 words");
* - `clutIndex`, `tpage`
*/
struct TexturedQuad {
TexturedQuad() : command(0x2c000000) {}
TexturedQuad() : command(0x2d000000) {}
TexturedQuad& setOpaque() {
command &= ~0x02000000;
return *this;
Expand Down Expand Up @@ -213,11 +213,11 @@ static_assert(sizeof(GouraudQuad) == (sizeof(uint32_t) * 8), "GouraudQuad is not
* `setColorA` method.
*/
struct GouraudTexturedQuad {
GouraudTexturedQuad() : command(0x3d000000) {}
GouraudTexturedQuad(Color c) : command(0x3d000000 | c.packed) {}
GouraudTexturedQuad() : command(0x3c000000) {}
GouraudTexturedQuad(Color c) : command(0x3c000000 | c.packed) {}
GouraudTexturedQuad& setColorA(Color c) {
uint32_t wasSemiTrans = command & 0x02000000;
command = 0x3d000000 | c.packed | wasSemiTrans;
command = 0x3c000000 | c.packed | wasSemiTrans;
return *this;
}
GouraudTexturedQuad& setColorB(Color c) {
Expand Down
8 changes: 4 additions & 4 deletions src/mips/psyqo/primitives/triangles.hh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static_assert(sizeof(Triangle) == (sizeof(uint32_t) * 4), "Triangle is not 4 wor
* - `clutIndex`, `tpage`
*/
struct TexturedTriangle {
TexturedTriangle() : command(0x24000000) {}
TexturedTriangle() : command(0x25000000) {}
TexturedTriangle& setOpaque() {
command &= ~0x02000000;
return *this;
Expand Down Expand Up @@ -189,11 +189,11 @@ static_assert(sizeof(GouraudTriangle) == (sizeof(uint32_t) * 6), "GouraudTriangl
* - `clutIndex`, `tpage`
*/
struct GouraudTexturedTriangle {
GouraudTexturedTriangle() : command(0x35000000) {}
GouraudTexturedTriangle(Color c) : command(0x35000000 | c.packed) {}
GouraudTexturedTriangle() : command(0x34000000) {}
GouraudTexturedTriangle(Color c) : command(0x34000000 | c.packed) {}
GouraudTexturedTriangle& setColorA(Color c) {
uint32_t wasSemiTrans = command & 0x02000000;
command = 0x35000000 | c.packed | wasSemiTrans;
command = 0x34000000 | c.packed | wasSemiTrans;
return *this;
}
GouraudTexturedTriangle& setColorB(Color c) {
Expand Down

0 comments on commit 9a8b33f

Please sign in to comment.