- #ifdef BUILD_CRUNCH
- /* attempt to load crn */
- StripExtension( name );
- strcat( name, ".crn" );
- size = vfsLoadFile( ( const char* ) name, ( void** ) &buffer, 0 );
- if ( size > 0 ) {
- LoadCRNBuffer( buffer, size, &image->pixels, &image->width, &image->height );
- break;
- }
- #endif // BUILD_CRUNCH
- } while (qfalse);
+ #ifdef BUILD_CRUNCH
+ /* attempt to load crn */
+ StripExtension( name );
+ strcat( name, ".crn" );
+ size = vfsLoadFile( ( const char* ) name, ( void** ) &buffer, 0 );
+ if ( size > 0 ) {
+ LoadCRNBuffer( buffer, size, &image->pixels, &image->width, &image->height );
+ goto image_load_success;
+ }
+ #endif // BUILD_CRUNCH
+
+ /* attempt to load webp */
+ StripExtension( name );
+ strcat( name, ".webp" );
+ size = vfsLoadFile( (const char*) name, (void**) &buffer, 0 );
+ if ( size > 0 ) {
+ LoadWEBPBuffer( buffer, size, &image->pixels, &image->width, &image->height );
+ goto image_load_success;
+ }
+
+ image_load_success: