int ft_printf(const char *format, ...) { va_list arg; int done; done = 0; va_start(arg, format); if (no_procent(format)) return (ft_strlen(format)); done = what_to_print(format, &arg); va_end(arg); return (done); }
void create_map(char *map_name, int load){ FILE *map; char temp[100]; int y = y1b + 1, x = x1b + 1; int i, j; switch(load){ case 0: strcpy(temp,"Levels\\"); strcat(temp,map_name); break; case 1: strcpy(temp,"Saved Games\\"); strcat(temp,map_name); break; case 2: strcpy(temp,"Saved Maps\\"); strcat(temp,map_name); break; } map = fopen(temp, "rb"); print_border(); //okvir for (i = y; i<y2b; i++){ fread(matrix[i - y1b] + x - x1b, sizeof(char), 89, map); } for (i = y - 2; i < y2b - 2; i++) for (j = x - x1b; j<x2b - 2; j++){ what_to_print(i + 2, j + 2, i + 2, j + 2, matrix[i][j]); if (matrix[i][j] == '.') matrix[i][j] = ' '; } fclose(map); refresh(); }