Skip to content

Commit

Permalink
Renderers: Revert whitespace changes in tr_image_load.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
JKSunny committed Apr 15, 2024
1 parent 90d4de9 commit ba9c5e8
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions codemp/rd-common/tr_image_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,37 +107,34 @@ void R_LoadImage( const char *shortname, byte **pic, int *width, int *height ) {
*height = 0;

// Try loading the image with the original extension (if possible).
const char *extension = COM_GetExtension(shortname);
const ImageLoaderMap *imageLoader = FindImageLoader(extension);
if (imageLoader != NULL)
const char *extension = COM_GetExtension (shortname);
const ImageLoaderMap *imageLoader = FindImageLoader (extension);
if ( imageLoader != NULL )
{
imageLoader->loader(shortname, pic, width, height);
if (*pic)
imageLoader->loader (shortname, pic, width, height);
if ( *pic )
{
return;
}
}

// Loop through all the image loaders trying to load this image.
char extensionlessName[MAX_QPATH];
COM_StripExtension(shortname, extensionlessName, sizeof(extensionlessName));
for (int i = 0; i < numImageLoaders; i++)
COM_StripExtension(shortname, extensionlessName, sizeof( extensionlessName ));
for ( int i = 0; i < numImageLoaders; i++ )
{
const ImageLoaderMap *tryLoader = &imageLoaders[i];
if (tryLoader == imageLoader)
if ( tryLoader == imageLoader )
{
// Already tried this one.
continue;
}

const char *name = va("%s.%s", extensionlessName, tryLoader->extension);

tryLoader->loader(name, pic, width, height);
if (*pic)
const char *name = va ("%s.%s", extensionlessName, tryLoader->extension);
tryLoader->loader (name, pic, width, height);
if ( *pic )
{
return;
}
}

return;
}

0 comments on commit ba9c5e8

Please sign in to comment.