Skip to content

Commit

Permalink
Trying to fix filepath issue
Browse files Browse the repository at this point in the history
  • Loading branch information
EPICGameGuy committed Dec 30, 2023
1 parent 8fa8ffc commit aa5d923
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions dependencies/egg-library/src/filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ void set_filesystem_type(Type new_type)

bool load_file(const Path& path, std::vector<std::byte>& out_bytes)
{
const char* filepath = path.to_full_filepath();
printf("Filesystem::load_file: %s\n", filepath);
std::ifstream file(filepath, std::ios::binary);
const char* filepath = path.to_full_filepath();
std::string filepath_copy = filepath;
printf("Filesystem::load_file: %s\n", filepath_copy.c_str());
std::ifstream file(filepath_copy, std::ios::binary);

if (file.is_open() && file.good())
{
// Read the file size
Expand All @@ -47,9 +49,11 @@ bool load_file(const Path& path, std::vector<std::byte>& out_bytes)

bool load_file(const Path& path, std::unique_ptr<std::byte[]>& out_bytes, size_t& size, size_t alignment)
{
const char* filepath = path.to_full_filepath();
printf("Filesystem::load_file: %s\n", filepath);
std::ifstream file(filepath, std::ios::binary);
const char* filepath = path.to_full_filepath();
std::string filepath_copy = filepath;
printf("Filesystem::load_file: %s\n", filepath_copy.c_str());
std::ifstream file(filepath_copy, std::ios::binary);

if (file.is_open() && file.good())
{
// Read the file size
Expand Down

0 comments on commit aa5d923

Please sign in to comment.