X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fclient%2Fio.c;h=43a695ab02b90f43356ea9712436f42c11eaa31d;hb=0cc6c4ad7e0b01e2a89ced908f410eadf3f22b1f;hp=481495d81fdb295ea0f00d622c9681a9bbbdfd22;hpb=a053b626309d3d9c51caecf35a018b6e1df5ecb5;p=plomrogue diff --git a/src/client/io.c b/src/client/io.c index 481495d..43a695a 100644 --- a/src/client/io.c +++ b/src/client/io.c @@ -15,10 +15,10 @@ #include "../common/try_malloc.h" /* try_malloc() */ #include "../common/rexit.h" /* exit_trouble(), exit_err() */ #include "../common/readwrite.h" /* try_fopen(), try_fclose(), try_fgets(), - * try_fgetc() + * try_fgetc(), textfile_width() */ #include "control.h" /* try_key() */ -#include "map_window.h" /* map_center() */ +#include "map.h" /* map_center() */ #include "misc.h" /* reset_windows() */ #include "windows.h" /* reset_windows_on_winch(), draw_all_wins() */ #include "world.h" /* world global */ @@ -110,7 +110,7 @@ static void read_map_cells(FILE * file) char * f_name = "read_map_cells()"; free(world.map.cells); world.map.cells = try_malloc(world.map.size.y * world.map.size.x, f_name); - uint16_t y, x; + uint8_t y, x; for (y = 0; y < world.map.size.y; y++) { for (x = 0; x < world.map.size.x; x++) @@ -193,7 +193,7 @@ static uint8_t read_world() { return 0; } - uint32_t linemax = textfile_sizes(file, NULL); + uint32_t linemax = textfile_width(file); char * read_buf = try_malloc(linemax + 1, f_name); world.turn = read_value_from_line(read_buf, linemax, file); world.player_score = read_value_from_line(read_buf, linemax, file);