blob: 4a049f1de9b3c5790974f5319f7a0da04e409b9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
diff --git a/BlockOut/Makefile b/BlockOut/Makefile
index 0cdfa00..7e5b531 100644
--- a/BlockOut/Makefile
+++ b/BlockOut/Makefile
@@ -71,6 +71,10 @@ LFLAGS = -L $(SDL_LIBS) \
endif
+ifdef GAME_DATA_PREFIX
+CXXFLAGS += -DBL2_HOME=\"$(GAME_DATA_PREFIX)\"
+endif
+
#--------------------------------------------------------------------
diff --git a/BlockOut/Utils.cpp b/BlockOut/Utils.cpp
index 4ccd8df..eb37e88 100644
--- a/BlockOut/Utils.cpp
+++ b/BlockOut/Utils.cpp
@@ -206,13 +206,21 @@ BOOL CheckEnv() {
printf("Please set the HOME variable to your home directory (ex: HOME=/users/jeanluc)\n");
return FALSE;
}
-
+
+#ifndef BL2_HOME
+
char *blockoutHome = getenv("BL2_HOME");
if( blockoutHome==NULL ) {
printf("BL2_HOME environement variable if not defined !\n");
printf("Please set the BL2_HOME to the BlockOut II installation directory (ex: BL2_HOME=/usr/local/bl2).\n");
return FALSE;
}
+#else
+
+ char const *blockoutHome = BL2_HOME;
+
+#endif
+
strcpy( bl2Home , blockoutHome );
char bl2Dir[512];
|