| 347 | } |
| 348 | |
| 349 | void CLocatorAPI::ProcessOne(LPCSTR path, const _finddata_t& F, bool bNoRecurse) |
| 350 | { |
| 351 | string_path N; |
| 352 | strcpy_s(N, path); |
| 353 | strcat_s(N, F.name); |
| 354 | xr_strlwr(N); |
| 355 | |
| 356 | if (F.attrib & _A_HIDDEN) |
| 357 | { |
| 358 | return; |
| 359 | } |
| 360 | |
| 361 | if (F.attrib & _A_SUBDIR) |
| 362 | { |
| 363 | if (0 == xr_strcmp(F.name, ".")) |
| 364 | return; |
| 365 | if (0 == xr_strcmp(F.name, "..")) |
| 366 | return; |
| 367 | |
| 368 | strcat_s(N, "\\"); |
| 369 | |
| 370 | if (bNoRecurse) |
| 371 | { |
| 372 | // register folder itself |
| 373 | Register(N, VFS_STANDARD_FILE, 0, 0, 0, (u32)-1, true); |
| 374 | |
| 375 | return; |
| 376 | } |
| 377 | |
| 378 | RecurseScanPhysicalPath(N, false, bNoRecurse); |
| 379 | } |
| 380 | else |
| 381 | { |
| 382 | if (strext(N) && (0 == strncmp(strext(N), ".db", 3) || 0 == strncmp(strext(N), ".sq", 3))) |
| 383 | { |
| 384 | string_path base_path{}; |
| 385 | if (FS.path_exist(fsgame::fs_root)) |
| 386 | { |
| 387 | strconcat(sizeof(_path), base_path, FS.get_path(fsgame::fs_root)->m_Path, "gamedata"); |
| 388 | } |
| 389 | |
| 390 | Msg("--Found base arch: [%s], size: [%u]", N, F.size); |
| 391 | ProcessArchive(N, base_path); |
| 392 | } |
| 393 | else |
| 394 | { |
| 395 | Register(N, VFS_STANDARD_FILE, 0, F.size, F.size, (u32)F.time_write); |
| 396 | } |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | IC bool pred_str_ff(const _finddata_t& x, const _finddata_t& y) { return xr_strcmp(x.name, y.name) < 0; } |
| 401 | |