MCPcopy Create free account
hub / github.com/ZDoom/Raze / insideLoop

Function insideLoop

source/core/rendering/hw_sections.cpp:294–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292
293static TArray<DVector2> points;
294static int insideLoop(int vertex, TArray<int>& loop)
295{
296 points.Resize(loop.Size() - 1);
297 for (unsigned ii = 0; ii < loop.Size() - 1; ii++)
298 {
299 points[ii] = wall[loop[ii]].pos;
300 }
301
302 // to reliably detect walls where vertices lie directly on outer walls, we must test the wall's center as well.
303 // SW: Wanton Destrcution's $bath.map, sector 601 is an example for that.
304 DVector2 pts[] = { wall[vertex].pos, wall[vertex].center() };
305 for (int i = 0; i < 2; i++)
306 {
307 int isinside = insidePoly(pts[i].X, pts[i].Y, points.Data(), points.Size());
308 if (isinside == 1) return 1;
309 }
310 return -1;
311}
312
313static int insideLoop(TArray<int>& check, TArray<int>& loop)
314{

Callers 1

GroupDataFunction · 0.85

Calls 5

insidePolyFunction · 0.85
centerMethod · 0.80
ResizeMethod · 0.45
SizeMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected