Skip to content

Commit

Permalink
fix bpp2 (#2715)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDrawingCoder-Gamer authored Nov 11, 2024
1 parent e98d37a commit e3c3bc6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/studio/screens/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,16 +1853,17 @@ static void onImportTilesBase(Console* console, const char* name, const void* bu
case 2:
color1 = tic_nearest_color(pal->colors, (tic_rgb*)(img.pixels + i + j * img.width), 4);
color2 = tic_nearest_color(pal->colors, (tic_rgb*)(img.pixels + i + 1 + j * img.width), 4);
// unsure if it's better to do add or or it together.
color = (color2 << 2) + color1;
// adding them together caused issues with squashing??? no idea why this isn't the case
// for bpp 1
color = (color2 << 2) | color1;
setSpritePixel(base, x, y, color);
break;
case 1:
color1 = tic_nearest_color(pal->colors, (tic_rgb*)(img.pixels + i + j * img.width), 2);
color2 = tic_nearest_color(pal->colors, (tic_rgb*)(img.pixels + i + 1 + j * img.width), 2);
color3 = tic_nearest_color(pal->colors, (tic_rgb*)(img.pixels + i + 2 + j * img.width), 2);
color4 = tic_nearest_color(pal->colors, (tic_rgb*)(img.pixels + i + 3 + j * img.width), 2);
color = (color4 << 3) + (color3 << 2) + (color2 << 1) + color1;
color = (color4 << 3) | (color3 << 2) | (color2 << 1) | color1;
setSpritePixel(base, x, y, color);
break;
}
Expand Down

0 comments on commit e3c3bc6

Please sign in to comment.