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

Function AdaptVisibleAreas

src/tools/map_replace_area.cpp:324–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324bool AdaptVisibleAreas(const float aaaGameAreas[2][2][2], const CMapObject aObs[2], float aaaVisibleAreas[2][2][2])
325{
326 float aDistance[2];
327 GetGameAreaDistance(aaaGameAreas, aObs, aaaVisibleAreas, aDistance);
328
329 for(int i = 0; i < 2; i++)
330 {
331 if(aObs[0].m_aSpeed[i] == 1 || aObs[1].m_aSpeed[i] == 1)
332 continue;
333
334 for(int j = 0; j < 2; j++)
335 aaaVisibleAreas[1][i][j] -= aDistance[i];
336
337 if(!GetLineIntersection(aaaVisibleAreas[0][i], aaaVisibleAreas[1][i], aaaVisibleAreas[0][i]))
338 return false;
339
340 for(int j = 0; j < 2; j++)
341 aaaVisibleAreas[1][i][j] = aaaVisibleAreas[0][i][j] + aDistance[i];
342 }
343
344 return true;
345}
346
347bool AdaptReplaceableAreas(const float aaaGameAreas[2][2][2], const float aaaVisibleAreas[2][2][2], const CMapObject aObs[2], float aaaReplaceableAreas[2][2][2])
348{

Callers 1

ReplaceAreaTilesFunction · 0.85

Calls 2

GetGameAreaDistanceFunction · 0.85
GetLineIntersectionFunction · 0.85

Tested by

no test coverage detected