]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/map.c
fix two msvc compile errors
[xonotic/netradiant.git] / tools / quake3 / q3map2 / map.c
index b986b18dccddf97cab3f6ba646b6753e5886c904..9b7ba71a55c1f33a472b122302f38d6eefb9fc73 100644 (file)
@@ -600,6 +600,7 @@ and links it to the current entity
 static void MergeOrigin(entity_t *ent, vec3_t origin)
 {
        vec3_t adjustment;
+       char string[128];
 
        /* we have not parsed the brush completely yet... */
        GetVectorForKey( ent, "origin", ent->origin );
@@ -608,7 +609,6 @@ static void MergeOrigin(entity_t *ent, vec3_t origin)
        VectorAdd(adjustment, ent->origin, ent->origin);
        VectorCopy(origin, ent->originbrush_origin);
 
-       char string[128];
        sprintf(string, "%f %f %f", ent->origin[0], ent->origin[1], ent->origin[2]);
        SetKeyValue(ent, "origin", string);
 }
@@ -1553,14 +1553,18 @@ static qboolean ParseMapEntity( qboolean onlyLights )
        /* get explicit shadow flags */
        GetEntityShadowFlags( mapEnt, NULL, &castShadows, &recvShadows );
        
+       /* vortex: added _ls key (short name of lightmapscale) */
        /* ydnar: get lightmap scaling value for this entity */
        if( strcmp( "", ValueForKey( mapEnt, "lightmapscale" ) ) ||
-               strcmp( "", ValueForKey( mapEnt, "_lightmapscale" ) ) )
+               strcmp( "", ValueForKey( mapEnt, "_lightmapscale" ) ) || 
+               strcmp( "", ValueForKey( mapEnt, "_ls" ) ) )
        {
                /* get lightmap scale from entity */
                lightmapScale = FloatForKey( mapEnt, "lightmapscale" );
                if( lightmapScale <= 0.0f )
                        lightmapScale = FloatForKey( mapEnt, "_lightmapscale" );
+               if( lightmapScale <= 0.0f )
+                       lightmapScale = FloatForKey( mapEnt, "_ls" );
                if( lightmapScale > 0.0f )
                        Sys_Printf( "Entity %d (%s) has lightmap scale of %.4f\n", mapEnt->mapEntityNum, classname, lightmapScale );
        }