#include #include #include #include"cmd_parse.h" #include"pixel_format.h" #include #include using namespace hgl; bool sub_folder =false; const PixelFormat * pixel_fmt[4] ={nullptr,nullptr,nullptr,nullptr}; //选中格式 bool gen_mipmaps =false; //是否产生mipmaps bool use_color_key =false; //是否使用ColorKey uint8 color_key[3]; //ColorKey颜色 const PixelFormat *ParseParamFormat(const cmd_parse &cmd,const char *flag,const PixelFormat *default_format) { std::string fmtstr; if(!cmd.GetString(flag,fmtstr))return(nullptr); const PixelFormat *result=GetPixelFormat(fmtstr.c_str()); if(result)return(result); std::cerr<<"[FORMAT ERROR] Don't support \""<name<\n" "\n" "Params:\n" "\t/s : proc sub-directory\n" "\n"; PrintFormatList(); return 0; } cmd_parse cp(argc,argv); if(cp.Find("/s")!=-1)sub_folder=true; //检测是否处理子目录 if(cp.Find("/mip")!=-1)gen_mipmaps=true; //检测是否生成mipmaps ParamColorKey(cp); ParseParamFormat(cp); //检测推荐格式 ilInit(); ilShutDown(); return 0; }