]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.c
make the endless loop run in 3 milliseconds (fixes BIH TracePoint)
[xonotic/darkplaces.git] / model_shared.c
index 559de9e8140e78fad525fb831a4c2f2dd3fb001c..0761758c6f366c79f5efa66c3225d115d58b103b 100644 (file)
@@ -2797,7 +2797,7 @@ void Mod_BuildVBOs(void)
                        VectorScale(loadmodel->surfmesh.data_tvector3f + 3*vertexindex, 1.0f, vertexmesh->tvector3f);
                        VectorScale(loadmodel->surfmesh.data_normal3f + 3*vertexindex, 1.0f, vertexmesh->normal3f);
                        if (loadmodel->surfmesh.data_lightmapcolor4f)
-                               Vector4Scale(loadmodel->surfmesh.data_lightmapcolor4f + 4*vertexindex, 255.0f, vertexmesh->color4ub);
+                               Vector4Copy(loadmodel->surfmesh.data_lightmapcolor4f + 4*vertexindex, vertexmesh->color4f);
                        Vector2Copy(loadmodel->surfmesh.data_texcoordtexture2f + 2*vertexindex, vertexmesh->texcoordtexture2f);
                        if (loadmodel->surfmesh.data_texcoordlightmap2f)
                                Vector2Scale(loadmodel->surfmesh.data_texcoordlightmap2f + 2*vertexindex, 1.0f, vertexmesh->texcoordlightmap2f);
@@ -3428,8 +3428,8 @@ static void Mod_GenerateLightmaps_LightPoint(dp_model_t *model, const vec3_t pos
                        continue;
                lightiradius = 1.0f / lightradius;
                dist = sqrt(dist2) * lightiradius;
-               intensity = dist < 1 ? ((1.0f - dist) * r_shadow_lightattenuationlinearscale.value / (r_shadow_lightattenuationdividebias.value + dist*dist)) : 0;
-               if (intensity <= 0)
+               intensity = (1.0f - dist) * r_shadow_lightattenuationlinearscale.value / (r_shadow_lightattenuationdividebias.value + dist*dist);
+               if (intensity <= 0.0f)
                        continue;
                if (model && model->TraceLine)
                {