summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2013-01-09 23:21:37 +0100
committererihel <erihel@gmail.com>2013-01-09 23:21:37 +0100
commit08578c401565c200a205317327c7b0c6f4bb65e1 (patch)
tree34185d4dbd821bb759b514c3b07d6f2863be4147 /src
parent983373f150f6b122e92f054fa1b8e1af60b21197 (diff)
parentcf722462438707871e53bd96235b767e77dce6d3 (diff)
downloadcolobot-08578c401565c200a205317327c7b0c6f4bb65e1.tar.gz
colobot-08578c401565c200a205317327c7b0c6f4bb65e1.tar.bz2
colobot-08578c401565c200a205317327c7b0c6f4bb65e1.zip
Merge branch 'dev' of github:colobot/colobot into dev
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt16
-rw-r--r--src/graphics/engine/modelmanager.cpp4
-rw-r--r--src/ui/maindialog.cpp51
3 files changed, 57 insertions, 14 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c00d347..a90b735 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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)
-# Tools directory is built separately
add_subdirectory(tools)
add_subdirectory(po)
@@ -196,10 +202,16 @@ ${OPTIONAL_LIBS}
${PLATFORM_LIBS}
)
+# Local
include_directories(
.
..
${CMAKE_CURRENT_BINARY_DIR}
+)
+
+# System
+include_directories(
+SYSTEM
${SDL_INCLUDE_DIR}
${SDLIMAGE_INCLUDE_DIR}
${SDLTTF_INCLUDE_DIR}
diff --git a/src/graphics/engine/modelmanager.cpp b/src/graphics/engine/modelmanager.cpp
index afaa718..5b17769 100644
--- a/src/graphics/engine/modelmanager.cpp
+++ b/src/graphics/engine/modelmanager.cpp
@@ -8,9 +8,9 @@
#include <cstdio>
-namespace Gfx {
+template<> Gfx::CModelManager* CSingleton<Gfx::CModelManager>::mInstance = nullptr;
-template<> CModelManager* CSingleton<CModelManager>::mInstance = nullptr;
+namespace Gfx {
CModelManager::CModelManager(CEngine* engine)
{
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index 68e7854..bbba825 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -4277,6 +4277,7 @@ void CMainDialog::IOReadName()
CEdit* pe;
std::string filename;
char op[100];
+ char op_i18n[100];
char line[500];
char resume[100];
char name[100];
@@ -4290,6 +4291,9 @@ void CMainDialog::IOReadName()
sprintf(resume, "%s %d", m_sceneName, m_chap[m_index]+1);
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");
if ( file != NULL )
{
@@ -4305,11 +4309,13 @@ void CMainDialog::IOReadName()
}
}
- // TODO: Fallback to an non-localized entry
- sprintf(op, "Title.%c", m_app->GetLanguageChar() );
if ( Cmd(line, op) )
{
OpString(line, "resume", resume);
+ }
+ if ( Cmd(line, op_i18n) )
+ {
+ OpString(line, "resume", resume);
break;
}
}
@@ -4648,12 +4654,14 @@ void CMainDialog::UpdateSceneChap(int &chap)
//struct _finddata_t fileBuffer;
std::string fileName;
char op[100];
+ char op_i18n[100];
char line[500];
char name[100];
int i, j;
bool bPassed;
memset(op, 0, 100);
+ memset(op_i18n, 0, 100);
memset(line, 0, 500);
memset(name, 0, 100);
@@ -4689,6 +4697,9 @@ void CMainDialog::UpdateSceneChap(int &chap)
else
{
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 )
{
for ( i=0 ; i<500 ; i++ )
@@ -4701,11 +4712,13 @@ void CMainDialog::UpdateSceneChap(int &chap)
}
}
- // TODO: Fallback to an non-localized entry
- sprintf(op, "Title.%c", m_app->GetLanguageChar());
if ( Cmd(line, op) )
{
OpString(line, "text", name);
+ }
+ if ( Cmd(line, op_i18n) )
+ {
+ OpString(line, "text", name);
break;
}
}
@@ -4736,6 +4749,9 @@ void CMainDialog::UpdateSceneChap(int &chap)
if ( file == NULL ) break;
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 )
{
for ( i=0 ; i<500 ; i++ )
@@ -4748,11 +4764,13 @@ void CMainDialog::UpdateSceneChap(int &chap)
}
}
- // TODO: Fallback to an non-localized entry
- sprintf(op, "Title.%c", m_app->GetLanguageChar());
if ( Cmd(line, op) )
{
OpString(line, "text", name);
+ }
+ if ( Cmd(line, op_i18n) )
+ {
+ OpString(line, "text", name);
break;
}
}
@@ -4801,12 +4819,14 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
CList* pl;
std::string fileName;
char op[100];
+ char op_i18n[100];
char line[500];
char name[100];
int i, j;
bool bPassed;
memset(op, 0, 100);
+ memset(op_i18n, 0, 100);
memset(line, 0, 500);
memset(name, 0, 100);
@@ -4839,6 +4859,9 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
if ( file == NULL ) break;
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 )
{
for ( i=0 ; i<500 ; i++ )
@@ -4851,11 +4874,13 @@ 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) )
{
OpString(line, "text", name);
+ }
+ if ( Cmd(line, op_i18n) )
+ {
+ OpString(line, "text", name);
break;
}
}
@@ -4950,6 +4975,7 @@ void CMainDialog::UpdateSceneResume(int rank)
CCheck* pc;
std::string fileName;
char op[100];
+ char op_i18n[100];
char line[500];
char name[500];
int i, numTry;
@@ -4980,6 +5006,9 @@ void CMainDialog::UpdateSceneResume(int rank)
}
BuildSceneName(fileName, m_sceneName, rank);
+ sprintf(op, "Resume.E");
+ sprintf(op_i18n, "Resume.%c", m_app->GetLanguageChar());
+
file = fopen(fileName.c_str(), "r");
if ( file == NULL ) return;
@@ -4996,11 +5025,13 @@ void CMainDialog::UpdateSceneResume(int rank)
}
}
- // TODO: Fallback to an non-localized entry
- sprintf(op, "Resume.%c", m_app->GetLanguageChar());
if ( Cmd(line, op) )
{
OpString(line, "text", name);
+ }
+ if ( Cmd(line, op_i18n) )
+ {
+ OpString(line, "text", name);
break;
}
}