-
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.
Merge pull request #34 from Haliris/sprite_render
Sprite render
- Loading branch information
Showing
14 changed files
with
158 additions
and
346 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/03 18:39:21 by tsuchen ### ########.fr */ | ||
/* Updated: 2024/09/04 12:28:56 by tsuchen ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -54,7 +54,7 @@ | |
# define MINI_MAP_W 200 | ||
# define MINI_MAP_H 200 | ||
# define MINI_MAP_X 15 | ||
# define MINI_MAP_Y 15 | ||
# define MINI_MAP_Y 505 | ||
# define KEY_PRESS 2 | ||
# define MOUSE_PRESS 4 | ||
# define MOUSE_MOVE 6 | ||
|
@@ -77,10 +77,12 @@ typedef enum e_keys | |
ARROW_UP = 65362, | ||
ARROW_DOWN = 65364, | ||
ESC_KEY = 65307, | ||
SPACE_KEY = 32, | ||
W_KEY = 119, | ||
A_KEY = 97, | ||
S_KEY = 115, | ||
D_KEY = 100, | ||
R_KEY = 114, | ||
M1 = 65307, | ||
P_KEY = 112, | ||
} t_keys; | ||
|
@@ -142,6 +144,7 @@ int key_events(int keycode, t_data *data); | |
int mouse_move(int x, int y, t_data *data); | ||
void move_check(t_vec *step, t_data *data, int add_or_sub); | ||
int mouse_press(int button, int x, int y, t_data *data); | ||
void interact_door(t_data *data); | ||
/* color utils*/ | ||
int create_trgb(int t, int r, int g, int b); | ||
int get_color(int trgb, char index); | ||
|
@@ -157,5 +160,8 @@ 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); | ||
void play_sprite_backward(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/07/05 15:01:46 by tsuchen #+# #+# */ | ||
/* Updated: 2024/08/29 11:13:15 by tsuchen ### ########.fr */ | ||
/* Updated: 2024/09/04 09:28:05 by tsuchen ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
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
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
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.
Oops, something went wrong.