feat: reorganize the code
This commit is contained in:
parent
a00a02e527
commit
5103cbf709
40 changed files with 326 additions and 325 deletions
33
includes/main/env.h
Normal file
33
includes/main/env.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* env.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 15:26:13 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 14:39:26 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef ENV_H
|
||||
# define ENV_H
|
||||
|
||||
# define WINDOW_WIDTH 600
|
||||
# define WINDOW_HEIGHT 400
|
||||
# define WINDOW_TITLE "undretale"
|
||||
# define FPS 20
|
||||
# define WALK_STEPS_NB 4
|
||||
|
||||
typedef struct s_env
|
||||
{
|
||||
t_memclass mc;
|
||||
void *mlx;
|
||||
void *win;
|
||||
t_room room;
|
||||
bool input[4];
|
||||
} t_env;
|
||||
|
||||
extern t_env g_env;
|
||||
|
||||
#endif
|
||||
21
includes/main/error.h
Normal file
21
includes/main/error.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* error.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 16:04:31 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 18:04:00 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef ERROR_H
|
||||
# define ERROR_H
|
||||
|
||||
void error_err(t_const_string msg);
|
||||
void error_perror(t_const_string s);
|
||||
void error_str(t_const_string s, t_const_string msg);
|
||||
void success(void);
|
||||
|
||||
#endif
|
||||
20
includes/main/input.h
Normal file
20
includes/main/input.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* input.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/26 12:16:32 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 14:39:38 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef INPUT_H
|
||||
# define INPUT_H
|
||||
|
||||
int key_press_hook(int keycode);
|
||||
int key_release_hook(int keycode);
|
||||
void input_loop(void);
|
||||
|
||||
#endif
|
||||
18
includes/main/main.h
Normal file
18
includes/main/main.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* main.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/02 13:39:54 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 14:39:40 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MAIN_H
|
||||
# define MAIN_H
|
||||
|
||||
int main(void);
|
||||
|
||||
#endif
|
||||
18
includes/main/timedloop.h
Normal file
18
includes/main/timedloop.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* timedloop.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/26 15:02:16 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 14:39:46 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef TIMEDLOOP_H
|
||||
# define TIMEDLOOP_H
|
||||
|
||||
void timedloop(void (*f)(void));
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue