This commit is contained in:
Ladebeze66
2024-01-16 18:01:58 +01:00
parent 5ad918c85c
commit 5ec8268935
32 changed files with 6769 additions and 2776 deletions

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/14 20:30:59 by fgras-ca #+# #+# */
/* Updated: 2024/01/14 20:56:42 by fgras-ca ### ########.fr */
/* Updated: 2024/01/16 17:36:23 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,7 +16,8 @@ void load_texture(t_structure_main *w, char *file_path, void **texture_ptr)
{
int width;
int height;
//printf("load texture %s\n", file_path);
width = 0;
height = 0;
*texture_ptr = mlx_xpm_file_to_image(w->s_win.mlx,
@@ -32,10 +33,11 @@ void load_texture(t_structure_main *w, char *file_path, void **texture_ptr)
void load_wall_textures(t_structure_main *w)
{
load_texture(w, "textures/NO.xpm", (void **)&w->s_img.north_texture);
load_texture(w, "textures/SO.xpm", (void **)&w->s_img.south_texture);
load_texture(w, "textures/WE.xpm", (void **)&w->s_img.west_texture);
load_texture(w, "textures/EA.xpm", (void **)&w->s_img.east_texture);
printf("loadtexture %s\n", w->t->north);
load_texture(w, w->t->north, (void **)&w->s_img.north_texture);
load_texture(w, w->t->south, (void **)&w->s_img.south_texture);
load_texture(w, w->t->west, (void **)&w->s_img.west_texture);
load_texture(w, w->t->east, (void **)&w->s_img.east_texture);
}
void exit_error(t_structure_main *w)

Binary file not shown.

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/12 17:39:11 by fgras-ca #+# #+# */
/* Updated: 2024/01/14 21:26:16 by fgras-ca ### ########.fr */
/* Updated: 2024/01/16 16:55:50 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -61,13 +61,13 @@ void draw_texture(t_texture_params *params)
void *get_selected_texture(t_structure_main *w, WallDirection wallDir)
{
if (wallDir == NORTH)
return (w->s_img.north_texture);
return (w->t->north);
else if (wallDir == SOUTH)
return (w->s_img.south_texture);
return (w->t->south);
else if (wallDir == WEST)
return (w->s_img.west_texture);
return (w->t->west);
else if (wallDir == EAST)
return (w->s_img.east_texture);
return (w->t->east);
else
{
fprintf(stderr, "Invalid wall direction.\n");

Binary file not shown.