mirror of https://github.com/bjornbytes/lovr.git
Slight update to lovrDirSep;
Macro instead of global variable.
This commit is contained in:
parent
79fd5ad7d8
commit
12fcaffc3b
|
@ -7,12 +7,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
const char lovrDirSep = '\\';
|
||||
#else
|
||||
const char lovrDirSep = '/';
|
||||
#endif
|
||||
|
||||
void* luax_readfile(const char* filename, size_t* bytesRead) {
|
||||
return lovrFilesystemRead(filename, -1, bytesRead);
|
||||
}
|
||||
|
@ -434,7 +428,7 @@ static int libLoader(lua_State* L) {
|
|||
luaL_Buffer buffer;
|
||||
luaL_buffinit(L, &buffer);
|
||||
luaL_addstring(&buffer, lovrFilesystemGetRealDirectory(filename));
|
||||
luaL_addchar(&buffer, lovrDirSep);
|
||||
luaL_addchar(&buffer, LOVR_PATH_SEP);
|
||||
luaL_addstring(&buffer, filename);
|
||||
luaL_pushresult(&buffer);
|
||||
|
||||
|
@ -461,7 +455,7 @@ static int libLoader(lua_State* L) {
|
|||
}
|
||||
} else if (*p == '?') {
|
||||
for (const char* m = module; n && *m; n--, m++) {
|
||||
*f++ = *m == '.' ? lovrDirSep : *m;
|
||||
*f++ = *m == '.' ? LOVR_PATH_SEP : *m;
|
||||
}
|
||||
p++;
|
||||
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
|
||||
#define LOVR_PATH_MAX 1024
|
||||
|
||||
extern const char lovrDirSep;
|
||||
#ifdef _WIN32
|
||||
#define LOVR_PATH_SEP '\\'
|
||||
#else
|
||||
#define LOVR_PATH_SEP '/'
|
||||
#endif
|
||||
|
||||
bool lovrFilesystemInit(const char* argExe, const char* argGame, const char* argRoot);
|
||||
void lovrFilesystemDestroy(void);
|
||||
|
|
|
@ -107,7 +107,7 @@ static bool openvr_init(float offset, uint32_t msaa) {
|
|||
}
|
||||
|
||||
char path[LOVR_PATH_MAX];
|
||||
snprintf(path, sizeof(path), "%s%cactions.json", lovrFilesystemGetSaveDirectory(), lovrDirSep);
|
||||
snprintf(path, sizeof(path), "%s%cactions.json", lovrFilesystemGetSaveDirectory(), LOVR_PATH_SEP);
|
||||
state.input->SetActionManifestPath(path);
|
||||
state.input->GetActionSetHandle("/actions/lovr", &state.actionSet);
|
||||
|
||||
|
|
Loading…
Reference in New Issue