Skip to content

Commit

Permalink
Updating gitignore
Browse files Browse the repository at this point in the history
Moving to_full_filepath to own cpp file
  • Loading branch information
EPICGameGuy committed Dec 30, 2023
1 parent 26bfad9 commit 32015fd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@

build

dependencies/ps2gl
dependencies/cxxopts
dependencies/meshoptimizer
dependencies/ps2gl
dependencies/openvcl
dependencies/ps2stuff
2 changes: 1 addition & 1 deletion compile.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if [ $1 != "ci" ]; then
if [ ! "$1" ] || [ $1 != "ci" ]; then
sudo apt install -y build-essential binutils-dev git cmake genisoimage libassimp-dev
fi

Expand Down
13 changes: 1 addition & 12 deletions dependencies/egg-library/include/egg/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,7 @@ struct Path
return std::string_view(mem.data()) == std::string_view(rhs);
}

const char* to_full_filepath(Type in_filesystem_type = get_filesystem_type()) const
{
// 9 is the max filesystem prefix length
static std::array<char, max_path_length + 9> buffer {'\0'};

const char* filesystem_prefix = get_filesystem_prefix(in_filesystem_type);
size_t filesystem_prefix_length = strlen(filesystem_prefix);
strncpy(buffer.data(), filesystem_prefix, filesystem_prefix_length);
strncpy(buffer.data() + filesystem_prefix_length, mem.data(), max_path_length);

return buffer.data();
}
const char* to_full_filepath(Type in_filesystem_type = get_filesystem_type()) const;

constexpr uint32_t hash() const
{
Expand Down
13 changes: 13 additions & 0 deletions dependencies/egg-library/src/filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@ void iterate_dir(const Path& dir, std::function<void(const Path&)> itr_func, boo
}
}

const char* Path::to_full_filepath(Type in_filesystem_type) const
{
// 9 is the max filesystem prefix length
static std::array<char, max_path_length + 9> buffer {'\0'};

const char* filesystem_prefix = get_filesystem_prefix(in_filesystem_type);
size_t filesystem_prefix_length = strlen(filesystem_prefix);
strncpy(buffer.data(), filesystem_prefix, filesystem_prefix_length);
strncpy(buffer.data() + filesystem_prefix_length, mem.data(), max_path_length);

return buffer.data();
}

// void run_tests()
// {
// switch (get_filesystem_type())
Expand Down

0 comments on commit 32015fd

Please sign in to comment.