]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.c
Let the other players know if a connected player has timed out
[xonotic/darkplaces.git] / model_shared.c
index e29e3f8dac4ddaa21f24770bbd263c6985b39a39..3213a050f8a015f6d195dafc91a5415852c6d2ed 100644 (file)
@@ -55,6 +55,7 @@ static modloader_t loader[] =
        {NULL, "BSP2", 4, Mod_BSP2_Load},
        {NULL, "2PSB", 4, Mod_2PSB_Load},
        {NULL, "IBSP", 4, Mod_IBSP_Load},
+       {NULL, "VBSP", 4, Mod_VBSP_Load},
        {NULL, "ZYMOTICMODEL", 13, Mod_ZYMOTICMODEL_Load},
        {NULL, "DARKPLACESMODEL", 16, Mod_DARKPLACESMODEL_Load},
        {NULL, "PSKMODEL", 9, Mod_PSKMODEL_Load},
@@ -517,10 +518,10 @@ model_t *Mod_LoadModel(model_t *mod, qbool crash, qbool checkdisk)
                // all models use memory, so allocate a memory pool
                mod->mempool = Mem_AllocPool(mod->name, 0, NULL);
 
-               // call the apropriate loader
+               // We need to have a reference to the base model in case we're parsing submodels
                loadmodel = mod;
 
-               // Try matching magic bytes.
+               // Call the appropriate loader. Try matching magic bytes.
                for (i = 0; loader[i].Load; i++)
                {
                        // Headerless formats can just load based on extension. Otherwise match the magic string.
@@ -2884,7 +2885,7 @@ void Mod_VertexRangeFromElements(int numelements, const int *elements, int *firs
 
 void Mod_SetDrawSkyAndWater(model_t* mod)
 {
-       size_t j;
+       int j;
        uint64_t basematerialflags = 0;
        // by default assume there is no sky or water used in this model
        mod->DrawSky = NULL;
@@ -2935,7 +2936,12 @@ void Mod_MakeSortedSurfaces(model_t *mod)
 {
        // make an optimal set of texture-sorted batches to draw...
        int j, k;
-       Mod_MakeSortedSurfaces_qsortsurface_t *info = (Mod_MakeSortedSurfaces_qsortsurface_t*)R_FrameData_Alloc(mod->num_surfaces * sizeof(*info));
+       Mod_MakeSortedSurfaces_qsortsurface_t *info;
+
+       if(cls.state == ca_dedicated)
+               return;
+
+       info = (Mod_MakeSortedSurfaces_qsortsurface_t*)R_FrameData_Alloc(mod->num_surfaces * sizeof(*info));
        if (!mod->modelsurfaces_sorted)
                mod->modelsurfaces_sorted = (int *) Mem_Alloc(loadmodel->mempool, mod->num_surfaces * sizeof(*mod->modelsurfaces_sorted));
        // the goal is to sort by submodel (can't change which submodel a surface belongs to), and then by effects and textures