mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Don't upload 8 bit grayscale images as 16 bit luminance
Using more color bits than the source image provides shouldn't improve the quality.
This commit is contained in:
parent
bead4aa8c7
commit
476134f5a6
2 changed files with 4 additions and 16 deletions
|
@ -206,7 +206,6 @@ void R_ImageList_f( void ) {
|
|||
estSize *= 4;
|
||||
break;
|
||||
case GL_LUMINANCE8:
|
||||
case GL_LUMINANCE16:
|
||||
case GL_LUMINANCE:
|
||||
format = "L ";
|
||||
// 1 byte per pixel?
|
||||
|
@ -219,7 +218,6 @@ void R_ImageList_f( void ) {
|
|||
estSize *= 3;
|
||||
break;
|
||||
case GL_LUMINANCE8_ALPHA8:
|
||||
case GL_LUMINANCE16_ALPHA16:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
format = "LA ";
|
||||
// 2 bytes per pixel?
|
||||
|
@ -684,10 +682,8 @@ static void Upload32( unsigned *data,
|
|||
{
|
||||
if(r_greyscale->integer)
|
||||
{
|
||||
if(r_texturebits->integer == 16)
|
||||
if(r_texturebits->integer == 16 || r_texturebits->integer == 32)
|
||||
internalFormat = GL_LUMINANCE8;
|
||||
else if(r_texturebits->integer == 32)
|
||||
internalFormat = GL_LUMINANCE16;
|
||||
else
|
||||
internalFormat = GL_LUMINANCE;
|
||||
}
|
||||
|
@ -719,10 +715,8 @@ static void Upload32( unsigned *data,
|
|||
{
|
||||
if(r_greyscale->integer)
|
||||
{
|
||||
if(r_texturebits->integer == 16)
|
||||
if(r_texturebits->integer == 16 || r_texturebits->integer == 32)
|
||||
internalFormat = GL_LUMINANCE8_ALPHA8;
|
||||
else if(r_texturebits->integer == 32)
|
||||
internalFormat = GL_LUMINANCE16_ALPHA16;
|
||||
else
|
||||
internalFormat = GL_LUMINANCE_ALPHA;
|
||||
}
|
||||
|
|
|
@ -222,7 +222,6 @@ void R_ImageList_f( void ) {
|
|||
estSize *= 4;
|
||||
break;
|
||||
case GL_LUMINANCE8:
|
||||
case GL_LUMINANCE16:
|
||||
case GL_LUMINANCE:
|
||||
format = "L ";
|
||||
// 1 byte per pixel?
|
||||
|
@ -235,7 +234,6 @@ void R_ImageList_f( void ) {
|
|||
estSize *= 3;
|
||||
break;
|
||||
case GL_LUMINANCE8_ALPHA8:
|
||||
case GL_LUMINANCE16_ALPHA16:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
format = "LA ";
|
||||
// 2 bytes per pixel?
|
||||
|
@ -1724,10 +1722,8 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, GLenum picForm
|
|||
{
|
||||
if(r_greyscale->integer)
|
||||
{
|
||||
if(r_texturebits->integer == 16)
|
||||
if(r_texturebits->integer == 16 || r_texturebits->integer == 32)
|
||||
internalFormat = GL_LUMINANCE8;
|
||||
else if(r_texturebits->integer == 32)
|
||||
internalFormat = GL_LUMINANCE16;
|
||||
else
|
||||
internalFormat = GL_LUMINANCE;
|
||||
}
|
||||
|
@ -1763,10 +1759,8 @@ static GLenum RawImage_GetFormat(const byte *data, int numPixels, GLenum picForm
|
|||
{
|
||||
if(r_greyscale->integer)
|
||||
{
|
||||
if(r_texturebits->integer == 16)
|
||||
if(r_texturebits->integer == 16 || r_texturebits->integer == 32)
|
||||
internalFormat = GL_LUMINANCE8_ALPHA8;
|
||||
else if(r_texturebits->integer == 32)
|
||||
internalFormat = GL_LUMINANCE16_ALPHA16;
|
||||
else
|
||||
internalFormat = GL_LUMINANCE_ALPHA;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue