Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
akatsuki105 committed Feb 8, 2024
1 parent 4d66b01 commit d0cc3a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/gb/video/renderer/software/layer_bg.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (l *bgLayer) drawScanline(y int, scanline []pixel) {
x := i + util.Flip(8, hflip, j)
if x < len(scanline) {
if z >= scanline[x].z {
scanline[x].rgba = l.palette[(palID*4)+colorID].RGBA()
scanline[x].rgba = l.palette[(palID*4)+colorID]
scanline[x].z = z
scanline[x].colorID = colorID
scanline[x].isBG = true
Expand Down
4 changes: 2 additions & 2 deletions core/gb/video/renderer/software/layer_sprite.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (l *spriteLayer) drawObjScanline8(spriteIdx int, scanline []pixel, y int) {
idx := s.x + util.Flip(8, s.xflip, i)
if (0 <= idx) && (idx < 160) {
if z >= scanline[idx].z || (scanline[idx].colorID == 0) {
scanline[idx].rgba = palette[colorID].RGBA()
scanline[idx].rgba = palette[colorID]
scanline[idx].z = z
scanline[idx].colorID = colorID
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func (l *spriteLayer) drawObjScanline16(spriteIdx int, scanline []pixel, y int)
idx := s.x + util.Flip(8, s.xflip, i)
if (0 <= idx) && (idx < 160) {
if z >= scanline[idx].z || (scanline[idx].colorID == 0) {
scanline[idx].rgba = palette[colorID].RGBA()
scanline[idx].rgba = palette[colorID]
scanline[idx].z = z
scanline[idx].colorID = colorID
}
Expand Down
2 changes: 1 addition & 1 deletion core/gb/video/renderer/software/layer_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (l *windowLayer) drawScanline(y int, scanline []pixel) {
x := i + util.Flip(8, hflip, j)
if x < len(scanline) {
if scanline[x].z <= z || scanline[x].isBG {
scanline[x].rgba = l.r.bg.palette[(palID*4)+colorID].RGBA()
scanline[x].rgba = l.r.bg.palette[(palID*4)+colorID]
scanline[x].z = z
scanline[x].colorID = colorID
}
Expand Down
4 changes: 2 additions & 2 deletions core/gb/video/renderer/software/software.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Software struct {
}

type pixel struct {
rgba color.RGBA
rgba rgb555
z int // z-index
colorID int
isBG bool
Expand Down Expand Up @@ -67,7 +67,7 @@ func (s *Software) DrawScanline(y int, scanline []color.RGBA) {
s.sprite.drawScanline(y, s.scanline[:])

for i := 0; i < 160; i++ {
scanline[i] = s.scanline[i].rgba
scanline[i] = s.scanline[i].rgba.RGBA()
}
}

Expand Down

0 comments on commit d0cc3a9

Please sign in to comment.