Example #1
0
void SurfaceObject::load(const std::string & filename)
{
    if (selected_image == NULL)
        return;
    Color old_trans = selected_image->transparent;
    selected_image->reset();
    selected_image->transparent = Color(255, 0, 255); // old_trans;

    std::string path = convert_path(filename);
    Image * image = NULL;
#ifdef CHOWDREN_USE_CAPTURE
    if (!CaptureObject::filename.empty() &&
        CaptureObject::filename == path)
    {
        image = &CaptureObject::image;
    }
#endif
    if (image == NULL)
        image = get_image_cache(path, 0, 0, 0, 0, selected_image->transparent);
    selected_image->set_image(image);
    if (image == NULL)
        load_failed = true;

    set_edit_image(selected_index);
}
Example #2
0
void SurfaceObject::load(const std::string & filename,
                         const std::string & ignore_ext)
{
    if (selected_image == NULL)
        return;
    Color old_trans = selected_image->transparent;
    selected_image->reset();
    selected_image->transparent = Color(255, 0, 255); // old_trans;

    std::string path = convert_path(filename);
    Image * image = get_image_cache(path, 0, 0, 0, 0,
                                    selected_image->transparent);
    selected_image->set_image(image);

    if (image == NULL)
        load_failed = true;

    set_edit_image(selected_index);
}