From ed48508070963552fb990e9258b9c0155c383515 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 16 Mar 2016 10:55:39 -0600 Subject: [PATCH] qbsp: fix usage of offsetof() with a non-compile time constant, was erroring on gcc --- qbsp/wad.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qbsp/wad.cc b/qbsp/wad.cc index 1b7d8527..d890769f 100644 --- a/qbsp/wad.cc +++ b/qbsp/wad.cc @@ -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++) {