- fixed bug with server unable to start a game (sorry everyone)

- made faction texture preview an ini option: FactionPreview=true
This commit is contained in:
Mark Vejvoda 2010-08-31 20:31:20 +00:00
parent 6ce69a1e0b
commit f727c383b2
4 changed files with 39 additions and 33 deletions

View File

@ -71,6 +71,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
NetworkManager &networkManager= NetworkManager::getInstance();
Config &config = Config::getInstance();
defaultPlayerName = config.getString("NetPlayerName",Socket::getHostName().c_str());
enableFactionTexturePreview = config.getBool("FactionPreview","false");
labelMapInfo.setText("?");
@ -1120,26 +1121,26 @@ void MenuStateConnectedGame::loadFactionTexture(string filepath) {
cleanupFactionTexture();
if(filepath=="")
{
factionTexture=NULL;
}
else
{
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] filepath = [%s]\n",__FILE__,__FUNCTION__,__LINE__,filepath.c_str());
if(enableFactionTexturePreview == true) {
if(filepath == "") {
factionTexture=NULL;
}
else {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] filepath = [%s]\n",__FILE__,__FUNCTION__,__LINE__,filepath.c_str());
factionTexture = GraphicsInterface::getInstance().getFactory()->newTexture2D();
//loadingTexture = renderer.newTexture2D(rsGlobal);
factionTexture->setMipmap(true);
//loadingTexture->getPixmap()->load(filepath);
factionTexture->load(filepath);
factionTexture = GraphicsInterface::getInstance().getFactory()->newTexture2D();
//loadingTexture = renderer.newTexture2D(rsGlobal);
factionTexture->setMipmap(true);
//loadingTexture->getPixmap()->load(filepath);
factionTexture->load(filepath);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Renderer &renderer= Renderer::getInstance();
renderer.initTexture(rsGlobal,factionTexture);
Renderer &renderer= Renderer::getInstance();
renderer.initTexture(rsGlobal,factionTexture);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
}
}

View File

@ -109,6 +109,7 @@ private:
int8 switchSetupRequestFlagType;
string defaultPlayerName;
bool enableFactionTexturePreview;
string currentFactionLogo;
Texture2D *factionTexture;

View File

@ -61,6 +61,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b
NetworkManager &networkManager= NetworkManager::getInstance();
Config &config = Config::getInstance();
defaultPlayerName = config.getString("NetPlayerName",Socket::getHostName().c_str());
enableFactionTexturePreview = config.getBool("FactionPreview","false");
showFullConsole=false;
@ -522,7 +523,9 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
ConnectionSlot* connectionSlot= serverInterface->getSlot(i);
if(connectionSlot != NULL && connectionSlot->getNetworkGameDataSynchCheckOk() == false) {
if( connectionSlot != NULL && connectionSlot->isConnected() &&
connectionSlot->getAllowGameDataSynchCheck() == true &&
connectionSlot->getNetworkGameDataSynchCheckOk() == false) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
dataSynchCheckOk = false;
break;
@ -2120,26 +2123,26 @@ void MenuStateCustomGame::loadFactionTexture(string filepath) {
cleanupFactionTexture();
if(filepath=="")
{
factionTexture=NULL;
}
else
{
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] filepath = [%s]\n",__FILE__,__FUNCTION__,__LINE__,filepath.c_str());
if(enableFactionTexturePreview == true) {
if(filepath == "") {
factionTexture=NULL;
}
else {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] filepath = [%s]\n",__FILE__,__FUNCTION__,__LINE__,filepath.c_str());
factionTexture = GraphicsInterface::getInstance().getFactory()->newTexture2D();
//loadingTexture = renderer.newTexture2D(rsGlobal);
factionTexture->setMipmap(true);
//loadingTexture->getPixmap()->load(filepath);
factionTexture->load(filepath);
factionTexture = GraphicsInterface::getInstance().getFactory()->newTexture2D();
//loadingTexture = renderer.newTexture2D(rsGlobal);
factionTexture->setMipmap(true);
//loadingTexture->getPixmap()->load(filepath);
factionTexture->load(filepath);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Renderer &renderer= Renderer::getInstance();
renderer.initTexture(rsGlobal,factionTexture);
Renderer &renderer= Renderer::getInstance();
renderer.initTexture(rsGlobal,factionTexture);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
}
}

View File

@ -118,6 +118,7 @@ private:
string defaultPlayerName;
int8 switchSetupRequestFlagType;
bool enableFactionTexturePreview;
string currentFactionLogo;
Texture2D *factionTexture;