also -deluxemapsastexcoord

This commit is contained in:
Rudolf Polzer 2010-12-26 00:18:13 +01:00
parent bd191dea07
commit 5245aefcbe
3 changed files with 15 additions and 10 deletions

View File

@ -165,10 +165,10 @@ static void ConvertSurface( FILE *f, bspModel_t *model, int modelNum, bspDrawSur
fprintf( f, "\t*PROP_RECVSHADOW\t1\r\n" );
if(lightmapsAsTexcoord)
{
if(ds->lightmapNum[0] >= 0 && ds->lightmapNum[0] < numLightmapsASE)
fprintf( f, "\t*MATERIAL_REF\t%d\r\n", ds->lightmapNum[0] );
if(ds->lightmapNum[0] >= 0 && ds->lightmapNum[0] + deluxemap < numLightmapsASE)
fprintf( f, "\t*MATERIAL_REF\t%d\r\n", ds->lightmapNum[0] + deluxemap );
else
Sys_Printf( "WARNING: lightmap %d out of range, not exporting\n", ds->lightmapNum[0] );
Sys_Printf( "WARNING: lightmap %d out of range, not exporting\n", ds->lightmapNum[0] + deluxemap );
}
else
fprintf( f, "\t*MATERIAL_REF\t%d\r\n", ds->shaderNum );

View File

@ -74,18 +74,18 @@ static void ConvertSurfaceToOBJ( FILE *f, bspModel_t *model, int modelNum, bspDr
{
if(objLastShaderNum != ds->lightmapNum[0])
{
fprintf(f, "usemtl lm_%04d\r\n", ds->lightmapNum[0]);
objLastShaderNum = ds->lightmapNum[0];
fprintf(f, "usemtl lm_%04d\r\n", ds->lightmapNum[0] + deluxemap);
objLastShaderNum = ds->lightmapNum[0] + deluxemap;
}
if(ds->lightmapNum[0] < firstLightmap)
if(ds->lightmapNum[0] + deluxemap < firstLightmap)
{
Sys_Printf( "WARNING: lightmap %d out of range (exporting anyway)\n", ds->lightmapNum[0] );
firstLightmap = ds->lightmapNum[0];
Sys_Printf( "WARNING: lightmap %d out of range (exporting anyway)\n", ds->lightmapNum[0] + deluxemap );
firstLightmap = ds->lightmapNum[0] + deluxemap;
}
if(ds->lightmapNum[0] > lastLightmap)
{
Sys_Printf( "WARNING: lightmap %d out of range (exporting anyway)\n", ds->lightmapNum[0] );
lastLightmap = ds->lightmapNum[0];
Sys_Printf( "WARNING: lightmap %d out of range (exporting anyway)\n", ds->lightmapNum[0] + deluxemap );
lastLightmap = ds->lightmapNum[0] + deluxemap;
}
}
else

View File

@ -1604,6 +1604,11 @@ int ConvertBSPMain( int argc, char **argv )
shadersAsBitmap = qtrue;
else if( !strcmp( argv[ i ], "-lightmapsastexcoord" ) )
lightmapsAsTexcoord = qtrue;
else if( !strcmp( argv[ i ], "-deluxemapsastexcoord" ) )
{
lightmapsAsTexcoord = qtrue;
deluxemap = qtrue;
}
else if( !strcmp( argv[ i ], "-forcereadbsp" ) )
force_bsp = qtrue;
else if( !strcmp( argv[ i ], "-meta" ) )