| 472 | } |
| 473 | |
| 474 | CMapObject CreateMapObject(const CMapItemGroup *pLayerGroup, const int PosX, const int PosY, const int Width, const int Height) |
| 475 | { |
| 476 | CMapObject Ob; |
| 477 | |
| 478 | Ob.m_aaBaseArea[0][0] = PosX - pLayerGroup->m_OffsetX; |
| 479 | Ob.m_aaBaseArea[1][0] = PosY - pLayerGroup->m_OffsetY; |
| 480 | Ob.m_aaBaseArea[0][1] = Ob.m_aaBaseArea[0][0] + Width; |
| 481 | Ob.m_aaBaseArea[1][1] = Ob.m_aaBaseArea[1][0] + Height; |
| 482 | Ob.m_aLayerOffset[0] = pLayerGroup->m_OffsetX; |
| 483 | Ob.m_aLayerOffset[1] = pLayerGroup->m_OffsetY; |
| 484 | Ob.m_UseClipping = pLayerGroup->m_UseClipping; |
| 485 | Ob.m_aaClipArea[0][0] = pLayerGroup->m_ClipX; |
| 486 | Ob.m_aaClipArea[1][0] = pLayerGroup->m_ClipY; |
| 487 | Ob.m_aaClipArea[0][1] = pLayerGroup->m_ClipX + pLayerGroup->m_ClipW; |
| 488 | Ob.m_aaClipArea[1][1] = pLayerGroup->m_ClipY + pLayerGroup->m_ClipH; |
| 489 | Ob.m_aSpeed[0] = 1 - (pLayerGroup->m_ParallaxX / 100.0f); |
| 490 | Ob.m_aSpeed[1] = 1 - (pLayerGroup->m_ParallaxY / 100.0f); |
| 491 | |
| 492 | for(int i = 0; i < 2; i++) |
| 493 | { |
| 494 | Ob.m_aaScreenOffset[i][0] = -CMapObject::ms_aStandardScreen[i]; |
| 495 | Ob.m_aaScreenOffset[i][1] = CMapObject::ms_aStandardScreen[i]; |
| 496 | if(Ob.m_aSpeed[i] < 0) |
| 497 | std::swap(Ob.m_aaScreenOffset[i][0], Ob.m_aaScreenOffset[i][1]); |
| 498 | } |
| 499 | |
| 500 | SetExtendedArea(Ob); |
| 501 | return Ob; |
| 502 | } |
| 503 | |
| 504 | void SetExtendedArea(CMapObject &Ob) |
| 505 | { |
no test coverage detected