Cub3D
Loading...
Searching...
No Matches
error_cub3d.h
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* error_cub3d.h :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/11/12 15:26:28 by kamitsui #+# #+# */
9/* Updated: 2024/12/15 00:21:46 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#ifndef ERROR_CUB3D_H
14# define ERROR_CUB3D_H
15
19# define ERR_PROMPT "Error: "
20
21// init_game.c
22// Not one argument
23# define EMSG_ARG_COUNT "One argument must be specified"
24// Incorrect file extension
25# define EMSG_FILE_EXT "Specify a file path with .cub extension"
26// example
27// "Error: One argument must be specified"
28// "Error: Specify a file path with .cub extension"
29
30// init_cub_contents.c
31// open() system call failure
32# define EMSG_OPEN_FAILED "File open failed"
33// empty file or read() system call failure
34# define EMSG_READ_FAILED "File read failed"
35// if only '\n' in cubfile
36# define EMSG_EMPTY_CUB "Empty cub file"
37// example
38// "Error: File open failed"
39// "Error: File read failed"
40// "Error: Empty cub file"
41
42// parse_tex.c
43// Only key of texture ... "NO: "
44# define EMSG_XPM_FILE "Texture file"
45// mlx_get_data_addr() func failure with using texture image
46# define EMSG_IMG_DATA_ADDR "mlx_get_data_addr"
47// Incorrect XPM format OR mlx_xpm_file_to_image() func failure
48# define EMSG_MLX_XPM_TO_IMG "mlx_xpm_file_to_image"
49// example
50// "Error: NO: Texture file"
51// "Error: mlx_get_data_addr"
52// "Error: mlx_xpm_file_to_image: file_name.xpm"
53
54// Entry
55// If same entry is duplicate
56# define EMSG_ENTRY_DUP "Duplicate entry"
57// If Missing entry
58# define EMSG_ENTRY_MISS "Missing entry"
59// If invalid entry
60# define EMSG_ENTRY_INVAL "Invalid entry"
61// example
62// "Error: F: Duplicate entry"
63// "Error: F: Missing entry"
64// "Error: BA: Invalid entry"
65
72# define EMSG_RGB_EMPTY "Empty RGB component"
73// EX: "F"
74// - result.value : not use
75// - Out : "Error: F: Empty RGB component"
76
77# define EMSG_RGB_MISS "Missing RGB component"
78// EX: "F 10, 10, ,", "F 10, 10 ", and more ...
79// - result.value : -1
80// - Out : "Error: F: Missing RGB component B"
81
82# define EMSG_RGB_RANGE_OUT "Out of range (0 ~ 255)"
83// EX: "F 8523, 42, 42"
84// - result.value : -2
85// - Out : "Error: F: "8523" Out of range"
86
87# define EMSG_RGB_NOT_NUM "is not a number"
88// EX: "F i, 42, 42"
89// - result.value : -3
90// - Out : "Error: F: "i" is not a number"
91
92# define EMSG_UP_TO_THREE_RGB "Up to three RGB value"
93// EX: "F 0,255,0,0"
94// - result.value : -4
95// - Out : "Error: F: Up to three RGB value"
96
97// MAP
98# define EMSG_MAP_CHAR "MAP: Invalid characters found"
99# define EMSG_MAP_PLAYER_MULTI "MAP: Multiple player start positions"
100# define EMSG_MAP_PLAYER_MISS "MAP: Missing player start position"
101# define EMSG_MAP_NOT_LAST "MAP: Must be the last element"
102# define EMSG_MAP_NOT_ENCLOSED "MAP: Not enclosed by walls"
103# define EMSG_MAP_TOO_LARGE "MAP: Too large"
104
105#endif