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

Function GetBottomPt

TheForceEngine/TFE_Polygon/clipper.cpp:822–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820//------------------------------------------------------------------------------
821
822OutPt* GetBottomPt(OutPt *pp)
823{
824 OutPt* dups = 0;
825 OutPt* p = pp->Next;
826 while (p != pp)
827 {
828 if (p->Pt.Y > pp->Pt.Y)
829 {
830 pp = p;
831 dups = 0;
832 }
833 else if (p->Pt.Y == pp->Pt.Y && p->Pt.X <= pp->Pt.X)
834 {
835 if (p->Pt.X < pp->Pt.X)
836 {
837 dups = 0;
838 pp = p;
839 } else
840 {
841 if (p->Next != pp && p->Prev != pp) dups = p;
842 }
843 }
844 p = p->Next;
845 }
846 if (dups)
847 {
848 //there appears to be at least 2 vertices at BottomPt so ...
849 while (dups != p)
850 {
851 if (!FirstIsBottomPt(p, dups)) pp = dups;
852 dups = dups->Next;
853 while (dups->Pt != pp->Pt) dups = dups->Next;
854 }
855 }
856 return pp;
857}
858//------------------------------------------------------------------------------
859
860bool Pt2IsBetweenPt1AndPt3(const IntPoint pt1,

Callers 1

GetLowermostRecFunction · 0.85

Calls 1

FirstIsBottomPtFunction · 0.85

Tested by

no test coverage detected