PCG-FPS
v2 m0.22.4
Simple First Person Shooter with Procedurally Generated Level
fps2
AssetPath.h
Go to the documentation of this file.
1
3
#ifndef SKR_FPS2_ASSET_PATH_H
4
#define SKR_FPS2_ASSET_PATH_H
5
6
#include <string>
7
#include <Windows.h>
8
9
namespace
skr
10
{
11
namespace
fps2
12
{
13
18
static
std::string
GetAssetPath
(std::string file)
19
{
20
auto
getExeDir = []()
21
{
22
char
result[MAX_PATH];
23
auto
path = std::string(result, GetModuleFileNameA(
nullptr
, result, MAX_PATH));
24
return
path.substr(0, path.rfind(
"\\"
));
25
};
26
27
return
getExeDir() +
"/assets/"
+ file;
28
}
29
30
}
31
}
32
#endif // !SKR_FPS2_ASSET_PATH_H
33
skr::fps2::GetAssetPath
static std::string GetAssetPath(std::string file)
helper function got get the complete path of a given file in assets folder since the place of the exe...
Definition:
AssetPath.h:18
skr
Definition:
AssetPath.h:10
Generated by
1.8.18