MiniDevil As beautiful as a shell
welcome_demon.c File Reference

Demon ASCII art. More...

#include "welcome_ui.h"
+ Include dependency graph for welcome_demon.c:

Detailed Description

Demon ASCII art.

Definition in file welcome_demon.c.

Functions

const char * get_demon_art_line (int line)
 Return 1 line of the ASCII Demon art by index. More...
 
static const char * get_demon_color (int line)
 Map a Demon art row to its gradient color string. More...
 
static void print_demon_line (t_welcome_term *t, int line, int row)
 Print 1 demon art line at the correct terminal position, with color. More...
 
void animate_demon (t_welcome_term *t)
 Animate the Demon art with 100ms delay. More...
 
void flash_demon_eyes (t_welcome_term *t)
 Animate the demon's eyes blinking. More...
 

Function Documentation

◆ get_demon_art_line()

const char* get_demon_art_line ( int  line)

Return 1 line of the ASCII Demon art by index.

Parameters
lineLine index (0 to DEMON_LINES - 1)
Returns
Pointer to the art string or NULL if out of range

Definition at line 21 of file welcome_demon.c.

References DEMON_LINES.

Referenced by print_demon_line().

+ Here is the caller graph for this function:

◆ get_demon_color()

static const char* get_demon_color ( int  line)
static

Map a Demon art row to its gradient color string.

C_AURA 5 = brightest and C_AURA 1 = darkest

Parameters
lineArt line index
Returns
ANSI color escape string for that row

Definition at line 55 of file welcome_demon.c.

References C_AURA1, C_AURA2, C_AURA3, C_AURA4, and C_AURA5.

Referenced by print_demon_line().

+ Here is the caller graph for this function:

◆ print_demon_line()

static void print_demon_line ( t_welcome_term t,
int  line,
int  row 
)
static

Print 1 demon art line at the correct terminal position, with color.

Centers the line by using DEMON_WIDTH

Parameters
tTerminal dimensions (for centering)
lineArt line index
rowTerminal row to print on

Definition at line 77 of file welcome_demon.c.

References DEMON_WIDTH, get_demon_art_line(), get_demon_color(), print_at_pos(), RESET, and t_welcome_term::width.

Referenced by animate_demon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ animate_demon()

void animate_demon ( t_welcome_term t)

Animate the Demon art with 100ms delay.

Parameters
tTerminal dimensions for centering and row calculations

Definition at line 99 of file welcome_demon.c.

References t_welcome_term::center_y, DEMON_LINES, ft_msleep(), and print_demon_line().

Referenced by draw_welcome().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flash_demon_eyes()

void flash_demon_eyes ( t_welcome_term t)

Animate the demon's eyes blinking.

Parameters
tTerminal dimensions to calculate the eye positions

Definition at line 118 of file welcome_demon.c.

References BOLD, C_M1, C_M5, t_welcome_term::center_y, DEMON_WIDTH, ft_msleep(), print_at_pos(), RESET, and t_welcome_term::width.

Referenced by draw_welcome().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Go to the source code of this file.