changed brushq3 submodel firstsurface and firstbrush from pointers to integers
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Mar 2005 13:05:11 +0000 (13:05 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Mar 2005 13:05:11 +0000 (13:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5057 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c
model_brush.h

index 5969bf8..ae4d0b8 100644 (file)
@@ -4436,13 +4436,13 @@ static void Mod_Q3BSP_LoadModels(lump_t *l)
                c = LittleLong(in->numfaces);
                if (n < 0 || n + c > loadmodel->brush.num_surfaces)
                        Host_Error("Mod_Q3BSP_LoadModels: invalid face range %i : %i (%i faces)\n", n, n + c, loadmodel->brush.num_surfaces);
-               out->firstsurface = loadmodel->brush.data_surfaces + n;
+               out->firstsurface = n;
                out->numsurfaces = c;
                n = LittleLong(in->firstbrush);
                c = LittleLong(in->numbrushes);
                if (n < 0 || n + c > loadmodel->brush.num_brushes)
                        Host_Error("Mod_Q3BSP_LoadModels: invalid brush range %i : %i (%i brushes)\n", n, n + c, loadmodel->brush.num_brushes);
-               out->firstbrush = loadmodel->brush.data_brushes + n;
+               out->firstbrush = n;
                out->numbrushes = c;
        }
 }
@@ -5593,9 +5593,9 @@ void Mod_Q3BSP_Load(model_t *mod, void *buffer)
                mod->brush.submodel = i;
 
                // make the model surface list (used by shadowing/lighting)
-               mod->firstmodelsurface = mod->brushq3.data_models[i].firstsurface - mod->brush.data_surfaces;
+               mod->firstmodelsurface = mod->brushq3.data_models[i].firstsurface;
                mod->nummodelsurfaces = mod->brushq3.data_models[i].numsurfaces;
-               mod->firstmodelbrush = mod->brushq3.data_models[i].firstbrush - mod->brush.data_brushes;
+               mod->firstmodelbrush = mod->brushq3.data_models[i].firstbrush;
                mod->nummodelbrushes = mod->brushq3.data_models[i].numbrushes;
                mod->surfacelist = Mem_Alloc(loadmodel->mempool, mod->nummodelsurfaces * sizeof(*mod->surfacelist));
                for (j = 0;j < mod->nummodelsurfaces;j++)
index 9412d77..68ff89a 100644 (file)
@@ -766,9 +766,9 @@ typedef struct q3mmodel_s
        vec3_t mins;
        vec3_t maxs;
        int numsurfaces;
-       struct msurface_s *firstsurface;
+       int firstsurface;
        int numbrushes;
-       struct q3mbrush_s *firstbrush;
+       int firstbrush;
 }
 q3mmodel_t;