]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mvm_cmds.c
Fix a compile error on win32 I introduced.
[xonotic/darkplaces.git] / mvm_cmds.c
index 79edacfb2fa365c1c414912d482281f22fb8fac9..0e828304f72e4e3777840e47a35077ee2d2d403b 100644 (file)
@@ -36,6 +36,7 @@ const char *vm_m_extensions =
 "DP_QC_STRFTIME "
 "DP_QC_STRINGBUFFERS "
 "DP_QC_STRINGBUFFERS_CVARLIST "
+"DP_QC_STRINGBUFFERS_EXT_WIP "
 "DP_QC_STRINGCOLORFUNCTIONS "
 "DP_QC_STRING_CASE_FUNCTIONS "
 "DP_QC_STRREPLACE "
@@ -175,12 +176,28 @@ static void VM_M_getresolution(prvm_prog_t *prog)
 
        fs = ((prog->argc <= 1) || ((int)PRVM_G_FLOAT(OFS_PARM1)));
 
-       if(nr < 0 || nr >= (fs ? video_resolutions_count : video_resolutions_hardcoded_count))
+       if(nr < -1 || nr >= (fs ? video_resolutions_count : video_resolutions_hardcoded_count))
        {
                PRVM_G_VECTOR(OFS_RETURN)[0] = 0;
                PRVM_G_VECTOR(OFS_RETURN)[1] = 0;
                PRVM_G_VECTOR(OFS_RETURN)[2] = 0;
        }
+       else if(nr == -1)
+       {
+               vid_mode_t *m = VID_GetDesktopMode();
+               if (m)
+               {
+                       PRVM_G_VECTOR(OFS_RETURN)[0] = m->width;
+                       PRVM_G_VECTOR(OFS_RETURN)[1] = m->height;
+                       PRVM_G_VECTOR(OFS_RETURN)[2] = m->pixelheight_num / (prvm_vec_t) m->pixelheight_denom;
+               }
+               else
+               {
+                       PRVM_G_VECTOR(OFS_RETURN)[0] = 0;
+                       PRVM_G_VECTOR(OFS_RETURN)[1] = 0;
+                       PRVM_G_VECTOR(OFS_RETURN)[2] = 0;
+               }
+       }
        else
        {
                video_resolution_t *r = &((fs ? video_resolutions : video_resolutions_hardcoded)[nr]);
@@ -739,7 +756,7 @@ static void VM_M_copyentity (prvm_prog_t *prog)
        VM_SAFEPARMCOUNT(2,VM_M_copyentity);
        in = PRVM_G_EDICT(OFS_PARM0);
        out = PRVM_G_EDICT(OFS_PARM1);
-       memcpy(out->fields.vp, in->fields.vp, prog->entityfields * 4);
+       memcpy(out->fields.fp, in->fields.fp, prog->entityfields * sizeof(prvm_vec_t));
 }
 
 //#66 vector() getmousepos (EXT_CSQC)
@@ -1395,11 +1412,11 @@ VM_gecko_resize,                                        // #492 void gecko_resize( string name, float w, float h )
 VM_gecko_get_texture_extent,   // #493 vector gecko_get_texture_extent( string name )
 VM_crc16,                                              // #494 float(float caseinsensitive, string s, ...) crc16 = #494 (DP_QC_CRC16)
 VM_cvar_type,                                  // #495 float(string name) cvar_type = #495; (DP_QC_CVAR_TYPE)
-NULL,                                                                  // #496
-NULL,                                                                  // #497
-NULL,                                                                  // #498
-NULL,                                                                  // #499
-NULL,                                                                  // #500
+VM_numentityfields,                            // #496 float() numentityfields = #496; (QP_QC_ENTITYDATA)
+VM_entityfieldname,                            // #497 string(float fieldnum) entityfieldname = #497; (DP_QC_ENTITYDATA)
+VM_entityfieldtype,                            // #498 float(float fieldnum) entityfieldtype = #498; (DP_QC_ENTITYDATA)
+VM_getentityfieldstring,               // #499 string(float fieldnum, entity ent) getentityfieldstring = #499; (DP_QC_ENTITYDATA)
+VM_putentityfieldstring,               // #500 float(float fieldnum, entity ent, string s) putentityfieldstring = #500; (DP_QC_ENTITYDATA)
 NULL,                                                                  // #501
 NULL,                                                                  // #502
 VM_whichpack,                                  // #503 string(string) whichpack = #503;
@@ -1434,10 +1451,10 @@ NULL,                                                                   // #531
 VM_log,                                                                        // #532
 VM_getsoundtime,                                               // #533 float(entity e, float channel) getsoundtime = #533; (DP_SND_GETSOUNDTIME)
 VM_soundlength,                                                        // #534 float(string sample) soundlength = #534; (DP_SND_GETSOUNDTIME)
-NULL,                                                                  // #535
-NULL,                                                                  // #536
-NULL,                                                                  // #537
-NULL,                                                                  // #538
+VM_buf_loadfile,                        // #535 float(string filename, float bufhandle) buf_loadfile (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_buf_writefile,                       // #536 float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_bufstr_find,                         // #537 float(float bufhandle, string match, float matchrule, float startpos) bufstr_find (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_matchpattern,                        // #538 float(string s, string pattern, float matchrule) matchpattern (DP_QC_STRINGBUFFERS_EXT_WIP)
 NULL,                                                                  // #539
 NULL,                                                                  // #540
 NULL,                                                                  // #541