added RF_FULLBRIGHT and RF_NOSHADOW renderflags for CSQC
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 18 Feb 2010 06:10:59 +0000 (06:10 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 18 Feb 2010 06:10:59 +0000 (06:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9982 d7cf8633-e32d-0410-b094-e92efae38249

csprogs.c
csprogs.h

index f8e47a6..ff12745 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -176,6 +176,7 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
                r_refdef.scene.entities[r_refdef.scene.numentities++] = entrender;
                entrender->entitynumber = edictnum;
                //entrender->shadertime = 0; // shadertime was set by spawn()
+               entrender->flags = 0;
                entrender->alpha = 1;
                entrender->scale = 1;
                VectorSet(entrender->colormod, 1, 1, 1);
@@ -255,7 +256,6 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
                if(renderflags & RF_NOCULL)             entrender->flags |= RENDER_NOCULL;
                if(renderflags & RF_DEPTHHACK)  entrender->flags |= RENDER_NODEPTHTEST;
                if(renderflags & RF_ADDITIVE)           entrender->flags |= RENDER_ADDITIVE;
-
        }
 
        c = (int)ed->fields.client->colormap;
@@ -270,7 +270,7 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
        // either fullbright or lit
        if(!r_fullbright.integer)
        {
-               if (!(entrender->effects & EF_FULLBRIGHT))
+               if (!(entrender->effects & EF_FULLBRIGHT) && !(renderflags & RF_FULLBRIGHT))
                        entrender->flags |= RENDER_LIGHT;
                else if(r_equalize_entities_fullbright.integer)
                        entrender->flags |= RENDER_LIGHT | RENDER_EQUALIZE;
@@ -278,6 +278,7 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
        // hide player shadow during intermission or nehahra movie
        if (!(entrender->effects & (EF_NOSHADOW | EF_ADDITIVE | EF_NODEPTHTEST))
         &&  (entrender->alpha >= 1)
+        && !(renderflags & RF_NOSHADOW)
         && !(entrender->flags & RENDER_VIEWMODEL)
         && (!(entrender->flags & RENDER_EXTERIORMODEL) || (!cl.intermission && cls.protocol != PROTOCOL_NEHAHRAMOVIE && !cl_noplayershadow.integer)))
                entrender->flags |= RENDER_SHADOW;
index c4db62b..6e2e517 100644 (file)
--- a/csprogs.h
+++ b/csprogs.h
@@ -51,6 +51,9 @@
 #define RF_USETRANSPARENTOFFSET 64 // Allows QC to customize origin used for transparent sorting via transparent_origin global, helps to fix transparent sorting bugs on a very large entities
 #define RF_NOCULL                              128 // do not cull this entity using r_cullentities, for large outdoor entities (asteroids on the sky. etc)
 
+#define RF_FULLBRIGHT                  256
+#define RF_NOSHADOW                            512
+
 extern cvar_t csqc_progname;   //[515]: csqc crc check and right csprogs name according to progs.dat
 extern cvar_t csqc_progcrc;
 extern cvar_t csqc_progsize;