24static char loading_message[256] =
"";
30 log_msg(ERROR,
"Wait Output",
"Loading screen text is NULL");
35 strncpy(loading_message, text,
sizeof(loading_message) - 1);
36 loading_message[
sizeof(loading_message) - 1] =
'\0';
46 int msg_len = strlen(loading_message);
47 int msg_x = (width - msg_len) / 2;
48 int msg_y = height / 2 - 1;
54 frame = (frame + 1) % 4;
56 char anim[10] =
"|/-\\|/-\\";
57 char animation_str[2] = {anim[frame],
'\0'};
75 const char* title =
"DUNGEON CRAWL";
76 int title_len = strlen(title);
77 int title_x = (width - title_len) / 2;
78 int title_y = height / 3;
81 print_text(title_y, title_x, title, RED_TEXT_COLORS);
84 const char* version =
"Version 1.0";
85 const char* copyright =
"(C) 2025 DungeonCrawl Team";
87 int version_len = strlen(version);
88 int copyright_len = strlen(copyright);
90 int version_x = (width - version_len) / 2;
91 int copyright_x = (width - copyright_len) / 2;
97 const char* loading_msg =
"Loading game...";
98 int loading_len = strlen(loading_msg);
101 static int frame = 0;
102 frame = (frame + 1) % 4;
103 char anim[5] =
"|/-\\";
104 char animation_str[32];
105 snprintf(animation_str,
sizeof(animation_str),
"%s %c", loading_msg, anim[frame]);
129 const char* welcome_msg =
"Welcome to Dungeon Crawl! Press any key to continue...";
130 int msg_len = strlen(welcome_msg);
131 int msg_x = (width - msg_len) / 2;
132 int msg_y = height / 2;
Exposes functions for the IO-Handler.
void log_msg(const log_level_t level, const char *module, const char *format,...)
Logs a formatted message with a specified log level and module.
Header file for logging functionality of the game.
void print_text(int y, int x, const char *text, uint64_t ncchannel)
Print text at a specific position.
void print_text_default(int y, int x, const char *text)
Print text at a specific position with default colors.
bool render_frame(void)
Render the current frame.
bool get_screen_dimensions(int *width, int *height)
Get the dimensions of the standard plane.
void clear_screen(void)
Clear the screen.
Exposes functions for outputting to the console.
void draw_welcome_screen(void)
Draw the welcome screen with a message.
void draw_launch_screen(void)
Draw the launch screen with title and animation.
void draw_loading_screen(const char *text)
Draw a loading screen with animation.
Exposes functions for drawing the laoding screen.