[colobot] 91/390: Added portable build flag

Didier Raboud odyx at moszumanska.debian.org
Fri Jun 12 14:21:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch upstream/latest
in repository colobot.

commit 7af92cc4ce04ecf5e9232bc89acee6311c0f6bc4
Author: krzys-h <krzys_h at interia.pl>
Date:   Sat Oct 18 20:00:30 2014 +0200

    Added portable build flag
---
 CMakeLists.txt            | 3 +++
 src/app/app.cpp           | 5 +++++
 src/common/config.h.cmake | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6deed31..d0d1416 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,9 @@ option(ASSERTS "Enable assert()s" ON)
 # Development build can be enabled/disabled regardless of build type
 option(DEV_BUILD "Enable development build (enables some debugging tools, local setting paths, etc.)" OFF)
 
+# Portable build - load all data from current directory
+option(PORTABLE "Portable build" OFF)
+
 # Building tests can be enabled/disabled
 option(TESTS "Build tests" OFF)
 
diff --git a/src/app/app.cpp b/src/app/app.cpp
index ce6a6b5..adc7ea3 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -151,8 +151,13 @@ CApplication::CApplication()
     m_mouseButtonsState = 0;
     m_trackedKeys = 0;
 
+    #ifdef PORTABLE
+    m_dataPath = "./data";
+    m_langPath = "./lang";
+    #else
     m_dataPath = GetSystemUtils()->GetDataPath();
     m_langPath = GetSystemUtils()->GetLangPath();
+    #endif
 
     m_runSceneName = "";
     m_runSceneRank = 0;
diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake
index 98ccefe..44c1085 100644
--- a/src/common/config.h.cmake
+++ b/src/common/config.h.cmake
@@ -24,6 +24,8 @@
 #define SDL_MAIN_FUNC main
 #endif
 
+#cmakedefine PORTABLE @PORTABLE@
+
 #define COLOBOT_VERSION "@COLOBOT_VERSION_FULL@"
 #define COLOBOT_CODENAME "@COLOBOT_VERSION_CODENAME@"
 #define COLOBOT_FULLNAME "Colobot @COLOBOT_VERSION_CODENAME@"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list