From 6946155a5686f19a62157af00746f834bec47448 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Fri, 14 Dec 2012 11:17:42 +0100 Subject: Inherit translation setting from environment. This ensures that users with a correctly-defined locale don't need to explicitely set the locale. - By dropping the setlocale content, it fixes the loading of translations. - Add a Debug log message to check what is put in the environment. --- src/common/global.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/global.h b/src/common/global.h index 9704a2b..579db7d 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -29,6 +29,7 @@ */ enum Language { + LANGUAGE_ENV = -1, LANGUAGE_ENGLISH = 0, LANGUAGE_FRENCH = 1, LANGUAGE_GERMAN = 2, -- cgit v1.2.3-1-g7c22 From 56a170391f944f7a042b81fe7e6817a0c28fb005 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 16 Dec 2012 13:22:58 +0100 Subject: Split gtest and gmock, fixed using system packages - split the bundled gtest and gmock libraries - allowed the use of system gmock - refactoring in CMakeLists --- src/common/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index ccbb739..08efdb3 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -7,7 +7,7 @@ include_directories( . ../.. ../../.. -${GTEST_DIR}/include +${GTEST_INCLUDE_DIR} ) -- cgit v1.2.3-1-g7c22 From c190c3efaec57dcb550a57a56538010ff5e2b532 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Sun, 16 Dec 2012 21:29:13 +0100 Subject: Set a default datadir, in sync with the data installation path. --- src/common/config.h.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 8c85df1..7cc2386 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -6,4 +6,6 @@ #cmakedefine PLATFORM_OTHER @PLATFORM_OTHER@ #cmakedefine USE_GLEW @USE_GLEW@ -#cmakedefine GLEW_STATIC \ No newline at end of file +#cmakedefine GLEW_STATIC + +#define CBOT_DEFAULT_DATADIR "@COLOBOT_DATA_DIR@" -- cgit v1.2.3-1-g7c22 From a266692615e146246fd547c5b132a1fcc98b6a10 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Sun, 16 Dec 2012 21:51:12 +0100 Subject: Use default installation paths for i18n. This finishes the work started in 19b75e174338f8e7be7486a7445d1e90e9795077 by actually using the translation where they are installed. --- src/common/config.h.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 8c85df1..f76a780 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -6,4 +6,6 @@ #cmakedefine PLATFORM_OTHER @PLATFORM_OTHER@ #cmakedefine USE_GLEW @USE_GLEW@ -#cmakedefine GLEW_STATIC \ No newline at end of file +#cmakedefine GLEW_STATIC + +#define CBOT_I18N_DIR "@CMAKE_INSTALL_PREFIX@/share/locale/" -- cgit v1.2.3-1-g7c22 From 3c976c040b48caa9f3e75d12a6502e39193ce9a6 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Wed, 19 Dec 2012 16:52:11 +0100 Subject: Don't enforce CMake build type on users. Only set CMAKE_BUILD_TYPE to Debug when no value is provided. --- src/common/test/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index 08efdb3..370213d 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 2.8) -set(CMAKE_BUILD_TYPE debug) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE debug) +endif(NOT CMAKE_BUILD_TYPE) set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wold-style-cast -std=gnu++0x") include_directories( -- cgit v1.2.3-1-g7c22 From 7e9ef0c042fd14373a129ca8a5ac94e9679daee9 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Wed, 19 Dec 2012 16:54:58 +0100 Subject: Put common CXX flags in common variables CMAKE_CXX_FLAGS is taken into account in all builds; build-type-specific flags are appended to it. --- src/common/test/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index 370213d..26a31c9 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 2.8) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE debug) endif(NOT CMAKE_BUILD_TYPE) -set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wold-style-cast -std=gnu++0x") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x") +set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") include_directories( . -- cgit v1.2.3-1-g7c22 From f77734e01c85aded92cf5fdc1e7038658e6aaf29 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Thu, 20 Dec 2012 00:23:12 +0100 Subject: Installation path fixes and CMakeLists refactoring make && make install should now give a working installation. --- src/common/config.h.cmake | 4 ++-- src/common/global.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/common') diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 23b6de8..9b30720 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -8,5 +8,5 @@ #cmakedefine USE_GLEW @USE_GLEW@ #cmakedefine GLEW_STATIC -#define CBOT_DEFAULT_DATADIR "@COLOBOT_DATA_DIR@" -#define CBOT_I18N_DIR "@CMAKE_INSTALL_PREFIX@/share/locale/" +#define COLOBOT_DEFAULT_DATADIR "@COLOBOT_INSTALL_DATA_DIR@" +#define COLOBOT_I18N_DIR "@COLOBOT_INSTALL_I18N_DIR@" diff --git a/src/common/global.h b/src/common/global.h index 2d57ee0..0b2d8ec 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -181,7 +181,6 @@ enum DataDir DIR_AI, //! < ai scripts DIR_FONT, //! < fonts DIR_HELP, //! < help files - DIR_I18N, //! < translations DIR_ICON, //! < icons & images DIR_LEVEL, //! < levels DIR_MODEL, //! < models -- cgit v1.2.3-1-g7c22 From 6d607e3ae8d60d2d5f11f053511a305db415205e Mon Sep 17 00:00:00 2001 From: erihel Date: Fri, 21 Dec 2012 17:31:55 +0100 Subject: latest changes --- src/common/config.h.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common') diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 9b30720..dd280a3 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -10,3 +10,5 @@ #define COLOBOT_DEFAULT_DATADIR "@COLOBOT_INSTALL_DATA_DIR@" #define COLOBOT_I18N_DIR "@COLOBOT_INSTALL_I18N_DIR@" + +#cmakedefine OPENAL_SOUND -- cgit v1.2.3-1-g7c22 From e62996858b2ce2be322eae55f86b4b0ad7172a08 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Thu, 27 Dec 2012 17:10:45 +0100 Subject: Create a central version Make it 0.1.0~pre-alpha for now. - Add it to runtime program - Add it to -help option - Add it to manpage - Update translations --- src/common/config.h.cmake | 4 ++++ src/common/restext.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index dd280a3..022bb69 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -8,6 +8,10 @@ #cmakedefine USE_GLEW @USE_GLEW@ #cmakedefine GLEW_STATIC +#define COLOBOT_VERSION "@COLOBOT_VERSION_FULL@" +#define COLOBOT_CODENAME "@COLOBOT_VERSION_CODENAME@" +#define COLOBOT_FULLNAME "Colobot @COLOBOT_VERSION_CODENAME@" + #define COLOBOT_DEFAULT_DATADIR "@COLOBOT_INSTALL_DATA_DIR@" #define COLOBOT_I18N_DIR "@COLOBOT_INSTALL_I18N_DIR@" diff --git a/src/common/restext.cpp b/src/common/restext.cpp index da06131..4c56ae5 100644 --- a/src/common/restext.cpp +++ b/src/common/restext.cpp @@ -17,6 +17,8 @@ #include "common/restext.h" +#include "common/config.h" + #include "common/global.h" #include "common/event.h" #include "common/logger.h" @@ -39,7 +41,7 @@ const char* stringsCbot[TX_MAX] = { nullptr }; void InitializeRestext() { - stringsText[RT_VERSION_ID] = "Colobot Gold"; + stringsText[RT_VERSION_ID] = COLOBOT_FULLNAME; stringsText[RT_DISINFO_TITLE] = "SatCom"; stringsText[RT_WINDOW_MAXIMIZED] = "Maximize"; -- cgit v1.2.3-1-g7c22 From 3e4c1a1ad88456ebf201b257b91847bd995c8773 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Fri, 28 Dec 2012 13:37:08 +0100 Subject: Replaced malloc/free with new/delete - now new/delete used everywhere except for CBotStack, which has to be fixed in other way - some segfaults should be fixed with this --- src/common/image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/image.cpp b/src/common/image.cpp index f3cfa34..ef8097e 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -124,14 +124,14 @@ bool PNGSaveSurface(const char *filename, SDL_Surface *surf) png_write_info(png_ptr, info_ptr); png_set_packing(png_ptr); - row_pointers = static_cast( malloc(sizeof(png_bytep)*surf->h) ); + row_pointers = new png_bytep[surf->h]; for (i = 0; i < surf->h; i++) row_pointers[i] = static_cast( static_cast(surf->pixels) ) + i*surf->pitch; png_write_image(png_ptr, row_pointers); png_write_end(png_ptr, info_ptr); /* Cleaning out... */ - free(row_pointers); + delete[] row_pointers; png_destroy_write_struct(&png_ptr, &info_ptr); fclose(fp); -- cgit v1.2.3-1-g7c22