]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.c
removed cruft
[xonotic/darkplaces.git] / model_brush.c
index 82c2eb342b88738c392cf90db67890ad04ffd059..913e9b3d6a1053a72cd6b0c8bd384558961f0b91 100644 (file)
@@ -340,8 +340,6 @@ void Mod_LoadLighting (lump_t *l)
        byte d;
        char litfilename[1024];
        loadmodel->lightdata = NULL;
-       if (!l->filelen)
-               return;
        if (hlbsp) // LordHavoc: load the colored lighting data straight
        {
                loadmodel->lightdata = Hunk_AllocName ( l->filelen, loadname);
@@ -361,6 +359,7 @@ void Mod_LoadLighting (lump_t *l)
                                i = LittleLong(((int *)data)[1]);
                                if (i == 1)
                                {
+                                       Con_DPrintf("%s loaded", litfilename);
                                        loadmodel->lightdata = data + 8;
                                        return;
                                }
@@ -371,6 +370,8 @@ void Mod_LoadLighting (lump_t *l)
                                Con_Printf("Corrupt .lit file (old version?), ignoring\n");
                }
                // LordHavoc: oh well, expand the white lighting data
+               if (!l->filelen)
+                       return;
                loadmodel->lightdata = Hunk_AllocName ( l->filelen*3, litfilename);
                in = loadmodel->lightdata + l->filelen*2; // place the file at the end, so it will not be overwritten until the very last write
                out = loadmodel->lightdata;
@@ -866,29 +867,70 @@ void Mod_LoadClipnodes (lump_t *l)
        loadmodel->clipnodes = out;
        loadmodel->numclipnodes = count;
 
-       hull = &loadmodel->hulls[1];
-       hull->clipnodes = out;
-       hull->firstclipnode = 0;
-       hull->lastclipnode = count-1;
-       hull->planes = loadmodel->planes;
-       hull->clip_mins[0] = -16;
-       hull->clip_mins[1] = -16;
-       hull->clip_mins[2] = -24;
-       hull->clip_maxs[0] = 16;
-       hull->clip_maxs[1] = 16;
-       hull->clip_maxs[2] = 32;
-
-       hull = &loadmodel->hulls[2];
-       hull->clipnodes = out;
-       hull->firstclipnode = 0;
-       hull->lastclipnode = count-1;
-       hull->planes = loadmodel->planes;
-       hull->clip_mins[0] = -32;
-       hull->clip_mins[1] = -32;
-       hull->clip_mins[2] = -24;
-       hull->clip_maxs[0] = 32;
-       hull->clip_maxs[1] = 32;
-       hull->clip_maxs[2] = 64;
+       if (hlbsp)
+       {
+               hull = &loadmodel->hulls[1];
+               hull->clipnodes = out;
+               hull->firstclipnode = 0;
+               hull->lastclipnode = count-1;
+               hull->planes = loadmodel->planes;
+               hull->clip_mins[0] = -16;
+               hull->clip_mins[1] = -16;
+               hull->clip_mins[2] = -36;
+               hull->clip_maxs[0] = 16;
+               hull->clip_maxs[1] = 16;
+               hull->clip_maxs[2] = 36;
+
+               hull = &loadmodel->hulls[2];
+               hull->clipnodes = out;
+               hull->firstclipnode = 0;
+               hull->lastclipnode = count-1;
+               hull->planes = loadmodel->planes;
+               hull->clip_mins[0] = -32;
+               hull->clip_mins[1] = -32;
+               hull->clip_mins[2] = -32;
+               hull->clip_maxs[0] = 32;
+               hull->clip_maxs[1] = 32;
+               hull->clip_maxs[2] = 32;
+
+               hull = &loadmodel->hulls[3];
+               hull->clipnodes = out;
+               hull->firstclipnode = 0;
+               hull->lastclipnode = count-1;
+               hull->planes = loadmodel->planes;
+               hull->clip_mins[0] = -16;
+               hull->clip_mins[1] = -16;
+               hull->clip_mins[2] = -18;
+               hull->clip_maxs[0] = 16;
+               hull->clip_maxs[1] = 16;
+               hull->clip_maxs[2] = 18;
+       }
+       else
+       {
+               hull = &loadmodel->hulls[1];
+               hull->clipnodes = out;
+               hull->firstclipnode = 0;
+               hull->lastclipnode = count-1;
+               hull->planes = loadmodel->planes;
+               hull->clip_mins[0] = -16;
+               hull->clip_mins[1] = -16;
+               hull->clip_mins[2] = -24;
+               hull->clip_maxs[0] = 16;
+               hull->clip_maxs[1] = 16;
+               hull->clip_maxs[2] = 32;
+
+               hull = &loadmodel->hulls[2];
+               hull->clipnodes = out;
+               hull->firstclipnode = 0;
+               hull->lastclipnode = count-1;
+               hull->planes = loadmodel->planes;
+               hull->clip_mins[0] = -32;
+               hull->clip_mins[1] = -32;
+               hull->clip_mins[2] = -24;
+               hull->clip_maxs[0] = 32;
+               hull->clip_maxs[1] = 32;
+               hull->clip_maxs[2] = 64;
+       }
 
        for (i=0 ; i<count ; i++, out++, in++)
        {