| 422 | } |
| 423 | |
| 424 | bool InsertDestinationQuads(const float aaaGameAreas[2][2][2], const CQuad *pQuads, const int NumQuads, const CMapItemGroup *apLayerGroups[2], CQuad *pDestQuads, int &QuadsCounter) |
| 425 | { |
| 426 | bool DataChanged = false; |
| 427 | |
| 428 | for(int i = 0; i < NumQuads; i++) |
| 429 | { |
| 430 | CMapObject aObs[2]; |
| 431 | aObs[0] = CreateMapObject(apLayerGroups[0], fx2f(pQuads[i].m_aPoints[4].x), fx2f(pQuads[i].m_aPoints[4].y), 0, 0); |
| 432 | float aaVisibleArea[2][2]; |
| 433 | |
| 434 | if(GetVisibleArea(aaaGameAreas[0], aObs[0], aaVisibleArea)) |
| 435 | { |
| 436 | float aQuadPos[2]; |
| 437 | aObs[1] = CreateMapObject(apLayerGroups[1], 0, 0, 0, 0); |
| 438 | |
| 439 | if(!AdaptVisiblePoint(aaaGameAreas, aaVisibleArea, aObs, aQuadPos)) |
| 440 | continue; |
| 441 | |
| 442 | pDestQuads[QuadsCounter] = pQuads[i]; |
| 443 | for(auto &Point : pDestQuads[QuadsCounter].m_aPoints) |
| 444 | { |
| 445 | Point.x += f2fx(aQuadPos[0]) - pDestQuads[QuadsCounter].m_aPoints[4].x; |
| 446 | Point.y += f2fx(aQuadPos[1]) - pDestQuads[QuadsCounter].m_aPoints[4].y; |
| 447 | } |
| 448 | |
| 449 | QuadsCounter++; |
| 450 | DataChanged = true; |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | return DataChanged; |
| 455 | } |
| 456 | |
| 457 | bool AdaptVisiblePoint(const float aaaGameAreas[2][2][2], const float aaVisibleArea[2][2], const CMapObject aObs[2], float aPos[2]) |
| 458 | { |
no test coverage detected