engine: imagelib: img_wad: dirty hack to fix black holes in console background images

This commit is contained in:
Alibek Omarov 2022-12-08 05:39:29 +03:00
parent 7469d6a248
commit ea3bfd969c

View File

@ -311,6 +311,9 @@ qboolean Image_LoadLMP( const char *name, const byte *buffer, fs_offset_t filesi
{ {
int numcolors; int numcolors;
// HACKHACK: console background image shouldn't be transparent
if( !Q_stristr( name, "conback" ))
{
for( i = 0; i < pixels; i++ ) for( i = 0; i < pixels; i++ )
{ {
if( fin[i] == 255 ) if( fin[i] == 255 )
@ -320,6 +323,7 @@ qboolean Image_LoadLMP( const char *name, const byte *buffer, fs_offset_t filesi
break; break;
} }
} }
}
pal = fin + pixels; pal = fin + pixels;
numcolors = *(short *)pal; numcolors = *(short *)pal;
if( numcolors != 256 ) pal = NULL; // corrupted lump ? if( numcolors != 256 ) pal = NULL; // corrupted lump ?