diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bc6f12ad..db4b9d95 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -89,8 +89,6 @@ endif() # Source files set(BASE_SOURCES ${OPENAL_SRC} - app/${SYSTEM_CPP_MODULE} - app/${SYSTEM_H_MODULE} app/app.cpp app/app.h app/controller.cpp @@ -103,10 +101,6 @@ set(BASE_SOURCES app/pausemanager.h app/signal_handlers.cpp app/signal_handlers.h - app/system.cpp - app/system.h - app/system_other.cpp - app/system_other.h common/config_file.cpp common/config_file.h common/error.h @@ -143,6 +137,12 @@ set(BASE_SOURCES common/resources/sndfile_wrapper.h common/restext.cpp common/restext.h + common/system/system.cpp + common/system/system.h + common/system/system_other.cpp + common/system/system_other.h + common/system/${SYSTEM_CPP_MODULE} + common/system/${SYSTEM_H_MODULE} common/settings.cpp common/settings.h common/singleton.h diff --git a/src/app/app.cpp b/src/app/app.cpp index d34532f7..d9583d09 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -22,7 +22,6 @@ #include "app/controller.h" #include "app/input.h" #include "app/pathman.h" -#include "app/system.h" #include "common/config_file.h" #include "common/image.h" @@ -34,6 +33,8 @@ #include "common/resources/resourcemanager.h" +#include "common/system/system.h" + #include "graphics/core/nulldevice.h" #include "graphics/opengl/glutil.h" diff --git a/src/app/main.cpp b/src/app/main.cpp index 88908f6f..abf65669 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -26,10 +26,6 @@ #include "app/app.h" #include "app/signal_handlers.h" -#include "app/system.h" -#if PLATFORM_WINDOWS - #include "app/system_windows.h" -#endif #include "common/logger.h" #include "common/make_unique.h" @@ -38,6 +34,11 @@ #include "common/resources/resourcemanager.h" +#include "common/system/system.h" +#if PLATFORM_WINDOWS + #include "common/system/system_windows.h" +#endif + #if PLATFORM_WINDOWS #include #endif diff --git a/src/app/pathman.cpp b/src/app/pathman.cpp index 8f862110..a3848280 100644 --- a/src/app/pathman.cpp +++ b/src/app/pathman.cpp @@ -23,15 +23,17 @@ #include "common/config.h" #include "app/app.h" -#include "app/system.h" -#ifdef PLATFORM_WINDOWS - #include "app/system_windows.h" -#endif + #include "common/logger.h" #include "common/resources/resourcemanager.h" +#include "common/system/system.h" +#ifdef PLATFORM_WINDOWS + #include "common/system/system_windows.h" +#endif + #include #include diff --git a/src/app/signal_handlers.cpp b/src/app/signal_handlers.cpp index 87dbb4ac..223d7db8 100644 --- a/src/app/signal_handlers.cpp +++ b/src/app/signal_handlers.cpp @@ -19,13 +19,13 @@ #include "app/signal_handlers.h" -#include "app/system.h" - #include "common/stringutils.h" #include "common/version.h" #include "common/resources/resourcemanager.h" +#include "common/system/system.h" + #include "level/robotmain.h" #include diff --git a/src/common/config_file.cpp b/src/common/config_file.cpp index 62862667..6148eaec 100644 --- a/src/common/config_file.cpp +++ b/src/common/config_file.cpp @@ -20,14 +20,14 @@ #include "common/config_file.h" -#include "app/system.h" - #include "common/logger.h" #include "common/make_unique.h" #include "common/resources/inputstream.h" #include "common/resources/outputstream.h" +#include "common/system/system.h" + #include #include #include diff --git a/src/app/system.cpp b/src/common/system/system.cpp similarity index 95% rename from src/app/system.cpp rename to src/common/system/system.cpp index fc55af24..210b4a75 100644 --- a/src/app/system.cpp +++ b/src/common/system/system.cpp @@ -18,18 +18,18 @@ */ -#include "app/system.h" +#include "common/system/system.h" #include "common/config.h" #if defined(PLATFORM_WINDOWS) - #include "app/system_windows.h" + #include "common/system/system_windows.h" #elif defined(PLATFORM_LINUX) - #include "app/system_linux.h" + #include "common/system/system_linux.h" #elif defined(PLATFORM_MACOSX) - #include "app/system_macosx.h" + #include "common/system/system_macosx.h" #else - #include "app/system_other.h" + #include "common/system/system_other.h" #endif #include "common/make_unique.h" diff --git a/src/app/system.h b/src/common/system/system.h similarity index 99% rename from src/app/system.h rename to src/common/system/system.h index ecb1de89..2be5ae16 100644 --- a/src/app/system.h +++ b/src/common/system/system.h @@ -18,7 +18,7 @@ */ /** - * \file app/system.h + * \file common/system/system.h * \brief System functions: time stamps, info dialogs, etc. */ diff --git a/src/app/system_linux.cpp b/src/common/system/system_linux.cpp similarity index 98% rename from src/app/system_linux.cpp rename to src/common/system/system_linux.cpp index 8cb59ecf..fd663919 100644 --- a/src/app/system_linux.cpp +++ b/src/common/system/system_linux.cpp @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -#include "app/system_linux.h" +#include "common/system/system_linux.h" #include "common/logger.h" diff --git a/src/app/system_linux.h b/src/common/system/system_linux.h similarity index 95% rename from src/app/system_linux.h rename to src/common/system/system_linux.h index af2fde64..e451a936 100644 --- a/src/app/system_linux.h +++ b/src/common/system/system_linux.h @@ -18,11 +18,11 @@ */ /** - * \file app/system_linux.h + * \file common/system/system_linux.h * \brief Linux-specific implementation of system functions */ -#include "app/system.h" +#include "common/system/system.h" #include diff --git a/src/app/system_macosx.cpp b/src/common/system/system_macosx.cpp similarity index 98% rename from src/app/system_macosx.cpp rename to src/common/system/system_macosx.cpp index 8b99a47a..47304876 100644 --- a/src/app/system_macosx.cpp +++ b/src/common/system/system_macosx.cpp @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -#include "app/system_macosx.h" +#include "common/system/system_macosx.h" #include "common/logger.h" diff --git a/src/app/system_macosx.h b/src/common/system/system_macosx.h similarity index 92% rename from src/app/system_macosx.h rename to src/common/system/system_macosx.h index 99873f05..c8abba53 100644 --- a/src/app/system_macosx.h +++ b/src/common/system/system_macosx.h @@ -18,12 +18,12 @@ */ /** - * \file app/system_macosx.h + * \file common/system/system_macosx.h * \brief MacOSX-specific implementation of system functions */ -#include "app/system.h" -#include "app/system_other.h" +#include "common/system/system.h" +#include "common/system/system_other.h" //@colobot-lint-exclude UndefinedFunctionRule diff --git a/src/app/system_other.cpp b/src/common/system/system_other.cpp similarity index 97% rename from src/app/system_other.cpp rename to src/common/system/system_other.cpp index 5b8d15f4..8547b829 100644 --- a/src/app/system_other.cpp +++ b/src/common/system/system_other.cpp @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -#include "app/system_other.h" +#include "common/system/system_other.h" void CSystemUtilsOther::Init() diff --git a/src/app/system_other.h b/src/common/system/system_other.h similarity index 95% rename from src/app/system_other.h rename to src/common/system/system_other.h index 37e61e6a..caac018d 100644 --- a/src/app/system_other.h +++ b/src/common/system/system_other.h @@ -18,11 +18,11 @@ */ /** - * \file app/system_other.h + * \file common/system/system_other.h * \brief Fallback code for other systems */ -#include "app/system.h" +#include "common/system/system.h" #include diff --git a/src/app/system_windows.cpp b/src/common/system/system_windows.cpp similarity index 99% rename from src/app/system_windows.cpp rename to src/common/system/system_windows.cpp index a9ae1544..4c6d13ef 100644 --- a/src/app/system_windows.cpp +++ b/src/common/system/system_windows.cpp @@ -17,7 +17,7 @@ * along with this program. If not, see http://gnu.org/licenses */ -#include "app/system_windows.h" +#include "common/system/system_windows.h" #include "common/logger.h" diff --git a/src/app/system_windows.h b/src/common/system/system_windows.h similarity index 95% rename from src/app/system_windows.h rename to src/common/system/system_windows.h index 4379b3e6..dae9e0fa 100644 --- a/src/app/system_windows.h +++ b/src/common/system/system_windows.h @@ -18,11 +18,11 @@ */ /** - * \file app/system_windows.h + * \file common/system/system_windows.h * \brief Windows-specific implementation of system functions */ -#include "app/system.h" +#include "common/system/system.h" //@colobot-lint-exclude UndefinedFunctionRule diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 27d2db70..74a473ae 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -22,7 +22,6 @@ #include "app/app.h" #include "app/input.h" -#include "app/system.h" #include "common/image.h" #include "common/key.h" @@ -30,6 +29,8 @@ #include "common/make_unique.h" #include "common/stringutils.h" +#include "common/system/system.h" + #include "common/thread/resource_owning_thread.h" #include "graphics/core/device.h" diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 446834f7..c21fb600 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -1,8 +1,8 @@ # Platform-dependent tests if(PLATFORM_WINDOWS) - set(PLATFORM_TESTS app/system_windows_test.cpp) + set(PLATFORM_TESTS common/system/system_windows_test.cpp) elseif(PLATFORM_LINUX) - set(PLATFORM_TESTS app/system_linux_test.cpp) + set(PLATFORM_TESTS common/system/system_linux_test.cpp) endif() # Sources diff --git a/test/unit/app/app_test.cpp b/test/unit/app/app_test.cpp index 13a3caa9..073dd89a 100644 --- a/test/unit/app/app_test.cpp +++ b/test/unit/app/app_test.cpp @@ -19,10 +19,10 @@ #include "app/app.h" -#include "app/system_other.h" - #include "common/make_unique.h" +#include "common/system/system_other.h" + #include #include diff --git a/test/unit/common/config_file_test.cpp b/test/unit/common/config_file_test.cpp index b95b6b01..4a001373 100644 --- a/test/unit/common/config_file_test.cpp +++ b/test/unit/common/config_file_test.cpp @@ -17,11 +17,11 @@ * along with this program. If not, see http://gnu.org/licenses */ -#include "app/system.h" - #include "common/config_file.h" #include "common/logger.h" +#include "common/system/system.h" + #include #include #include diff --git a/test/unit/app/system_linux_test.cpp b/test/unit/common/system/system_linux_test.cpp similarity index 96% rename from test/unit/app/system_linux_test.cpp rename to test/unit/common/system/system_linux_test.cpp index d69b3fb5..9d51d884 100644 --- a/test/unit/app/system_linux_test.cpp +++ b/test/unit/common/system/system_linux_test.cpp @@ -17,8 +17,8 @@ * along with this program. If not, see http://gnu.org/licenses */ -#include "app/system.h" -#include "app/system_linux.h" +#include "common/system/system.h" +#include "common/system/system_linux.h" #include diff --git a/test/unit/app/system_windows_test.cpp b/test/unit/common/system/system_windows_test.cpp similarity index 96% rename from test/unit/app/system_windows_test.cpp rename to test/unit/common/system/system_windows_test.cpp index 46a729e4..1c2d8535 100644 --- a/test/unit/app/system_windows_test.cpp +++ b/test/unit/common/system/system_windows_test.cpp @@ -17,8 +17,8 @@ * along with this program. If not, see http://gnu.org/licenses */ -#include "app/system.h" -#include "app/system_windows.h" +#include "common/system/system.h" +#include "common/system/system_windows.h" #include