dev: reorganize global variables and constants

This commit is contained in:
mcolonna 2024-04-20 13:05:14 +02:00
parent a395676ee9
commit 5992784dce
26 changed files with 401 additions and 356 deletions

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/26 15:26:13 by mcolonna #+# #+# */
/* Updated: 2024/04/20 12:47:22 by mcolonna ### ########.fr */
/* Updated: 2024/04/20 15:46:49 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,15 +18,13 @@
# define WINDOW_TITLE "undretale"
# define FPS 20
# define TEXT_SPACE 9
# define LEVEL_COUNT 10
extern const t_const_string g_levels[LEVEL_COUNT];
typedef struct s_env
{
// GLOBAL
t_memclass mc;
t_loopfunctions loopfunctions;
// IO
// display
@ -49,8 +47,16 @@ typedef struct s_env
int max_ketchup;
// moves
int moves;
} t_env;
} t_env;
extern t_env g_env;
typedef struct s_consts
{
t_const_string levels[LEVEL_COUNT];
t_assetmeta assetsmap[NB_ASSETS];
t_spritemeta spritesmap[NB_SPRITES];
t_roomcase roomcases[];
} t_consts;
extern const t_consts g_consts;
#endif

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/02 13:39:54 by mcolonna #+# #+# */
/* Updated: 2024/04/17 13:17:59 by mcolonna ### ########.fr */
/* Updated: 2024/04/20 13:29:14 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,8 +19,6 @@ typedef struct s_loopfunctions
void (*draw)(void);
} t_loopfunctions;
extern t_loopfunctions g_loopfunctions;
int main(int argc, t_const_string *argv);
#endif