diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index 40bb760a..4c1b821a 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -160,6 +160,7 @@ typedef int intptr_t; #include #include #include +#include #include #include #include diff --git a/code/renderergl1/tr_bsp.c b/code/renderergl1/tr_bsp.c index 83862c28..5de7ff90 100644 --- a/code/renderergl1/tr_bsp.c +++ b/code/renderergl1/tr_bsp.c @@ -330,7 +330,7 @@ static void ParseFace( dsurface_t *ds, drawVert_t *verts, msurface_t *surf, int numIndexes = LittleLong( ds->numIndexes ); // create the srfSurfaceFace_t - sfaceSize = ( size_t ) &((srfSurfaceFace_t *)0)->points[numPoints]; + sfaceSize = offsetof( srfSurfaceFace_t, points ) + sizeof( *cv->points ) * numPoints; ofsIndexes = sfaceSize; sfaceSize += sizeof( int ) * numIndexes;