]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
q3map2: also look for .dds file in dds/ prefix like Doom3 or Darkplaces 172/head
authorThomas Debesse <dev@illwieckz.net>
Thu, 18 Feb 2021 19:46:01 +0000 (20:46 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sat, 20 Feb 2021 16:59:58 +0000 (17:59 +0100)
also tell user which image file is found for the given texture path

tools/quake3/q3map2/image.c

index 36658b86dead1f5578a8202a636e60325c6e16bb..93f1b6ed76f19f792d708e7538d68bee351e8833 100644 (file)
@@ -461,6 +461,16 @@ image_t *ImageLoad( const char *filename ){
        StripExtension( name );
        strcat( name, ".dds" );
        size = vfsLoadFile( (const char*) name, (void**) &buffer, 0 );
+
+       /* also look for .dds image in dds/ prefix like Doom3 or DarkPlaces */
+       if ( size <= 0 ) {
+               strcpy( name, "dds/" );
+               strcat( name, image->name );
+               StripExtension( name );
+               strcat( name, ".dds" );
+               size = vfsLoadFile( (const char*) name, (void**) &buffer, 0 );
+       }
+
        if ( size > 0 ) {
                LoadDDSBuffer( buffer, size, &image->pixels, &image->width, &image->height );
                goto image_load_success;
@@ -497,6 +507,9 @@ image_t *ImageLoad( const char *filename ){
 
        image_load_success:
 
+       /* tell user which image file is found for the given texture path */
+       Sys_FPrintf( SYS_VRB, "Loaded image: \"%s\"\n", name );
+
        /* free file buffer */
        free( buffer );