| 342 | } |
| 343 | |
| 344 | CC_NOINLINE static void MakeCachePath(cc_string* mainPath, cc_string* altPath, const cc_string* url) { |
| 345 | cc_string key; char keyBuffer[STRING_INT_CHARS]; |
| 346 | String_InitArray(key, keyBuffer); |
| 347 | HashUrl(&key, url); |
| 348 | |
| 349 | if (UseDedicatedCache(mainPath, &key)) { |
| 350 | /* If using dedicated cache directory, also fallback to default cache directory */ |
| 351 | String_Format1(altPath, "texturecache/%s", &key); |
| 352 | } else { |
| 353 | mainPath->length = 0; |
| 354 | String_Format1(mainPath, "texturecache/%s", &key); |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | /* Returns non-zero if given URL has been cached */ |
| 359 | static int IsCached(const cc_string* url) { |
no test coverage detected