Sfoglia il codice sorgente

fix: round off error in ColorAlphaBlend (#2524)

pull/2525/head
Roy Qu 3 anni fa
committed by GitHub
parent
commit
0964353073
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. +4
    -4
      src/rtextures.c

+ 4
- 4
src/rtextures.c Vedi File

@ -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

Caricamento…
Annulla
Salva