Skip to content

Commit

Permalink
Use Axes instead of two ints on initial_background.
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan McQuen <[email protected]>
  • Loading branch information
ryanpcmcquen committed Sep 4, 2020
1 parent a67d08a commit a759625
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions assets/data/map_layout_0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
27, 28, 16, 16, 16, 16, 17, _
27, 28, 16, 28, 16, 16, 17, _
27, 28, 28, 16, 28, 16, 17, _
27, 28, 28, 28, 28, 28, 17, _
27, 28, 28, 28, 34, 28, 17, _
48, 49, 28, 28, 28, 28, 37, 1, 2, 5, _
_, _, 27, 16, 28, 28, 16, 16, 16, 17
_, _, 27, 16, 16, 16, 16, 16, 16, 17
_, _, 27, 16, 16, 28, 28, 28, 16, 17
_, _, 27, 28, 28, 58, 28, 28, 16, 17
_, _, 27, 28, 28, 28, 28, 28, 16, 17
_, _, 27, 16, 16, 28, 16, 28, 16, 17
_, _, 27, 28, 28, 16, 16, 16, 16, 17
_, _, 27, 16, 16, 16, 16, 16, 16, 17
Expand Down
6 changes: 3 additions & 3 deletions line_count.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cloc|github.com/AlDanial/cloc v 1.82 T=0.02 s (365.7 files/s, 73246.1 lines/s)
cloc|github.com/AlDanial/cloc v 1.86 T=0.13 s (52.3 files/s, 10451.9 lines/s)
--- | ---

Language|files|blank|comment|code
:-------|-------:|-------:|-------:|-------:
C/C++ Header|6|256|144|982
C/C++ Header|6|255|144|981
C|1|6|0|14
--------|--------|--------|--------|--------
SUM:|7|262|144|996
SUM:|7|261|144|995
22 changes: 10 additions & 12 deletions source/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,18 @@ void draw_edit_grid(App* app, Game* game, Axes background, int map_tile)
void generate_map(App* app, Game* game)
{
Axes background;

int initial_background_x;
int initial_background_y;
Axes initial_background;

if (strcmp(game->map.layout_file, MAP_LIBRARY_FILE) == 0) {
initial_background_x = game->player.global.x - game->player.window.x;
initial_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 {
initial_background_x = 0;
initial_background_y = 0;
initial_background.x = 0;
initial_background.y = 0;
}

background.x = initial_background_x;
background.y = initial_background_y;
background.x = initial_background.x;
background.y = initial_background.y;

char last_char = ',';
int current_row = 0, current_column = 0;
Expand Down Expand Up @@ -288,7 +286,7 @@ 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;

background.x = initial_background_x;
background.x = initial_background.x;

current_column = 0;

Expand Down Expand Up @@ -370,6 +368,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.
background.x = initial_background_x;
background.y = initial_background_y;
background.x = initial_background.x;
background.y = initial_background.y;
}

0 comments on commit a759625

Please sign in to comment.