lav-sdl

SDL верзија програма Лавиринт
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување b0f0e936d9700de6e94c9aca44acd57c8f712dda
родитељ a7c75b8aed6c1e486995404215649def1e2d4c80
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Tue, 15 Aug 2023 06:49:20 +0200

Sort print_* functions

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Mlav-sdl.c | 52++++++++++++++++++++++++++--------------------------
измењених датотека: 1, додавања: 26(+), брисања: 26(-)

diff --git a/lav-sdl.c b/lav-sdl.c @@ -86,8 +86,6 @@ static int state = STATE_SEARCHING_PAUSED; static SDL_Texture* ter16_texture = NULL; static SDL_Window* window = NULL; -void print_debug(const char* fmt, ...); -void print_error(const char* fmt, ...); void assign_point(const SDL_Point* from, SDL_Point* to); void assign_point_xy(const int x, const int y, SDL_Point* to); void assign_pointF(const SDL_FPoint* from, SDL_FPoint* to); @@ -111,34 +109,12 @@ int location_pop(SDL_Point* location); void location_push(const SDL_Point* location); void next_step(void); int passable(const int x, const int y); +void print_debug(const char* fmt, ...); +void print_error(const char* fmt, ...); void reset(void); void update_size(void); void -print_debug(const char* fmt, ...) -{ - char buf[PRINT_BUFSIZE]; - va_list args; - - va_start(args, fmt); - vsnprintf(buf, sizeof(buf), fmt, args); - va_end(args); - printf("d: %s\n", buf); -} - -void -print_error(const char* fmt, ...) -{ - char buf[PRINT_BUFSIZE]; - va_list args; - - va_start(args, fmt); - vsnprintf(buf, sizeof(buf), fmt, args); - va_end(args); - fprintf(stderr, "%s: %s\n", PROGNAME, buf); -} - -void assign_point(const SDL_Point* from, SDL_Point* to) { to->x = from->x; @@ -735,6 +711,30 @@ passable(const int x, const int y) } void +print_debug(const char* fmt, ...) +{ + char buf[PRINT_BUFSIZE]; + va_list args; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + printf("d: %s\n", buf); +} + +void +print_error(const char* fmt, ...) +{ + char buf[PRINT_BUFSIZE]; + va_list args; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + fprintf(stderr, "%s: %s\n", PROGNAME, buf); +} + +void reset(void) { for (int y = 0; y < labyrinth.height; y++)