From 45501ad994847e9e973c271655e7766cd445f673 Mon Sep 17 00:00:00 2001 From: Tero Lindeman Date: Sun, 7 May 2017 11:03:29 +0300 Subject: [PATCH] Use KLYSTRACK env variable to look for resources --- src/theme.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/theme.c b/src/theme.c index fdd5e488..89b6cb4b 100644 --- a/src/theme.c +++ b/src/theme.c @@ -300,11 +300,18 @@ static char cwd[1000] = ""; void init_resources_dir(void) { + if (SDL_getenv("KLYSTRACK") == NULL) + { #if RESOURCES_IN_BINARY_DIR - getcwd(cwd, sizeof(cwd)); + getcwd(cwd, sizeof(cwd)); #else - strncpy(cwd, TOSTRING(RES_PATH), sizeof(cwd)); + strncpy(cwd, TOSTRING(RES_PATH), sizeof(cwd)); #endif + } + else + { + strncpy(cwd, SDL_getenv("KLYSTRACK"), sizeof(cwd)); + } } char * query_resource_directory(void)