44
55#include "raycast.h"
66
7- static int * * texture_load (int y , int x , unsigned char * img_data , t_rc_main * wlf )
7+ static int * * texture_load (int y , int x , unsigned char * img_data , t_rc_main * m )
88{
99 int y_tx ;
1010 int x_tx ;
@@ -14,17 +14,17 @@ static int **texture_load(int y, int x, unsigned char *img_data, t_rc_main *wlf)
1414
1515 y_d = 0 ;
1616 y_tx = (y >= 64 ? y - 64 : y );
17- if (!(arr = (int * * )ft_memalloc (sizeof (int * ) * wlf -> textures .w )))
17+ if (!(arr = (int * * )ft_memalloc (sizeof (int * ) * m -> textures .w )))
1818 exit (39 );
1919 while (y_tx <= y )
2020 {
21- if (!(arr [y_d ] = (int * )ft_memalloc (sizeof (int ) * wlf -> textures .h )))
21+ if (!(arr [y_d ] = (int * )ft_memalloc (sizeof (int ) * m -> textures .h )))
2222 exit (36 );
2323 x_d = 0 ;
2424 x_tx = x - 64 ;
2525 while (x_tx < x )
2626 {
27- arr [y_d ][x_d ] = * ((int * )img_data + (x_tx + y_tx * wlf -> textures .w ));
27+ arr [y_d ][x_d ] = * ((int * )img_data + (x_tx + y_tx * m -> textures .w ));
2828 x_d ++ ;
2929 x_tx ++ ;
3030 }
@@ -34,25 +34,25 @@ static int **texture_load(int y, int x, unsigned char *img_data, t_rc_main *wlf)
3434 return (arr );
3535}
3636
37- static int get_textures_from_texture_pack (t_rc_main * wlf , t_conf_json * conf , char * path )
37+ static int get_textures_from_texture_pack (t_rc_main * m , t_conf_json * conf , char * path )
3838{
3939 int y ;
4040 int x ;
41- unsigned char * img_data ;
41+ unsigned char * img_data = 0 ;
4242 int * * arr ;
4343 t_list * tmp ;
4444
45- img_data = stbi_load (path , & wlf -> textures .w ,
46- & wlf -> textures .h , & wlf -> textures .bpp , 4 );
45+ img_data = stbi_load (path , & m -> textures .w ,
46+ & m -> textures .h , & m -> textures .bpp , 4 );
4747 y = 0 ;
48- while (++ y < (wlf -> textures .h / 64 + 1 ))
48+ while (++ y < (m -> textures .h / 64 + 1 ))
4949 {
5050 x = 0 ;
51- while (++ x < (wlf -> textures .w / 64 ) + 1 )
51+ while (++ x < (m -> textures .w / 64 ) + 1 )
5252 {
5353 tmp = ft_lstnew (NULL , 0 );
54- x = (x * 64 == wlf -> textures .w * 64 ? 0 : x * 64 );
55- arr = texture_load (y * 64 , x , img_data , wlf );
54+ x = (x * 64 == m -> textures .w * 64 ? 0 : x * 64 );
55+ arr = texture_load (y * 64 , x , img_data , m );
5656 tmp -> content = (void * * )arr ;
5757 tmp -> content_size = ++ (conf -> index );
5858 ft_lstadd (& conf -> textures , tmp );
@@ -64,7 +64,7 @@ static int get_textures_from_texture_pack(t_rc_main *wlf, t_conf_json *conf, cha
6464 return (FUNCTION_SUCCESS );
6565}
6666
67- int rc_jtoc_get_textures (t_rc_main * wlf , t_conf_json * conf , t_jnode * node )
67+ int rc_jtoc_get_textures (t_rc_main * m , t_conf_json * conf , t_jnode * node )
6868{
6969 t_jnode * tmp ;
7070 char * path ;
@@ -81,7 +81,7 @@ int rc_jtoc_get_textures(t_rc_main *wlf, t_conf_json *conf, t_jnode *node)
8181 if (!(tmp = jtoc_node_get_by_path (node , "type" )) || tmp -> type != string )
8282 return (rc_jtoc_sdl_log_error ("TEXTURE TYPE ERROR" , -1 ));
8383 if (!(ft_strcmp (jtoc_get_string (tmp ), "pack" )))
84- get_textures_from_texture_pack (wlf , conf , path );
84+ get_textures_from_texture_pack (m , conf , path );
8585 else if (!(ft_strcmp (jtoc_get_string (tmp ), "single" )))
8686 ; //TODO
8787 else
0 commit comments