2010-04-01 02:13:28 +02:00
|
|
|
// ==============================================================
|
|
|
|
// This file is part of Glest (www.glest.org)
|
|
|
|
//
|
2011-12-14 08:40:48 +01:00
|
|
|
// Copyright (C) 2001-2008 Martiño Figueroa
|
2010-04-01 02:13:28 +02:00
|
|
|
//
|
2010-12-09 21:41:11 +01:00
|
|
|
// You can redistribute this code and/or modify it under
|
|
|
|
// the terms of the GNU General Public License as published
|
|
|
|
// by the Free Software Foundation; either version 2 of the
|
2010-04-01 02:13:28 +02:00
|
|
|
// License, or (at your option) any later version
|
|
|
|
// ==============================================================
|
|
|
|
|
|
|
|
#include "core_data.h"
|
|
|
|
|
|
|
|
#include "logger.h"
|
|
|
|
#include "renderer.h"
|
|
|
|
#include "graphics_interface.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "util.h"
|
2010-08-06 00:27:26 +02:00
|
|
|
#include "platform_util.h"
|
2010-12-09 21:41:11 +01:00
|
|
|
#include "game_constants.h"
|
|
|
|
#include "game_util.h"
|
2011-05-25 21:03:22 +02:00
|
|
|
#include "lang.h"
|
2011-12-03 09:17:49 +01:00
|
|
|
#include "game_settings.h"
|
2012-05-19 10:40:49 +02:00
|
|
|
#include "video_player.h"
|
2010-04-01 02:13:28 +02:00
|
|
|
#include "leak_dumper.h"
|
|
|
|
|
|
|
|
using namespace Shared::Sound;
|
|
|
|
using namespace Shared::Graphics;
|
|
|
|
using namespace Shared::Util;
|
|
|
|
|
|
|
|
namespace Glest{ namespace Game{
|
|
|
|
|
|
|
|
// =====================================================
|
|
|
|
// class CoreData
|
|
|
|
// =====================================================
|
|
|
|
|
|
|
|
// ===================== PUBLIC ========================
|
|
|
|
|
2010-12-09 21:41:11 +01:00
|
|
|
CoreData &CoreData::getInstance() {
|
2010-04-01 02:13:28 +02:00
|
|
|
static CoreData coreData;
|
|
|
|
return coreData;
|
|
|
|
}
|
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
CoreData::CoreData() {
|
|
|
|
logoTexture=NULL;
|
|
|
|
logoTextureList.clear();
|
|
|
|
backgroundTexture=NULL;
|
|
|
|
fireTexture=NULL;
|
|
|
|
teamColorTexture=NULL;
|
|
|
|
snowTexture=NULL;
|
|
|
|
waterSplashTexture=NULL;
|
|
|
|
customTexture=NULL;
|
|
|
|
buttonSmallTexture=NULL;
|
|
|
|
buttonBigTexture=NULL;
|
|
|
|
horizontalLineTexture=NULL;
|
|
|
|
verticalLineTexture=NULL;
|
|
|
|
checkBoxTexture=NULL;
|
|
|
|
checkedCheckBoxTexture=NULL;
|
|
|
|
gameWinnerTexture=NULL;
|
|
|
|
notOnServerTexture=NULL;
|
|
|
|
onServerDifferentTexture=NULL;
|
|
|
|
onServerTexture=NULL;
|
|
|
|
onServerInstalledTexture=NULL;
|
|
|
|
|
|
|
|
miscTextureList.clear();
|
|
|
|
|
|
|
|
displayFont=NULL;
|
|
|
|
menuFontNormal=NULL;
|
|
|
|
displayFontSmall=NULL;
|
|
|
|
menuFontBig=NULL;
|
|
|
|
menuFontVeryBig=NULL;
|
|
|
|
consoleFont=NULL;
|
|
|
|
|
|
|
|
displayFont3D=NULL;
|
|
|
|
menuFontNormal3D=NULL;
|
|
|
|
displayFontSmall3D=NULL;
|
|
|
|
menuFontBig3D=NULL;
|
|
|
|
menuFontVeryBig3D=NULL;
|
|
|
|
consoleFont3D=NULL;
|
2012-05-19 10:40:49 +02:00
|
|
|
|
|
|
|
introVideoFilename="";
|
|
|
|
mainMenuVideoFilename="";
|
2011-10-25 20:39:11 +02:00
|
|
|
}
|
|
|
|
|
2010-12-09 21:41:11 +01:00
|
|
|
CoreData::~CoreData() {
|
2011-12-02 17:07:59 +01:00
|
|
|
cleanup();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CoreData::cleanup() {
|
2011-09-27 12:16:09 +02:00
|
|
|
deleteValues(waterSounds.getSoundsPtr()->begin(), waterSounds.getSoundsPtr()->end());
|
|
|
|
waterSounds.getSoundsPtr()->clear();
|
2010-04-01 02:13:28 +02:00
|
|
|
}
|
|
|
|
|
2012-03-19 22:35:54 +01:00
|
|
|
Texture2D *CoreData::getTextureBySystemId(TextureSystemType type) const {
|
|
|
|
Texture2D *result = NULL;
|
|
|
|
switch(type) {
|
|
|
|
case tsyst_logoTexture:
|
|
|
|
result = logoTexture;
|
|
|
|
break;
|
|
|
|
//std::vector<Texture2D *> logoTextureList;
|
|
|
|
case tsyst_backgroundTexture:
|
|
|
|
result = backgroundTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_fireTexture:
|
|
|
|
result = fireTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_teamColorTexture:
|
|
|
|
result = teamColorTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_snowTexture:
|
|
|
|
result = snowTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_waterSplashTexture:
|
|
|
|
result = waterSplashTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_customTexture:
|
|
|
|
result = customTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_buttonSmallTexture:
|
|
|
|
result = buttonSmallTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_buttonBigTexture:
|
|
|
|
result = buttonBigTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_horizontalLineTexture:
|
|
|
|
result = horizontalLineTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_verticalLineTexture:
|
|
|
|
result = verticalLineTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_checkBoxTexture:
|
|
|
|
result = checkBoxTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_checkedCheckBoxTexture:
|
|
|
|
result = checkedCheckBoxTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_gameWinnerTexture:
|
|
|
|
result = gameWinnerTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_notOnServerTexture:
|
|
|
|
result = notOnServerTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_onServerDifferentTexture:
|
|
|
|
result = onServerDifferentTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_onServerTexture:
|
|
|
|
result = onServerTexture;
|
|
|
|
break;
|
|
|
|
case tsyst_onServerInstalledTexture:
|
|
|
|
result = onServerInstalledTexture;
|
|
|
|
break;
|
|
|
|
|
|
|
|
//std::vector<Texture2D *> miscTextureList;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2010-12-09 21:41:11 +01:00
|
|
|
void CoreData::load() {
|
|
|
|
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
2011-03-23 06:49:38 +01:00
|
|
|
if(data_path != "") {
|
|
|
|
endPathWithSlash(data_path);
|
|
|
|
}
|
2010-12-09 21:41:11 +01:00
|
|
|
|
2011-11-02 18:17:28 +01:00
|
|
|
//const string dir = data_path + "data/core";
|
2011-11-04 02:12:05 +01:00
|
|
|
Logger::getInstance().add(Lang::getInstance().get("LogScreenCoreDataLoading","",true));
|
2010-04-01 02:13:28 +02:00
|
|
|
|
|
|
|
Renderer &renderer= Renderer::getInstance();
|
|
|
|
|
|
|
|
//textures
|
|
|
|
backgroundTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(backgroundTexture) {
|
|
|
|
backgroundTexture->setMipmap(false);
|
2011-11-02 18:17:28 +01:00
|
|
|
backgroundTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/back.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
backgroundTexture->setTextureSystemId(tsyst_backgroundTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
|
|
|
fireTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(fireTexture) {
|
|
|
|
fireTexture->setFormat(Texture::fAlpha);
|
|
|
|
fireTexture->getPixmap()->init(1);
|
2011-11-02 18:17:28 +01:00
|
|
|
fireTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/misc_textures/fire_particle.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
fireTexture->setTextureSystemId(tsyst_fireTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
2011-07-07 00:02:38 +02:00
|
|
|
teamColorTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(teamColorTexture) {
|
|
|
|
teamColorTexture->setFormat(Texture::fAlpha);
|
|
|
|
teamColorTexture->getPixmap()->init(1);
|
2011-11-02 18:17:28 +01:00
|
|
|
teamColorTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/misc_textures/team_color_texture.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
teamColorTexture->setTextureSystemId(tsyst_teamColorTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-07-07 00:02:38 +02:00
|
|
|
|
2010-04-01 02:13:28 +02:00
|
|
|
snowTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(snowTexture) {
|
|
|
|
snowTexture->setMipmap(false);
|
|
|
|
snowTexture->setFormat(Texture::fAlpha);
|
|
|
|
snowTexture->getPixmap()->init(1);
|
2011-11-02 18:17:28 +01:00
|
|
|
snowTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/misc_textures/snow_particle.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
snowTexture->setTextureSystemId(tsyst_snowTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-12-09 21:41:11 +01:00
|
|
|
|
2010-04-01 02:13:28 +02:00
|
|
|
customTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(customTexture) {
|
2011-11-02 18:17:28 +01:00
|
|
|
customTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/custom_texture.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
customTexture->setTextureSystemId(tsyst_customTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
2011-08-31 23:51:46 +02:00
|
|
|
notOnServerTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(notOnServerTexture) {
|
2011-11-02 18:17:28 +01:00
|
|
|
notOnServerTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/not_on_server.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
notOnServerTexture->setTextureSystemId(tsyst_notOnServerTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
|
|
|
|
2011-08-31 23:51:46 +02:00
|
|
|
onServerDifferentTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(onServerDifferentTexture) {
|
2011-11-02 18:17:28 +01:00
|
|
|
onServerDifferentTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/on_server_different.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
onServerDifferentTexture->setTextureSystemId(tsyst_onServerDifferentTexture);
|
2011-11-02 18:17:28 +01:00
|
|
|
|
2011-09-27 07:29:57 +02:00
|
|
|
onServerTexture= renderer.newTexture2D(rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
onServerTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/on_server.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
onServerTexture->setTextureSystemId(tsyst_onServerTexture);
|
2011-11-02 18:17:28 +01:00
|
|
|
|
2011-09-27 07:29:57 +02:00
|
|
|
onServerInstalledTexture= renderer.newTexture2D(rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
onServerInstalledTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/on_server_installed.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
onServerInstalledTexture->setTextureSystemId(tsyst_onServerInstalledTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-08-31 23:51:46 +02:00
|
|
|
|
2010-04-01 02:13:28 +02:00
|
|
|
logoTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(logoTexture) {
|
|
|
|
logoTexture->setMipmap(false);
|
2011-11-02 18:17:28 +01:00
|
|
|
logoTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/logo.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
logoTexture->setTextureSystemId(tsyst_logoTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
2010-08-06 00:27:26 +02:00
|
|
|
logoTextureList.clear();
|
2011-11-02 18:17:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
string logosPath = getGameCustomCoreDataPath(data_path, "") + "data/core/menu/textures/logo*.*";
|
2010-08-06 00:27:26 +02:00
|
|
|
vector<string> logoFilenames;
|
2011-10-07 19:21:09 +02:00
|
|
|
findAll(logosPath, logoFilenames, false, false);
|
2010-08-06 00:27:26 +02:00
|
|
|
for(int i = 0; i < logoFilenames.size(); ++i) {
|
|
|
|
string logo = logoFilenames[i];
|
2010-08-07 00:19:48 +02:00
|
|
|
if(strcmp("logo.tga",logo.c_str()) != 0) {
|
2010-08-06 00:27:26 +02:00
|
|
|
Texture2D *logoTextureExtra= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(logoTextureExtra) {
|
|
|
|
logoTextureExtra->setMipmap(true);
|
2011-11-03 15:23:21 +01:00
|
|
|
logoTextureExtra->getPixmap()->load(getGameCustomCoreDataPath(data_path, "") + "data/core/menu/textures/" + logo);
|
2011-09-27 07:29:57 +02:00
|
|
|
logoTextureList.push_back(logoTextureExtra);
|
|
|
|
}
|
2010-08-06 00:27:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-02 17:07:59 +01:00
|
|
|
if(logoTextureList.empty() == true) {
|
2011-11-02 18:17:28 +01:00
|
|
|
logosPath= data_path + "data/core/menu/textures/logo*.*";
|
|
|
|
vector<string> logoFilenames;
|
|
|
|
findAll(logosPath, logoFilenames, false, false);
|
|
|
|
for(int i = 0; i < logoFilenames.size(); ++i) {
|
|
|
|
string logo = logoFilenames[i];
|
|
|
|
if(strcmp("logo.tga",logo.c_str()) != 0) {
|
|
|
|
Texture2D *logoTextureExtra= renderer.newTexture2D(rsGlobal);
|
|
|
|
if(logoTextureExtra) {
|
|
|
|
logoTextureExtra->setMipmap(true);
|
|
|
|
logoTextureExtra->getPixmap()->load(data_path + "data/core/menu/textures/" + logo);
|
|
|
|
logoTextureList.push_back(logoTextureExtra);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-07 19:21:09 +02:00
|
|
|
miscTextureList.clear();
|
2011-11-02 18:17:28 +01:00
|
|
|
|
|
|
|
string introPath = getGameCustomCoreDataPath(data_path, "") + "data/core/menu/textures/intro*.*";
|
2011-10-07 19:21:09 +02:00
|
|
|
vector<string> introFilenames;
|
|
|
|
findAll(introPath, introFilenames, false, false);
|
|
|
|
for(int i = 0; i < introFilenames.size(); ++i) {
|
|
|
|
string logo = introFilenames[i];
|
|
|
|
//if(strcmp("logo.tga",logo.c_str()) != 0) {
|
|
|
|
Texture2D *logoTextureExtra= renderer.newTexture2D(rsGlobal);
|
|
|
|
if(logoTextureExtra) {
|
|
|
|
logoTextureExtra->setMipmap(true);
|
2011-11-03 15:23:21 +01:00
|
|
|
logoTextureExtra->getPixmap()->load(getGameCustomCoreDataPath(data_path, "") + "data/core/menu/textures/" + logo);
|
2011-10-07 19:21:09 +02:00
|
|
|
miscTextureList.push_back(logoTextureExtra);
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
}
|
2011-12-02 17:07:59 +01:00
|
|
|
if(miscTextureList.empty() == true) {
|
2011-11-02 18:17:28 +01:00
|
|
|
introPath= data_path + "data/core/menu/textures/intro*.*";
|
|
|
|
vector<string> introFilenames;
|
|
|
|
findAll(introPath, introFilenames, false, false);
|
|
|
|
for(int i = 0; i < introFilenames.size(); ++i) {
|
|
|
|
string logo = introFilenames[i];
|
|
|
|
//if(strcmp("logo.tga",logo.c_str()) != 0) {
|
|
|
|
Texture2D *logoTextureExtra= renderer.newTexture2D(rsGlobal);
|
|
|
|
if(logoTextureExtra) {
|
|
|
|
logoTextureExtra->setMipmap(true);
|
|
|
|
logoTextureExtra->getPixmap()->load(data_path + "data/core/menu/textures/" + logo);
|
|
|
|
miscTextureList.push_back(logoTextureExtra);
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
2011-10-07 19:21:09 +02:00
|
|
|
|
2010-04-01 02:13:28 +02:00
|
|
|
waterSplashTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(waterSplashTexture) {
|
|
|
|
waterSplashTexture->setFormat(Texture::fAlpha);
|
|
|
|
waterSplashTexture->getPixmap()->init(1);
|
2011-11-02 18:17:28 +01:00
|
|
|
waterSplashTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/misc_textures/water_splash.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
waterSplashTexture->setTextureSystemId(tsyst_waterSplashTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
|
|
|
buttonSmallTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(buttonSmallTexture) {
|
|
|
|
buttonSmallTexture->setForceCompressionDisabled(true);
|
2011-11-02 18:17:28 +01:00
|
|
|
buttonSmallTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/button_small.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
buttonSmallTexture->setTextureSystemId(tsyst_buttonSmallTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
|
|
|
buttonBigTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(buttonBigTexture) {
|
|
|
|
buttonBigTexture->setForceCompressionDisabled(true);
|
2011-11-02 18:17:28 +01:00
|
|
|
buttonBigTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/button_big.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
buttonBigTexture->setTextureSystemId(tsyst_buttonBigTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-12-09 21:41:11 +01:00
|
|
|
|
2010-12-27 01:59:57 +01:00
|
|
|
horizontalLineTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(horizontalLineTexture) {
|
|
|
|
horizontalLineTexture->setForceCompressionDisabled(true);
|
2011-11-02 18:17:28 +01:00
|
|
|
horizontalLineTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/line_horizontal.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
horizontalLineTexture->setTextureSystemId(tsyst_horizontalLineTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-12-27 01:59:57 +01:00
|
|
|
|
|
|
|
verticalLineTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(verticalLineTexture) {
|
|
|
|
verticalLineTexture->setForceCompressionDisabled(true);
|
2011-11-02 18:17:28 +01:00
|
|
|
verticalLineTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/line_vertical.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
verticalLineTexture->setTextureSystemId(tsyst_verticalLineTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-12-27 01:59:57 +01:00
|
|
|
|
|
|
|
checkBoxTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(checkBoxTexture) {
|
|
|
|
checkBoxTexture->setForceCompressionDisabled(true);
|
2011-11-02 18:17:28 +01:00
|
|
|
checkBoxTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/checkbox.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
checkBoxTexture->setTextureSystemId(tsyst_checkBoxTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-12-27 01:59:57 +01:00
|
|
|
|
|
|
|
checkedCheckBoxTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(checkedCheckBoxTexture) {
|
|
|
|
checkedCheckBoxTexture->setForceCompressionDisabled(true);
|
2011-11-02 18:17:28 +01:00
|
|
|
checkedCheckBoxTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/menu/textures/checkbox_checked.tga"));
|
2012-03-19 22:35:54 +01:00
|
|
|
checkedCheckBoxTexture->setTextureSystemId(tsyst_checkedCheckBoxTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-12-27 01:59:57 +01:00
|
|
|
|
2011-04-05 15:34:54 +02:00
|
|
|
gameWinnerTexture= renderer.newTexture2D(rsGlobal);
|
2011-09-27 07:29:57 +02:00
|
|
|
if(gameWinnerTexture) {
|
|
|
|
gameWinnerTexture->setForceCompressionDisabled(true);
|
2011-11-02 18:17:28 +01:00
|
|
|
gameWinnerTexture->getPixmap()->load(getGameCustomCoreDataPath(data_path, "data/core/misc_textures/game_winner.png"));
|
2012-03-19 22:35:54 +01:00
|
|
|
gameWinnerTexture->setTextureSystemId(tsyst_gameWinnerTexture);
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-04-05 15:34:54 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
loadFonts();
|
|
|
|
|
|
|
|
//sounds
|
2011-11-23 20:12:06 +01:00
|
|
|
clickSoundA.load(getGameCustomCoreDataPath(data_path, "data/core/menu/sound/click_a.wav"));
|
|
|
|
clickSoundB.load(getGameCustomCoreDataPath(data_path, "data/core/menu/sound/click_b.wav"));
|
|
|
|
clickSoundC.load(getGameCustomCoreDataPath(data_path, "data/core/menu/sound/click_c.wav"));
|
|
|
|
attentionSound.load(getGameCustomCoreDataPath(data_path, "data/core/menu/sound/attention.wav"));
|
|
|
|
highlightSound.load(getGameCustomCoreDataPath(data_path, "data/core/menu/sound/highlight.wav"));
|
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
XmlTree xmlTree;
|
|
|
|
//string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
2011-11-02 18:17:28 +01:00
|
|
|
xmlTree.load(getGameCustomCoreDataPath(data_path, "data/core/menu/menu.xml"),Properties::getTagReplacementValues());
|
2011-10-25 20:39:11 +02:00
|
|
|
const XmlNode *menuNode= xmlTree.getRootNode();
|
|
|
|
|
2011-11-23 20:12:06 +01:00
|
|
|
string menuMusicPath = "/menu/music/";
|
|
|
|
string menuIntroMusicFile = "intro_music.ogg";
|
|
|
|
string menuMusicFile = "menu_music.ogg";
|
|
|
|
|
|
|
|
if(menuNode->hasChild("intro") == true) {
|
|
|
|
const XmlNode *introNode= menuNode->getChild("intro");
|
|
|
|
|
|
|
|
// intro info
|
|
|
|
const XmlNode *menuPathNode= introNode->getChild("menu-music-path");
|
|
|
|
menuMusicPath = menuPathNode->getAttribute("value")->getRestrictedValue();
|
|
|
|
const XmlNode *menuIntroMusicNode= introNode->getChild("menu-intro-music");
|
|
|
|
menuIntroMusicFile = menuIntroMusicNode->getAttribute("value")->getRestrictedValue();
|
|
|
|
const XmlNode *menuMusicNode= introNode->getChild("menu-music");
|
|
|
|
menuMusicFile = menuMusicNode->getAttribute("value")->getRestrictedValue();
|
|
|
|
}
|
2011-11-02 18:17:28 +01:00
|
|
|
introMusic.open(getGameCustomCoreDataPath(data_path, "data/core/" + menuMusicPath + menuIntroMusicFile));
|
2011-10-25 20:39:11 +02:00
|
|
|
introMusic.setNext(&menuMusic);
|
2011-11-02 18:17:28 +01:00
|
|
|
menuMusic.open(getGameCustomCoreDataPath(data_path, "data/core/" + menuMusicPath + menuMusicFile));
|
2011-10-25 20:39:11 +02:00
|
|
|
menuMusic.setNext(&menuMusic);
|
|
|
|
|
2012-04-16 17:46:22 +02:00
|
|
|
cleanup();
|
2011-10-25 20:39:11 +02:00
|
|
|
waterSounds.resize(6);
|
|
|
|
|
|
|
|
for(int i=0; i<6; ++i){
|
|
|
|
waterSounds[i]= new StaticSound();
|
|
|
|
if(waterSounds[i]) {
|
2011-11-02 18:17:28 +01:00
|
|
|
waterSounds[i]->load(getGameCustomCoreDataPath(data_path, "data/core/water_sounds/water"+intToStr(i)+".wav"));
|
2011-10-25 20:39:11 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-19 10:40:49 +02:00
|
|
|
|
|
|
|
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
|
|
|
|
Shared::Graphics::VideoPlayer::hasBackEndVideoPlayer() == true) {
|
|
|
|
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
|
2012-05-21 20:32:53 +02:00
|
|
|
Config &config= Config::getInstance();
|
|
|
|
|
|
|
|
introVideoFilename = config.getString("IntroVideoURL","");
|
|
|
|
if(introVideoFilename == "") {
|
|
|
|
string introVideoPath = getGameCustomCoreDataPath(data_path, "") + "data/core/menu/videos/intro.*";
|
|
|
|
vector<string> introVideos;
|
|
|
|
findAll(introVideoPath, introVideos, false, false);
|
|
|
|
for(int i = 0; i < introVideos.size(); ++i) {
|
|
|
|
string video = getGameCustomCoreDataPath(data_path, "") + "data/core/menu/videos/" + introVideos[i];
|
|
|
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Checking if intro video [%s] exists\n",video.c_str());
|
|
|
|
|
|
|
|
if(fileExists(video)) {
|
|
|
|
introVideoFilename = video;
|
|
|
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FOUND intro video [%s] will use this file\n",video.c_str());
|
|
|
|
break;
|
|
|
|
}
|
2012-05-19 10:40:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-21 20:32:53 +02:00
|
|
|
mainMenuVideoFilename = config.getString("MainMenuVideoURL","");
|
|
|
|
if(mainMenuVideoFilename == "") {
|
|
|
|
string mainVideoPath = getGameCustomCoreDataPath(data_path, "") + "data/core/menu/videos/main.*";
|
|
|
|
vector<string> mainVideos;
|
|
|
|
findAll(mainVideoPath, mainVideos, false, false);
|
|
|
|
for(int i = 0; i < mainVideos.size(); ++i) {
|
|
|
|
string video = getGameCustomCoreDataPath(data_path, "") + "data/core/menu/videos/" + mainVideos[i];
|
|
|
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Checking if intro video [%s] exists\n",video.c_str());
|
|
|
|
|
|
|
|
if(fileExists(video)) {
|
|
|
|
mainMenuVideoFilename = video;
|
|
|
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("FOUND intro video [%s] will use this file\n",video.c_str());
|
|
|
|
break;
|
|
|
|
}
|
2012-05-19 10:40:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CoreData::hasIntroVideoFilename() const {
|
2012-05-21 20:32:53 +02:00
|
|
|
//bool result = (introVideoFilename != "" && fileExists(introVideoFilename) == true);
|
|
|
|
bool result = (introVideoFilename != "");
|
2012-05-19 10:40:49 +02:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CoreData::hasMainMenuVideoFilename() const {
|
2012-05-21 20:32:53 +02:00
|
|
|
//bool result = (mainMenuVideoFilename != "" && fileExists(mainMenuVideoFilename) == true);
|
|
|
|
bool result = (mainMenuVideoFilename != "");
|
2012-05-19 10:40:49 +02:00
|
|
|
return result;
|
2011-10-25 20:39:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CoreData::loadFonts() {
|
|
|
|
Renderer &renderer= Renderer::getInstance();
|
2011-05-25 21:03:22 +02:00
|
|
|
Lang &lang= Lang::getInstance();
|
|
|
|
|
2010-04-01 02:13:28 +02:00
|
|
|
//display font
|
|
|
|
Config &config= Config::getInstance();
|
2011-05-25 21:03:22 +02:00
|
|
|
|
|
|
|
string displayFontNamePrefix = config.getString("FontDisplayPrefix");
|
|
|
|
string displayFontNamePostfix = config.getString("FontDisplayPostfix");
|
|
|
|
int displayFontSize = computeFontSize(config.getInt("FontDisplayBaseSize"));
|
|
|
|
|
2011-06-08 09:18:06 +02:00
|
|
|
//printf("Checking if langfile has custom FontDisplayPostfix\n");
|
|
|
|
|
2011-05-25 21:03:22 +02:00
|
|
|
if(lang.hasString("FontDisplayPrefix") == true) {
|
|
|
|
displayFontNamePrefix = lang.get("FontDisplayPrefix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontDisplayPostfix") == true) {
|
|
|
|
displayFontNamePostfix = lang.get("FontDisplayPostfix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontDisplayBaseSize") == true) {
|
|
|
|
displayFontSize = strToInt(lang.get("FontDisplayBaseSize"));
|
|
|
|
}
|
|
|
|
|
2011-06-08 09:18:06 +02:00
|
|
|
//printf("displayFontNamePostfix [%s]\n",displayFontNamePostfix.c_str());
|
|
|
|
|
|
|
|
string displayFontName = displayFontNamePrefix + intToStr(displayFontSize) + displayFontNamePostfix;
|
2011-05-25 21:03:22 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(displayFont) {
|
|
|
|
renderer.endFont(displayFont, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
displayFont=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == false) {
|
|
|
|
displayFont= renderer.newFont(rsGlobal);
|
|
|
|
if(displayFont) {
|
2012-01-05 23:35:05 +01:00
|
|
|
displayFont->setType(displayFontName,config.getString("FontDisplay",""),config.getString("FontDisplayFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
displayFont->setSize(displayFontSize);
|
|
|
|
//displayFont->setYOffsetFactor(config.getFloat("FontDisplayYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-06-08 09:18:06 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(displayFont3D) {
|
|
|
|
renderer.endFont(displayFont3D, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
displayFont3D=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == true) {
|
|
|
|
displayFont3D= renderer.newFont3D(rsGlobal);
|
|
|
|
if(displayFont3D) {
|
2012-01-05 23:35:05 +01:00
|
|
|
displayFont3D->setType(displayFontName,config.getString("FontDisplay",""),config.getString("FontDisplayFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
displayFont3D->setSize(displayFontSize);
|
|
|
|
//displayFont3D->setYOffsetFactor(config.getFloat("FontDisplayYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
2011-03-28 05:54:23 +02:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] displayFontName = [%s] displayFontSize = %d\n",__FILE__,__FUNCTION__,__LINE__,displayFontName.c_str(),displayFontSize);
|
2010-04-11 03:25:06 +02:00
|
|
|
|
2010-04-01 20:59:05 +02:00
|
|
|
//menu fonts
|
2011-05-25 21:03:22 +02:00
|
|
|
string displayFontNameSmallPrefix = config.getString("FontDisplayPrefix");
|
|
|
|
string displayFontNameSmallPostfix = config.getString("FontDisplayPostfix");
|
|
|
|
int displayFontNameSmallSize = computeFontSize(config.getInt("FontDisplaySmallBaseSize"));
|
|
|
|
|
|
|
|
if(lang.hasString("FontDisplayPrefix") == true) {
|
|
|
|
displayFontNameSmallPrefix = lang.get("FontDisplayPrefix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontDisplayPostfix") == true) {
|
|
|
|
displayFontNameSmallPostfix = lang.get("FontDisplayPostfix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontDisplaySmallBaseSize") == true) {
|
|
|
|
displayFontNameSmallSize = strToInt(lang.get("FontDisplaySmallBaseSize"));
|
|
|
|
}
|
|
|
|
|
2011-06-08 09:18:06 +02:00
|
|
|
string displayFontNameSmall = displayFontNameSmallPrefix + intToStr(displayFontNameSmallSize) + displayFontNameSmallPostfix;
|
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(displayFontSmall) {
|
|
|
|
renderer.endFont(displayFontSmall, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
displayFontSmall=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == false) {
|
|
|
|
displayFontSmall= renderer.newFont(rsGlobal);
|
|
|
|
if(displayFontSmall) {
|
2012-01-05 23:35:05 +01:00
|
|
|
displayFontSmall->setType(displayFontNameSmall,config.getString("FontSmallDisplay",""),config.getString("FontSmallDisplayFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
displayFontSmall->setSize(displayFontNameSmallSize);
|
|
|
|
//displayFontSmall->setYOffsetFactor(config.getFloat("FontSmallDisplayYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-06-08 09:18:06 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(displayFontSmall3D) {
|
|
|
|
renderer.endFont(displayFontSmall3D, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
displayFontSmall3D=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == true) {
|
|
|
|
displayFontSmall3D= renderer.newFont3D(rsGlobal);
|
|
|
|
if(displayFontSmall3D) {
|
2012-01-05 23:35:05 +01:00
|
|
|
displayFontSmall3D->setType(displayFontNameSmall,config.getString("FontSmallDisplay",""),config.getString("FontSmallDisplayFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
displayFontSmall3D->setSize(displayFontNameSmallSize);
|
|
|
|
//displayFontSmall3D->setYOffsetFactor(config.getFloat("FontSmallDisplayYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-12-09 21:41:11 +01:00
|
|
|
|
2011-03-28 05:54:23 +02:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] displayFontSmallName = [%s] displayFontSmallNameSize = %d\n",__FILE__,__FUNCTION__,__LINE__,displayFontNameSmall.c_str(),displayFontNameSmallSize);
|
2010-12-09 21:41:11 +01:00
|
|
|
|
2011-05-25 21:03:22 +02:00
|
|
|
string menuFontNameNormalPrefix = config.getString("FontMenuNormalPrefix");
|
|
|
|
string menuFontNameNormalPostfix = config.getString("FontMenuNormalPostfix");
|
|
|
|
int menuFontNameNormalSize = computeFontSize(config.getInt("FontMenuNormalBaseSize"));
|
|
|
|
|
|
|
|
if(lang.hasString("FontMenuNormalPrefix") == true) {
|
|
|
|
menuFontNameNormalPrefix = lang.get("FontMenuNormalPrefix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontMenuNormalPostfix") == true) {
|
|
|
|
menuFontNameNormalPostfix = lang.get("FontMenuNormalPostfix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontMenuNormalBaseSize") == true) {
|
|
|
|
menuFontNameNormalSize = strToInt(lang.get("FontMenuNormalBaseSize"));
|
|
|
|
}
|
|
|
|
|
2011-06-08 09:18:06 +02:00
|
|
|
string menuFontNameNormal= menuFontNameNormalPrefix + intToStr(menuFontNameNormalSize) + menuFontNameNormalPostfix;
|
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(menuFontNormal) {
|
|
|
|
renderer.endFont(menuFontNormal, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontNormal=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == false) {
|
|
|
|
menuFontNormal= renderer.newFont(rsGlobal);
|
|
|
|
if(menuFontNormal) {
|
2012-01-05 23:35:05 +01:00
|
|
|
menuFontNormal->setType(menuFontNameNormal,config.getString("FontMenuNormal",""),config.getString("FontMenuNormalFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontNormal->setSize(menuFontNameNormalSize);
|
|
|
|
menuFontNormal->setWidth(Font::wBold);
|
|
|
|
//menuFontNormal->setYOffsetFactor(config.getFloat("FontMenuNormalYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-06-08 09:18:06 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(menuFontNormal3D) {
|
|
|
|
renderer.endFont(menuFontNormal3D, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontNormal3D=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == true) {
|
|
|
|
menuFontNormal3D= renderer.newFont3D(rsGlobal);
|
|
|
|
if(menuFontNormal3D) {
|
2012-01-05 23:35:05 +01:00
|
|
|
menuFontNormal3D->setType(menuFontNameNormal,config.getString("FontMenuNormal",""),config.getString("FontMenuNormalFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontNormal3D->setSize(menuFontNameNormalSize);
|
|
|
|
menuFontNormal3D->setWidth(Font::wBold);
|
|
|
|
//menuFontNormal3D->setYOffsetFactor(config.getFloat("FontMenuNormalYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
2011-03-28 05:54:23 +02:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] menuFontNormalName = [%s] menuFontNormalNameSize = %d\n",__FILE__,__FUNCTION__,__LINE__,menuFontNameNormal.c_str(),menuFontNameNormalSize);
|
2010-04-01 20:59:05 +02:00
|
|
|
|
2011-05-25 21:03:22 +02:00
|
|
|
string menuFontNameBigPrefix = config.getString("FontMenuBigPrefix");
|
|
|
|
string menuFontNameBigPostfix = config.getString("FontMenuBigPostfix");
|
|
|
|
int menuFontNameBigSize = computeFontSize(config.getInt("FontMenuBigBaseSize"));
|
|
|
|
|
|
|
|
if(lang.hasString("FontMenuBigPrefix") == true) {
|
|
|
|
menuFontNameBigPrefix = lang.get("FontMenuBigPrefix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontMenuBigPostfix") == true) {
|
|
|
|
menuFontNameBigPostfix = lang.get("FontMenuBigPostfix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontMenuBigBaseSize") == true) {
|
|
|
|
menuFontNameBigSize = strToInt(lang.get("FontMenuBigBaseSize"));
|
|
|
|
}
|
|
|
|
|
2010-04-01 20:59:05 +02:00
|
|
|
string menuFontNameBig= menuFontNameBigPrefix+intToStr(menuFontNameBigSize)+menuFontNameBigPostfix;
|
2011-05-25 21:03:22 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(menuFontBig) {
|
|
|
|
renderer.endFont(menuFontBig, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontBig=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == false) {
|
|
|
|
menuFontBig= renderer.newFont(rsGlobal);
|
|
|
|
if(menuFontBig) {
|
2012-01-05 23:35:05 +01:00
|
|
|
menuFontBig->setType(menuFontNameBig,config.getString("FontMenuBig",""),config.getString("FontMenuBigFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontBig->setSize(menuFontNameBigSize);
|
|
|
|
//menuFontBig->setYOffsetFactor(config.getFloat("FontMenuBigYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-06-08 09:18:06 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(menuFontBig3D) {
|
|
|
|
renderer.endFont(menuFontBig3D, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontBig3D=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == true) {
|
|
|
|
menuFontBig3D= renderer.newFont3D(rsGlobal);
|
|
|
|
if(menuFontBig3D) {
|
2012-01-05 23:35:05 +01:00
|
|
|
menuFontBig3D->setType(menuFontNameBig,config.getString("FontMenuBig",""),config.getString("FontMenuBigFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontBig3D->setSize(menuFontNameBigSize);
|
|
|
|
//menuFontBig3D->setYOffsetFactor(config.getFloat("FontMenuBigYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
2011-03-28 05:54:23 +02:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] menuFontNameBig = [%s] menuFontNameBigSize = %d\n",__FILE__,__FUNCTION__,__LINE__,menuFontNameBig.c_str(),menuFontNameBigSize);
|
2010-04-11 03:25:06 +02:00
|
|
|
|
2011-05-25 21:03:22 +02:00
|
|
|
string menuFontNameVeryBigPrefix = config.getString("FontMenuBigPrefix");
|
|
|
|
string menuFontNameVeryBigPostfix = config.getString("FontMenuBigPostfix");
|
|
|
|
int menuFontNameVeryBigSize = computeFontSize(config.getInt("FontMenuVeryBigBaseSize"));
|
|
|
|
|
|
|
|
if(lang.hasString("FontMenuBigPrefix") == true) {
|
|
|
|
menuFontNameVeryBigPrefix = lang.get("FontMenuBigPrefix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontMenuBigPostfix") == true) {
|
|
|
|
menuFontNameVeryBigPostfix = lang.get("FontMenuBigPostfix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontMenuVeryBigBaseSize") == true) {
|
|
|
|
menuFontNameVeryBigSize = strToInt(lang.get("FontMenuVeryBigBaseSize"));
|
|
|
|
}
|
|
|
|
|
2011-06-08 09:18:06 +02:00
|
|
|
string menuFontNameVeryBig= menuFontNameVeryBigPrefix + intToStr(menuFontNameVeryBigSize) + menuFontNameVeryBigPostfix;
|
2011-05-25 21:03:22 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(menuFontVeryBig) {
|
|
|
|
renderer.endFont(menuFontVeryBig, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontVeryBig=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == false) {
|
|
|
|
menuFontVeryBig= renderer.newFont(rsGlobal);
|
|
|
|
if(menuFontVeryBig) {
|
2012-01-05 23:35:05 +01:00
|
|
|
menuFontVeryBig->setType(menuFontNameVeryBig,config.getString("FontMenuVeryBig",""),config.getString("FontMenuVeryBigFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontVeryBig->setSize(menuFontNameVeryBigSize);
|
|
|
|
//menuFontVeryBig->setYOffsetFactor(config.getFloat("FontMenuVeryBigYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-06-08 09:18:06 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(menuFontVeryBig3D) {
|
|
|
|
renderer.endFont(menuFontVeryBig3D, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontVeryBig3D=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == true) {
|
|
|
|
menuFontVeryBig3D= renderer.newFont3D(rsGlobal);
|
|
|
|
if(menuFontVeryBig3D) {
|
2012-01-05 23:35:05 +01:00
|
|
|
menuFontVeryBig3D->setType(menuFontNameVeryBig,config.getString("FontMenuVeryBig",""),config.getString("FontMenuVeryBigFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
menuFontVeryBig3D->setSize(menuFontNameVeryBigSize);
|
|
|
|
//menuFontVeryBig3D->setYOffsetFactor(config.getFloat("FontMenuVeryBigYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
2011-06-28 02:51:13 +02:00
|
|
|
//printf("CoreData menuFontVeryBig3D [%d] menuFontVeryBig3D [%p]\n",menuFontVeryBig3D->getSize(),menuFontVeryBig3D);
|
|
|
|
|
2011-03-28 05:54:23 +02:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] menuFontNameVeryBig = [%s] menuFontNameVeryBigSize = %d\n",__FILE__,__FUNCTION__,__LINE__,menuFontNameVeryBig.c_str(),menuFontNameVeryBigSize);
|
2010-04-11 03:25:06 +02:00
|
|
|
|
2010-04-01 02:13:28 +02:00
|
|
|
//console font
|
2011-05-25 21:03:22 +02:00
|
|
|
string consoleFontNamePrefix = config.getString("FontConsolePrefix");
|
|
|
|
string consoleFontNamePostfix = config.getString("FontConsolePostfix");
|
|
|
|
int consoleFontNameSize = computeFontSize(config.getInt("FontConsoleBaseSize"));
|
|
|
|
|
|
|
|
if(lang.hasString("FontConsolePrefix") == true) {
|
|
|
|
consoleFontNamePrefix = lang.get("FontConsolePrefix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontConsolePostfix") == true) {
|
|
|
|
consoleFontNamePostfix = lang.get("FontConsolePostfix");
|
|
|
|
}
|
|
|
|
if(lang.hasString("FontConsoleBaseSize") == true) {
|
|
|
|
consoleFontNameSize = strToInt(lang.get("FontConsoleBaseSize"));
|
|
|
|
}
|
|
|
|
|
2011-06-08 09:18:06 +02:00
|
|
|
string consoleFontName= consoleFontNamePrefix + intToStr(consoleFontNameSize) + consoleFontNamePostfix;
|
2011-05-25 21:03:22 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(consoleFont) {
|
|
|
|
renderer.endFont(consoleFont, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
consoleFont=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == false) {
|
|
|
|
consoleFont= renderer.newFont(rsGlobal);
|
|
|
|
if(consoleFont) {
|
2012-01-05 23:35:05 +01:00
|
|
|
consoleFont->setType(consoleFontName,config.getString("FontConsole",""),config.getString("FontConsoleFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
consoleFont->setSize(consoleFontNameSize);
|
|
|
|
//consoleFont->setYOffsetFactor(config.getFloat("FontConsoleYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2011-06-08 09:18:06 +02:00
|
|
|
|
2011-10-25 20:39:11 +02:00
|
|
|
if(consoleFont3D) {
|
|
|
|
renderer.endFont(consoleFont3D, rsGlobal);
|
2011-11-02 18:17:28 +01:00
|
|
|
consoleFont3D=NULL;
|
|
|
|
}
|
|
|
|
if(Renderer::renderText3DEnabled == true) {
|
|
|
|
consoleFont3D= renderer.newFont3D(rsGlobal);
|
|
|
|
if(consoleFont3D) {
|
2012-01-05 23:35:05 +01:00
|
|
|
consoleFont3D->setType(consoleFontName,config.getString("FontConsole",""),config.getString("FontConsoleFamily",""));
|
2011-11-02 18:17:28 +01:00
|
|
|
consoleFont3D->setSize(consoleFontNameSize);
|
|
|
|
//consoleFont3D->setYOffsetFactor(config.getFloat("FontConsoleYOffsetFactor",floatToStr(FontMetrics::DEFAULT_Y_OFFSET_FACTOR).c_str()));
|
|
|
|
}
|
2011-09-27 07:29:57 +02:00
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
|
2011-03-28 05:54:23 +02:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] consoleFontName = [%s] consoleFontNameSize = %d\n",__FILE__,__FUNCTION__,__LINE__,consoleFontName.c_str(),consoleFontNameSize);
|
2010-04-01 02:13:28 +02:00
|
|
|
}
|
|
|
|
|
2011-06-11 10:52:49 +02:00
|
|
|
int CoreData::computeFontSize(int size) {
|
|
|
|
int rs = size;
|
2010-04-08 00:20:28 +02:00
|
|
|
Config &config= Config::getInstance();
|
2011-06-11 10:52:49 +02:00
|
|
|
if(Font::forceLegacyFonts == true) {
|
|
|
|
int screenH = config.getInt("ScreenHeight");
|
|
|
|
rs = size * screenH / 1024;
|
|
|
|
}
|
|
|
|
else {
|
2011-06-28 08:18:24 +02:00
|
|
|
if(Renderer::renderText3DEnabled) {
|
|
|
|
//rs = ((float)size * 0.85);
|
|
|
|
//rs = 24;
|
|
|
|
}
|
2011-06-28 02:51:13 +02:00
|
|
|
//int screenH = config.getInt("ScreenHeight");
|
|
|
|
//rs = size * screenH / 1024;
|
|
|
|
|
2011-06-11 10:52:49 +02:00
|
|
|
}
|
2010-04-08 00:20:28 +02:00
|
|
|
//FontSizeAdjustment
|
2011-06-11 10:52:49 +02:00
|
|
|
rs += config.getInt("FontSizeAdjustment");
|
2011-06-30 01:48:48 +02:00
|
|
|
if(Font::forceLegacyFonts == false) {
|
|
|
|
rs += Font::baseSize; //basesize only for new font system
|
|
|
|
}
|
2011-06-11 10:52:49 +02:00
|
|
|
if(Font::forceLegacyFonts == true) {
|
|
|
|
if(rs < 10) {
|
|
|
|
rs= 10;
|
|
|
|
}
|
2010-04-01 02:13:28 +02:00
|
|
|
}
|
2011-03-28 05:54:23 +02:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fontsize orginal %d calculated:%d \n",__FILE__,__FUNCTION__,__LINE__,size,rs);
|
2010-04-01 02:13:28 +02:00
|
|
|
return rs;
|
|
|
|
}
|
|
|
|
|
2011-12-03 09:17:49 +01:00
|
|
|
void CoreData::saveGameSettingsToFile(std::string fileName, GameSettings *gameSettings, int advancedIndex) {
|
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
|
|
|
Config &config = Config::getInstance();
|
|
|
|
string userData = config.getString("UserData_Root","");
|
|
|
|
if(userData != "") {
|
|
|
|
endPathWithSlash(userData);
|
|
|
|
}
|
|
|
|
fileName = userData + fileName;
|
|
|
|
|
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileName = [%s]\n",__FILE__,__FUNCTION__,__LINE__,fileName.c_str());
|
|
|
|
|
|
|
|
#if defined(WIN32) && !defined(__MINGW32__)
|
|
|
|
FILE *fp = _wfopen(utf8_decode(fileName).c_str(), L"w");
|
|
|
|
std::ofstream saveGameFile(fp);
|
|
|
|
#else
|
|
|
|
std::ofstream saveGameFile;
|
|
|
|
saveGameFile.open(fileName.c_str(), ios_base::out | ios_base::trunc);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
saveGameFile << "Description=" << gameSettings->getDescription() << std::endl;
|
|
|
|
saveGameFile << "MapFilterIndex=" << gameSettings->getMapFilterIndex() << std::endl;
|
|
|
|
saveGameFile << "Map=" << gameSettings->getMap() << std::endl;
|
|
|
|
saveGameFile << "Tileset=" << gameSettings->getTileset() << std::endl;
|
|
|
|
saveGameFile << "TechTree=" << gameSettings->getTech() << std::endl;
|
|
|
|
saveGameFile << "DefaultUnits=" << gameSettings->getDefaultUnits() << std::endl;
|
|
|
|
saveGameFile << "DefaultResources=" << gameSettings->getDefaultResources() << std::endl;
|
|
|
|
saveGameFile << "DefaultVictoryConditions=" << gameSettings->getDefaultVictoryConditions() << std::endl;
|
|
|
|
saveGameFile << "FogOfWar=" << gameSettings->getFogOfWar() << std::endl;
|
|
|
|
saveGameFile << "AdvancedIndex=" << advancedIndex << std::endl;
|
|
|
|
saveGameFile << "AllowObservers=" << gameSettings->getAllowObservers() << std::endl;
|
|
|
|
saveGameFile << "FlagTypes1=" << gameSettings->getFlagTypes1() << std::endl;
|
|
|
|
saveGameFile << "EnableObserverModeAtEndGame=" << gameSettings->getEnableObserverModeAtEndGame() << std::endl;
|
|
|
|
saveGameFile << "AiAcceptSwitchTeamPercentChance=" << gameSettings->getAiAcceptSwitchTeamPercentChance() << std::endl;
|
|
|
|
saveGameFile << "PathFinderType=" << gameSettings->getPathFinderType() << std::endl;
|
|
|
|
saveGameFile << "EnableServerControlledAI=" << gameSettings->getEnableServerControlledAI() << std::endl;
|
|
|
|
saveGameFile << "NetworkFramePeriod=" << gameSettings->getNetworkFramePeriod() << std::endl;
|
|
|
|
saveGameFile << "NetworkPauseGameForLaggedClients=" << gameSettings->getNetworkPauseGameForLaggedClients() << std::endl;
|
|
|
|
|
|
|
|
saveGameFile << "FactionThisFactionIndex=" << gameSettings->getThisFactionIndex() << std::endl;
|
|
|
|
saveGameFile << "FactionCount=" << gameSettings->getFactionCount() << std::endl;
|
|
|
|
|
|
|
|
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
|
|
|
|
int slotIndex = gameSettings->getStartLocationIndex(i);
|
|
|
|
|
|
|
|
saveGameFile << "FactionControlForIndex" << slotIndex << "=" << gameSettings->getFactionControl(i) << std::endl;
|
|
|
|
saveGameFile << "ResourceMultiplierIndex" << slotIndex << "=" << gameSettings->getResourceMultiplierIndex(i) << std::endl;
|
|
|
|
saveGameFile << "FactionTeamForIndex" << slotIndex << "=" << gameSettings->getTeam(i) << std::endl;
|
|
|
|
saveGameFile << "FactionStartLocationForIndex" << slotIndex << "=" << gameSettings->getStartLocationIndex(i) << std::endl;
|
|
|
|
saveGameFile << "FactionTypeNameForIndex" << slotIndex << "=" << gameSettings->getFactionTypeName(i) << std::endl;
|
|
|
|
saveGameFile << "FactionPlayerNameForIndex" << slotIndex << "=" << gameSettings->getNetworkPlayerName(i) << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(WIN32) && !defined(__MINGW32__)
|
|
|
|
fclose(fp);
|
|
|
|
#endif
|
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
}
|
|
|
|
|
2012-03-17 09:20:17 +01:00
|
|
|
bool CoreData::loadGameSettingsFromFile(std::string fileName, GameSettings *gameSettings) {
|
2011-12-03 09:17:49 +01:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
|
|
|
|
2012-03-17 09:20:17 +01:00
|
|
|
bool fileWasFound = false;
|
2011-12-03 09:17:49 +01:00
|
|
|
Config &config = Config::getInstance();
|
|
|
|
string userData = config.getString("UserData_Root","");
|
|
|
|
if(userData != "") {
|
|
|
|
endPathWithSlash(userData);
|
|
|
|
}
|
2012-03-17 09:20:17 +01:00
|
|
|
if(fileExists(userData + fileName) == true) {
|
|
|
|
fileName = userData + fileName;
|
|
|
|
fileWasFound = true;
|
|
|
|
}
|
2011-12-03 09:17:49 +01:00
|
|
|
|
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileName = [%s]\n",__FILE__,__FUNCTION__,__LINE__,fileName.c_str());
|
|
|
|
|
|
|
|
if(fileExists(fileName) == false) {
|
2012-03-17 09:20:17 +01:00
|
|
|
return false;
|
2011-12-03 09:17:49 +01:00
|
|
|
}
|
|
|
|
|
2012-03-17 09:20:17 +01:00
|
|
|
fileWasFound = true;
|
2011-12-03 09:17:49 +01:00
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileName = [%s]\n",__FILE__,__FUNCTION__,__LINE__,fileName.c_str());
|
|
|
|
|
|
|
|
Properties properties;
|
|
|
|
properties.load(fileName);
|
|
|
|
|
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileName = [%s]\n",__FILE__,__FUNCTION__,__LINE__,fileName.c_str());
|
|
|
|
|
|
|
|
gameSettings->setMapFilterIndex(properties.getInt("MapFilterIndex","0"));
|
|
|
|
gameSettings->setDescription(properties.getString("Description"));
|
|
|
|
gameSettings->setMap(properties.getString("Map"));
|
|
|
|
gameSettings->setTileset(properties.getString("Tileset"));
|
|
|
|
gameSettings->setTech(properties.getString("TechTree"));
|
|
|
|
gameSettings->setDefaultUnits(properties.getBool("DefaultUnits"));
|
|
|
|
gameSettings->setDefaultResources(properties.getBool("DefaultResources"));
|
|
|
|
gameSettings->setDefaultVictoryConditions(properties.getBool("DefaultVictoryConditions"));
|
|
|
|
gameSettings->setFogOfWar(properties.getBool("FogOfWar"));
|
|
|
|
//listBoxAdvanced.setSelectedItemIndex(properties.getInt("AdvancedIndex","0"));
|
|
|
|
|
|
|
|
gameSettings->setAllowObservers(properties.getBool("AllowObservers","false"));
|
|
|
|
gameSettings->setFlagTypes1(properties.getInt("FlagTypes1","0"));
|
|
|
|
gameSettings->setEnableObserverModeAtEndGame(properties.getBool("EnableObserverModeAtEndGame"));
|
|
|
|
gameSettings->setAiAcceptSwitchTeamPercentChance(properties.getInt("AiAcceptSwitchTeamPercentChance","30"));
|
|
|
|
|
|
|
|
gameSettings->setPathFinderType(static_cast<PathFinderType>(properties.getInt("PathFinderType",intToStr(pfBasic).c_str())));
|
|
|
|
gameSettings->setEnableServerControlledAI(properties.getBool("EnableServerControlledAI","true"));
|
|
|
|
gameSettings->setNetworkFramePeriod(properties.getInt("NetworkFramePeriod",intToStr(GameConstants::networkFramePeriod).c_str()));
|
|
|
|
gameSettings->setNetworkPauseGameForLaggedClients(properties.getBool("NetworkPauseGameForLaggedClients","false"));
|
|
|
|
|
|
|
|
gameSettings->setThisFactionIndex(properties.getInt("FactionThisFactionIndex"));
|
|
|
|
gameSettings->setFactionCount(properties.getInt("FactionCount"));
|
|
|
|
|
|
|
|
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
|
|
|
|
gameSettings->setFactionControl(i,(ControlType)properties.getInt(string("FactionControlForIndex") + intToStr(i),intToStr(ctClosed).c_str()) );
|
|
|
|
|
|
|
|
if(gameSettings->getFactionControl(i) == ctNetworkUnassigned) {
|
|
|
|
gameSettings->setFactionControl(i,ctNetwork);
|
|
|
|
}
|
|
|
|
|
|
|
|
gameSettings->setResourceMultiplierIndex(i,properties.getInt(string("ResourceMultiplierIndex") + intToStr(i),"5"));
|
|
|
|
gameSettings->setTeam(i,properties.getInt(string("FactionTeamForIndex") + intToStr(i),"0") );
|
|
|
|
gameSettings->setStartLocationIndex(i,properties.getInt(string("FactionStartLocationForIndex") + intToStr(i),intToStr(i).c_str()) );
|
|
|
|
gameSettings->setFactionTypeName(i,properties.getString(string("FactionTypeNameForIndex") + intToStr(i),"?") );
|
|
|
|
|
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, factionTypeName [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,gameSettings->getFactionTypeName(i).c_str());
|
|
|
|
|
|
|
|
if(gameSettings->getFactionControl(i) == ctHuman) {
|
|
|
|
gameSettings->setNetworkPlayerName(i,properties.getString(string("FactionPlayerNameForIndex") + intToStr(i),"") );
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
gameSettings->setNetworkPlayerName(i,"");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
2012-03-17 09:20:17 +01:00
|
|
|
|
|
|
|
return fileWasFound;
|
2011-12-03 09:17:49 +01:00
|
|
|
}
|
|
|
|
|
2010-04-01 02:13:28 +02:00
|
|
|
// ================== PRIVATE ========================
|
|
|
|
|
|
|
|
}}//end namespace
|