int load_hole_cube_datas3(t_hole_cube *s, t_bunny_ini *ini, char *scope) { const char *field; if ((field = bunny_ini_get_field(ini, scope, "opacity", 0)) == NULL) return (my_puterr("load_datas: missing hole_cube opacity")); s->opacity = (double)my_getnbr((char *)field) / 100; if ((field = bunny_ini_get_field(ini, scope, "color1", 0)) == NULL) return (my_puterr("load_datas: missing hole_cube color1")); s->color1.full = my_getcolor((char *)field, "0123456789ABCDEF"); if ((field = bunny_ini_get_field(ini, scope, "color2", 0)) == NULL) return (my_puterr("load_datas: missing hole_cube color2")); s->color2.full = my_getcolor((char *)field, "0123456789ABCDEF"); s->tex_name = NULL; s->texture = NULL; if (s->tex_type == IMAGE) { if ((field = bunny_ini_get_field(ini, scope, "texture", 0)) == NULL) return (my_puterr("load_datas: missing hole_cube texture")); s->tex_name = my_strdup((char *)field); if ((s->texture = bunny_load_pixelarray((char *)field)) == NULL) return (my_puterr("load_datas: invalid hole_cube texture1")); } return (0); }
int is_dim(char *line, t_screen *screen) { char *word; int i; i = -1; if ((word = get_next_word(line, &i)) && is_equal(word, "screen_dim")) { free(word); if ((word = get_next_word(line, &i))) screen->width = my_getcolor(word, -1); free(word); if ((word = get_next_word(line, &i))) screen->height = my_getcolor(word, -1); free(word); return (1); } free(word); return (0); }