aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bmp.c4
-rw-r--r--config.h2
-rw-r--r--main.c6
-rw-r--r--map.c14
-rw-r--r--map.h6
-rw-r--r--priority_queue.c2
-rw-r--r--priority_queue.h2
-rw-r--r--structs.h2
8 files changed, 19 insertions, 19 deletions
diff --git a/bmp.c b/bmp.c
index 14a8d61..3abac0d 100644
--- a/bmp.c
+++ b/bmp.c
@@ -13,7 +13,7 @@ void map_to_bmp(Map map, size_t map_width, size_t map_height, Position start, Po
/* Dimensions of the resulting image */
int32_t width = map_width;
int32_t height = map_height;
- uint16_t bitcount = 24;
+ uint16_t bitcount = 24;
/* Width of a single row in bytes */
int width_in_bytes = ((width * bitcount + 31) / 32) * 4;
@@ -25,7 +25,7 @@ void map_to_bmp(Map map, size_t map_width, size_t map_height, Position start, Po
const uint32_t biSize = 40;
/* Bitmap bit offset */
- const uint32_t bfOffBits = 54;
+ const uint32_t bfOffBits = 54;
/* Size in bytes of resulting BMP */
uint32_t filesize = 54 + imagesize;
diff --git a/config.h b/config.h
index 31222fb..581c6c6 100644
--- a/config.h
+++ b/config.h
@@ -7,7 +7,7 @@
#define ANIM_DELAY_USEC 10*1000
/* The characters that represent different tiles.
- * Some have two characters -- that's because of the rendering trick where we
+ * Some have two characters -- that's because of the rendering trick where we
* use two characters back-to-back so they look like a square. */
#define EMPTY_CHAR ' '
#define GOAL_CHAR_1 'G'
diff --git a/main.c b/main.c
index ef99997..74e283f 100644
--- a/main.c
+++ b/main.c
@@ -16,7 +16,7 @@
/* So, TODO for now:
- Allow maps to have costs
- - Write out the amount of visited squares (to see how algorithms differ in
+ - Write out the amount of visited squares (to see how algorithms differ in
efficiency)
- Map editor function
- Rework the UI, probably completely
@@ -201,12 +201,12 @@ int main(int argc, char **argv) {
path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim);
}
break;
- case 'e':
+ case 'e':
is_maze = 0;
visited_free(visited, height);
path_free(path, height);
- map_editor(&map, &width, &height, &start_pos, &end_pos);
+ map_editor(&map, &width, &height, &start_pos, &end_pos);
wrefresh(curscr);
visited = visited_new(width, height);
diff --git a/map.c b/map.c
index cbfe333..3bd7500 100644
--- a/map.c
+++ b/map.c
@@ -22,7 +22,7 @@ Map empty_map(size_t width, size_t height) {
for (size_t row = 0; row < height; row++) {
map[row] = malloc(sizeof(MapTile) * width);
if (map[row] == NULL) return NULL;
- memset(map[row], 0, width*sizeof(MapTile));
+ memset(map[row], 0, width*sizeof(MapTile));
}
return map;
@@ -260,16 +260,16 @@ void draw_map(Map map, size_t width, size_t height, Position start, Position goa
for (size_t j = 0; j < width; j++) {
int color_pair = 0; /* The color pair of the current char */
switch (map[i][j]) {
- case EMPTY:
+ case EMPTY:
if (visited != NULL && visited[i][j])
color_pair = COLOR_PAIR(VISITED_COLOR);
- else
+ else
color_pair = COLOR_PAIR(EMPTY_COLOR);
- c = EMPTY_CHAR;
+ c = EMPTY_CHAR;
break;
- case WALL:
+ case WALL:
color_pair = COLOR_PAIR(WALL_COLOR);
- c = WALL_CHAR;
+ c = WALL_CHAR;
break;
}
@@ -291,7 +291,7 @@ void draw_map(Map map, size_t width, size_t height, Position start, Position goa
}
}
}
-
+
/* Render the frontier */
if (frontier != NULL) {
attron(COLOR_PAIR(FRONTIER_COLOR));
diff --git a/map.h b/map.h
index ecebbb9..fef684c 100644
--- a/map.h
+++ b/map.h
@@ -21,8 +21,8 @@ unsigned int neighbours_4dir(Position neighbour_array[4], size_t cost_array[4],
unsigned int neighbours_8dir(Position neighbour_array[8], size_t cost_array[8], Position pos, size_t width, size_t height, \
char **visited);
-/* https://en.wikipedia.org/wiki/Maze_generation_algorithm#Randomized_depth-first_search
- * WARNING: width and height are not the width and height of the returned map!
+/* https://en.wikipedia.org/wiki/Maze_generation_algorithm#Randomized_depth-first_search
+ * WARNING: width and height are not the width and height of the returned map!
* The actual size for a given dimention is (dimension * 2 - 1) */
Map rbt_maze_map(size_t width, size_t height, unsigned int seed);
@@ -42,7 +42,7 @@ Map rbt_maze_map(size_t width, size_t height, unsigned int seed);
* ..@....... */
Map file_plaintext_map(char *filename, size_t *width, size_t *height, Position *start_pos, Position *end_pos);
-/* Draw the map. Bet you didn't expect that.
+/* Draw the map. Bet you didn't expect that.
* path could be NULL to draw a map with no path. So can cursor, frontier and visited */
void draw_map(Map map, size_t width, size_t height, Position start, Position goal, Position *cursor, Path path, char **visited, PositionPQ *frontier);
diff --git a/priority_queue.c b/priority_queue.c
index 7e706a8..a6df02b 100644
--- a/priority_queue.c
+++ b/priority_queue.c
@@ -19,7 +19,7 @@ int ppq_insert(PositionPQ **ppq, Position pos, size_t priority) {
(*ppq) = ppq_new(pos, priority);
return PPQ_INSERT_NEW;
}
-
+
PositionPQ *n = ppq_new(pos, priority);
if (start->priority > priority) {
diff --git a/priority_queue.h b/priority_queue.h
index 241dcc7..f773475 100644
--- a/priority_queue.h
+++ b/priority_queue.h
@@ -3,7 +3,7 @@
#include "structs.h"
-/* This is basically a sorted linked list
+/* This is basically a sorted linked list
* Pro tip: if you always use the same priority, this becomes a regular queue */
struct PositionPQNode_s {
Position pos;
diff --git a/structs.h b/structs.h
index fa8982b..801b1a6 100644
--- a/structs.h
+++ b/structs.h
@@ -27,7 +27,7 @@ enum Colors_e {
CURSOR_COLOR = 8,
};
-/* A map is a 2D array of MapTiles.
+/* A map is a 2D array of MapTiles.
* Use as map[row][column] */
typedef MapTile** Map;