114{
115 MkDir(GetExecutableDir() + PATH_SEPARATOR "Data" PATH_SEPARATOR "cache" PATH_SEPARATOR "texture_thumbnails" PATH_SEPARATOR);
116
117 for(
auto it = textureDatabaseJ.
begin() ; it != textureDatabaseJ.
end() ; it++)
118 {
119 if(!FileExists(GetExecutableDir() + PATH_SEPARATOR "Data" PATH_SEPARATOR "cache" PATH_SEPARATOR "texture_thumbnails" PATH_SEPARATOR + it.key() + ".png"))
120 {
121 Log("Downloading thumbnail for texture: " + it.key());
122 DownloadFile("https://cdn.polyhaven.com", "/asset_img/thumbs/" +
123 it.key() + ".png?width=100&height=100", GetExecutableDir()
124 + PATH_SEPARATOR "Data" PATH_SEPARATOR "cache"
125 PATH_SEPARATOR "texture_thumbnails" PATH_SEPARATOR +
126 it.key() + ".png");
127 }
128 }
129}
iterator begin() noexcept
returns an iterator to the first element
iterator end() noexcept
returns an iterator to one past the last element