change, fix, .gitignore *

fix: warning gnu old-style field designator ext.
change: inner walls texture
dev: add *.o and *.a to .gitignore
This commit is contained in:
mcolonna 2024-04-22 12:46:58 +02:00
parent 960f13d9db
commit 42706ab8cc
17 changed files with 500 additions and 479 deletions

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/26 16:32:36 by mcolonna #+# #+# */
/* Updated: 2024/04/21 20:18:51 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 13:11:02 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,19 +15,19 @@
t_env g_env;
const t_consts g_consts = {
roomcases: {
{c: '0', object: NULL, surface: CASE_FLOOR_1},
{c: '1', object: wall_init, surface: CASE_FLOOR_1},
{c: 'P', object: snas_init, surface: CASE_FLOOR_1},
{c: 'C', object: ketchup_init, surface: CASE_FLOOR_1},
{c: 'E', object: exit_init, surface: CASE_FLOOR_1},
{c: 'F', object: firsk_init, surface: CASE_FLOOR_1},
{c: 'B', object: NULL, surface: CASE_BRIDGE},
{c: 'A', object: activablewall_init, surface: CASE_BRIDGE},
{c: 'U', object: ultimateketchup_init, surface: CASE_FLOOR_1},
{c: '\0'}
.roomcases = {
{.c = '0', .object = NULL, .surface = CASE_FLOOR_1},
{.c = '1', .object = wall_init, .surface = CASE_FLOOR_1},
{.c = 'P', .object = snas_init, .surface = CASE_FLOOR_1},
{.c = 'C', .object = ketchup_init, .surface = CASE_FLOOR_1},
{.c = 'E', .object = exit_init, .surface = CASE_FLOOR_1},
{.c = 'F', .object = firsk_init, .surface = CASE_FLOOR_1},
{.c = 'B', .object = NULL, .surface = CASE_BRIDGE},
{.c = 'A', .object = activablewall_init, .surface = CASE_BRIDGE},
{.c = 'U', .object = ultimateketchup_init, .surface = CASE_FLOOR_1},
{.c = '\0'}
},
levels: {
.levels = {
"rooms/01.ber",
"rooms/02.ber",
"rooms/03.ber",
@ -39,13 +39,13 @@ const t_consts g_consts = {
"rooms/09.ber",
"rooms/10.ber",
},
assetsmap: {
.assetsmap = {
{"floor/1", 50, 100, 50, 125, true},
{"floor/2", 50, 100, 50, 125, true},
// WALL
{"wall/border_top", 50, 100, 50, 125, true},
{"wall/border_bottom", 50, 100, 50, 100, true},
{"wall/inner", 50, 100, 30, 100, false},
{"wall/inner", 50, 120, 30, 100, false},
// BRIDGE
{"wall/bridge", 50, 100, 50, 125, false},
// OBJECTS
@ -180,7 +180,7 @@ const t_consts g_consts = {
{"text/big/youwin", 0, 600, 0, 400, false},
{"text/big/gameover", 0, 600, 0, 400, false},
},
spritesmap: {
.spritesmap = {
{WALL_BORDER_TOP, 50, 50, ANIMATION, 1, 1},
{WALL_BORDER_BOTTOM, 50, 50, ANIMATION, 1, 1},
{FLOOR_1, 50, 50, ANIMATION, 1, 1},

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/20 15:05:54 by mcolonna #+# #+# */
/* Updated: 2024/04/20 15:16:29 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:42:43 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,10 +15,10 @@
t_input_hidden *get_input_hidden(void)
{
static t_input_hidden v = {
enter: false,
input_i: 0,
to_unpress: {false, false, false, false},
inputbuf: {false, false, false, false},
.enter = false,
.input_i = 0,
.to_unpress = {false, false, false, false},
.inputbuf = {false, false, false, false},
};
return (&v);

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 15:27:03 by mcolonna #+# #+# */
/* Updated: 2024/04/21 16:09:40 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:44:28 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -37,9 +37,9 @@ static bool activablewall_walk_through(
t_object activablewall_init(t_memclass mc)
{
static const t_objecttype type
= {solid_firsk: false, solid_snas: false,
init: activablewall_init, loop: activablewall_loop,
draw: activablewall_draw, walk_through: activablewall_walk_through};
= {.solid_firsk = false, .solid_snas = false,
.init = activablewall_init, .loop = activablewall_loop,
.draw = activablewall_draw, .walk_through = activablewall_walk_through};
t_object r;
t_wall_data *data;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/08 15:01:16 by mcolonna #+# #+# */
/* Updated: 2024/04/21 17:06:07 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:44:51 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -59,9 +59,9 @@ static bool exit_walk_through(
t_object exit_init(t_memclass mc)
{
static const t_objecttype type
= {solid_firsk: true, solid_snas: true,
init: exit_init, loop: exit_loop, draw: exit_draw,
walk_through: exit_walk_through};
= {.solid_firsk = true, .solid_snas = true,
.init = exit_init, .loop = exit_loop, .draw = exit_draw,
.walk_through = exit_walk_through};
t_object r;
t_exit_data *data;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/11 13:55:04 by mcolonna #+# #+# */
/* Updated: 2024/04/20 16:17:08 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:45:11 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -36,15 +36,15 @@ static void firsk_draw(t_object *obj, t_point p)
t_object firsk_init(t_memclass mc)
{
static const t_objecttype type
= {solid_firsk: false, solid_snas: false,
init: firsk_init, loop: firsk_loop, draw: firsk_draw,
walk_through: NULL};
= {.solid_firsk = false, .solid_snas = false,
.init = firsk_init, .loop = firsk_loop, .draw = firsk_draw,
.walk_through = NULL};
static const t_character_sprites sprites = {
still: SPR_FIRSK,
walk_left: SPR_FIRSK_WALK_LEFT,
walk_right: SPR_FIRSK_WALK_RIGHT,
walk_up: SPR_FIRSK_WALK_UP,
walk_down: SPR_FIRSK_WALK_DOWN,
.still = SPR_FIRSK,
.walk_left = SPR_FIRSK_WALK_LEFT,
.walk_right = SPR_FIRSK_WALK_RIGHT,
.walk_up = SPR_FIRSK_WALK_UP,
.walk_down = SPR_FIRSK_WALK_DOWN,
};
t_object r;
t_firsk_data *data;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 15:27:03 by mcolonna #+# #+# */
/* Updated: 2024/04/18 17:14:55 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:45:21 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -38,12 +38,12 @@ t_object ketchup_init(t_memclass mc)
{
static const t_objecttype type
= {
solid_firsk: true,
solid_snas: false,
init: ketchup_init,
loop: ketchup_loop,
draw: ketchup_draw,
walk_through: ketchup_walk_through};
.solid_firsk = true,
.solid_snas = false,
.init = ketchup_init,
.loop = ketchup_loop,
.draw = ketchup_draw,
.walk_through = ketchup_walk_through};
t_object r;
t_wall_data *data;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 15:27:03 by mcolonna #+# #+# */
/* Updated: 2024/04/21 16:30:38 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:45:37 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -85,15 +85,15 @@ static void snas_draw(t_object *obj, t_point p)
t_object snas_init(t_memclass mc)
{
static const t_objecttype type
= {solid_firsk: false, solid_snas: false,
init: snas_init, loop: snas_loop, draw: snas_draw,
walk_through: snas_walk_through};
= {.solid_firsk = false, .solid_snas = false,
.init = snas_init, .loop = snas_loop, .draw = snas_draw,
.walk_through = snas_walk_through};
static const t_character_sprites sprites = {
still: SPR_SNAS,
walk_left: SPR_SNAS_WALK_LEFT,
walk_right: SPR_SNAS_WALK_RIGHT,
walk_up: SPR_SNAS_WALK_UP,
walk_down: SPR_SNAS_WALK_DOWN,
.still = SPR_SNAS,
.walk_left = SPR_SNAS_WALK_LEFT,
.walk_right = SPR_SNAS_WALK_RIGHT,
.walk_up = SPR_SNAS_WALK_UP,
.walk_down = SPR_SNAS_WALK_DOWN,
};
t_object r;
t_snas_data *data;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 15:27:03 by mcolonna #+# #+# */
/* Updated: 2024/04/21 19:50:16 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:45:46 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -29,9 +29,9 @@ static void ultimateketchup_draw(t_object *obj, t_point p)
t_object ultimateketchup_init(t_memclass mc)
{
static const t_objecttype type
= {solid_firsk: true, solid_snas: true,
init: ultimateketchup_init, loop: ultimateketchup_loop,
draw: ultimateketchup_draw, walk_through: NULL};
= {.solid_firsk = true, .solid_snas = true,
.init = ultimateketchup_init, .loop = ultimateketchup_loop,
.draw = ultimateketchup_draw, .walk_through = NULL};
t_object r;
t_ultimateketchup_data *data;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 15:27:03 by mcolonna #+# #+# */
/* Updated: 2024/04/18 15:58:27 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:46:03 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -27,9 +27,9 @@ static void wall_draw(t_object *obj, t_point p)
t_object wall_init(t_memclass mc)
{
static const t_objecttype type
= {solid_firsk: true, solid_snas: true,
init: wall_init, loop: wall_loop, draw: wall_draw,
walk_through: NULL};
= {.solid_firsk = true, .solid_snas = true,
.init = wall_init, .loop = wall_loop, .draw = wall_draw,
.walk_through = NULL};
t_object r;
t_wall_data *data;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/10 18:19:19 by mcolonna #+# #+# */
/* Updated: 2024/04/19 17:32:16 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:43:20 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -66,9 +66,9 @@ static t_direction pathfinding_checkdirections(
t_direction pathfinding(t_point start, t_point finish, bool for_firsk)
{
const t_pathfinding_env env = {
start: start,
finish: finish,
mc: mem_subclass(error_err, g_env.mc)
.start = start,
.finish = finish,
.mc = mem_subclass(error_err, g_env.mc)
};
t_path_map map;
t_point case_checking;

View file

@ -6,7 +6,7 @@
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/15 17:35:13 by mcolonna #+# #+# */
/* Updated: 2024/04/18 18:30:25 by mcolonna ### ########.fr */
/* Updated: 2024/04/22 12:43:44 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,9 +21,9 @@ void path_map_case_init(t_point p, void **el, void *args_p)
const t_sprite *surface
= &room.surfaces[p.y * room.width + p.x];
const t_path_map_case r = {
to_check: false,
before: point_init(-1, -1),
solid: p.x == 0 || p.x == room.width - 1 || p.y == 0
.to_check = false,
.before = point_init(-1, -1),
.solid = p.x == 0 || p.x == room.width - 1 || p.y == 0
|| p.y == room.height - 1 || (
obj && ((args->for_firsk && obj->type.solid_firsk)
|| (!args->for_firsk && obj->type.solid_snas)))