Skip to content

Commit

Permalink
add assets folder for launcher assets
Browse files Browse the repository at this point in the history
  • Loading branch information
GEEKiDoS committed Jul 27, 2024
1 parent 549fe5f commit 1fc305b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
url = https://github.com/nothings/stb.git
[submodule "deps/ifs_layeredfs"]
path = deps/ifs_layeredfs
url = https://github.com/mon/ifs_layeredfs.git
url = https://github.com/GEEKiDoS/ifs_layeredfs/git
2 changes: 1 addition & 1 deletion deps/ifs_layeredfs
Submodule ifs_layeredfs updated from 5bd88a to 47025f
30 changes: 27 additions & 3 deletions src/client/component/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <utils/string.hpp>

// from ifs_layeredfs
extern "C" int init(void);
extern "C" int init(const char* data_dir);

namespace filesystem
{
Expand Down Expand Up @@ -73,8 +73,32 @@ namespace filesystem
public:
void post_avs_init() override
{
if (!utils::flags::has_flag("disable_ifs_hook"))
init();
if (utils::flags::has_flag("disable_ifs_hook"))
return;

utils::nt::library self{ };

auto g = game::environment::get_game();
std::filesystem::path data_dir = self.get_folder();
data_dir /= "assets";

if (g == launcher::game::iidx)
data_dir /= "iidx";
else if (g == launcher::game::sdvx)
data_dir /= "iidx";
else if (g == launcher::game::gitadora)
data_dir /= "gitadora";

static auto abs_data_path = std::filesystem::absolute(data_dir).generic_string();

if (!std::filesystem::exists(data_dir))
{
printf("warning: data dir %s not exists\n", abs_data_path.data());
init(nullptr);
return;
}

init(abs_data_path.data());
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace game
{
launcher::game game = launcher::game::invalid;
utils::nt::library game_module;
bool inited = false;;
bool inited = false;

launcher::game get_game()
{
Expand Down

0 comments on commit 1fc305b

Please sign in to comment.