From: Rudolf Polzer Date: Wed, 23 Feb 2011 12:24:47 +0000 (+0100) Subject: also load DDS files the way DarkPlaces stores them (does DDS loading even work?) X-Git-Tag: xonotic-v0.5.0~45 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8850310690375a24654e7f0ff9b76ea55ddd1470;p=xonotic%2Fnetradiant.git also load DDS files the way DarkPlaces stores them (does DDS loading even work?) --- diff --git a/tools/quake3/q3map2/image.c b/tools/quake3/q3map2/image.c index 929b15d9..b35963e6 100644 --- a/tools/quake3/q3map2/image.c +++ b/tools/quake3/q3map2/image.c @@ -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 );