Skip to content

Commit 66f5e6f

Browse files
committed
v0.2, fix z fighting on vote sprites
1 parent fe67efb commit 66f5e6f

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

game/res/Jam15/bg/title.png

+2-2
Loading

game/res/Jam15/bg/title_nocont.png

+2-2
Loading

game/res/src/title pal.act

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:5deb1b0d2d70e4ac1c3ed33816f69f40ed75fb8555fd0a538b0524134a901de5
3+
size 768

game/res/src/title.psd

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:d2b316261164f198440f687dd787e9eb446babe075db94d3142aba4da9f2a953
3-
size 322560
2+
oid sha256:ff53d20da590a6c6d69f22590cadd90143df3cc0133e395160bda0f3c1a38ea6
3+
size 324729

game/src/VoteMode.cpp

+12-13
Original file line numberDiff line numberDiff line change
@@ -445,16 +445,6 @@ void VoteMode::SetupGraphics()
445445
right.SetZ(z++);
446446
}
447447

448-
// Add midline sprite
449-
{
450-
auto [id, spr] = m_game->Sprites().AddSprite(SpriteSize::r2c1, TILE_ATTR_FULL(PAL2, TRUE, FALSE, FALSE, m_barMidLine_tileIndex));
451-
m_midline = id;
452-
453-
spr.SetX(c_screenWidthPx / 2);
454-
spr.SetY(16 * 8);
455-
spr.SetZ(0); // behind cursor
456-
}
457-
458448
// Add cursor sprite
459449
{
460450
// Cursor has to use PAL3 to get shadow mode to work
@@ -466,8 +456,17 @@ void VoteMode::SetupGraphics()
466456
spr.SetZ(z++);
467457
}
468458

459+
// Add midline sprite
460+
{
461+
auto [id, spr] = m_game->Sprites().AddSprite(SpriteSize::r2c1, TILE_ATTR_FULL(PAL2, TRUE, FALSE, FALSE, m_barMidLine_tileIndex));
462+
m_midline = id;
463+
464+
spr.SetX(c_screenWidthPx / 2);
465+
spr.SetY(16 * 8);
466+
spr.SetZ(z++); // behind cursor
467+
}
468+
469469
// Add sillhouette sprites, in columns to make it easier to update x later
470-
z = -96; // below everything
471470
for (u16 i = 0; i < 4; ++i)
472471
{
473472
u16 const tileOffset = i * 16;
@@ -482,7 +481,7 @@ void VoteMode::SetupGraphics()
482481
TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, m_silLeft_tileIndex[r] + tileOffset));
483482
spr.SetX(xOffset - 8);
484483
spr.SetY(r * 32);
485-
spr.SetZ(z++);
484+
spr.SetZ(z++); // behind everything
486485
m_silLeftSprites[arrOffset + r] = id;
487486
}
488487
// right
@@ -492,7 +491,7 @@ void VoteMode::SetupGraphics()
492491
m_silRightSprites[arrOffset + r] = id;
493492
spr.SetX(c_screenWidthPx - 112 + xOffset + 8);
494493
spr.SetY(r * 32);
495-
spr.SetZ(z++);
494+
spr.SetZ(z++); // behind everything
496495
}
497496
}
498497
}

0 commit comments

Comments
 (0)