fastfiles: Use defines instead of magic numbers

This commit is contained in:
Diavolo 2022-09-11 12:55:40 +02:00
parent f1e261a7b3
commit 0e62d816e8
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5

View File

@ -175,7 +175,7 @@ namespace fastfiles
if (check_loc_folder && game::DB_IsLocalized(filename.data())) if (check_loc_folder && game::DB_IsLocalized(filename.data()))
{ {
const auto handle = find_fastfile(filename, false); const auto handle = find_fastfile(filename, false);
if (handle != reinterpret_cast<HANDLE>(-1)) if (handle != INVALID_HANDLE_VALUE)
{ {
return handle; return handle;
} }
@ -187,12 +187,13 @@ namespace fastfiles
{ {
if (!filesystem::find_file("zone/"s + loc_folder + filename, &path)) if (!filesystem::find_file("zone/"s + loc_folder + filename, &path))
{ {
return reinterpret_cast<HANDLE>(-1); return INVALID_HANDLE_VALUE;
} }
} }
const auto handle = CreateFileA(path.data(), 0x80000000, 1u, 0, 3u, 0x60000000u, 0); const auto handle = CreateFileA(path.data(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
if (handle != reinterpret_cast<HANDLE>(-1)) FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, nullptr);
if (handle != INVALID_HANDLE_VALUE)
{ {
fastfile_handles.push_back(handle); fastfile_handles.push_back(handle);
} }