-
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.
removed redundent spwan_dir and p_dir_default
- Loading branch information
1 parent
560309f
commit 492df5b
Showing
5 changed files
with
7 additions
and
21 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 00:19:44 by tsuchen #+# #+# */ | ||
/* Updated: 2024/08/29 16:57:43 by tsuchen ### ########.fr */ | ||
/* Updated: 2024/08/29 17:49:31 by tsuchen ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -89,13 +89,6 @@ typedef enum e_move | |
RIGHT, | ||
LEFT, | ||
} t_move; | ||
typedef enum e_p_dir | ||
{ | ||
NORTH = 'N', | ||
SOUTH = 'S', | ||
WEST = 'W', | ||
EAST = 'E', | ||
} t_p_dir; | ||
|
||
typedef struct s_image | ||
{ | ||
|
@@ -117,11 +110,9 @@ typedef struct s_data | |
void *window; | ||
t_image image; | ||
t_textdata *textures; | ||
t_p_dir p_dir_default; | ||
t_vec p_pos; | ||
t_vec p_dir; | ||
t_vec p_cam; | ||
t_p_dir spawn_dir; | ||
} t_data; | ||
|
||
int cleanup(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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: tsuchen <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/08/27 17:03:43 by jteissie #+# #+# */ | ||
/* Updated: 2024/08/29 17:01:29 by tsuchen ### ########.fr */ | ||
/* Updated: 2024/08/29 17:52:04 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: tsuchen <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/08/15 12:03:33 by tsuchen #+# #+# */ | ||
/* Updated: 2024/08/29 16:37:04 by tsuchen ### ########.fr */ | ||
/* Updated: 2024/08/29 17:48:44 by tsuchen ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -19,7 +19,6 @@ | |
// i = 0; | ||
// printf("Player position x: %.2f, y: %.2f\n", data->p_pos.x, data->p_pos.y); | ||
// printf("Player direction x: %.2f, y: %.2f\n", data->p_dir.x, data->p_dir.y); | ||
// printf("Player default dir: %d\n", data->p_dir_default); | ||
// printf("Map path is: %s\n", data->map_path); | ||
// printf("Map output:\n"); | ||
// while (data->map[i]) | ||
|
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:12:00 by tsuchen #+# #+# */ | ||
/* Updated: 2024/08/29 10:55:16 by tsuchen ### ########.fr */ | ||
/* Updated: 2024/08/29 17:49:49 by tsuchen ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -40,25 +40,21 @@ static void get_player_dir(t_data *data, u_int32_t x, u_int32_t y) | |
{ | ||
if (data->map[x][y] == 'N') | ||
{ | ||
data->p_dir_default = NORTH; | ||
vec_init(&data->p_dir, -1.0f, 0.0f); | ||
vec_init(&data->p_cam, 0.0f, tan(FOV / 2)); | ||
} | ||
else if (data->map[x][y] == 'S') | ||
{ | ||
data->p_dir_default = SOUTH; | ||
vec_init(&data->p_dir, 1.0f, 0.0f); | ||
vec_init(&data->p_cam, 0.0f, tan(FOV / 2) * -1); | ||
} | ||
else if (data->map[x][y] == 'W') | ||
{ | ||
data->p_dir_default = WEST; | ||
vec_init(&data->p_dir, 0.0f, -1.0f); | ||
vec_init(&data->p_cam, tan(FOV / 2) * -1, 0.0f); | ||
} | ||
else if (data->map[x][y] == 'E') | ||
{ | ||
data->p_dir_default = EAST; | ||
vec_init(&data->p_dir, 0.0f, 1.0f); | ||
vec_init(&data->p_cam, tan(FOV / 2), 0.0f); | ||
} | ||
|
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