diff --git a/src/libsuperderpy.c b/src/libsuperderpy.c index e17d229..ce8bccb 100644 --- a/src/libsuperderpy.c +++ b/src/libsuperderpy.c @@ -221,8 +221,6 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char* 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"))); al_set_display_icon(game->display, icon); al_destroy_bitmap(icon); @@ -564,7 +562,6 @@ SYMBOL_INTERNAL void libsuperderpy_mainloop(void* g) { } else if (ev.type == ALLEGRO_EVENT_DISPLAY_RESIZE) { al_acknowledge_resize(game->display); SetupViewport(game, game->viewport_config); - ResizeGamestates(game); } else if ((game->config.debug) && (ev.type == ALLEGRO_EVENT_DISPLAY_SWITCH_OUT)) { PauseExecution(game); } else if ((game->config.debug) && (ev.type == ALLEGRO_EVENT_DISPLAY_SWITCH_IN)) { diff --git a/src/utils.c b/src/utils.c index 3cd3e73..e5f170b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -462,6 +462,9 @@ SYMBOL_EXPORT void SetupViewport(struct Game* game, struct Viewport config) { al_use_transform(&game->projection); Console_Unload(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) {