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 929b15d..b35963e 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 );