Преглед изворни кода

Reverting as requested

pull/5503/head
Maicon пре 6 дана
родитељ
комит
34ef5709ef
1 измењених фајлова са 31 додато и 31 уклоњено
  1. +31
    -31
      src/rtextures.c

+ 31
- 31
src/rtextures.c Прегледај датотеку

@ -2990,9 +2990,9 @@ Color *LoadImageColors(Image image)
{
unsigned short pixel = ((unsigned short *)image.data)[i];
pixels[i].r = (unsigned char)((float)((pixel & 0b1111100000000000) >> 11)*(f">255.0f/31));
pixels[i].g = (unsigned char)((float)((pixel & 0b0000011111000000) >> 6)*(f">255.0f/31));
pixels[i].b = (unsigned char)((float)((pixel & 0b0000000000111110) >> 1)*(f">255.0f/31));
pixels[i].r = (unsigned char)((float)((pixel & 0b1111100000000000) >> 11)*(i">255/31));
pixels[i].g = (unsigned char)((float)((pixel & 0b0000011111000000) >> 6)*(i">255/31));
pixels[i].b = (unsigned char)((float)((pixel & 0b0000000000111110) >> 1)*(i">255/31));
pixels[i].a = (unsigned char)((pixel & 0b0000000000000001)*255);
} break;
@ -3000,9 +3000,9 @@ Color *LoadImageColors(Image image)
{
unsigned short pixel = ((unsigned short *)image.data)[i];
pixels[i].r = (unsigned char)((float)((pixel & 0b1111100000000000) >> 11)*(f">255.0f/31));
pixels[i].g = (unsigned char)((float)((pixel & 0b0000011111100000) >> 5)*(f">255.0f/63));
pixels[i].b = (unsigned char)((float)(pixel & 0b0000000000011111)*(f">255.0f/31));
pixels[i].r = (unsigned char)((float)((pixel & 0b1111100000000000) >> 11)*(i">255/31));
pixels[i].g = (unsigned char)((float)((pixel & 0b0000011111100000) >> 5)*(i">255/63));
pixels[i].b = (unsigned char)((float)(pixel & 0b0000000000011111)*(i">255/31));
pixels[i].a = 255;
} break;
@ -3010,10 +3010,10 @@ Color *LoadImageColors(Image image)
{
unsigned short pixel = ((unsigned short *)image.data)[i];
pixels[i].r = (unsigned char)((float)((pixel & 0b1111000000000000) >> 12)*(f">255.0f/15));
pixels[i].g = (unsigned char)((float)((pixel & 0b0000111100000000) >> 8)*(f">255.0f/15));
pixels[i].b = (unsigned char)((float)((pixel & 0b0000000011110000) >> 4)*(f">255.0f/15));
pixels[i].a = (unsigned char)((float)(pixel & 0b0000000000001111)*(f">255.0f/15));
pixels[i].r = (unsigned char)((float)((pixel & 0b1111000000000000) >> 12)*(i">255/15));
pixels[i].g = (unsigned char)((float)((pixel & 0b0000111100000000) >> 8)*(i">255/15));
pixels[i].b = (unsigned char)((float)((pixel & 0b0000000011110000) >> 4)*(i">255/15));
pixels[i].a = (unsigned char)((float)(pixel & 0b0000000000001111)*(i">255/15));
} break;
case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8:
@ -3234,9 +3234,9 @@ Color GetImageColor(Image image, int x, int y)
{
unsigned short pixel = ((unsigned short *)image.data)[y*image.width + x];
color.r = (unsigned char)((float)((pixel & 0b1111100000000000) >> 11)*(f">255.0f/31));
color.g = (unsigned char)((float)((pixel & 0b0000011111000000) >> 6)*(f">255.0f/31));
color.b = (unsigned char)((float)((pixel & 0b0000000000111110) >> 1)*(f">255.0f/31));
color.r = (unsigned char)((float)((pixel & 0b1111100000000000) >> 11)*(i">255/31));
color.g = (unsigned char)((float)((pixel & 0b0000011111000000) >> 6)*(i">255/31));
color.b = (unsigned char)((float)((pixel & 0b0000000000111110) >> 1)*(i">255/31));
color.a = (unsigned char)((pixel & 0b0000000000000001)*255);
} break;
@ -3244,9 +3244,9 @@ Color GetImageColor(Image image, int x, int y)
{
unsigned short pixel = ((unsigned short *)image.data)[y*image.width + x];
color.r = (unsigned char)((float)((pixel & 0b1111100000000000) >> 11)*(f">255.0f/31));
color.g = (unsigned char)((float)((pixel & 0b0000011111100000) >> 5)*(f">255.0f/63));
color.b = (unsigned char)((float)(pixel & 0b0000000000011111)*(f">255.0f/31));
color.r = (unsigned char)((float)((pixel & 0b1111100000000000) >> 11)*(i">255/31));
color.g = (unsigned char)((float)((pixel & 0b0000011111100000) >> 5)*(i">255/63));
color.b = (unsigned char)((float)(pixel & 0b0000000000011111)*(i">255/31));
color.a = 255;
} break;
@ -3254,10 +3254,10 @@ Color GetImageColor(Image image, int x, int y)
{
unsigned short pixel = ((unsigned short *)image.data)[y*image.width + x];
color.r = (unsigned char)((float)((pixel & 0b1111000000000000) >> 12)*(f">255.0f/15));
color.g = (unsigned char)((float)((pixel & 0b0000111100000000) >> 8)*(f">255.0f/15));
color.b = (unsigned char)((float)((pixel & 0b0000000011110000) >> 4)*(f">255.0f/15));
color.a = (unsigned char)((float)(pixel & 0b0000000000001111)*(f">255.0f/15));
color.r = (unsigned char)((float)((pixel & 0b1111000000000000) >> 12)*(i">255/15));
color.g = (unsigned char)((float)((pixel & 0b0000111100000000) >> 8)*(i">255/15));
color.b = (unsigned char)((float)((pixel & 0b0000000011110000) >> 4)*(i">255/15));
color.a = (unsigned char)((float)(pixel & 0b0000000000001111)*(i">255/15));
} break;
case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8:
@ -5203,26 +5203,26 @@ Color GetPixelColor(void *srcPtr, int format)
case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: color = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1] }; break;
case PIXELFORMAT_UNCOMPRESSED_R5G6B5:
{
color.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 11)*f">255.0f/31);
color.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 5) & 0b0000000000111111)*f">255.0f/63);
color.b = (unsigned char)((((unsigned short *)srcPtr)[0] & 0b0000000000011111)*f">255.0f/31);
color.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 11)*i">255/31);
color.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 5) & 0b0000000000111111)*i">255/63);
color.b = (unsigned char)((((unsigned short *)srcPtr)[0] & 0b0000000000011111)*i">255/31);
color.a = 255;
} break;
case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1:
{
color.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 11)*f">255.0f/31);
color.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 6) & 0b0000000000011111)*f">255.0f/31);
color.b = (unsigned char)((((unsigned short *)srcPtr)[0] & 0b0000000000011111)*f">255.0f/31);
color.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 11)*i">255/31);
color.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 6) & 0b0000000000011111)*i">255/31);
color.b = (unsigned char)((((unsigned short *)srcPtr)[0] & 0b0000000000011111)*i">255/31);
color.a = (((unsigned short *)srcPtr)[0] & 0b0000000000000001)? 255 : 0;
} break;
case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4:
{
color.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 12)*f">255.0f/15);
color.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 8) & 0b0000000000001111)*f">255.0f/15);
color.b = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 4) & 0b0000000000001111)*f">255.0f/15);
color.a = (unsigned char)((((unsigned short *)srcPtr)[0] & 0b0000000000001111)*f">255.0f/15);
color.r = (unsigned char)((((unsigned short *)srcPtr)[0] >> 12)*i">255/15);
color.g = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 8) & 0b0000000000001111)*i">255/15);
color.b = (unsigned char)(((((unsigned short *)srcPtr)[0] >> 4) & 0b0000000000001111)*i">255/15);
color.a = (unsigned char)((((unsigned short *)srcPtr)[0] & 0b0000000000001111)*i">255/15);
} break;
case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: color = (Color){ ((unsigned char *)srcPtr)[0], ((unsigned char *)srcPtr)[1], ((unsigned char *)srcPtr)[2], ((unsigned char *)srcPtr)[3] }; break;
@ -5602,4 +5602,4 @@ static Vector4 *LoadImageDataNormalized(Image image)
return pixels;
}
#endif // SUPPORT_MODULE_RTEXTURES
#endif // SUPPORT_MODULE_RTEXTURES

Loading…
Откажи
Сачувај