diff options
author | luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> | 2021-05-23 10:51:26 -0400 |
---|---|---|
committer | luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> | 2021-05-23 10:51:26 -0400 |
commit | c723d980e772f7e7ab82dbcb7ad07132c09ab5b4 (patch) | |
tree | 0bed002b2990b9e837220618a321f3b6517a1099 /src/util.c | |
parent | c50a21fba07db80ac44c6f09fd202ba4b2e2c7d3 (diff) | |
parent | ffbbc88801de3fc56d0bf5f0af1418ca7cfcfa4f (diff) |
Merge branch 'master' of https://github.com/pret/pokeemerald
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c index 8aa54857a..a4e3fa4cf 100644 --- a/src/util.c +++ b/src/util.c @@ -2,6 +2,7 @@ #include "util.h" #include "sprite.h" #include "palette.h" +#include "constants/rgb.h" const u32 gBitTable[] = { @@ -271,8 +272,8 @@ void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor) s8 g = data1->g; s8 b = data1->b; struct PlttData *data2 = (struct PlttData *)&blendColor; - gPlttBufferFaded[index] = ((r + (((data2->r - r) * coeff) >> 4)) << 0) - | ((g + (((data2->g - g) * coeff) >> 4)) << 5) - | ((b + (((data2->b - b) * coeff) >> 4)) << 10); + gPlttBufferFaded[index] = RGB(r + (((data2->r - r) * coeff) >> 4), + g + (((data2->g - g) * coeff) >> 4), + b + (((data2->b - b) * coeff) >> 4)); } } |