MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / GetLowermostRec

Function GetLowermostRec

TheForceEngine/TFE_Polygon/clipper.cpp:2327–2344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2325//------------------------------------------------------------------------------
2326
2327OutRec* GetLowermostRec(OutRec *outRec1, OutRec *outRec2)
2328{
2329 //work out which polygon fragment has the correct hole state ...
2330 if (!outRec1->BottomPt)
2331 outRec1->BottomPt = GetBottomPt(outRec1->Pts);
2332 if (!outRec2->BottomPt)
2333 outRec2->BottomPt = GetBottomPt(outRec2->Pts);
2334 OutPt *OutPt1 = outRec1->BottomPt;
2335 OutPt *OutPt2 = outRec2->BottomPt;
2336 if (OutPt1->Pt.Y > OutPt2->Pt.Y) return outRec1;
2337 else if (OutPt1->Pt.Y < OutPt2->Pt.Y) return outRec2;
2338 else if (OutPt1->Pt.X < OutPt2->Pt.X) return outRec1;
2339 else if (OutPt1->Pt.X > OutPt2->Pt.X) return outRec2;
2340 else if (OutPt1->Next == OutPt1) return outRec2;
2341 else if (OutPt2->Next == OutPt2) return outRec1;
2342 else if (FirstIsBottomPt(OutPt1, OutPt2)) return outRec1;
2343 else return outRec2;
2344}
2345//------------------------------------------------------------------------------
2346
2347bool OutRec1RightOfOutRec2(OutRec* outRec1, OutRec* outRec2)

Callers 2

AppendPolygonMethod · 0.85
JoinCommonEdgesMethod · 0.85

Calls 2

GetBottomPtFunction · 0.85
FirstIsBottomPtFunction · 0.85

Tested by

no test coverage detected