HalfLife renderamt support (why? boredom...)
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Aug 2000 00:03:04 +0000 (00:03 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Aug 2000 00:03:04 +0000 (00:03 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6 d7cf8633-e32d-0410-b094-e92efae38249

pr_edict.c
progs.h
sv_main.c

index 27ba135..c0ffb11 100644 (file)
@@ -92,6 +92,8 @@ int eval_glow_color;
 int eval_items2;
 int eval_scale;
 int eval_alpha;
+int eval_renderamt; // HalfLife support
+int eval_rendertype; // HalfLife support
 int eval_fullbright;
 int eval_ammo_shells1;
 int eval_ammo_nails1;
@@ -137,6 +139,8 @@ void FindEdictFieldOffsets()
        eval_items2 = FindFieldOffset("items2");
        eval_scale = FindFieldOffset("scale");
        eval_alpha = FindFieldOffset("alpha");
+       eval_renderamt = FindFieldOffset("renderamt"); // HalfLife support
+       eval_rendertype = FindFieldOffset("rendertype"); // HalfLife support
        eval_fullbright = FindFieldOffset("fullbright");
        eval_ammo_shells1 = FindFieldOffset("ammo_shells1");
        eval_ammo_nails1 = FindFieldOffset("ammo_nails1");
diff --git a/progs.h b/progs.h
index 7bcc6d1..f33e955 100644 (file)
--- a/progs.h
+++ b/progs.h
@@ -72,6 +72,8 @@ extern int eval_glow_color;
 extern int eval_items2;
 extern int eval_scale;
 extern int eval_alpha;
+extern int eval_renderamt; // HalfLife support
+extern int eval_rendertype; // HalfLife support
 extern int eval_fullbright;
 extern int eval_ammo_shells1;
 extern int eval_ammo_nails1;
index 5fbc78d..454d6a0 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -485,6 +485,8 @@ void SV_WriteEntitiesToClient (edict_t      *clent, sizebuf_t *msg)
                if (val = GETEDICTFIELDVALUE(ent, eval_alpha))
                if ((alpha = (int) (val->_float * 255.0)) == 0)
                        alpha = 255;
+               if (val = GETEDICTFIELDVALUE(ent, eval_renderamt)) // HalfLife support
+                       alpha -= (int) val->_float;
                if (alpha < 0) alpha = 0;
                if (alpha > 255) alpha = 255;