Browse Source

engine: common: imagelib: fix loading cubemaps

Loop break was a bug that was added after refactoring imagelib loader.

In fact, it was mindlessly copypasted from old code, where same break was
used to quickly exit from inner format bruteforcing loop, than outer cubemap
loading loop.
pull/2/head
Alibek Omarov 2 years ago
parent
commit
1caa276531
  1. 7
      engine/common/imagelib/img_main.c

7
engine/common/imagelib/img_main.c

@ -321,10 +321,9 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size )
{ {
for( i = 0; i < 6; i++ ) for( i = 0; i < 6; i++ )
{ {
if( Image_ProbeLoad( extfmt, loadname, cmap->type[i].suf, cmap->type[i].hint ) && if( Image_ProbeLoad( extfmt, loadname, cmap->type[i].suf, cmap->type[i].hint ))
FS_AddSideToPack( cmap->type[i].flags )) // process flags to flip some sides
{ {
break; FS_AddSideToPack( cmap->type[i].flags );
} }
if( image.num_sides != i + 1 ) // check side if( image.num_sides != i + 1 ) // check side
@ -339,7 +338,7 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size )
} }
} }
// make sure what all sides is loaded // make sure that all sides is loaded
if( image.num_sides != 6 ) if( image.num_sides != 6 )
{ {
// unexpected errors ? // unexpected errors ?

Loading…
Cancel
Save