]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
CSQC Getlight - added globals:
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 24 Sep 2011 15:35:49 +0000 (15:35 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 24 Sep 2011 15:35:49 +0000 (15:35 +0000)
  vector getlight_dir;
  vector getlight_ambient;
  vector getlight_diffuse;

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11366 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
dpdefs/csprogsdefs.qc
prvm_offsets.h

index 0e3e515d44dd7e4bd1034476f0b1fbc8989185a2..289d071c3585bacf8af2af64105c314aecab2729 100644 (file)
@@ -681,7 +681,7 @@ static void VM_CL_getlight (void)
        vec3_t ambientcolor, diffusecolor, diffusenormal;
        vec_t *p;
 
-       VM_SAFEPARMCOUNTRANGE(1, 2, VM_CL_getlight);
+       VM_SAFEPARMCOUNTRANGE(1, 3, VM_CL_getlight);
 
        p = PRVM_G_VECTOR(OFS_PARM0);
        VectorClear(ambientcolor);
@@ -692,6 +692,12 @@ static void VM_CL_getlight (void)
        else if (cl.worldmodel && cl.worldmodel->brush.LightPoint)
                cl.worldmodel->brush.LightPoint(cl.worldmodel, p, ambientcolor, diffusecolor, diffusenormal);
        VectorMA(ambientcolor, 0.5, diffusecolor, PRVM_G_VECTOR(OFS_RETURN));
+       if (PRVM_clientglobalvector(getlight_ambient))
+               VectorCopy(ambientcolor, PRVM_clientglobalvector(getlight_ambient));
+       if (PRVM_clientglobalvector(getlight_diffuse))
+               VectorCopy(diffusecolor, PRVM_clientglobalvector(getlight_diffuse));
+       if (PRVM_clientglobalvector(getlight_dir))
+               VectorCopy(diffusenormal, PRVM_clientglobalvector(getlight_dir));
 }
 
 //============================================================================
index 1a08e588e0d97abbb084e63cc20e01121c883293..bf284e05387e31a4b024704d50154bd543fab314 100644 (file)
@@ -399,6 +399,9 @@ void(vector v1, vector min, vector max, vector v2, float nomonsters, entity fore
 vector() randomvec = #91;
 vector(vector org) getlight = #92;
 vector(vector org, float lpflags) getlight2 = #92;
+vector getlight_dir;
+vector getlight_ambient;
+vector getlight_diffuse;
 const float LP_LIGHTMAP        = 1;
 const float LP_RTWORLD = 2;
 const float LP_DYNLIGHT = 4;
index cfcf220ab5c99a9521ac9883edb0d808e61f6683..3293081a81c32a6b44fa323e8a8ccd8be7bd2695 100644 (file)
@@ -100,6 +100,9 @@ PRVM_DECLARE_clientglobalfloat(dmg_take)
 PRVM_DECLARE_clientglobalfloat(drawfont)
 PRVM_DECLARE_clientglobalfloat(frametime)
 PRVM_DECLARE_clientglobalfloat(gettaginfo_parent)
+PRVM_DECLARE_clientglobalvector(getlight_ambient)
+PRVM_DECLARE_clientglobalvector(getlight_diffuse)
+PRVM_DECLARE_clientglobalvector(getlight_dir)
 PRVM_DECLARE_clientglobalfloat(input_buttons)
 PRVM_DECLARE_clientglobalfloat(input_timelength)
 PRVM_DECLARE_clientglobalfloat(intermission)
@@ -438,6 +441,9 @@ PRVM_DECLARE_global(gettaginfo_offset)
 PRVM_DECLARE_global(gettaginfo_parent)
 PRVM_DECLARE_global(gettaginfo_right)
 PRVM_DECLARE_global(gettaginfo_up)
+PRVM_DECLARE_global(getlight_ambient)
+PRVM_DECLARE_global(getlight_diffuse)
+PRVM_DECLARE_global(getlight_dir)
 PRVM_DECLARE_global(input_angles)
 PRVM_DECLARE_global(input_buttons)
 PRVM_DECLARE_global(input_movevalues)