Skip to content

Commit

Permalink
GPU: more math helpers cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Oct 3, 2023
1 parent 8bb33a4 commit f6b412a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/dual/include/dual/nds/video_unit/gpu/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ namespace dual::nds {
}

static Color4 FromRGB555(u16 color) {
auto r = (color << 1) & 62;
auto g = (color >> 4) & 62;
auto b = (color >> 9) & 62;
const int r = (color << 1) & 62;
const int g = (color >> 4) & 62;
const int b = (color >> 9) & 62;

return Color4{
s8(r | (r >> 5)),
s8(g | (g >> 5)),
s8(b | (b >> 5)),
s8(63)
(i8)(r | (r >> 5)),
(i8)(g | (g >> 5)),
(i8)(b | (b >> 5)),
(i8)63
};
}

Expand Down

0 comments on commit f6b412a

Please sign in to comment.