From b4583908af7a5066a6074b94ddb38dfcb6ea78c0 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 25 Jun 2022 04:20:24 -0400 Subject: [PATCH] slight speed improvement; these weren't inlining properly, they do now though --- light/ltface.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/light/ltface.cc b/light/ltface.cc index f5625ed7..d4c9298f 100644 --- a/light/ltface.cc +++ b/light/ltface.cc @@ -1858,8 +1858,8 @@ inline qvec3f BounceLight_ColorAtDist( } // mxd. Surface light falloff. Returns color in [0,255] -static qvec3f SurfaceLight_ColorAtDist( - const settings::worldspawn_keys &cfg, const float intensity, const qvec3f color, const float dist) +inline qvec3f SurfaceLight_ColorAtDist( + const settings::worldspawn_keys &cfg, const float &intensity, const qvec3d &color, const float &dist) { // Exponential falloff const float d = max(dist, 16.0f); // Clamp away hotspots, also avoid division by 0... @@ -1898,7 +1898,7 @@ inline qvec3f GetIndirectLighting(const settings::worldspawn_keys &cfg, const bo // dir: vpl -> sample point direction // mxd. returns color in [0,255] -static qvec3f GetSurfaceLighting(const settings::worldspawn_keys &cfg, const surfacelight_t *vpl, const qvec3f &dir, +inline qvec3f GetSurfaceLighting(const settings::worldspawn_keys &cfg, const surfacelight_t *vpl, const qvec3f &dir, const float dist, const qvec3f &normal) { qvec3f result; @@ -1962,7 +1962,7 @@ SurfaceLight_SphereCull(const surfacelight_t *vpl, const lightsurf_t *lightsurf) const float dist = qv::length(dir) + lightsurf->radius; // Get light contribution - const qvec3f color = SurfaceLight_ColorAtDist(cfg, vpl->totalintensity, qvec3f(vpl->color), dist); + const qvec3f color = SurfaceLight_ColorAtDist(cfg, vpl->totalintensity, vpl->color, dist); return LightSample_Brightness(color) < 0.25f; }