소스 검색

fix: round off error in ColorAlphaBlend (#2524)

pull/2525/head
Roy Qu 3 년 전
committed by GitHub
부모
커밋
0964353073
No known key found for this signature in database 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

불러오는 중...
취소
저장