This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +18
-64
lines changed Expand file tree Collapse file tree 4 files changed +18
-64
lines changed Original file line number Diff line number Diff line change 22#include < Tkge/Engine.hpp>
33#include < Tkge/Graphics/Drawable.hpp>
44#include < Tkge/Graphics/Shader.hpp>
5- #include < Tkge/Utilities.hpp>
65#include < klib/assert.hpp>
76#include < kvf/time.hpp>
87#include < cmath>
@@ -108,12 +107,12 @@ namespace
108107 }
109108} // namespace
110109
111- int main ([[maybe_unused]] int argc, [[maybe_unused]] char ** argv)
110+ int main ([[maybe_unused]] int argc, char ** argv)
112111{
113112 try
114113 {
115114 KLIB_ASSERT (argc > 0 );
116- const auto assets_path = Upfind (Tkge::Utilities::GetCurrentExecutablePath () , " Assets" );
115+ const auto assets_path = Upfind (*argv , " Assets" );
117116 Run (assets_path);
118117 }
119118 catch (const std::exception& e)
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11#include < Tkge/AssetLoader.hpp>
2- #include < Tkge/Utilities.hpp>
32#include < filesystem>
43
4+ #ifdef _WIN32
5+ #ifndef WIN32_MEAN_AND_LEAN
6+ #define WIN32_MEAN_AND_LEAN
7+ #define _AMD64_
8+ #endif
9+ #include < libloaderapi.h>
10+ #include < minwindef.h>
11+ #endif
12+
513std::vector<std::filesystem::path> Tkge::AssetLoader::GetSearchPaths () const
614{
715 std::vector<std::filesystem::path> paths{};
816
917 paths.emplace_back (" ." );
1018
11- paths.push_back (Tkge::Utilities::GetCurrentExecutablePath ());
19+ #ifdef _WIN32
20+ char buffer[MAX_PATH]{};
21+ GetModuleFileNameA (nullptr , buffer, MAX_PATH);
22+
23+ paths.push_back (std::filesystem::path{buffer}.parent_path ());
1224 paths.push_back (paths.back () / " Assets" );
25+ #else
26+ #endif
1327
1428 return paths;
1529}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments