diff --git a/include/qbsp/map.hh b/include/qbsp/map.hh index dce8291f..b044d413 100644 --- a/include/qbsp/map.hh +++ b/include/qbsp/map.hh @@ -101,7 +101,6 @@ public: vec3_t mins, maxs; brush_t *brushes; /* NULL terminated list */ int numbrushes; - struct lumpdata lumps[BSPX_LUMPS]; int firstoutputfacenumber; int outputmodelnumber; @@ -125,7 +124,6 @@ public: VectorSet(origin,0,0,0); VectorSet(mins,0,0,0); VectorSet(maxs,0,0,0); - memset(lumps, 0, sizeof(lumps)); } }; diff --git a/qbsp/bspfile.cc b/qbsp/bspfile.cc index c3a28cd4..21d527eb 100644 --- a/qbsp/bspfile.cc +++ b/qbsp/bspfile.cc @@ -76,52 +76,8 @@ AddLumpFromBuffer(FILE *f, int Type, void* src, size_t srcbytes) } } -static void -GenLump(const char *bspxlump, int Type, size_t sz) -{ - int cLen = 0; - int i; - const struct lumpdata *entities; - const mapentity_t *entity; - char *out; - - for (i = 0; i < map.numentities(); i++) { - entity = &map.entities.at(i); - entities = &entity->lumps[Type]; - cLen += entities->count*sz; - } - if (!cLen) - return; - out = (char *)malloc(cLen); - cLen = 0; - for (i = 0; i < map.numentities(); i++) { - entity = &map.entities.at(i); - entities = &entity->lumps[Type]; - memcpy(out+cLen, entities->data, entities->count*sz); - cLen += entities->count*sz; - } - BSPX_AddLump(bspxlump, out, cLen); -} - void BSPX_AddLump(const char *xname, const void *xdata, size_t xsize) { - bspxentry_t *e; - for (e = bspxentries; e; e = e->next) - { - if (!strcmp(e->lumpname, xname)) - break; - } - if (!e) - { - e = (bspxentry_t *)malloc(sizeof(*e)); - memset(e, 0, sizeof(*e)); - strncpy(e->lumpname, xname, sizeof(e->lumpname)); - e->next = bspxentries; - bspxentries = e; - } - - e->lumpdata = xdata; - e->lumpsize = xsize; } /* @@ -165,12 +121,12 @@ WriteBSPFile(void) AddLumpFromBuffer(f, LUMP_LIGHTING, nullptr, 0); AddLumpFromBuffer(f, LUMP_VISIBILITY, nullptr, 0); AddLumpFromBuffer(f, LUMP_ENTITIES, map.exported_entities.data(), map.exported_entities.size() + 1); // +1 to write the terminating null (safe in C++11) - AddLumpFromBuffer(f, LUMP_TEXTURES, map.exported_texdata.data(), map.exported_texdata.size()); - - GenLump("LMSHIFT", BSPX_LMSHIFT, 1); + AddLumpFromBuffer(f, LUMP_TEXTURES, map.exported_texdata.data(), map.exported_texdata.size()); // TODO: pass bspx lumps to generic bsp code so they are written + //GenLump("LMSHIFT", BSPX_LMSHIFT, 1); + fseek(f, 0, SEEK_SET); ret = fwrite(header, sizeof(dheader_t), 1, f); if (ret != 1) diff --git a/qbsp/surfaces.cc b/qbsp/surfaces.cc index 9d9da2aa..2011a443 100644 --- a/qbsp/surfaces.cc +++ b/qbsp/surfaces.cc @@ -491,7 +491,6 @@ int MakeFaceEdges(mapentity_t *entity, node_t *headnode) { int i, firstface; - struct lumpdata *lmshifts = &entity->lumps[BSPX_LMSHIFT]; Message(msgProgress, "MakeFaceEdges");