mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
support a case where width, height and ratio in params are all zeros
This commit is contained in:
parent
deb38e778c
commit
834b1028f5
1 changed files with 4 additions and 1 deletions
|
@ -713,7 +713,10 @@ SYMBOL_INTERNAL void SetupViewport(struct Game* game) {
|
|||
game->_priv.window_width = al_get_display_width(game->display);
|
||||
game->_priv.window_height = al_get_display_height(game->display);
|
||||
|
||||
if ((game->viewport.width == 0) || (game->viewport.height == 0)) {
|
||||
if (game->viewport.width == 0 && game->viewport.height == 0) {
|
||||
game->viewport.width = game->_priv.window_width;
|
||||
game->viewport.height = game->_priv.window_height;
|
||||
} else if (game->viewport.width == 0 || game->viewport.height == 0) {
|
||||
game->viewport.height = al_get_display_height(game->display);
|
||||
game->viewport.width = (int)(game->_priv.params.aspect * game->viewport.height);
|
||||
if (game->viewport.width > al_get_display_width(game->display)) {
|
||||
|
|
Loading…
Reference in a new issue