Merge branch 'dev' of github:colobot/colobot into dev
commit
08578c4015
|
@ -6,3 +6,5 @@ before_install:
|
||||||
- git submodule update --init --recursive
|
- git submodule update --init --recursive
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install -qq --no-install-recommends libgl1-mesa-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libpng12-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev google-mock libgtest-dev doxygen graphviz po4a librsvg2-bin
|
- sudo apt-get install -qq --no-install-recommends libgl1-mesa-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libpng12-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev google-mock libgtest-dev doxygen graphviz po4a librsvg2-bin
|
||||||
|
notifications:
|
||||||
|
email: false
|
||||||
|
|
|
@ -47,10 +47,27 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Global compile flags
|
# Global compile flags
|
||||||
# These are specific to GCC/MinGW; for other compilers, change as necessary
|
# These are specific to GCC/MinGW/clang; for other compilers, change as necessary
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=c++11")
|
# The flags are used throughout src/ subdir
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
set(COLOBOT_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=c++11")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
set(COLOBOT_CXX_FLAGS_RELEASE "-O2")
|
||||||
|
set(COLOBOT_CXX_FLAGS_DEBUG "-g -O0")
|
||||||
|
|
||||||
|
# Compiler detection
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||||
|
if (NOT (GCC_VERSION VERSION_GREATER 4.6 OR GCC_VERSION VERSION_EQUAL 4.6))
|
||||||
|
message(FATAL_ERROR "${PROJECT_NAME} requires GCC 4.6 or greater.")
|
||||||
|
else()
|
||||||
|
message(STATUS "Detected GCC version 4.6+")
|
||||||
|
endif()
|
||||||
|
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
message(STATUS "Detected Clang compiler")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Your C++ compiler doesn't seem to support C++11.\n"
|
||||||
|
"Supported compilers at this time are GCC 4.6+ and clang.")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Asserts can be enabled/disabled regardless of build type
|
# Asserts can be enabled/disabled regardless of build type
|
||||||
option(ASSERTS "Enable assert()s" ON)
|
option(ASSERTS "Enable assert()s" ON)
|
||||||
|
@ -185,11 +202,11 @@ if(${TESTS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Installation paths defined before compiling sources
|
# Installation paths defined before compiling sources
|
||||||
set(COLOBOT_INSTALL_BIN_DIR games CACHE PATH "Colobot binary directory")
|
set(COLOBOT_INSTALL_BIN_DIR ${CMAKE_INSTALL_PREFIX}/games CACHE PATH "Colobot binary directory")
|
||||||
set(COLOBOT_INSTALL_DATA_DIR share/games/colobot CACHE PATH "Colobot shared data directory")
|
set(COLOBOT_INSTALL_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/games/colobot CACHE PATH "Colobot shared data directory")
|
||||||
set(COLOBOT_INSTALL_LIB_DIR lib/colobot CACHE PATH "Colobot libraries directory")
|
set(COLOBOT_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/colobot CACHE PATH "Colobot libraries directory")
|
||||||
set(COLOBOT_INSTALL_DOC_DIR share/doc/colobot CACHE PATH "Colobot documentation directory")
|
set(COLOBOT_INSTALL_DOC_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/colobot CACHE PATH "Colobot documentation directory")
|
||||||
set(COLOBOT_INSTALL_I18N_DIR share/locale CACHE PATH "Colobot translations directory")
|
set(COLOBOT_INSTALL_I18N_DIR ${CMAKE_INSTALL_PREFIX}/share/locale CACHE PATH "Colobot translations directory")
|
||||||
|
|
||||||
# Subdirectory with sources
|
# Subdirectory with sources
|
||||||
add_subdirectory(src bin)
|
add_subdirectory(src bin)
|
||||||
|
@ -199,10 +216,13 @@ add_subdirectory(src bin)
|
||||||
# Installation
|
# Installation
|
||||||
##
|
##
|
||||||
|
|
||||||
file(GLOB DATA_FILES "data/*")
|
# Data: check if the submodule handles its own installation
|
||||||
|
if(EXISTS "${CMAKE_SOURCE_DIR}/data/CMakeLists.txt")
|
||||||
# Data
|
message(STATUS "Data directory will install itself.")
|
||||||
install(DIRECTORY data/ DESTINATION ${COLOBOT_INSTALL_DATA_DIR})
|
add_subdirectory(data)
|
||||||
|
else()
|
||||||
|
message(WARNING "Data directory is not available; make sure colobot-data is installed in ${COLOBOT_INSTALL_DATA_DIR}.")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
if(INSTALL_DOCS AND DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
|
if(INSTALL_DOCS AND DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
|
||||||
|
|
2
data
2
data
|
@ -1 +1 @@
|
||||||
Subproject commit 6b6e5a0ab56bf42f17d969c1bd4c09185605cad6
|
Subproject commit 5a991a77eb5f476d29b4d4f976be48fdf74a053f
|
|
@ -1,5 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${${ORIGINAL_CXX_FLAGS}}")
|
||||||
|
|
||||||
include_directories(. include ${GTEST_INCLUDE_DIR})
|
include_directories(. include ${GTEST_INCLUDE_DIR})
|
||||||
|
|
||||||
# gmock-all.cc includes all other sources
|
# gmock-all.cc includes all other sources
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
# CBot library is built separately
|
# Compile flags as defined in global CMakeLists
|
||||||
|
set(CMAKE_CXX_FLAGS ${COLOBOT_CXX_FLAGS})
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE ${COLOBOT_CXX_FLAGS_RELEASE})
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG ${COLOBOT_CXX_FLAGS_DEBUG})
|
||||||
|
|
||||||
|
|
||||||
|
# Subdirectories
|
||||||
|
|
||||||
add_subdirectory(CBot)
|
add_subdirectory(CBot)
|
||||||
|
|
||||||
# Tools directory is built separately
|
|
||||||
add_subdirectory(tools)
|
add_subdirectory(tools)
|
||||||
|
|
||||||
add_subdirectory(po)
|
add_subdirectory(po)
|
||||||
|
@ -196,10 +202,16 @@ ${OPTIONAL_LIBS}
|
||||||
${PLATFORM_LIBS}
|
${PLATFORM_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Local
|
||||||
include_directories(
|
include_directories(
|
||||||
.
|
.
|
||||||
..
|
..
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
# System
|
||||||
|
include_directories(
|
||||||
|
SYSTEM
|
||||||
${SDL_INCLUDE_DIR}
|
${SDL_INCLUDE_DIR}
|
||||||
${SDLIMAGE_INCLUDE_DIR}
|
${SDLIMAGE_INCLUDE_DIR}
|
||||||
${SDLTTF_INCLUDE_DIR}
|
${SDLTTF_INCLUDE_DIR}
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
namespace Gfx {
|
template<> Gfx::CModelManager* CSingleton<Gfx::CModelManager>::mInstance = nullptr;
|
||||||
|
|
||||||
template<> CModelManager* CSingleton<CModelManager>::mInstance = nullptr;
|
namespace Gfx {
|
||||||
|
|
||||||
CModelManager::CModelManager(CEngine* engine)
|
CModelManager::CModelManager(CEngine* engine)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4277,6 +4277,7 @@ void CMainDialog::IOReadName()
|
||||||
CEdit* pe;
|
CEdit* pe;
|
||||||
std::string filename;
|
std::string filename;
|
||||||
char op[100];
|
char op[100];
|
||||||
|
char op_i18n[100];
|
||||||
char line[500];
|
char line[500];
|
||||||
char resume[100];
|
char resume[100];
|
||||||
char name[100];
|
char name[100];
|
||||||
|
@ -4290,6 +4291,9 @@ void CMainDialog::IOReadName()
|
||||||
|
|
||||||
sprintf(resume, "%s %d", m_sceneName, m_chap[m_index]+1);
|
sprintf(resume, "%s %d", m_sceneName, m_chap[m_index]+1);
|
||||||
BuildSceneName(filename, m_sceneName, (m_chap[m_index]+1)*100);
|
BuildSceneName(filename, m_sceneName, (m_chap[m_index]+1)*100);
|
||||||
|
sprintf(op, "Title.E");
|
||||||
|
sprintf(op_i18n, "Title.%c", m_app->GetLanguageChar() );
|
||||||
|
|
||||||
file = fopen(filename.c_str(), "r");
|
file = fopen(filename.c_str(), "r");
|
||||||
if ( file != NULL )
|
if ( file != NULL )
|
||||||
{
|
{
|
||||||
|
@ -4305,9 +4309,11 @@ void CMainDialog::IOReadName()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Fallback to an non-localized entry
|
|
||||||
sprintf(op, "Title.%c", m_app->GetLanguageChar() );
|
|
||||||
if ( Cmd(line, op) )
|
if ( Cmd(line, op) )
|
||||||
|
{
|
||||||
|
OpString(line, "resume", resume);
|
||||||
|
}
|
||||||
|
if ( Cmd(line, op_i18n) )
|
||||||
{
|
{
|
||||||
OpString(line, "resume", resume);
|
OpString(line, "resume", resume);
|
||||||
break;
|
break;
|
||||||
|
@ -4648,12 +4654,14 @@ void CMainDialog::UpdateSceneChap(int &chap)
|
||||||
//struct _finddata_t fileBuffer;
|
//struct _finddata_t fileBuffer;
|
||||||
std::string fileName;
|
std::string fileName;
|
||||||
char op[100];
|
char op[100];
|
||||||
|
char op_i18n[100];
|
||||||
char line[500];
|
char line[500];
|
||||||
char name[100];
|
char name[100];
|
||||||
int i, j;
|
int i, j;
|
||||||
bool bPassed;
|
bool bPassed;
|
||||||
|
|
||||||
memset(op, 0, 100);
|
memset(op, 0, 100);
|
||||||
|
memset(op_i18n, 0, 100);
|
||||||
memset(line, 0, 500);
|
memset(line, 0, 500);
|
||||||
memset(name, 0, 100);
|
memset(name, 0, 100);
|
||||||
|
|
||||||
|
@ -4689,6 +4697,9 @@ void CMainDialog::UpdateSceneChap(int &chap)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BuildResumeName(name, m_sceneName, j+1); // default name
|
BuildResumeName(name, m_sceneName, j+1); // default name
|
||||||
|
sprintf(op, "Title.E");
|
||||||
|
sprintf(op_i18n, "Title.%c", m_app->GetLanguageChar());
|
||||||
|
|
||||||
while ( fgets(line, 500, file) != NULL )
|
while ( fgets(line, 500, file) != NULL )
|
||||||
{
|
{
|
||||||
for ( i=0 ; i<500 ; i++ )
|
for ( i=0 ; i<500 ; i++ )
|
||||||
|
@ -4701,9 +4712,11 @@ void CMainDialog::UpdateSceneChap(int &chap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Fallback to an non-localized entry
|
|
||||||
sprintf(op, "Title.%c", m_app->GetLanguageChar());
|
|
||||||
if ( Cmd(line, op) )
|
if ( Cmd(line, op) )
|
||||||
|
{
|
||||||
|
OpString(line, "text", name);
|
||||||
|
}
|
||||||
|
if ( Cmd(line, op_i18n) )
|
||||||
{
|
{
|
||||||
OpString(line, "text", name);
|
OpString(line, "text", name);
|
||||||
break;
|
break;
|
||||||
|
@ -4736,6 +4749,9 @@ void CMainDialog::UpdateSceneChap(int &chap)
|
||||||
if ( file == NULL ) break;
|
if ( file == NULL ) break;
|
||||||
|
|
||||||
BuildResumeName(name, m_sceneName, j+1); // default name
|
BuildResumeName(name, m_sceneName, j+1); // default name
|
||||||
|
sprintf(op, "Title.E");
|
||||||
|
sprintf(op_i18n, "Title.%c", m_app->GetLanguageChar());
|
||||||
|
|
||||||
while ( fgets(line, 500, file) != NULL )
|
while ( fgets(line, 500, file) != NULL )
|
||||||
{
|
{
|
||||||
for ( i=0 ; i<500 ; i++ )
|
for ( i=0 ; i<500 ; i++ )
|
||||||
|
@ -4748,9 +4764,11 @@ void CMainDialog::UpdateSceneChap(int &chap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Fallback to an non-localized entry
|
|
||||||
sprintf(op, "Title.%c", m_app->GetLanguageChar());
|
|
||||||
if ( Cmd(line, op) )
|
if ( Cmd(line, op) )
|
||||||
|
{
|
||||||
|
OpString(line, "text", name);
|
||||||
|
}
|
||||||
|
if ( Cmd(line, op_i18n) )
|
||||||
{
|
{
|
||||||
OpString(line, "text", name);
|
OpString(line, "text", name);
|
||||||
break;
|
break;
|
||||||
|
@ -4801,12 +4819,14 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
|
||||||
CList* pl;
|
CList* pl;
|
||||||
std::string fileName;
|
std::string fileName;
|
||||||
char op[100];
|
char op[100];
|
||||||
|
char op_i18n[100];
|
||||||
char line[500];
|
char line[500];
|
||||||
char name[100];
|
char name[100];
|
||||||
int i, j;
|
int i, j;
|
||||||
bool bPassed;
|
bool bPassed;
|
||||||
|
|
||||||
memset(op, 0, 100);
|
memset(op, 0, 100);
|
||||||
|
memset(op_i18n, 0, 100);
|
||||||
memset(line, 0, 500);
|
memset(line, 0, 500);
|
||||||
memset(name, 0, 100);
|
memset(name, 0, 100);
|
||||||
|
|
||||||
|
@ -4839,6 +4859,9 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
|
||||||
if ( file == NULL ) break;
|
if ( file == NULL ) break;
|
||||||
|
|
||||||
BuildResumeName(name, m_sceneName, j+1); // default name
|
BuildResumeName(name, m_sceneName, j+1); // default name
|
||||||
|
sprintf(op, "Title.E");
|
||||||
|
sprintf(op_i18n, "Title.%c", m_app->GetLanguageChar());
|
||||||
|
|
||||||
while ( fgets(line, 500, file) != NULL )
|
while ( fgets(line, 500, file) != NULL )
|
||||||
{
|
{
|
||||||
for ( i=0 ; i<500 ; i++ )
|
for ( i=0 ; i<500 ; i++ )
|
||||||
|
@ -4851,9 +4874,11 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Fallback to an non-localized entry
|
|
||||||
sprintf(op, "Title.%c", m_app->GetLanguageChar());
|
|
||||||
if ( Cmd(line, op) )
|
if ( Cmd(line, op) )
|
||||||
|
{
|
||||||
|
OpString(line, "text", name);
|
||||||
|
}
|
||||||
|
if ( Cmd(line, op_i18n) )
|
||||||
{
|
{
|
||||||
OpString(line, "text", name);
|
OpString(line, "text", name);
|
||||||
break;
|
break;
|
||||||
|
@ -4950,6 +4975,7 @@ void CMainDialog::UpdateSceneResume(int rank)
|
||||||
CCheck* pc;
|
CCheck* pc;
|
||||||
std::string fileName;
|
std::string fileName;
|
||||||
char op[100];
|
char op[100];
|
||||||
|
char op_i18n[100];
|
||||||
char line[500];
|
char line[500];
|
||||||
char name[500];
|
char name[500];
|
||||||
int i, numTry;
|
int i, numTry;
|
||||||
|
@ -4980,6 +5006,9 @@ void CMainDialog::UpdateSceneResume(int rank)
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildSceneName(fileName, m_sceneName, rank);
|
BuildSceneName(fileName, m_sceneName, rank);
|
||||||
|
sprintf(op, "Resume.E");
|
||||||
|
sprintf(op_i18n, "Resume.%c", m_app->GetLanguageChar());
|
||||||
|
|
||||||
file = fopen(fileName.c_str(), "r");
|
file = fopen(fileName.c_str(), "r");
|
||||||
if ( file == NULL ) return;
|
if ( file == NULL ) return;
|
||||||
|
|
||||||
|
@ -4996,9 +5025,11 @@ void CMainDialog::UpdateSceneResume(int rank)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Fallback to an non-localized entry
|
|
||||||
sprintf(op, "Resume.%c", m_app->GetLanguageChar());
|
|
||||||
if ( Cmd(line, op) )
|
if ( Cmd(line, op) )
|
||||||
|
{
|
||||||
|
OpString(line, "text", name);
|
||||||
|
}
|
||||||
|
if ( Cmd(line, op_i18n) )
|
||||||
{
|
{
|
||||||
OpString(line, "text", name);
|
OpString(line, "text", name);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue