diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/config.h.cmake | 11 | ||||
-rw-r--r-- | src/common/global.h | 2 | ||||
-rw-r--r-- | src/common/image.cpp | 4 | ||||
-rw-r--r-- | src/common/restext.cpp | 4 | ||||
-rw-r--r-- | src/common/test/CMakeLists.txt | 9 |
5 files changed, 22 insertions, 8 deletions
diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 8c85df1..022bb69 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -6,4 +6,13 @@ #cmakedefine PLATFORM_OTHER @PLATFORM_OTHER@ #cmakedefine USE_GLEW @USE_GLEW@ -#cmakedefine GLEW_STATIC
\ No newline at end of file +#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@" + +#cmakedefine OPENAL_SOUND diff --git a/src/common/global.h b/src/common/global.h index 864f0a4..0b2d8ec 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -165,6 +165,7 @@ enum Error */ enum Language { + LANGUAGE_ENV = -1, LANGUAGE_ENGLISH = 0, LANGUAGE_FRENCH = 1, LANGUAGE_GERMAN = 2, @@ -180,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 diff --git a/src/common/image.cpp b/src/common/image.cpp index 638304e..be5711d 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<png_bytep*>( 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<png_bytep>( static_cast<Uint8 *>(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); 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"; diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index ccbb739..26a31c9 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -1,13 +1,16 @@ cmake_minimum_required(VERSION 2.8) -set(CMAKE_BUILD_TYPE debug) -set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wold-style-cast -std=gnu++0x") +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE debug) +endif(NOT CMAKE_BUILD_TYPE) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x") +set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") include_directories( . ../.. ../../.. -${GTEST_DIR}/include +${GTEST_INCLUDE_DIR} ) |