| 384 | } |
| 385 | |
| 386 | int64_t GDREPackedData::get_file_size(const String &p_path) { |
| 387 | String simplified_path = p_path.simplify_path().trim_prefix("res://"); |
| 388 | PathMD5 pmd5(simplified_path.md5_buffer()); |
| 389 | HashMap<PathMD5, PackedData::PackedFile, PathMD5>::Iterator E = files.find(pmd5); |
| 390 | if (!E) { |
| 391 | return -1; //not found |
| 392 | } |
| 393 | if (E->value.offset == 0) { |
| 394 | return -1; //was erased |
| 395 | } |
| 396 | return E->value.size; |
| 397 | } |
| 398 | |
| 399 | Ref<FileAccess> GDREPackedData::try_open_path(const String &p_path) { |
| 400 | String simplified_path = p_path.simplify_path().trim_prefix("res://"); |