helper functions
| 2 | |
| 3 | // helper functions |
| 4 | void IGraphics::CalcScreenParams(float Aspect, float Zoom, float *pWidth, float *pHeight) const |
| 5 | { |
| 6 | const float Amount = 1150 * 1000; |
| 7 | const float WMax = 1500; |
| 8 | const float HMax = 1050; |
| 9 | |
| 10 | const float f = std::sqrt(Amount) / std::sqrt(Aspect); |
| 11 | *pWidth = f * Aspect; |
| 12 | *pHeight = f; |
| 13 | |
| 14 | // limit the view |
| 15 | if(*pWidth > WMax) |
| 16 | { |
| 17 | *pWidth = WMax; |
| 18 | *pHeight = *pWidth / Aspect; |
| 19 | } |
| 20 | |
| 21 | if(*pHeight > HMax) |
| 22 | { |
| 23 | *pHeight = HMax; |
| 24 | *pWidth = *pHeight * Aspect; |
| 25 | } |
| 26 | |
| 27 | *pWidth *= Zoom; |
| 28 | *pHeight *= Zoom; |
| 29 | } |
| 30 | |
| 31 | void IGraphics::MapScreenToWorld(float CenterX, float CenterY, float ParallaxX, float ParallaxY, |
| 32 | float ParallaxZoom, float OffsetX, float OffsetY, float Aspect, float Zoom, float *pPoints) const |
no outgoing calls
no test coverage detected