diff options
Diffstat (limited to '')
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | inc/cub3d_defines.h | 2 | ||||
-rw-r--r-- | media/img/numbers/percent.xpm | 253 | ||||
-rw-r--r-- | src/ft_draw_hud.c | 4 | ||||
-rw-r--r-- | src/ft_draw_life_bar.c | 26 | ||||
-rw-r--r-- | src/ft_tex_init.c | 62 |
6 files changed, 218 insertions, 130 deletions
@@ -154,7 +154,6 @@ CFLAGS += -Wall CFLAGS += -Wextra CFLAGS += -Werror CFLAGS += -pedantic -CFLAGS += -march=ivybridge -O2 -pipe #--------------------------------------------------------------------------------------------------# ifdef DEBUG CFLAGS += ${DBG} diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h index 01fa291..5e10084 100644 --- a/inc/cub3d_defines.h +++ b/inc/cub3d_defines.h @@ -123,7 +123,7 @@ enum # define FT_SEV_PATH "./media/img/numbers/seven.xpm" # define FT_EIG_PATH "./media/img/numbers/eight.xpm" # define FT_NIN_PATH "./media/img/numbers/nine.xpm" -# define FT_PER_PATH "./media/img/numbers/percent.xpm" +# define FT_PER_PATH "./media/img/numbers/zero.xpm" /* ** ====== SOUNDS ====== diff --git a/media/img/numbers/percent.xpm b/media/img/numbers/percent.xpm index 7554d05..9792a1a 100644 --- a/media/img/numbers/percent.xpm +++ b/media/img/numbers/percent.xpm @@ -1,105 +1,164 @@ /* XPM */ static char *percent[] = { /* columns rows colors chars-per-pixel */ -"100 100 3 1 ", -" c black", -". c #1B1B1D", -"X c #342424", +"100 100 62 1 ", +" c #000000", +". c #000001", +"X c #010101", +"o c #030303", +"O c #030304", +"+ c #030404", +"@ c #040404", +"# c #040405", +"$ c #040505", +"% c #050505", +"& c #060607", +"* c #070707", +"= c #070708", +"- c #070808", +"; c #080808", +": c #080809", +"> c #111112", +", c #141415", +"< c #141416", +"1 c #151516", +"2 c #151517", +"3 c #171718", +"4 c #171719", +"5 c #181719", +"6 c #181819", +"7 c #18181A", +"8 c #1A1A1C", +"9 c #1B1B1C", +"0 c #1A1B1D", +"q c #1B1B1D", +"w c #1B1B1E", +"e c #1C1B1D", +"r c #1B1C1E", +"t c #1C1C1D", +"y c #1C1C1E", +"u c #1E1C1E", +"i c #1F1C1E", +"p c #1E1D1E", +"a c #1F1D1E", +"s c #211D1E", +"d c #211D1F", +"f c #221D1F", +"g c #211E1F", +"h c #221E1F", +"j c #241E20", +"k c #241F20", +"l c #251F20", +"z c #2A2122", +"x c #2C2122", +"c c #2D2122", +"v c #2E2122", +"b c #2D2222", +"n c #2E2222", +"m c #2E2223", +"M c #2F2223", +"N c #302223", +"B c #312223", +"V c #302323", +"C c #312323", +"Z c #332424", +"A c #342424", +"S c #352424", /* pixels */ " ", -" ", -" ........ ", -" ............... ", -" .................. ", -" ....................... ........ ", -" ......................... .............. ", -" ........................... ................... ", -" ............................ ...................... ", -" ..................XXXX........ ........................ ", -" .............XXXXXXXXXX........ .......................... ", -" ..........XXXXXXXXXXXXXX........ ............................ ", -" .......XXXXXXXXXXXXXXXXXX........ .................XXXX........ ", -" .......XXXXXXXXXXXXXXXXXXXX....... ...............XXXXXXXX....... ", -" .......XXXXXXXXXXXXXXXXXXXX....... ............XXXXXXXXXXXX....... ", -" .......XXXXXXXXXXXXXXXXXXXXX........ ..........XXXXXXXXXXXXXX........ ", -" .......XXXXXXXXXX...XXXXXXXXX....... ..........XXXXXXXXXXXXXXX....... ", -" .......XXXXXXXXX.....XXXXXXXX....... .........XXXXXXXXXXXXXXXX........ ", -" .......XXXXXXXXX.....XXXXXXXX....... .........XXXXXXXXXXXXXXXX........ ", -" .......XXXXXXXX.......XXXXXXX....... .........XXXXXXXXXXXXXXXXX........ ", -" .......XXXXXXXXX.....XXXXXXX........ .........XXXXXXXXXXXXXXXXX........ ", -" .......XXXXXXXXX.....XXXXXXX....... .........XXXXXXXXXXXXXXXXX........ ", -" .......XXXXXXXXXX...XXXXXXXX....... .........XXXXXXXXXXXXXXXXX........ ", -" .......XXXXXXXXXXXXXXXXXXXXX....... ........XXXXXXXXXXXXXXXXX......... ", -" .......XXXXXXXXXXXXXXXXXXX....... ........XXXXXXXXXXXXXXXXXX........ ", -" .......XXXXXXXXXXXXXXXXXXX....... ........XXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXX....... ........XXXXXXXXXXXXXXXXXX........ ", -" .........XXXXXXXXXXXXXX........ .........XXXXXXXXXXXXXXXXXX....... ", -" ...........XXXXXXXXXXX........ .........XXXXXXXXXXXXXXXXXX........ ", -" ............................. .........XXXXXXXXXXXXXXXXXX........ ", -" ............................ .........XXXXXXXXXXXXXXXXXXX....... ", -" ........................... ........XXXXXXXXXXXXXXXXXXX........ ", -" ........................ ........XXXXXXXXXXXXXXXXXXXX....... ", -" ...................... ........XXXXXXXXXXXXXXXXXXXX....... ", -" ................... ........XXXXXXXXXXXXXXXXXXX........ ", -" ............... ........XXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" .........XXXXXXXXXXXXXXXXXXX........ ", -" .........XXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXX......... ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" .........XXXXXXXXXXXXXXXXXXX........ ", -" .........XXXXXXXXXXXXXXXXXXX........ ", -" .........XXXXXXXXXXXXXXXXXXXX....... ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXX......... ", -" ........XXXXXXXXXXXXXXXXXXX......... ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXXX....... ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXXX........ ", -" ........XXXXXXXXXXXXXXXXXXXX....... ", -" ........XXXXXXXXXXXXXXXXXXXX........ ....... ", -" ........XXXXXXXXXXXXXXXXXXXX........ ........... ", -" .......XXXXXXXXXXXXXXXXXXXXX....... ................ ", -" ........XXXXXXXXXXXXXXXXXXXX........ ................... ", -" ........XXXXXXXXXXXXXXXXXXXXX....... ...................... ", -" .........XXXXXXXXXXXXXXXXXXXX........ ......................... ", -" .........XXXXXXXXXXXXXXXXXXXX........ ........................... ", -" .........XXXXXXXXXXXXXXXXXXXX........ ................X............ ", -" ..........XXXXXXXXXXXXXXXXXXXX......... ..............XXXXXXX.......... ", -" ...........XXXXXXXXXXXXXXXXXXXXX........ ............XXXXXXXXXXXX......... ", -" ............XXXXXXXXXXXXXXXXXXXXX........ ..........XXXXXXXXXXXXXXX........ ", -" ............XXXXXXXXXXXXXXXXXXXXX........ .........XXXXXXXXXXXXXXXXXX........ ", -" ............XXXXXXXXXXXXXXXXXXXXX........ ........XXXXXXXXXXXXXXXXXXXXX....... ", -" ...........XXXXXXXXXXXXXXXXXXXXX......... ........XXXXXXXXXXXXXXXXXXXXX........ ", -" ...........XXXXXXXXXXXXXXXXXXXXX......... ........XXXXXXXXXXXXXXXXXXXXXXX....... ", -" .........XXXXXXXXXXXXXXXXXXXXXX........ ........XXXXXXXXXXXXXXXXXXXXXXXX....... ", -" ........XXXXXXXXXXXXXXXXXXXXX......... .......XXXXXXXXXXX...XXXXXXXXXXX....... ", -" .........XXXXXXXXXXXXXXXXXXXX......... ........XXXXXXXXXX.....XXXXXXXXXX....... ", -" ........XXXXXXXXXXXXXXXXXXX.......... .......XXXXXXXXXXX.....XXXXXXXXXX....... ", -" ........XXXXXXXXXXXXXXXXXXX........... .......XXXXXXXXXX.......XXXXXXXXX....... ", -" .......XXXXXXXXXXXXXXXXXXX........... .......XXXXXXXXXXXX.....XXXXXXXXXX....... ", -" .......XXXXXXXXXXXXXXXXX............ .......XXXXXXXXXXXX.....XXXXXXXXX....... ", -" .......XXXXXXXXXXXXXXXX............. .......XXXXXXXXXXXXX...XXXXXXXXXX....... ", -" .......XXXXXXXXXXXXXX............. .......XXXXXXXXXXXXXXXXXXXXXXXXX....... ", -" .......XXXXXXXXXXX............... .......XXXXXXXXXXXXXXXXXXXXXXXXX....... ", -" .......XXXXXXX................. ........XXXXXXXXXXXXXXXXXXXXXXX........ ", -" .............................. ........XXXXXXXXXXXXXXXXXXXXX........ ", -" ............................. .........XXXXXXXXXXXXXXXXXX.......... ", -" ........................... ............XXXXXXXXXXX............ ", -" ........................ .................................. ", -" ...................... ................................. ", -" .................. ............................... ", -" ............ ............................ ", -" .......................... ", -" ...................... ", -" ............... ", -" ", +" ######## ", +" X#&###-<553355<& ", +" ##;133535rrtrrrrr<# ", +" ##=,558trrrrr6rrrr8t6;X ######## ", +" =<46tttt8r8rrrrr8rr8tt6<- ###;<444446<=# ", +" =<qtqtttttrr8rrrrrrrrtrrr<& ###;<446qqtttttt6<# ", +" =<rqqqt8tt8rrrr6rrr88rrrrrt<# #=<444qeqtqqqttqtttt<; ", +" ;<qqqqqr0rrrrtr0rrtjttrqqqqt6; #<6qqqrrrr0rrrqqqqq6tt<; ", +" #<qqqqqq0rr888tgtrzxMMnjrqqqt6<; #-4qrqqq8r88r0rrqqqqqqttt<# ", +" ;6tqeeqq00atthmCmmZZSSZnt6qq8tt<# =<5qqqqqqr00r0rrrqqqqqqqtt6; ", +" O<qqqeettrzMZmCCSSSSSSZZZzrqrttt6; =<qqqqqqqq8rr0r8rrthtqqqtett<# ", +" :6qqqqehnZMZSZSZSSSZSZSSZxtttttt8<# =<tqqqqrtrrrrrrppzxVVnhqqeqtt6# ", +" #<qqqqqtnSSSZSSSSZSSSZSZZSSntttttt6# =<qtqrqqrt6trtthMMMZSSZntqtett5# ", +" :5eqqqqhBSZSSZZSZSZZSZSSSSSCtttttt6; =<qqqtrqrrtthnCCCZSSSSSSntetett6# ", +" @<qqqqqtnSSSZSSZSZZMZZSZSZZSChtt8r8t<# #4qqqqtt6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eqqqqqhnSZSZSZZSZSSZSSZSVjqqqqqq<; ", +" #<qqqqqqqqqqrqqqrqq0rqq0qqqq6= #<etqqqqqhmVSZSSZSSZSZSZZSSZntqqqqt6; ", +" =<4qqqqqqqqqqqqrrqqrqqqqqqq<# ;6tqqqqqjmSSSSZSSZSSSZSSZSSmjqqqttt<# ", +" #;<qtqqqqqqqqqqqqqqqqqqqq4= *<tqqqqqhnSSZSSSZSSZSSZSSZSZbtqqqqq<= ", +" =<6q0qqqqqqqqqqqqqqqqq<= #<ttqqqqtnZSZSSZSZSZSZSZZSSZmjqqqqq6; ", +" #;<qqyyq0qtqqqtqqqq6<= *6tteeqqhBSSSZZZSSZSSZSSSSZmaqqqqqq<# ", +" O=<4445444444444<:@ *<ettee6hnASZSSSSSZSZSSZSZSVjrqqqqq6; ", +" ############### *<eteee8hBZSVSSZZSSZSSSSSSSSmeqqqqqq<O ", +" =<8eeee8snSSSSSSZSZSSZZSZVSSmjqqqqqq<= ", +" =<eeeee8sfBSZSSSSSSZZSSZZSSSmaqqqqqq<= ", +" #<qe8qeeeflSSSZSSZSSSSZSSZSVxjqqqqq00= ", +" ;6teqqqefBASSSSZSSZZSSZSZSSVjqqqqqqt<# ", +" #<etteqqenAAZZSZSSZSSZSZZSSZneqqqqqq<# ", +" ;4qeqqqqqhBAASZZSSZZSZZSSZZZMhqqqqqq<; ", +" =<qqqqqqqhnAAAZSZSSSSZSSZSZZmzqqqqqq<= ", +" #<qqqqqqqhnAAAASZSZSZSSSZSSZSmtqqqqt6; ", +" ;6tqqeeqhnAAAAASSZSSSZSZSZSZmjrqqqqt<# ", +" #<tqqqqehnSSAAAASSSSSZSZSSSSntrqqqqq<: ", +" #<tttqqqtnCSSAAAASSVSSSZSZSSnhqrqqqe6; ", +" ;8e8ee8efBSSSAASBSSSAAAAAAAMfeeeetrq<# ", +" =<8eeeeesSSSSBAASASSBAAAAAAAfeeee8tt<= ", +" =<q88e8eslSSSAAABAAAASSAASSAlfeqqeet<; ", +" #<tq8yeejlSSSSASSSSSAASSASSSMseeqee8<; ", +" ;6qqyy8yjASSSSAASSSSAAAAAASAjqqq8qq<# ", +" ;<tqq008jlASSSSAASVSSAAAAAASleqqqee5: ", +" #<ttqq08jlASSSSSAASSSSAAAAAAMsqqqqee<@ ", +" #<tttqqqjBSSSSSSSSBSSSSAAAAABseqqqqq<= ", +" =00qqqqqjVSSSSSVSSSSSSSSSSSVntqqqqe5: @###### ", +" =<q0qqqqjlVSSSSSSSSSSSVSSVSSmjeqqqqq<@ ##:<44444<= ", +" #<qqqqq0jBSSSSSSSSSSSVSSSSSSVjqqqqqq<: ##;<45qqqtttq<=# ", +" ;4qqqqqamSSSSSSSVSSSVSSSSSSSmtqqqqq5: #;<46qyqqqqqqqqq6<= ", +" =<qqqq00jVSSSVSVSSSSSSSSSVSSVlqqqqqq<# @:<7qqqqqqqqqqqqqqtq<: ", +" =4qqqqq00mVSSSSSSSSSSSSSSSSSVmeqqqqt6; O;<8q0qqqqqqqqqqqqqqqqe<= ", +" =<qqqqqq0jVSSSSSSSSSSVSSSVSSSnjqqqqqq<# =<4qqqqqqqqqqqqqqqqqqqqqq<= ", +" =<qqqqqqqjmAAASSSSVSSSSSSSSSSnhqqqqqq<= =4qqqqqqqqqqqqqetqqqqqqqqqq<= ", +" #;<tttqqqehnAAASSZSSZZSSZSSSSZmhrtt8rr5; =<qeqqqqqqqqqqarjbaaa0qqqqqqq4= ", +" #;<6ttttrqqhnAAAAZSSZZSSZZSSZSSCh8r8rg8r,# ;<qqqqqqqqqqarjmmVZmVmjrrqqqqrq<= ", +" #;<6qttt6t8qhnAAAAASZZSSSSSSZSZSSnrr8r888,& #<tqqqqqqqqyjbVVZSSSZSZmmjrr0rq0q<# ", +" ;<6tttttqee8hnCAAAAASZSZSZZSSSZSSmt8rr8rt3&X ;6tqqqqqqyjmZZSSZSZSSSSSZmar00qqt6; ", +" #4qeqqtttttthnAAAAAAAZSSSSSZSZSZZmzrrr8r83&X #<qqqqqqtjmVS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BBBnhhteqeqqqqqqq6<# #6rrrtrtnASSZZSSSSSSSSSSSSSZSSAAntttqqe4# ", +" #4qqqeqtnBBCBBnjttttqqqqqqqqqqq<;# #<qqr68thnZSZSSSSSSZSZSSCSSZZSCnhtteeqq<# ", +" #4qqqqqetththhtqqeqeeqqqqqqqqq<= ;6rrr8r8hnSSSSSSSSSZSSSSSSZZZnhr88tqe6; ", +" #4eqqqqqqeeqqqqqqqqqqqqqqqeq6<- #<ttrt8tthnBBBSSSSSSSSSSAZmnhtrtrqqtt<# ", +" #<qqqqqqqeeqqqqqqqqqqqqqeq6<=# #<rr8tt8qththnBnnCmBnBBnjatrrr8tqtt6; ", +" :5eeqqqqqeqqqttqqqqqeeq5<;# ;6tttttqqqqqththtththhtrqrqr8tttrt<# ", +" @<eeqqqr8eqqq6ttqqaq54<:# X<rttttqqqqqqqqqrrrqqqqqrrr8rt8tq<# ", +" ;<6qttttttttttq5444=#O =<ttttqqqqqqqqqqqqqqqqtt6ttttt6<= ", +" #;<6445444444<=### =<tttqqqqqqqqqqqqqqqqtttqttt<=# ", +" ############ #<6tqqqqqqqqqqqqqqqqttttq6<# ", +" #;<446qtqqqqettqtttt666<;# ", +" ###=<44446666<6666<;## ", +" ############### ", " ", " ", " ", diff --git a/src/ft_draw_hud.c b/src/ft_draw_hud.c index e852ec1..5feab32 100644 --- a/src/ft_draw_hud.c +++ b/src/ft_draw_hud.c @@ -45,7 +45,7 @@ static void x = 0; cl->tlist[16].tex_y = (y * y_ratio) >> 16; while (x < (uint16_t)((cl->mlist.map_w - * cl->mlist.scale) + 20 + (28 * cl->mlist.scale))) + * cl->mlist.scale) + 20 + (32 * cl->mlist.scale))) { cl->tlist[16].tex_x = (x * x_ratio) >> 16; ft_put_image_back_to_ptr(y, x, cl); @@ -64,7 +64,7 @@ static void x = 0; y = wl->y_size - (map_h * scl) - 20; - while (x < (map_w * scl) + 20 + (28 * scl)) + while (x < (map_w * scl) + 20 + (32 * scl)) { while (y < wl->y_size) y++; diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c index b90daa1..687e3a7 100644 --- a/src/ft_draw_life_bar.c +++ b/src/ft_draw_life_bar.c @@ -15,17 +15,17 @@ #include <stdint.h> static void - ft_draw_tnum(t_img num, int16_t y, int16_t x, t_cub *cl) + ft_draw_tnum(int8_t id, int16_t y, int16_t x, t_cub *cl) { *(cl->img.ptr + x * 4 + (cl->img.sizeline * y)) = - (uint8_t)*(num.ptr + num.tex_x * 4 + 4 * - num.img_w * num.tex_y); + (uint8_t)*(cl->tnum[id].ptr + cl->tnum[id].tex_x * 4 + 4 * + cl->tnum[id].img_w * cl->tnum[id].tex_y); *(cl->img.ptr + x * 4 + (cl->img.sizeline * y) + 1) = - (uint8_t)*(num.ptr + num.tex_x * 4 + 4 * - num.img_w * num.tex_y + 1); + (uint8_t)*(cl->tnum[id].ptr + cl->tnum[id].tex_x * 4 + 4 * + cl->tnum[id].img_w * cl->tnum[id].tex_y + 1); *(cl->img.ptr + x * 4 + (cl->img.sizeline * y) + 2) = - (uint8_t)*(num.ptr + num.tex_x * 4 + 4 * - num.img_w * num.tex_y + 2); + (uint8_t)*(cl->tnum[id].ptr + cl->tnum[id].tex_x * 4 + 4 * + cl->tnum[id].img_w * cl->tnum[id].tex_y + 2); } /* static void */ @@ -41,22 +41,22 @@ static void int16_t x; int16_t y; - x_ratio = (int)((cl->tnum[10].img_w << 16) / (7 * cl->mlist.scale)) + 1; + x_ratio = (int)((cl->tnum[10].img_w << 16) / (8 * cl->mlist.scale)) + 1; y_ratio = (int)((cl->tnum[10].img_h << 16) / - ((cl->mlist.map_h * cl->mlist.scale) - 20)) + 1; + ((cl->mlist.map_h * cl->mlist.scale))) + 1; y = cl->wlist.y_size - (cl->mlist.map_h * cl->mlist.scale) - 10; while (y < (int16_t)cl->wlist.y_size - 10) { cl->tnum[10].tex_y = (y * y_ratio) >> 16; - x = ((cl->mlist.map_w * cl->mlist.scale) + 20 + ((28 * cl->mlist.scale) - - ((28 * cl->mlist.scale) / 4))); + x = ((cl->mlist.map_w * cl->mlist.scale) + 20 + ((32 * cl->mlist.scale) + - ((32 * cl->mlist.scale) / 4))); while (x < (int16_t)((cl->mlist.map_w * cl->mlist.scale) - + 10 + ((28 * cl->mlist.scale)))) + + 10 + ((32 * cl->mlist.scale)))) { cl->tnum[10].tex_x = (x * x_ratio) >> 16; /* if (cl->tnum[10].ptr[cl->tnum[10].tex_x * 4 + 4 * */ /* cl->tnum[10].img_h * cl->tnum[10].tex_y]) */ - ft_draw_tnum(cl->tnum[10], y, x, cl); + ft_draw_tnum(10, y, x, cl); x++; } y++; diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index 5c0bed3..5e445ce 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -41,12 +41,52 @@ */ static void - ft_init_number(t_img *tnum, const char *path, t_cub *cl) + ft_init_numbers(t_cub *cl) { - tnum->img = mlx_xpm_file_to_image(cl->wlist.wlx, - path, &tnum->img_w, &tnum->img_h); - tnum->ptr = mlx_get_data_addr(tnum->img, - &tnum->bpp, &tnum->sizeline, &tnum->endian); + cl->tnum[0].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_ZER_PATH, &cl->tnum[0].img_w, &cl->tnum[0].img_h); + cl->tnum[0].ptr = mlx_get_data_addr(cl->tnum[0].img, + &cl->tnum[0].bpp, &cl->tnum[0].sizeline, &cl->tnum[0].endian); + cl->tnum[1].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_ONE_PATH, &cl->tnum[1].img_w, &cl->tnum[1].img_h); + cl->tnum[1].ptr = mlx_get_data_addr(cl->tnum[1].img, + &cl->tnum[1].bpp, &cl->tnum[1].sizeline, &cl->tnum[1].endian); + cl->tnum[2].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_TWO_PATH, &cl->tnum[2].img_w, &cl->tnum[2].img_h); + cl->tnum[2].ptr = mlx_get_data_addr(cl->tnum[2].img, + &cl->tnum[2].bpp, &cl->tnum[2].sizeline, &cl->tnum[2].endian); + cl->tnum[3].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_THR_PATH, &cl->tnum[3].img_w, &cl->tnum[3].img_h); + cl->tnum[3].ptr = mlx_get_data_addr(cl->tnum[3].img, + &cl->tnum[3].bpp, &cl->tnum[3].sizeline, &cl->tnum[3].endian); + cl->tnum[4].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_FOU_PATH, &cl->tnum[4].img_w, &cl->tnum[4].img_h); + cl->tnum[4].ptr = mlx_get_data_addr(cl->tnum[4].img, + &cl->tnum[4].bpp, &cl->tnum[4].sizeline, &cl->tnum[4].endian); + cl->tnum[5].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_FIV_PATH, &cl->tnum[5].img_w, &cl->tnum[5].img_h); + cl->tnum[5].ptr = mlx_get_data_addr(cl->tnum[5].img, + &cl->tnum[5].bpp, &cl->tnum[5].sizeline, &cl->tnum[5].endian); + cl->tnum[6].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_SIX_PATH, &cl->tnum[6].img_w, &cl->tnum[6].img_h); + cl->tnum[6].ptr = mlx_get_data_addr(cl->tnum[6].img, + &cl->tnum[6].bpp, &cl->tnum[6].sizeline, &cl->tnum[6].endian); + cl->tnum[7].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_SEV_PATH, &cl->tnum[7].img_w, &cl->tnum[7].img_h); + cl->tnum[7].ptr = mlx_get_data_addr(cl->tnum[7].img, + &cl->tnum[7].bpp, &cl->tnum[7].sizeline, &cl->tnum[7].endian); + cl->tnum[8].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_EIG_PATH, &cl->tnum[8].img_w, &cl->tnum[8].img_h); + cl->tnum[8].ptr = mlx_get_data_addr(cl->tnum[8].img, + &cl->tnum[8].bpp, &cl->tnum[8].sizeline, &cl->tnum[8].endian); + cl->tnum[9].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_NIN_PATH, &cl->tnum[9].img_w, &cl->tnum[9].img_h); + cl->tnum[9].ptr = mlx_get_data_addr(cl->tnum[9].img, + &cl->tnum[9].bpp, &cl->tnum[9].sizeline, &cl->tnum[9].endian); + cl->tnum[10].img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_PER_PATH, &cl->tnum[10].img_w, &cl->tnum[10].img_h); + cl->tnum[10].ptr = mlx_get_data_addr(cl->tnum[10].img, + &cl->tnum[10].bpp, &cl->tnum[10].sizeline, &cl->tnum[10].endian); } static void @@ -96,17 +136,7 @@ static void FT_WEAPON_TWO_SPR_PATH, &cl->tlist[19].img_w, &cl->tlist[19].img_h); cl->tlist[19].ptr = mlx_get_data_addr(cl->tlist[19].img, &cl->tlist[19].bpp, &cl->tlist[19].sizeline, &cl->tlist[19].endian); - ft_init_number(&cl->tnum[0], FT_ZER_PATH, cl); - ft_init_number(&cl->tnum[1], FT_ONE_PATH, cl); - ft_init_number(&cl->tnum[2], FT_TWO_PATH, cl); - ft_init_number(&cl->tnum[3], FT_THR_PATH, cl); - ft_init_number(&cl->tnum[4], FT_FOU_PATH, cl); - ft_init_number(&cl->tnum[5], FT_FIV_PATH, cl); - ft_init_number(&cl->tnum[6], FT_SIX_PATH, cl); - ft_init_number(&cl->tnum[7], FT_SEV_PATH, cl); - ft_init_number(&cl->tnum[8], FT_EIG_PATH, cl); - ft_init_number(&cl->tnum[9], FT_NIN_PATH, cl); - ft_init_number(&cl->tnum[10], FT_PER_PATH, cl); + ft_init_numbers(cl); cl->walltexgood = 1; if (cl->mlist.sprite_var > 1) ft_next_sprite_init(cl); |