-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added rc_rendering in play_sprite function but it will stuck
- Loading branch information
1 parent
a6d4efc
commit 02a1a44
Showing
10 changed files
with
132 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# By: tsuchen <[email protected]> +#+ +:+ +#+ # | ||
# +#+#+#+#+#+ +#+ # | ||
# Created: 2024/08/15 12:02:08 by tsuchen #+# #+# # | ||
# Updated: 2024/09/03 16:36:38 by tsuchen ### ########.fr # | ||
# Updated: 2024/09/04 09:59:33 by tsuchen ### ########.fr # | ||
# # | ||
# **************************************************************************** # | ||
|
||
|
@@ -32,7 +32,7 @@ SRCS_RC = raycasting.c render_wall.c render_utils.c | |
|
||
SRCS_VEC = vector.c vector_2.c vector_3.c | ||
|
||
SRCS_FRM = lst_add_back.c lst_clear.c lst_last.c lst_new.c lst_size.c | ||
SRCS_FRM = frame_lst_utils.c sprite.c | ||
|
||
PATH_M = srcs/ | ||
PATH_PS = srcs/parser/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: tsuchen <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/08/15 00:19:44 by tsuchen #+# #+# */ | ||
/* Updated: 2024/09/04 09:44:06 by tsuchen ### ########.fr */ | ||
/* Updated: 2024/09/04 10:25:44 by tsuchen ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -160,5 +160,7 @@ void rc_mlx_pixel_put(t_image *image, int x, int y, int color); | |
void rc_stripe_pixel_put(t_data *data, int x, double ray_dist); | ||
/* Mini Map */ | ||
void put_mini_map(t_data *data); | ||
/* Sprite */ | ||
void play_sprite_forward(t_data *data, int map_x, int map_y); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: tsuchen <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/09/02 11:59:13 by jteissie #+# #+# */ | ||
/* Updated: 2024/09/04 09:38:09 by tsuchen ### ########.fr */ | ||
/* Updated: 2024/09/04 11:41:01 by tsuchen ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -46,9 +46,15 @@ static void change_door_state(t_data *data, t_vec *p_ray) | |
door_x = data->p_pos.x + p_ray->x; | ||
door_y = data->p_pos.y + p_ray->y; | ||
if (data->map[door_x][door_y] == 'D') | ||
data->map[door_x][door_y] = 'O'; | ||
{ | ||
play_sprite_forward(data, door_x, door_y); | ||
// data->map[door_x][door_y] = 'S'; | ||
} | ||
else if (data->map[door_x][door_y] == 'O') | ||
{ | ||
// play_sprite_backward(data, door_x, door_y); | ||
data->map[door_x][door_y] = 'D'; | ||
} | ||
} | ||
|
||
void interact_door(t_data *data) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* lst_new.c :+: :+: :+: */ | ||
/* frame_lst_utils.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: tsuchen <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/05/10 11:28:30 by tsuchen #+# #+# */ | ||
/* Updated: 2024/09/03 16:17:52 by tsuchen ### ########.fr */ | ||
/* Created: 2024/05/10 11:39:29 by tsuchen #+# #+# */ | ||
/* Updated: 2024/09/04 09:58:46 by tsuchen ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -23,17 +23,58 @@ t_frame *lst_new(void) | |
lst->prev = NULL; | ||
return (lst); | ||
} | ||
/* | ||
#include <stdio.h> | ||
int main(void) | ||
|
||
void lst_add_back(t_frame **lst, t_frame *new_node) | ||
{ | ||
t_frame *tmp; | ||
|
||
if (!new_node) | ||
return ; | ||
if (!(*lst)) | ||
{ | ||
*lst = new_node; | ||
return ; | ||
} | ||
tmp = *lst; | ||
while (tmp->next) | ||
tmp = tmp->next; | ||
new_node->prev = tmp; | ||
tmp->next = new_node; | ||
} | ||
|
||
void lst_clear(t_frame **lst, void (*del)(void *)) | ||
{ | ||
int a = 7; | ||
t_list *lst; | ||
lst = ft_lstnew(&a); | ||
printf("val_lst: %d, add_lst: %p\n", *((int *)(lst->content)), lst->content); | ||
printf("val_a : %d, add_a : %p\n", a, &a); | ||
printf("add of nex in lst: %p\n", lst->next); | ||
free(lst); | ||
return (0); | ||
}*/ | ||
t_frame *tmp; | ||
|
||
while (*lst) | ||
{ | ||
tmp = *lst; | ||
*lst = (*lst)->next; | ||
del(tmp); | ||
} | ||
} | ||
|
||
t_frame *lst_last(t_frame *lst) | ||
{ | ||
t_frame *tmp; | ||
|
||
tmp = lst; | ||
while (tmp->next) | ||
tmp = tmp->next; | ||
return (tmp); | ||
} | ||
|
||
int lst_size(t_frame *lst) | ||
{ | ||
int i; | ||
t_frame *tmp; | ||
|
||
tmp = lst; | ||
i = 0; | ||
while (tmp) | ||
{ | ||
i++; | ||
tmp = tmp->next; | ||
} | ||
return (i); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.