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

Function SetExtendedArea

src/tools/map_replace_area.cpp:504–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void SetExtendedArea(CMapObject &Ob)
505{
506 SetInexistent((float *)Ob.m_aaExtendedArea, 4);
507
508 for(int i = 0; i < 2; i++)
509 {
510 if(Ob.m_aSpeed[i] == 1)
511 {
512 float aInspectedArea[2];
513 if(GetLineIntersection(Ob.m_aaBaseArea[i], Ob.m_aaScreenOffset[i], aInspectedArea))
514 mem_copy(Ob.m_aaExtendedArea[i], aInspectedArea, sizeof(float[2]));
515 continue;
516 }
517
518 for(int j = 0; j < 2; j++)
519 Ob.m_aaExtendedArea[i][j] = (Ob.m_aaBaseArea[i][j] + Ob.m_aaScreenOffset[i][j] * Ob.m_aSpeed[i]) / (1 - Ob.m_aSpeed[i]);
520
521 if(Ob.m_aaExtendedArea[i][0] > Ob.m_aaExtendedArea[i][1])
522 std::swap(Ob.m_aaExtendedArea[i][0], Ob.m_aaExtendedArea[i][1]);
523 }
524}
525
526bool GetVisibleArea(const float aaGameArea[2][2], const CMapObject &Ob, float aaVisibleArea[2][2])
527{

Callers 2

AdaptVisiblePointFunction · 0.85
CreateMapObjectFunction · 0.85

Calls 3

SetInexistentFunction · 0.85
GetLineIntersectionFunction · 0.85
mem_copyFunction · 0.85

Tested by

no test coverage detected