Пример #1
0
void rectangle_set_border_color_html(rectangle_t * const obj, const char* html_color_code)
{
	PTR_CHECK(obj, "rectangle");

	obj->border_color = color_html(html_color_code);
	obj->has_border = true;
}
Пример #2
0
void rectangle_set_fill_color_html(rectangle_t * const obj, const char *html_color_code)
{
	PTR_CHECK(obj, "rectangle");

	obj->fill_color = color_html(html_color_code);
	obj->is_filled = true;
}
Пример #3
0
s_sprite c_tile::get_from_ini(ALLEGRO_CONFIG *config, const char * section, ALLEGRO_PATH * base_path)
{
    s_sprite temp;

    const char * buffer_file = al_get_config_value(config, section, "image_file");
    if(!buffer_file)
    {
        temp.index = -1;
        return temp;
    }
    ALLEGRO_PATH * imagepath = al_create_path(buffer_file);
    al_rebase_path(base_path, imagepath);
    temp.index = imagelist.load_image(al_path_cstr(imagepath, ALLEGRO_NATIVE_PATH_SEP));

    temp.x = get_config_int(config, section, "x");
    temp.y = get_config_int(config, section, "y");

    temp.width = get_config_int(config, section, "width");
    temp.height = get_config_int(config, section, "height");

    temp.origin_x = get_config_int(config, section, "origin_x");
    temp.origin_y = get_config_int(config, section, "origin_y");

    temp.origin_x = 0 - temp.origin_x;
    temp.origin_y = 0 - temp.origin_y;

    temp.palette_number = get_config_int(config, section, "palette_index");

    temp.column_height = get_config_int(config, section, "column_height");

    const char * color_selection = al_get_config_value(config, section, "color_source");
    if(color_selection)
        temp.color_by = get_color_selector(color_selection);

    const char * pal_source = al_get_config_value(config, section, "palette_source");
    if(pal_source)
        temp.color_source = get_color_source(pal_source);

    const char * color = al_get_config_value(config, section, "color_html");
    if(color)
        temp.color = color_html(color);

    const char * off = al_get_config_value(config, section, "offset_type");
    if(off)
        temp.offset_type = get_offset_type(off);

    const char * neigh = al_get_config_value(config, section, "border_terrain");
    if(neigh)
        temp.border_terrain = get_terrain_type(neigh);

    const char * neighbobj = al_get_config_value(config, section, "border_structure");
    if(neighbobj)
        temp.border_structure = get_structure_type(neighbobj);

    temp.offset_amount = get_config_int(config, section, "offset_amount");

    al_destroy_path(imagepath);
    return temp;
}