]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_particles.c
Gecko: load OffscreenGecko dynamically
[xonotic/darkplaces.git] / cl_particles.c
index a12e6844ab841ac60716182de6b58074b5d1e9c7..e9def1a549b1f53ce650870e0159f65be6c33b41 100644 (file)
@@ -902,7 +902,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o
                float len, dec, qd;
                int smoke, blood, bubbles, r, color;
 
-               if (spawndlight && r_refdef.numlights < MAX_DLIGHTS)
+               if (spawndlight && r_refdef.scene.numlights < MAX_DLIGHTS)
                {
                        vec4_t light;
                        Vector4Set(light, 0, 0, 0, 0);
@@ -923,7 +923,7 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o
                        {
                                matrix4x4_t tempmatrix;
                                Matrix4x4_CreateFromQuakeEntity(&tempmatrix, originmaxs[0], originmaxs[1], originmaxs[2], 0, 0, 0, light[3]);
-                               R_RTLight_Update(&r_refdef.lights[r_refdef.numlights++], false, &tempmatrix, light, -1, NULL, true, 1, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+                               R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &tempmatrix, light, -1, NULL, true, 1, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                        }
                }
 
@@ -1170,7 +1170,7 @@ void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins
                                                // glowing entity
                                                // called by CL_LinkNetworkEntity
                                                Matrix4x4_Scale(&tempmatrix, info->lightradiusstart, 1);
-                                               R_RTLight_Update(&r_refdef.lights[r_refdef.numlights++], false, &tempmatrix, info->lightcolor, -1, info->lightcubemapnum > 0 ? va("cubemaps/%i", info->lightcubemapnum) : NULL, info->lightshadow, 1, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+                                               R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &tempmatrix, info->lightcolor, -1, info->lightcubemapnum > 0 ? va("cubemaps/%i", info->lightcubemapnum) : NULL, info->lightshadow, 1, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                                        }
                                }
 
@@ -2229,9 +2229,9 @@ void R_DrawDecal_TransparentCallback(const entity_render_t *ent, const rtlight_t
 
                //blendmode = particletype[d->typeindex].blendmode;
 
-               cr = d->color[0] * (1.0f / 255.0f) * r_view.colorscale;
-               cg = d->color[1] * (1.0f / 255.0f) * r_view.colorscale;
-               cb = d->color[2] * (1.0f / 255.0f) * r_view.colorscale;
+               cr = d->color[0] * (1.0f / 255.0f) * r_refdef.view.colorscale;
+               cg = d->color[1] * (1.0f / 255.0f) * r_refdef.view.colorscale;
+               cb = d->color[2] * (1.0f / 255.0f) * r_refdef.view.colorscale;
                ca = d->alpha * (1.0f / 255.0f);
                //if (blendmode == PBLEND_MOD)
                {
@@ -2253,9 +2253,9 @@ void R_DrawDecal_TransparentCallback(const entity_render_t *ent, const rtlight_t
                        //if (blendmode == PBLEND_ALPHA)
                        //{
                        //      fog = 1 - fog;
-                       //      cr += r_refdef.fogcolor[0] * fog * r_view.colorscale;
-                       //      cg += r_refdef.fogcolor[1] * fog * r_view.colorscale;
-                       //      cb += r_refdef.fogcolor[2] * fog * r_view.colorscale;
+                       //      cr += r_refdef.fogcolor[0] * fog;
+                       //      cg += r_refdef.fogcolor[1] * fog;
+                       //      cb += r_refdef.fogcolor[2] * fog;
                        //}
                }
                c4f[0] = c4f[4] = c4f[8] = c4f[12] = cr;
@@ -2364,9 +2364,9 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
 
                blendmode = particletype[p->typeindex].blendmode;
 
-               cr = p->color[0] * (1.0f / 255.0f) * r_view.colorscale;
-               cg = p->color[1] * (1.0f / 255.0f) * r_view.colorscale;
-               cb = p->color[2] * (1.0f / 255.0f) * r_view.colorscale;
+               cr = p->color[0] * (1.0f / 255.0f) * r_refdef.view.colorscale;
+               cg = p->color[1] * (1.0f / 255.0f) * r_refdef.view.colorscale;
+               cb = p->color[2] * (1.0f / 255.0f) * r_refdef.view.colorscale;
                ca = p->alpha * (1.0f / 255.0f);
                if (blendmode == PBLEND_MOD)
                {
@@ -2396,9 +2396,9 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
                        if (blendmode == PBLEND_ALPHA)
                        {
                                fog = 1 - fog;
-                               cr += r_refdef.fogcolor[0] * fog * r_view.colorscale;
-                               cg += r_refdef.fogcolor[1] * fog * r_view.colorscale;
-                               cb += r_refdef.fogcolor[2] * fog * r_view.colorscale;
+                               cr += r_refdef.fogcolor[0] * fog;
+                               cg += r_refdef.fogcolor[1] * fog;
+                               cb += r_refdef.fogcolor[2] * fog;
                        }
                }
                c4f[0] = c4f[4] = c4f[8] = c4f[12] = cr;
@@ -2412,8 +2412,8 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
                switch(particletype[p->typeindex].orientation)
                {
                case PARTICLE_BILLBOARD:
-                       VectorScale(r_view.left, -size, right);
-                       VectorScale(r_view.up, size, up);
+                       VectorScale(r_refdef.view.left, -size, right);
+                       VectorScale(r_refdef.view.up, size, up);
                        v3f[ 0] = org[0] - right[0] - up[0];
                        v3f[ 1] = org[1] - right[1] - up[1];
                        v3f[ 2] = org[2] - right[2] - up[2];
@@ -2548,10 +2548,10 @@ void R_DrawParticles (void)
        if ((!cl.num_particles) || (!r_drawparticles.integer))
                return;
 
-       minparticledist = DotProduct(r_view.origin, r_view.forward) + 4.0f;
+       minparticledist = DotProduct(r_refdef.view.origin, r_refdef.view.forward) + 4.0f;
 
        // LordHavoc: only render if not too close
        for (i = 0, p = cl.particles;i < cl.num_particles;i++, p++)
-               if (p->typeindex && !p->delayedspawn && (DotProduct(p->org, r_view.forward) >= minparticledist || particletype[p->typeindex].orientation == PARTICLE_BEAM))
+               if (p->typeindex && !p->delayedspawn && (DotProduct(p->org, r_refdef.view.forward) >= minparticledist || particletype[p->typeindex].orientation == PARTICLE_BEAM))
                        R_MeshQueue_AddTransparent(p->org, R_DrawParticle_TransparentCallback, NULL, i, NULL);
 }