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.
This commit is contained in:
Alibek Omarov 2023-03-25 06:58:03 +03:00
parent e673fe9a02
commit 1caa276531
1 changed files with 3 additions and 4 deletions

View File

@ -321,10 +321,9 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size )
{
for( i = 0; i < 6; i++ )
{
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
if( Image_ProbeLoad( extfmt, loadname, cmap->type[i].suf, cmap->type[i].hint ))
{
break;
FS_AddSideToPack( cmap->type[i].flags );
}
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 )
{
// unexpected errors ?