MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / Tactical_IsInSelectionRect

Method Tactical_IsInSelectionRect

src/Misc/Selection.cpp:44–58  ·  view source on GitHub ↗

Reversed from Tactical::Select

Source from the content-addressed store, hash-verified

42
43 // Reversed from Tactical::Select
44 static bool Tactical_IsInSelectionRect(TacticalClass* pThis, LTRBStruct* pRect, const TacticalSelectableStruct& selectable)
45 {
46 if (selectable.Object && selectable.Object->IsAlive)
47 {
48 int nLocalX = selectable.X - pThis->TacticalPos.X;
49 int nLocalY = selectable.Y - pThis->TacticalPos.Y;
50
51 if ((nLocalX >= pRect->Left && nLocalX < pRect->Right + pRect->Left) &&
52 (nLocalY >= pRect->Top && nLocalY < pRect->Bottom + pRect->Top))
53 {
54 return true;
55 }
56 }
57 return false;
58 }
59
60 static bool Tactical_IsHighPriorityInRect(TacticalClass* pThis, LTRBStruct* rect)
61 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected