fix broken fullscreen toggle on Windows

This commit is contained in:
Sebastian Krzyszkowiak 2018-07-30 16:59:59 +02:00
parent c337e3435f
commit 8ff2a57b64
2 changed files with 3 additions and 3 deletions

View file

@ -221,8 +221,6 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
return NULL; return NULL;
} }
PrintConsole(game, "Viewport %dx%d", game->viewport.width, game->viewport.height);
ALLEGRO_BITMAP* icon = al_load_bitmap(GetDataFilePath(game, GetGameName(game, "icons/%s.png"))); ALLEGRO_BITMAP* icon = al_load_bitmap(GetDataFilePath(game, GetGameName(game, "icons/%s.png")));
al_set_display_icon(game->display, icon); al_set_display_icon(game->display, icon);
al_destroy_bitmap(icon); al_destroy_bitmap(icon);
@ -564,7 +562,6 @@ SYMBOL_INTERNAL void libsuperderpy_mainloop(void* g) {
} else if (ev.type == ALLEGRO_EVENT_DISPLAY_RESIZE) { } else if (ev.type == ALLEGRO_EVENT_DISPLAY_RESIZE) {
al_acknowledge_resize(game->display); al_acknowledge_resize(game->display);
SetupViewport(game, game->viewport_config); SetupViewport(game, game->viewport_config);
ResizeGamestates(game);
} else if ((game->config.debug) && (ev.type == ALLEGRO_EVENT_DISPLAY_SWITCH_OUT)) { } else if ((game->config.debug) && (ev.type == ALLEGRO_EVENT_DISPLAY_SWITCH_OUT)) {
PauseExecution(game); PauseExecution(game);
} else if ((game->config.debug) && (ev.type == ALLEGRO_EVENT_DISPLAY_SWITCH_IN)) { } else if ((game->config.debug) && (ev.type == ALLEGRO_EVENT_DISPLAY_SWITCH_IN)) {

View file

@ -462,6 +462,9 @@ SYMBOL_EXPORT void SetupViewport(struct Game* game, struct Viewport config) {
al_use_transform(&game->projection); al_use_transform(&game->projection);
Console_Unload(game); Console_Unload(game);
Console_Load(game); Console_Load(game);
ResizeGamestates(game);
PrintConsole(game, "Viewport %dx%d; display %dx%d", game->viewport.width, game->viewport.height, al_get_display_width(game->display), al_get_display_height(game->display));
} }
SYMBOL_EXPORT void WindowCoordsToViewport(struct Game* game, int* x, int* y) { SYMBOL_EXPORT void WindowCoordsToViewport(struct Game* game, int* x, int* y) {