Skip to content

Commit

Permalink
ppu: Fix incorrect merging of sprite layer with background layers
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Jan 11, 2024
1 parent d0130d0 commit a82ffa5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/dual/src/nds/video_unit/ppu/composer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,7 @@ namespace dual::nds {
if(pixel_new != k_color_transparent) {
pixel[0] = pixel_new;
layer[0] = bg;

if constexpr(opengl) {
prio[0] = bgcnt[bg].priority;
}
prio[0] = bgcnt[bg].priority;
break;
}
}
Expand All @@ -210,8 +207,10 @@ namespace dual::nds {
m_buffer_obj[x].color != k_color_transparent &&
m_buffer_obj[x].priority <= prio[0]) {
pixel[0] = m_buffer_obj[x].color;
layer[0] = LAYER_OBJ;
prio[0] = m_buffer_obj[x].priority;
if constexpr(opengl) {
layer[0] = LAYER_OBJ;
prio[0] = m_buffer_obj[x].priority;
}
}

if constexpr(opengl) {
Expand Down

0 comments on commit a82ffa5

Please sign in to comment.