qbsp: remove dead code
This commit is contained in:
parent
a7fd04af12
commit
df3ae568e5
|
|
@ -125,72 +125,6 @@ LoadBSPFile(void)
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
// To be used for all dynamic mem data
|
|
||||||
static void
|
|
||||||
AddLump(FILE *f, int Type)
|
|
||||||
{
|
|
||||||
lump_t *lump;
|
|
||||||
int cLen = 0;
|
|
||||||
int i;
|
|
||||||
size_t ret;
|
|
||||||
const struct lumpdata *entities;
|
|
||||||
const mapentity_t *entity;
|
|
||||||
|
|
||||||
lump = &header->lumps[Type];
|
|
||||||
lump->fileofs = ftell(f);
|
|
||||||
|
|
||||||
for (i = 0; i < map.numentities(); i++) {
|
|
||||||
entity = &map.entities.at(i);
|
|
||||||
entities = &entity->lumps[Type];
|
|
||||||
if (entities->data) {
|
|
||||||
if (Type == LUMP_MODELS && !options.hexen2) {
|
|
||||||
const dmodel_t *in = (const dmodel_t *)entities->data;
|
|
||||||
dmodelq1_t out;
|
|
||||||
int j, k;
|
|
||||||
for (j = 0; j < entities->count; j++)
|
|
||||||
{
|
|
||||||
for (k = 0; k < 3; k++) {
|
|
||||||
out.mins[k] = in[j].mins[k];
|
|
||||||
out.maxs[k] = in[j].maxs[k];
|
|
||||||
out.origin[k] = in[j].origin[k];
|
|
||||||
}
|
|
||||||
for (k = 0; k < MAX_MAP_HULLS_Q1; k++)
|
|
||||||
out.headnode[k] = in[j].headnode[k];
|
|
||||||
out.visleafs = in[j].visleafs;
|
|
||||||
out.firstface = in[j].firstface;
|
|
||||||
out.numfaces = in[j].numfaces;
|
|
||||||
ret = fwrite(&out, sizeof(out), 1, f);
|
|
||||||
if (ret != 1)
|
|
||||||
Error("Failure writing to file");
|
|
||||||
}
|
|
||||||
cLen += entities->count * sizeof(out);
|
|
||||||
} else {
|
|
||||||
ret = fwrite(entities->data, MemSize[Type], entities->count, f);
|
|
||||||
if (ret != entities->count)
|
|
||||||
Error("Failure writing to file");
|
|
||||||
cLen += entities->count * MemSize[Type];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add null terminating char for text
|
|
||||||
if (Type == LUMP_ENTITIES) {
|
|
||||||
ret = fwrite("", 1, 1, f);
|
|
||||||
if (ret != 1)
|
|
||||||
Error("Failure writing to file");
|
|
||||||
cLen++;
|
|
||||||
}
|
|
||||||
lump->filelen = cLen;
|
|
||||||
|
|
||||||
// Pad to 4-byte boundary
|
|
||||||
if (cLen % 4 != 0) {
|
|
||||||
size_t pad = 4 - (cLen % 4);
|
|
||||||
ret = fwrite(" ", 1, pad, f);
|
|
||||||
if (ret != pad)
|
|
||||||
Error("Failure writing to file");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: remove this once we switch to common
|
// TODO: remove this once we switch to common
|
||||||
static void
|
static void
|
||||||
AddLumpFromBuffer(FILE *f, int Type, void* src, size_t srcbytes)
|
AddLumpFromBuffer(FILE *f, int Type, void* src, size_t srcbytes)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue