// PORT: lists the texture paths named by each Granny model, for staging map/mob packs (tools/server/ava2-maps). // stdin: one model path per line; stdout: "TEX\t\t" lines, then "OK\t" or "ERR\t\t". #include #include #include #include int main() { std::string path; while(std::getline(std::cin,path)) { gr2::LoadError e;auto f=gr2::File::load_path(path,&e); if(!f){std::printf("ERR\t%s\t%s %s\n",path.c_str(),e.stage.c_str(),e.message.c_str());continue;} for(auto& m:gr2::dump_materials(*f))for(auto& t:m.all_textures)std::printf("TEX\t%s\t%s\n",path.c_str(),t.c_str()); std::printf("OK\t%s\n",path.c_str());std::fflush(stdout); } }