]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
also load DDS files the way DarkPlaces stores them (does DDS loading even work?)
authorRudolf Polzer <divverent@alientrap.org>
Wed, 23 Feb 2011 12:24:47 +0000 (13:24 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 23 Feb 2011 12:24:47 +0000 (13:24 +0100)
tools/quake3/q3map2/image.c

index 929b15d96cf5ec6c5e256955c16d0b40f0d9fdda..b35963e6837538fff6d09467708cd62aaff6e65b 100644 (file)
@@ -419,6 +419,12 @@ image_t *ImageLoad( const char *filename )
                                StripExtension( name );
                                strcat( name, ".dds" );
                                size = vfsLoadFile( (const char*) name, (void**) &buffer, 0 );
+                               if(size <= 0)
+                               {
+                                       memmove(name + 4, name, strlen(name) + 1);
+                                       memcpy(name, "dds/", 4);
+                                       size = vfsLoadFile( (const char*) name, (void**) &buffer, 0 );
+                               }
                                if( size > 0 )
                                {
                                        LoadDDSBuffer( buffer, size, &image->pixels, &image->width, &image->height );