logarithm
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 8 Nov 2009 18:01:05 +0000 (18:01 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 8 Nov 2009 18:01:05 +0000 (18:01 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9456 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
mvm_cmds.c
prvm_cmds.c
prvm_cmds.h
svvm_cmds.c

index d509e74..82d63a1 100644 (file)
@@ -4191,7 +4191,7 @@ VM_CL_SpawnParticleDelayed,               // #528 float(vector org, vector vel, float delay,
 VM_loadfromdata,                               // #529
 VM_loadfromfile,                               // #530
 NULL,                                                  // #531
-NULL,                                                  // #532
+VM_log,                                                        // #532
 NULL,                                                  // #533
 NULL,                                                  // #534
 NULL,                                                  // #535
index b22db36..29f4406 100644 (file)
@@ -21,6 +21,7 @@ char *vm_m_extensions =
 "DP_QC_CVAR_TYPE "
 "DP_QC_CVAR_DESCRIPTION "
 "DP_QC_FINDCHAIN_TOFIELD "
+"DP_QC_LOG "
 "DP_QC_RENDER_SCENE "
 "DP_QC_STRFTIME "
 "DP_QC_STRINGBUFFERS "
@@ -1309,7 +1310,7 @@ NULL,                                                                     // #528
 NULL,                                                                  // #529
 NULL,                                                                  // #530
 NULL,                                                                  // #531
-NULL,                                                                  // #532
+VM_log,                                                                        // #532
 NULL,                                                                  // #533
 NULL,                                                                  // #534
 NULL,                                                                  // #535
index 2950c00..be7fc68 100644 (file)
@@ -1568,6 +1568,12 @@ void VM_pow (void)
        PRVM_G_FLOAT(OFS_RETURN) = pow(PRVM_G_FLOAT(OFS_PARM0), PRVM_G_FLOAT(OFS_PARM1));
 }
 
+void VM_log (void)
+{
+       VM_SAFEPARMCOUNT(1,VM_log);
+       PRVM_G_FLOAT(OFS_RETURN) = log(PRVM_G_FLOAT(OFS_PARM0));
+}
+
 void VM_Files_Init(void)
 {
        int i;
index cb83fb5..b2e8527 100644 (file)
@@ -277,6 +277,7 @@ void VM_min (void);
 void VM_max (void);
 void VM_bound (void);
 void VM_pow (void);
+void VM_log (void);
 void VM_asin (void);
 void VM_acos (void);
 void VM_atan (void);
index 879ada0..030bb92 100644 (file)
@@ -88,6 +88,7 @@ char *vm_sv_extensions =
 "DP_QC_GETTAGINFO_BONEPROPERTIES "
 "DP_QC_GETTIME "
 "DP_QC_GETTIME_CDTRACK "
+"DP_QC_LOG "
 "DP_QC_MINMAXBOUND "
 "DP_QC_MULTIPLETEMPSTRINGS "
 "DP_QC_NUM_FOR_EDICT "
@@ -3608,7 +3609,7 @@ NULL,                                                     // #528
 VM_loadfromdata,                               // #529
 VM_loadfromfile,                               // #530
 VM_SV_setpause,                                        // #531 void(float pause) setpause = #531;
-NULL,                                                  // #532
+VM_log,                                                        // #532
 NULL,                                                  // #533
 NULL,                                                  // #534
 NULL,                                                  // #535