]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mvm_cmds.c
Remove FS_FIX_PATHS again and disable model rendering in the menu until someone can...
[xonotic/darkplaces.git] / mvm_cmds.c
index 681ebb8c40206f84f1653fd5cdd76b26afdcc18b..391076f520dd38c9235d218ee540f09682114c7d 100644 (file)
 char *vm_m_extensions =
 "BX_WAL_SUPPORT "
 "DP_CINEMATIC_DPV "
+"DP_FONT_VARIABLEWIDTH "
+"DP_GECKO_SUPPORT "
 "DP_MENU_EXTRESPONSEPACKET "
 "DP_QC_ASINACOSATANATAN2TAN "
+"DP_QC_CMD "
+"DP_QC_CRC16 "
+"DP_QC_CVAR_TYPE "
+"DP_QC_RENDER_SCENE "
 "DP_QC_STRFTIME "
-"DP_QC_STRING_CASE_FUNCTIONS "
+"DP_QC_STRINGBUFFERS "
 "DP_QC_STRINGCOLORFUNCTIONS "
+"DP_QC_STRING_CASE_FUNCTIONS "
+"DP_QC_STRREPLACE "
 "DP_QC_TOKENIZEBYSEPARATOR "
 "DP_QC_UNLIMITEDTEMPSTRINGS "
-"DP_QC_CMD "
-"DP_QC_STRREPLACE "
-"DP_FONT_VARIABLEWIDTH "
-// FIXME: rename this extension maybe? [12/5/2007 Black]
-"DP_GECKO_SUPPORT "
-"DP_QC_RENDER_SCENE"
-"DP_QC_STRINGBUFFERS "
-"DP_QC_CRC16 "
+"DP_QC_URI_ESCAPE "
 "FTE_STRINGS "
 ;
 
@@ -169,7 +170,7 @@ void VM_M_callfunction(void)
                if (builtinnumber < prog->numbuiltins && prog->builtins[builtinnumber])
                        prog->builtins[builtinnumber]();
                else
-                       PRVM_ERROR("No such builtin #%i in %s", builtinnumber, PRVM_NAME);
+                       PRVM_ERROR("No such builtin #%i in %s; most likely cause: outdated engine build. Try updating!", builtinnumber, PRVM_NAME);
        }
        else if(func - prog->functions > 0)
        {
@@ -875,9 +876,16 @@ VM_altstr_ins,                                             //  #86
 VM_findflags,                                          //  #87
 VM_findchainflags,                             //  #88
 VM_cvar_defstring,                             //  #89
+// deactivate support for model rendering in the menu until someone has time to do it right [3/2/2008 Andreas]
+#if 0
 VM_CL_setmodel,                                        // #90 void(entity e, string m) setmodel (QUAKE)
 VM_CL_precache_model,                  // #91 void(string s) precache_model (QUAKE)
 VM_CL_setorigin,                               // #92 void(entity e, vector o) setorigin (QUAKE)
+#else
+NULL,
+NULL,
+NULL,
+#endif
 NULL,                                                                  //  #93
 NULL,                                                                  //  #94
 NULL,                                                                  //  #95
@@ -1085,6 +1093,8 @@ NULL,                                                                     // #296
 NULL,                                                                  // #297
 NULL,                                                                  // #298
 NULL,                                                                  // #299
+// deactivate support for model rendering in the menu until someone has time to do it right [3/2/2008 Andreas]
+#if 0
 // CSQC range #300-#399
 VM_CL_R_ClearScene,                            // #300 void() clearscene (DP_QC_RENDER_SCENE)
 VM_CL_R_AddEntities,                   // #301 void(float mask) addentities (DP_QC_RENDER_SCENE)
@@ -1092,13 +1102,30 @@ VM_CL_R_AddEntity,                              // #302 void(entity ent) addentity (DP_QC_RENDER_SCENE)
 VM_CL_R_SetView,                               // #303 float(float property, ...) setproperty (DP_QC_RENDER_SCENE)
 VM_CL_R_RenderScene,                   // #304 void() renderscene (DP_QC_RENDER_SCENE)
 VM_CL_R_AddDynamicLight,               // #305 void(vector org, float radius, vector lightcolours) adddynamiclight (DP_QC_RENDER_SCENE)
-VM_CL_R_PolygonBegin,                  // #306 void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon
-VM_CL_R_PolygonVertex,                 // #307 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex
+VM_CL_R_PolygonBegin,                  // #306 void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon (DP_QC_RENDER_SCENE)
+VM_CL_R_PolygonVertex,                 // #307 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex (DP_QC_RENDER_SCENE)
 VM_CL_R_PolygonEnd,                            // #308 void() R_EndPolygon
 NULL/*VM_CL_R_LoadWorldModel*/,                                // #309 void(string modelname) R_LoadWorldModel
-NULL,                                                                  // #310
-NULL,                                                                  // #311
-NULL,                                                                  // #312
+// TODO: rearrange and merge all builtin lists and share as many extensions as possible between all VM instances [1/27/2008 Andreas]
+VM_CL_setattachment,                           // #310 void(entity e, entity tagentity, string tagname) setattachment (DP_GFX_QUAKE3MODELTAGS) (DP_QC_RENDER_SCENE)
+VM_CL_gettagindex,                             // #311 float(entity ent, string tagname) gettagindex (DP_QC_GETTAGINFO) (DP_QC_RENDER_SCENE)
+VM_CL_gettaginfo,                                      // #312 vector(entity ent, float tagindex) gettaginfo (DP_QC_GETTAGINFO) (DP_QC_RENDER_SCENE)
+#else
+// CSQC range #300-#399
+NULL,          
+NULL,          
+NULL,          
+NULL,          
+NULL,          
+NULL,          
+NULL,          
+NULL,  
+NULL,  
+NULL,
+NULL,  
+NULL,  
+NULL,  
+#endif
 NULL,                                                                  // #313
 NULL,                                                                  // #314
 NULL,                                                                  // #315
@@ -1281,7 +1308,7 @@ VM_gecko_movemouse,                               // #491 void gecko_mousemove( string name, float x, float
 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)
-NULL,                                                                  // #495
+VM_cvar_type,                                  // #495 float(string name) cvar_type = #495; (DP_QC_CVAR_TYPE)
 NULL,                                                                  // #496
 NULL,                                                                  // #497
 NULL,                                                                  // #498
@@ -1296,9 +1323,9 @@ NULL,                                                                     // #506
 NULL,                                                                  // #507
 NULL,                                                                  // #508
 NULL,                                                                  // #509
-NULL,                                                                  // #510
-NULL,                                                                  // #511
-NULL,                                                                  // #512
+VM_uri_escape,                                 // #510 string(string in) uri_escape = #510;
+VM_uri_unescape,                               // #511 string(string in) uri_unescape = #511;
+VM_etof,                                       // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT)
 NULL,                                                                  // #513
 NULL,                                                                  // #514
 NULL,                                                                  // #515
@@ -1415,24 +1442,30 @@ VM_M_getextresponse                             // #624 string getextresponse(void)
 
 const int vm_m_numbuiltins = sizeof(vm_m_builtins) / sizeof(prvm_builtin_t);
 
-r_refdef_scene_t menu_scene;
-
 void VM_M_Cmd_Init(void)
 {
+       r_refdef_scene_t *scene;
+
        VM_Cmd_Init();
        VM_Polygons_Reset();
 
-       memset (&menu_scene, 0, sizeof (menu_scene));
+       scene = R_GetScenePointer( RST_MENU );
+
+       memset (scene, 0, sizeof (*scene));
 
-       menu_scene.maxtempentities = 128;
-       menu_scene.tempentities = (entity_render_t*) Mem_Alloc(prog->progs_mempool, sizeof(entity_render_t) * menu_scene.maxtempentities);
+       scene->maxtempentities = 128;
+       scene->tempentities = (entity_render_t*) Mem_Alloc(prog->progs_mempool, sizeof(entity_render_t) * scene->maxtempentities);
 
-       menu_scene.maxentities = MAX_EDICTS + 256 + 512;
-       menu_scene.entities = (entity_render_t **)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t *) * menu_scene.maxentities);
+       scene->maxentities = MAX_EDICTS + 256 + 512;
+       scene->entities = (entity_render_t **)Mem_Alloc(prog->progs_mempool, sizeof(entity_render_t *) * scene->maxentities);
+
+       scene->ambient = 32.0f;
 }
 
 void VM_M_Cmd_Reset(void)
 {
+       // note: the menu's render entities are automatically freed when the prog's pool is freed
+
        //VM_Cmd_Init();
        VM_Cmd_Reset();
        VM_Polygons_Reset();