More details on terrain loading

master
krzys-h 2015-08-07 23:40:38 +02:00
parent d27a8978cc
commit bb3fc63e03
10 changed files with 98 additions and 3 deletions

View File

@ -279,6 +279,18 @@ msgstr ""
msgid "Loading finished!" msgid "Loading finished!"
msgstr "" msgstr ""
msgid "Terrain relief"
msgstr ""
msgid "Resources"
msgstr ""
msgid "Textures"
msgstr ""
msgid "Generating"
msgstr ""
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""

View File

@ -649,6 +649,9 @@ msgstr "Spiel\\Gameplay Einstellungen"
msgid "Gantry crane" msgid "Gantry crane"
msgstr "Träger" msgstr "Träger"
msgid "Generating"
msgstr ""
msgid "Gold Edition development by:" msgid "Gold Edition development by:"
msgstr "Goldausgabe Entwicklung von:" msgstr "Goldausgabe Entwicklung von:"
@ -1261,6 +1264,9 @@ msgstr "Dieses Wort ist reserviert"
msgid "Resolution" msgid "Resolution"
msgstr "Auflösung" msgstr "Auflösung"
msgid "Resources"
msgstr ""
msgid "Restart\\Restart the mission from the beginning" msgid "Restart\\Restart the mission from the beginning"
msgstr "Neu anfangen\\Die Mission von vorne anfangen" msgstr "Neu anfangen\\Die Mission von vorne anfangen"
@ -1506,9 +1512,15 @@ msgstr "Zielscheibe"
msgid "Target bot" msgid "Target bot"
msgstr "Mobile Zielscheibe" msgstr "Mobile Zielscheibe"
msgid "Terrain relief"
msgstr ""
msgid "Texture filtering\\Texture filtering" msgid "Texture filtering\\Texture filtering"
msgstr "" msgstr ""
msgid "Textures"
msgstr ""
msgid "The expression must return a boolean value" msgid "The expression must return a boolean value"
msgstr "Der Ausdruck muss einen boolschen Wert ergeben" msgstr "Der Ausdruck muss einen boolschen Wert ergeben"

View File

@ -644,6 +644,9 @@ msgstr "Jeu\\Options de jouabilité"
msgid "Gantry crane" msgid "Gantry crane"
msgstr "Portique" msgstr "Portique"
msgid "Generating"
msgstr ""
msgid "Gold Edition development by:" msgid "Gold Edition development by:"
msgstr "Edition d'Or développé par :" msgstr "Edition d'Or développé par :"
@ -1256,6 +1259,9 @@ msgstr "Ce mot est réservé"
msgid "Resolution" msgid "Resolution"
msgstr "Résolution" msgstr "Résolution"
msgid "Resources"
msgstr ""
msgid "Restart\\Restart the mission from the beginning" msgid "Restart\\Restart the mission from the beginning"
msgstr "Recommencer\\Recommencer la mission au début" msgstr "Recommencer\\Recommencer la mission au début"
@ -1502,9 +1508,15 @@ msgstr "Cible"
msgid "Target bot" msgid "Target bot"
msgstr "Cible d'entraînement" msgstr "Cible d'entraînement"
msgid "Terrain relief"
msgstr ""
msgid "Texture filtering\\Texture filtering" msgid "Texture filtering\\Texture filtering"
msgstr "" msgstr ""
msgid "Textures"
msgstr ""
msgid "The expression must return a boolean value" msgid "The expression must return a boolean value"
msgstr "L'expression doit ętre un boolean" msgstr "L'expression doit ętre un boolean"

View File

@ -651,6 +651,9 @@ msgstr "Gra\\Ustawienia gry"
msgid "Gantry crane" msgid "Gantry crane"
msgstr "Żuraw przesuwalny" msgstr "Żuraw przesuwalny"
msgid "Generating"
msgstr "Generowanie"
msgid "Gold Edition development by:" msgid "Gold Edition development by:"
msgstr "Twórcy Złotej Edycji:" msgstr "Twórcy Złotej Edycji:"
@ -1258,6 +1261,9 @@ msgstr "Słowo zarezerwowane języka CBOT"
msgid "Resolution" msgid "Resolution"
msgstr "Rozdzielczość" msgstr "Rozdzielczość"
msgid "Resources"
msgstr "Zasoby"
msgid "Restart\\Restart the mission from the beginning" msgid "Restart\\Restart the mission from the beginning"
msgstr "Uruchom ponownie\\Uruchamia ponownie misję od początku" msgstr "Uruchom ponownie\\Uruchamia ponownie misję od początku"
@ -1500,9 +1506,15 @@ msgstr "Cel"
msgid "Target bot" msgid "Target bot"
msgstr "Robot cel" msgstr "Robot cel"
msgid "Terrain relief"
msgstr "Rzeźba terenu"
msgid "Texture filtering\\Texture filtering" msgid "Texture filtering\\Texture filtering"
msgstr "" msgstr ""
msgid "Textures"
msgstr "Tekstury"
msgid "The expression must return a boolean value" msgid "The expression must return a boolean value"
msgstr "Wyrażenie musi zwrócić wartość logiczną" msgstr "Wyrażenie musi zwrócić wartość logiczną"

View File

@ -643,6 +643,9 @@ msgstr "Игра\\Настройки игры"
msgid "Gantry crane" msgid "Gantry crane"
msgstr "Козловой кран" msgstr "Козловой кран"
msgid "Generating"
msgstr ""
msgid "Gold Edition development by:" msgid "Gold Edition development by:"
msgstr "\"Золотое издание\" было разработано:" msgstr "\"Золотое издание\" было разработано:"
@ -1256,6 +1259,9 @@ msgstr "Резервное ключевое слово языка CBOT"
msgid "Resolution" msgid "Resolution"
msgstr "Разрешение" msgstr "Разрешение"
msgid "Resources"
msgstr ""
msgid "Restart\\Restart the mission from the beginning" msgid "Restart\\Restart the mission from the beginning"
msgstr "Заново\\Начать данную миссию с начала" msgstr "Заново\\Начать данную миссию с начала"
@ -1498,9 +1504,15 @@ msgstr "Цель"
msgid "Target bot" msgid "Target bot"
msgstr "Целевой бот" msgstr "Целевой бот"
msgid "Terrain relief"
msgstr ""
msgid "Texture filtering\\Texture filtering" msgid "Texture filtering\\Texture filtering"
msgstr "" msgstr ""
msgid "Textures"
msgstr ""
msgid "The expression must return a boolean value" msgid "The expression must return a boolean value"
msgstr "Выражение должно возвращать логическое значение" msgstr "Выражение должно возвращать логическое значение"

View File

@ -156,6 +156,10 @@ void InitializeRestext()
stringsText[RT_LOADING_PROGRAMS] = TR("Loading programs"); stringsText[RT_LOADING_PROGRAMS] = TR("Loading programs");
stringsText[RT_LOADING_CBOT_SAVE] = TR("Restoring CBot execution state"); stringsText[RT_LOADING_CBOT_SAVE] = TR("Restoring CBot execution state");
stringsText[RT_LOADING_FINISHED] = TR("Loading finished!"); stringsText[RT_LOADING_FINISHED] = TR("Loading finished!");
stringsText[RT_LOADING_TERRAIN_RELIEF] = TR("Terrain relief");
stringsText[RT_LOADING_TERRAIN_RES] = TR("Resources");
stringsText[RT_LOADING_TERRAIN_TEX] = TR("Textures");
stringsText[RT_LOADING_TERRAIN_GEN] = TR("Generating");

View File

@ -155,6 +155,10 @@ enum ResTextType
RT_LOADING_PROGRAMS = 217, RT_LOADING_PROGRAMS = 217,
RT_LOADING_CBOT_SAVE = 218, RT_LOADING_CBOT_SAVE = 218,
RT_LOADING_FINISHED = 219, RT_LOADING_FINISHED = 219,
RT_LOADING_TERRAIN_RELIEF = 220,
RT_LOADING_TERRAIN_RES = 221,
RT_LOADING_TERRAIN_TEX = 222,
RT_LOADING_TERRAIN_GEN = 223,
RT_MAX //! < number of values RT_MAX //! < number of values

View File

@ -3267,6 +3267,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (line->GetCommand() == "TerrainRelief" && !resetObject) if (line->GetCommand() == "TerrainRelief" && !resetObject)
{ {
m_ui->GetLoadingScreen()->SetProgress(0.2f+(1.f/5.f)*0.05f, RT_LOADING_TERRAIN, RT_LOADING_TERRAIN_RELIEF);
m_terrain->LoadRelief( m_terrain->LoadRelief(
line->GetParam("image")->AsPath("textures"), line->GetParam("image")->AsPath("textures"),
line->GetParam("factor")->AsFloat(1.0f), line->GetParam("factor")->AsFloat(1.0f),
@ -3276,12 +3277,14 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (line->GetCommand() == "TerrainRandomRelief" && !resetObject) if (line->GetCommand() == "TerrainRandomRelief" && !resetObject)
{ {
m_ui->GetLoadingScreen()->SetProgress(0.2f+(1.f/5.f)*0.05f, RT_LOADING_TERRAIN, RT_LOADING_TERRAIN_RELIEF);
m_terrain->RandomizeRelief(); m_terrain->RandomizeRelief();
continue; continue;
} }
if (line->GetCommand() == "TerrainResource" && !resetObject) if (line->GetCommand() == "TerrainResource" && !resetObject)
{ {
m_ui->GetLoadingScreen()->SetProgress(0.2f+(2.f/5.f)*0.05f, RT_LOADING_TERRAIN, RT_LOADING_TERRAIN_RES);
m_terrain->LoadResources(line->GetParam("image")->AsPath("textures")); m_terrain->LoadResources(line->GetParam("image")->AsPath("textures"));
continue; continue;
} }
@ -3333,6 +3336,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (line->GetCommand() == "TerrainInitTextures" && !resetObject) if (line->GetCommand() == "TerrainInitTextures" && !resetObject)
{ {
m_ui->GetLoadingScreen()->SetProgress(0.2f+(3.f/5.f)*0.05f, RT_LOADING_TERRAIN, RT_LOADING_TERRAIN_TEX);
std::string name = "../" + line->GetParam("image")->AsPath("textures"); std::string name = "../" + line->GetParam("image")->AsPath("textures");
if (name.find(".") == std::string::npos) if (name.find(".") == std::string::npos)
name += ".png"; name += ".png";
@ -3400,6 +3404,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (line->GetCommand() == "TerrainLevel" && !resetObject) if (line->GetCommand() == "TerrainLevel" && !resetObject)
{ {
m_ui->GetLoadingScreen()->SetProgress(0.2f+(3.f/5.f)*0.05f, RT_LOADING_TERRAIN, RT_LOADING_TERRAIN_TEX);
int id[50]; //TODO: I have no idea how TerrainLevel works, but maybe we should remove the limit to 50? int id[50]; //TODO: I have no idea how TerrainLevel works, but maybe we should remove the limit to 50?
if (line->GetParam("id")->IsDefined()) if (line->GetParam("id")->IsDefined())
{ {
@ -3430,6 +3435,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (line->GetCommand() == "TerrainCreate" && !resetObject) if (line->GetCommand() == "TerrainCreate" && !resetObject)
{ {
m_ui->GetLoadingScreen()->SetProgress(0.2f+(4.f/5.f)*0.05f, RT_LOADING_TERRAIN, RT_LOADING_TERRAIN_GEN);
m_terrain->CreateObjects(); m_terrain->CreateObjects();
continue; continue;
} }

View File

@ -146,9 +146,18 @@ void CScreenLoading::SetProgress(float progress, const std::string& text, const
pg->SetLevel(progress); pg->SetLevel(progress);
} }
SetBackground("textures/interface/interface.png"); if (progress != m_lastProgress ||
m_engine->SetBackForce(true); text != m_lastText ||
m_app->Render(); details != m_lastDetails )
{
SetBackground("textures/interface/interface.png");
m_engine->SetBackForce(true);
m_app->Render();
}
m_lastProgress = progress;
m_lastText = text;
m_lastDetails = details;
} }
void CScreenLoading::SetProgress(float progress, ResTextType text, const std::string& details) void CScreenLoading::SetProgress(float progress, ResTextType text, const std::string& details)
@ -158,4 +167,11 @@ void CScreenLoading::SetProgress(float progress, ResTextType text, const std::st
SetProgress(progress, name, details); SetProgress(progress, name, details);
} }
void CScreenLoading::SetProgress(float progress, ResTextType text, ResTextType details)
{
std::string name;
GetResource(RES_TEXT, details, name);
SetProgress(progress, text, name);
}
} // namespace Ui } // namespace Ui

View File

@ -39,9 +39,14 @@ public:
void SetProgress(float progress, const std::string& text, const std::string& details = ""); void SetProgress(float progress, const std::string& text, const std::string& details = "");
void SetProgress(float progress, ResTextType text, const std::string& details = ""); void SetProgress(float progress, ResTextType text, const std::string& details = "");
void SetProgress(float progress, ResTextType text, ResTextType details);
protected: protected:
bool m_visible; bool m_visible;
float m_lastProgress;
std::string m_lastText;
std::string m_lastDetails;
}; };
} // namespace Ui } // namespace Ui