entity_t *e;
vec3_t origin;
const char *key;
- char name[ 1024 ], base[ 1024 ];
+ char name[ 1024 ], base[ 1024 ], dirname[ 1024 ];
/* note it */
Sys_Printf( "--- Convert BSP to ASE ---\n" );
/* create the ase filename from the bsp name */
+ strcpy( dirname, bspName );
+ StripExtension( dirname );
strcpy( name, bspName );
StripExtension( name );
strcat( name, ".ase" );
{
char buf[1024];
FILE *tmp;
- snprintf(buf, sizeof(buf), "%s/lm_%04d.tga", base, lightmapCount);
+ snprintf(buf, sizeof(buf), "%s/lm_%04d.tga", dirname, lightmapCount);
buf[sizeof(buf) - 1] = 0;
tmp = fopen(buf, "rb");
if(!tmp)
entity_t *e;
vec3_t origin;
const char *key;
- char name[ 1024 ], base[ 1024 ], mtlname[ 1024 ];
+ char name[ 1024 ], base[ 1024 ], mtlname[ 1024 ], dirname[ 1024 ];
/* note it */
Sys_Printf( "--- Convert BSP to OBJ ---\n" );
/* create the ase filename from the bsp name */
+ strcpy( dirname, bspName );
+ StripExtension( dirname );
strcpy( name, bspName );
StripExtension( name );
strcat( name, ".obj" );
/* print header */
fprintf( f, "o %s\r\n", base );
fprintf( f, "# Generated by Q3Map2 (ydnar) -convert -format obj\r\n" );
- fprintf( f, "mtllib %s\r\n", mtlname );
+ fprintf( f, "mtllib %s.mtl\r\n", base );
fprintf( fmtl, "# Generated by Q3Map2 (ydnar) -convert -format obj\r\n" );
if(lightmapsAsTexcoord)
{
char buf[1024];
FILE *tmp;
- snprintf(buf, sizeof(buf), "%s/lm_%04d.tga", base, lightmapCount);
+ snprintf(buf, sizeof(buf), "%s/lm_%04d.tga", dirname, lightmapCount);
buf[sizeof(buf) - 1] = 0;
tmp = fopen(buf, "rb");
if(!tmp)