[Emulator] use filesystem::file_size instead of ftell where possible

This commit is contained in:
Gliniak
2024-03-22 11:03:34 +01:00
parent c9bf44f4f4
commit a966143823
3 changed files with 4 additions and 9 deletions

View File

@@ -26,9 +26,8 @@ RawModule::~RawModule() {}
bool RawModule::LoadFile(uint32_t base_address,
const std::filesystem::path& path) {
FILE* file = xe::filesystem::OpenFile(path, "rb");
fseek(file, 0, SEEK_END);
uint32_t file_length = static_cast<uint32_t>(ftell(file));
fseek(file, 0, SEEK_SET);
const uint32_t file_length =
static_cast<uint32_t>(std::filesystem::file_size(path));
// Allocate memory.
// Since we have no real heap just load it wherever.