void G2_RemoveRedundantGeneratedSurfaces(surfaceInfo_v &slist, int *activeSurfaces) { // walk the surface list, removing surface overrides or generated surfaces that are pointing at surfaces that aren't active anymore for (size_t i=0; i<slist.size(); i++) { if (slist[i].surface != -1) { // is this a generated surface? if (slist[i].offFlags & G2SURFACEFLAG_GENERATED) { // if it's not in the list, remove it if (!activeSurfaces[slist[i].genPolySurfaceIndex & 0xffff]) { G2_RemoveSurface(slist, i); } } // no, so it does point back at a legal surface else { // if it's not in the list, remove it if (!activeSurfaces[slist[i].surface]) { G2_RemoveSurface(slist, i); } } } } }
qboolean G2API_RemoveSurface(CGhoul2Info *ghlInfo, const int index) { if (ghlInfo) { // ensure we flush the cache ghlInfo->mMeshFrameNum = 0; return G2_RemoveSurface(ghlInfo->mSlist, index); } return qfalse; }