Browse Source

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

pull/2/head
Alibek Omarov 2 years ago
parent
commit
ea3bfd969c
  1. 4
      engine/common/imagelib/img_wad.c

4
engine/common/imagelib/img_wad.c

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

Loading…
Cancel
Save