_wfopen -> xe::filesystem::OpenFile.

Progress on #305.
This commit is contained in:
Ben Vanik
2015-06-28 17:16:44 -07:00
parent 1d7606097a
commit 1106029afc
9 changed files with 28 additions and 14 deletions

View File

@@ -9,6 +9,7 @@
#include "xenia/cpu/raw_module.h"
#include "xenia/base/filesystem.h"
#include "xenia/base/platform.h"
#include "xenia/base/string.h"
@@ -21,8 +22,8 @@ RawModule::RawModule(Processor* processor)
RawModule::~RawModule() {}
bool RawModule::LoadFile(uint32_t base_address, const std::wstring& path) {
auto fixed_path = xe::to_string(xe::fix_path_separators(path));
FILE* file = fopen(fixed_path.c_str(), "rb");
auto fixed_path = xe::fix_path_separators(path);
FILE* file = xe::filesystem::OpenFile(fixed_path, "rb");
fseek(file, 0, SEEK_END);
uint32_t file_length = static_cast<uint32_t>(ftell(file));
fseek(file, 0, SEEK_SET);
@@ -44,9 +45,9 @@ bool RawModule::LoadFile(uint32_t base_address, const std::wstring& path) {
// Setup debug info.
auto last_slash = fixed_path.find_last_of(xe::path_separator);
if (last_slash != std::string::npos) {
name_ = fixed_path.substr(last_slash + 1);
name_ = xe::to_string(fixed_path.substr(last_slash + 1));
} else {
name_ = fixed_path;
name_ = xe::to_string(fixed_path);
}
// TODO(benvanik): debug info