MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetVisibleArea

Function GetVisibleArea

src/tools/map_replace_area.cpp:526–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526bool GetVisibleArea(const float aaGameArea[2][2], const CMapObject &Ob, float aaVisibleArea[2][2])
527{
528 if(IsInexistent((float *)Ob.m_aaExtendedArea, 4))
529 return false;
530
531 if(aaVisibleArea)
532 SetInexistent((float *)aaVisibleArea, 4);
533
534 float aaInspectedArea[2][2];
535 mem_copy(aaInspectedArea, aaGameArea, sizeof(float[2][2]));
536
537 for(int i = 0; i < 2; i++)
538 {
539 if(Ob.m_aSpeed[i] == 1)
540 {
541 mem_copy(aaInspectedArea[i], Ob.m_aaExtendedArea[i], sizeof(float[2]));
542 continue;
543 }
544
545 if(Ob.m_UseClipping && !GetLineIntersection(aaInspectedArea[i], Ob.m_aaClipArea[i], aaInspectedArea[i]))
546 return false;
547
548 if(!GetLineIntersection(aaInspectedArea[i], Ob.m_aaExtendedArea[i], aaInspectedArea[i]))
549 return false;
550 }
551
552 if(aaVisibleArea)
553 mem_copy(aaVisibleArea, aaInspectedArea, sizeof(float[2][2]));
554
555 return true;
556}
557
558bool GetReplaceableArea(const float aaVisibleArea[2][2], const CMapObject &Ob, float aaReplaceableArea[2][2])
559{

Callers 4

ReplaceAreaTilesFunction · 0.85
RemoveDestinationQuadsFunction · 0.85
InsertDestinationQuadsFunction · 0.85
AdaptVisiblePointFunction · 0.85

Calls 4

IsInexistentFunction · 0.85
SetInexistentFunction · 0.85
mem_copyFunction · 0.85
GetLineIntersectionFunction · 0.85

Tested by

no test coverage detected