diff --git a/line_count.md b/line_count.md index 1b694b4..dc2d739 100644 --- a/line_count.md +++ b/line_count.md @@ -1,9 +1,9 @@ -cloc|github.com/AlDanial/cloc v 1.86 T=0.13 s (53.1 files/s, 10600.9 lines/s) +cloc|github.com/AlDanial/cloc v 1.82 T=0.02 s (328.9 files/s, 65876.7 lines/s) --- | --- Language|files|blank|comment|code :-------|-------:|-------:|-------:|-------: -C/C++ Header|6|252|143|982 +C/C++ Header|6|256|144|982 C|1|6|0|14 --------|--------|--------|--------|-------- -SUM:|7|258|143|996 +SUM:|7|262|144|996 diff --git a/source/initialization.h b/source/initialization.h index 8aa5480..c99b28a 100644 --- a/source/initialization.h +++ b/source/initialization.h @@ -79,6 +79,9 @@ int init() SDL_Log("Detected resolution: %ix%i\n", display_mode.w, display_mode.h); } + // Fix for multi-montior setups: + SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, 0); + app.window = SDL_CreateWindow(GAME_TITLE, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (int)SCREEN_WIDTH, (int)SCREEN_HEIGHT, SDL_WINDOW_RESIZABLE); // SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_RESIZABLE); diff --git a/source/map.h b/source/map.h index 278b6e6..8625201 100644 --- a/source/map.h +++ b/source/map.h @@ -222,13 +222,20 @@ void generate_map(App* app, Game* game) { Axes background; + int initial_background_x; + int initial_background_y; + if (strcmp(game->map.layout_file, MAP_LIBRARY_FILE) == 0) { - background.x = game->player.global.x - game->player.window.x; - background.y = game->player.global.y - game->player.window.y; + initial_background_x = game->player.global.x - game->player.window.x; + initial_background_y = game->player.global.y - game->player.window.y; } else { - background.x = 0, background.y = 0; + initial_background_x = 0; + initial_background_y = 0; } + background.x = initial_background_x; + background.y = initial_background_y; + char last_char = ','; int current_row = 0, current_column = 0; @@ -281,11 +288,8 @@ void generate_map(App* app, Game* game) // Record row data to be used for the map editor: game->map.columns_in_row[current_row] = current_column; - if (strcmp(game->map.layout_file, MAP_LIBRARY_FILE) == 0) { - background.x = game->player.global.x - game->player.window.x; - } else { - background.x = 0; - } + background.x = initial_background_x; + current_column = 0; // Y axis increases! @@ -366,8 +370,6 @@ void generate_map(App* app, Game* game) } // Reset positioning when the library is loaded so it appears in the upper left of the viewport. - if (strcmp(game->map.layout_file, MAP_LIBRARY_FILE) == 0) { - background.x = game->player.global.x - game->player.window.x; - background.y = game->player.global.y - game->player.window.y; - } + background.x = initial_background_x; + background.y = initial_background_y; }