ソースを参照

fix: round off error in ColorAlphaBlend (#2524)

pull/2525/head
Roy Qu 3年前
committed by GitHub
コミット
0964353073
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更4行の追加4行の削除
  1. +4
    -4
      src/rtextures.c

+ 4
- 4
src/rtextures.c ファイルの表示

@ -3809,10 +3809,10 @@ Color ColorAlphaBlend(Color dst, Color src, Color tint)
Color out = WHITE;
// Apply color tint to source color
src.r = (unsigned char)(((unsigned int)src.r*(unsigned int)tint.r) >> 8);
src.g = (unsigned char)(((unsigned int)src.g*(unsigned int)tint.g) >> 8);
src.b = (unsigned char)(((unsigned int)src.b*(unsigned int)tint.b) >> 8);
src.a = (unsigned char)(((unsigned int)src.a*(unsigned int)tint.a) >> 8);
src.r = (unsigned char)(((unsigned int)src.r*(p">(unsigned int)tint.r+1)) >> 8);
src.g = (unsigned char)(((unsigned int)src.g*(p">(unsigned int)tint.g+1)) >> 8);
src.b = (unsigned char)(((unsigned int)src.b*(p">(unsigned int)tint.b+1)) >> 8);
src.a = (unsigned char)(((unsigned int)src.a*(p">(unsigned int)tint.a+1)) >> 8);
//#define COLORALPHABLEND_FLOAT
#define COLORALPHABLEND_INTEGERS

読み込み中…
キャンセル
保存