#include "jpg_loader.h"
#include "video.h"

#include <iostream>

#ifdef Revision
#undef Revision
#endif
#define Revision "jpg_loader.cpp $Revision: 1.3 $"

extern Video_Surface *IMG_LoadJPG ( Video_Interface *video, std::string fname, std::string grp_name, std::string surf_name, bool overwrite );

Image_Loader* _get_imageloader ( void )
{
	return new JPG_Loader;
}

bool JPG_Loader::_loadimage ( std::string video_name, std::string image_name, std::string group_name, std::string surface_name, bool overwrite )
{
	std::cerr<<"loading file:"<<image_name<<std::endl;
	Video_Surface *srf;
	Video_Interface *vid=video_get_interface ( video_name );
	if(!vid){imageloader_seterror("No such video device: \""+video_name+"\"");return false;}
	srf=IMG_LoadJPG ( vid, image_name, group_name, surface_name, overwrite );
	return srf!=0;
}

