| 8 | { |
| 9 | |
| 10 | unsigned int CalculateMenuScale( const Size2& viewport_size ) |
| 11 | { |
| 12 | float scale_f= |
| 13 | std::min( |
| 14 | float( viewport_size.Width () ) / float( GameConstants::min_screen_width ), |
| 15 | float( viewport_size.Height() ) / float( GameConstants::min_screen_height ) ); |
| 16 | |
| 17 | // Do not scale menu too height. |
| 18 | if( scale_f > 3.0f ) |
| 19 | scale_f*= 1.0f - 0.25f * std::min( scale_f - 3.0f, 1.0f ); |
| 20 | |
| 21 | return std::max( 1u, static_cast<unsigned int>( scale_f ) ); |
| 22 | } |
| 23 | |
| 24 | unsigned int CalculateConsoleScale( const Size2& viewport_size ) |
| 25 | { |
no test coverage detected