qbsp: fix usage of offsetof() with a non-compile time constant, was erroring on gcc

This commit is contained in:
Eric Wasylishen 2016-03-16 10:55:39 -06:00
parent 8773e0bb15
commit ed48508070
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,7 @@ WADList_Process(const wad_t *wadlist)
WADList_AddAnimationFrames(wadlist);
/* Count space for miptex header/offsets */
texdata->count = offsetof(dmiptexlump_t, dataofs[map.nummiptex()]);
texdata->count = offsetof(dmiptexlump_t, dataofs[0]) + (map.nummiptex() * sizeof(uint32_t));
/* Count texture size. Slower, but saves memory. */
for (i = 0; i < map.nummiptex(); i++) {