- added an average renderfps to use when toggling shadows off/on to make it more smooth

- added a new commandline to autostart a new game with the last game settings you played called: 
--autostart-lastgame
This commit is contained in:
Mark Vejvoda 2010-10-02 02:17:50 +00:00
parent 02e0a1302f
commit c87e27eabd
8 changed files with 205 additions and 166 deletions

View File

@ -77,6 +77,8 @@ Game::Game(Program *program, const GameSettings *gameSettings):
lastRenderFps=-1;
avgUpdateFps=-1;
avgRenderFps=-1;
currentAvgRenderFpsTotal=0;
tickCount=0;
paused= false;
gameOver= false;
renderNetworkStatus= false;
@ -764,18 +766,24 @@ void Game::renderWorker() {
// ==================== tick ====================
void Game::tick(){
void Game::tick() {
tickCount++;
if(avgUpdateFps == -1) {
avgUpdateFps = updateFps;
}
else {
avgUpdateFps = (avgUpdateFps + updateFps) / 2;
}
currentAvgRenderFpsTotal += renderFps;
if(avgRenderFps == -1) {
avgRenderFps = renderFps;
}
else {
avgRenderFps = (avgRenderFps + renderFps) / 2;
// Update the average every 10 game ticks
if(tickCount % 10 == 0) {
avgRenderFps = currentAvgRenderFpsTotal / 10;
currentAvgRenderFpsTotal = 0;
}
if(captureAvgTestStatus == true) {

View File

@ -23,9 +23,11 @@
#include "script_manager.h"
#include "game_settings.h"
#include "network_interface.h"
#include "types.h"
#include "leak_dumper.h"
using std::vector;
using namespace Shared::Platform;
using namespace Shared::PlatformCommon;
namespace Glest{ namespace Game{
@ -78,7 +80,8 @@ private:
int mouse2d;
int mouseX, mouseY; //coords win32Api
int updateFps, lastUpdateFps, avgUpdateFps;
int totalRenderFps, renderFps, lastRenderFps, avgRenderFps;
int totalRenderFps, renderFps, lastRenderFps, avgRenderFps,currentAvgRenderFpsTotal;
Uint64 tickCount;
bool paused;
bool gameOver;
bool renderNetworkStatus;

View File

@ -137,7 +137,7 @@ const Vec4f Renderer::defColor= Vec4f(1.f, 1.f, 1.f, 1.f);
//const float Renderer::maxLightDist= 100.f;
const float Renderer::maxLightDist= 1000.f;
const int MIN_FPS_NORMAL_RENDERING = 15;
const int MIN_FPS_NORMAL_RENDERING = 9;
const int MIN_FPS_NORMAL_RENDERING_TOP_THRESHOLD = 25;
// ==================== constructor and destructor ====================

View File

@ -51,6 +51,7 @@ bool gameInitialized = false;
const char *GAME_ARGS[] = {
"--help",
"--autostart-lastgame",
"--connecthost",
"--starthost",
"--load-scenario",
@ -59,10 +60,12 @@ const char *GAME_ARGS[] = {
"--sdl-info",
"--validate-techtrees",
"--validate-factions"
};
enum GAME_ARG_TYPE {
GAME_ARG_HELP = 0,
GAME_ARG_AUTOSTART_LASTGAME,
GAME_ARG_CLIENT,
GAME_ARG_SERVER,
GAME_ARG_LOADSCENARIO,
@ -467,6 +470,7 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
printf("Commandline Parameter:\t\tDescription:");
printf("\n----------------------\t\t------------");
printf("\n%s\t\t\t\tdisplays this help text.",GAME_ARGS[GAME_ARG_HELP]);
printf("\n%s\t\tAutomatically starts a game with the last game settings you played.",GAME_ARGS[GAME_ARG_AUTOSTART_LASTGAME]);
printf("\n%s=x\t\t\tAuto connects to a network server at IP or hostname x",GAME_ARGS[GAME_ARG_CLIENT]);
printf("\n%s\t\t\tAuto creates a network server.",GAME_ARGS[GAME_ARG_SERVER]);
printf("\n%s=x\t\tAuto loads the specified scenario by scenario name.",GAME_ARGS[GAME_ARG_LOADSCENARIO]);
@ -682,6 +686,9 @@ int glestMain(int argc, char** argv){
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SERVER]) == true) {
program->initServer(mainWindow);
}
else if(hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_AUTOSTART_LASTGAME])) == true) {
program->initServer(mainWindow,true);
}
else if(hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_CLIENT])) == true) {
int foundParamIndIndex = -1;
hasCommandArgument(argc, argv,string(GAME_ARGS[GAME_ARG_CLIENT]) + string("="),&foundParamIndIndex);

View File

@ -141,13 +141,13 @@ void Program::initNormal(WindowGl *window){
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
void Program::initServer(WindowGl *window){
void Program::initServer(WindowGl *window, bool autostart) {
MainMenu* mainMenu= NULL;
init(window);
mainMenu= new MainMenu(this);
setState(mainMenu);
mainMenu->setState(new MenuStateCustomGame(this, mainMenu, true));
mainMenu->setState(new MenuStateCustomGame(this, mainMenu, true, false, autostart));
}
void Program::initClient(WindowGl *window, const Ip &serverIp) {

View File

@ -132,7 +132,7 @@ public:
static Program *getInstance() {return singleton;}
void initNormal(WindowGl *window);
void initServer(WindowGl *window);
void initServer(WindowGl *window,bool autostart=false);
void initClient(WindowGl *window, const Ip &serverIp);
void initScenario(WindowGl *window, string autoloadScenarioName);

View File

@ -45,10 +45,11 @@ struct FormatString {
// class MenuStateCustomGame
// =====================================================
MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, bool openNetworkSlots,bool parentMenuIsMasterserver) :
MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, bool openNetworkSlots,bool parentMenuIsMasterserver, bool autostart) :
MenuState(program, mainMenu, "new-game")
{
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
this->autostart = autostart;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] autostart = %d\n",__FILE__,__FUNCTION__,__LINE__,autostart);
containerName = "CustomGame";
activeInputLabel=NULL;
@ -588,165 +589,12 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){
else if(buttonPlayNow.mouseClick(x,y) && buttonPlayNow.getEnabled()) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
MutexSafeWrapper safeMutex(&masterServerThreadAccessor);
saveGameSettingsToFile("lastCustomGamSettings.mgg");
closeUnusedSlots();
soundRenderer.playFx(coreData.getClickSoundC());
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
std::vector<string> randomFactionSelectionList;
int RandomCount = 0;
for(int i= 0; i < mapInfo.players; ++i) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
// Check for random faction selection and choose the faction now
if(listBoxControls[i].getSelectedItemIndex() != ctClosed) {
if(listBoxFactions[i].getSelectedItem() == formatString(GameConstants::RANDOMFACTION_SLOTNAME)) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] i = %d\n",__FILE__,__FUNCTION__,__LINE__,i);
// Max 1000 tries to get a random, unused faction
for(int findRandomFaction = 1; findRandomFaction < 1000; ++findRandomFaction) {
srand(time(NULL) + findRandomFaction);
int selectedFactionIndex = rand() % listBoxFactions[i].getItemCount();
string selectedFactionName = listBoxFactions[i].getItem(selectedFactionIndex);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] selectedFactionName [%s] selectedFactionIndex = %d, findRandomFaction = %d\n",__FILE__,__FUNCTION__,__LINE__,selectedFactionName.c_str(),selectedFactionIndex,findRandomFaction);
if( selectedFactionName != formatString(GameConstants::RANDOMFACTION_SLOTNAME) &&
selectedFactionName != formatString(GameConstants::OBSERVER_SLOTNAME) &&
std::find(randomFactionSelectionList.begin(),randomFactionSelectionList.end(),selectedFactionName) == randomFactionSelectionList.end()) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
listBoxFactions[i].setSelectedItem(selectedFactionName);
randomFactionSelectionList.push_back(selectedFactionName);
break;
}
}
if(listBoxFactions[i].getSelectedItem() == formatString(GameConstants::RANDOMFACTION_SLOTNAME)) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] RandomCount = %d\n",__FILE__,__FUNCTION__,__LINE__,RandomCount);
listBoxFactions[i].setSelectedItemIndex(RandomCount);
randomFactionSelectionList.push_back(listBoxFactions[i].getItem(RandomCount));
}
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] i = %d, listBoxFactions[i].getSelectedItem() [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,listBoxFactions[i].getSelectedItem().c_str());
RandomCount++;
}
}
}
if(RandomCount > 0) {
needToSetChangedGameSettings = true;
}
safeMutex.ReleaseLock(true);
GameSettings gameSettings;
loadGameSettings(&gameSettings);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
// Send the game settings to each client if we have at least one networked client
safeMutex.Lock();
bool dataSynchCheckOk = true;
for(int i= 0; i < mapInfo.players; ++i) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(listBoxControls[i].getSelectedItemIndex() == ctNetwork) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
ConnectionSlot* connectionSlot= serverInterface->getSlot(i);
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;
}
}
}
if(dataSynchCheckOk == false) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
mainMessageBoxState=1;
showMessageBox( "You cannot start the game because\none or more clients do not have the same game data!", "Data Mismatch Error", false);
safeMutex.ReleaseLock();
return;
}
else {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if( (hasNetworkGameSettings() == true &&
needToSetChangedGameSettings == true) || (RandomCount > 0)) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
serverInterface->setGameSettings(&gameSettings,true);
needToSetChangedGameSettings = false;
lastSetChangedGameSettings = time(NULL);
}
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
bool bOkToStart = serverInterface->launchGame(&gameSettings);
if(bOkToStart == true) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if( listBoxPublishServer.getEditable() &&
listBoxPublishServer.getSelectedItemIndex() == 0) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
needToRepublishToMasterserver = true;
lastMasterserverPublishing = 0;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
needToBroadcastServerSettings = false;
needToRepublishToMasterserver = false;
safeMutex.ReleaseLock();
delete publishToMasterserverThread;
publishToMasterserverThread = NULL;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
assert(program != NULL);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
program->setState(new Game(program, &gameSettings));
return;
}
else {
safeMutex.ReleaseLock();
}
}
PlayNow();
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
else if(buttonRestoreLastSettings.mouseClick(x,y) && buttonRestoreLastSettings.getEnabled()) {
// Ensure we have set the gamesettings at least once
GameSettings gameSettings = loadGameSettingsFromFile("lastCustomGamSettings.mgg");
if(gameSettings.getMap() == "") {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
loadGameSettings(&gameSettings);
}
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
serverInterface->setGameSettings(&gameSettings,false);
MutexSafeWrapper safeMutex(&masterServerThreadAccessor);
needToRepublishToMasterserver = true;
if(hasNetworkGameSettings() == true)
{
needToSetChangedGameSettings = true;
lastSetChangedGameSettings = time(NULL);
}
RestoreLastGameSettings();
}
else if(listBoxMap.mouseClick(x, y)){
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n", getCurrentMapFile().c_str());
@ -976,6 +824,169 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
void MenuStateCustomGame::RestoreLastGameSettings() {
// Ensure we have set the gamesettings at least once
GameSettings gameSettings = loadGameSettingsFromFile("lastCustomGamSettings.mgg");
if(gameSettings.getMap() == "") {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
loadGameSettings(&gameSettings);
}
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
serverInterface->setGameSettings(&gameSettings,false);
MutexSafeWrapper safeMutex(&masterServerThreadAccessor);
needToRepublishToMasterserver = true;
if(hasNetworkGameSettings() == true)
{
needToSetChangedGameSettings = true;
lastSetChangedGameSettings = time(NULL);
}
}
void MenuStateCustomGame::PlayNow() {
MutexSafeWrapper safeMutex(&masterServerThreadAccessor);
saveGameSettingsToFile("lastCustomGamSettings.mgg");
closeUnusedSlots();
CoreData &coreData= CoreData::getInstance();
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
soundRenderer.playFx(coreData.getClickSoundC());
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
std::vector<string> randomFactionSelectionList;
int RandomCount = 0;
for(int i= 0; i < mapInfo.players; ++i) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
// Check for random faction selection and choose the faction now
if(listBoxControls[i].getSelectedItemIndex() != ctClosed) {
if(listBoxFactions[i].getSelectedItem() == formatString(GameConstants::RANDOMFACTION_SLOTNAME)) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] i = %d\n",__FILE__,__FUNCTION__,__LINE__,i);
// Max 1000 tries to get a random, unused faction
for(int findRandomFaction = 1; findRandomFaction < 1000; ++findRandomFaction) {
srand(time(NULL) + findRandomFaction);
int selectedFactionIndex = rand() % listBoxFactions[i].getItemCount();
string selectedFactionName = listBoxFactions[i].getItem(selectedFactionIndex);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] selectedFactionName [%s] selectedFactionIndex = %d, findRandomFaction = %d\n",__FILE__,__FUNCTION__,__LINE__,selectedFactionName.c_str(),selectedFactionIndex,findRandomFaction);
if( selectedFactionName != formatString(GameConstants::RANDOMFACTION_SLOTNAME) &&
selectedFactionName != formatString(GameConstants::OBSERVER_SLOTNAME) &&
std::find(randomFactionSelectionList.begin(),randomFactionSelectionList.end(),selectedFactionName) == randomFactionSelectionList.end()) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
listBoxFactions[i].setSelectedItem(selectedFactionName);
randomFactionSelectionList.push_back(selectedFactionName);
break;
}
}
if(listBoxFactions[i].getSelectedItem() == formatString(GameConstants::RANDOMFACTION_SLOTNAME)) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] RandomCount = %d\n",__FILE__,__FUNCTION__,__LINE__,RandomCount);
listBoxFactions[i].setSelectedItemIndex(RandomCount);
randomFactionSelectionList.push_back(listBoxFactions[i].getItem(RandomCount));
}
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] i = %d, listBoxFactions[i].getSelectedItem() [%s]\n",__FILE__,__FUNCTION__,__LINE__,i,listBoxFactions[i].getSelectedItem().c_str());
RandomCount++;
}
}
}
if(RandomCount > 0) {
needToSetChangedGameSettings = true;
}
safeMutex.ReleaseLock(true);
GameSettings gameSettings;
loadGameSettings(&gameSettings);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
// Send the game settings to each client if we have at least one networked client
safeMutex.Lock();
bool dataSynchCheckOk = true;
for(int i= 0; i < mapInfo.players; ++i) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(listBoxControls[i].getSelectedItemIndex() == ctNetwork) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
ConnectionSlot* connectionSlot= serverInterface->getSlot(i);
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;
}
}
}
if(dataSynchCheckOk == false) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
mainMessageBoxState=1;
showMessageBox( "You cannot start the game because\none or more clients do not have the same game data!", "Data Mismatch Error", false);
safeMutex.ReleaseLock();
return;
}
else {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if( (hasNetworkGameSettings() == true &&
needToSetChangedGameSettings == true) || (RandomCount > 0)) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
serverInterface->setGameSettings(&gameSettings,true);
needToSetChangedGameSettings = false;
lastSetChangedGameSettings = time(NULL);
}
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
bool bOkToStart = serverInterface->launchGame(&gameSettings);
if(bOkToStart == true) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if( listBoxPublishServer.getEditable() &&
listBoxPublishServer.getSelectedItemIndex() == 0) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
needToRepublishToMasterserver = true;
lastMasterserverPublishing = 0;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
needToBroadcastServerSettings = false;
needToRepublishToMasterserver = false;
safeMutex.ReleaseLock();
delete publishToMasterserverThread;
publishToMasterserverThread = NULL;
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
assert(program != NULL);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
program->setState(new Game(program, &gameSettings));
return;
}
else {
safeMutex.ReleaseLock();
}
}
}
void MenuStateCustomGame::mouseMove(int x, int y, const MouseState *ms){
if (mainMessageBox.getEnabled()) {
mainMessageBox.mouseMove(x, y);
@ -1527,6 +1538,12 @@ void MenuStateCustomGame::update() {
if(chrono.getMillis() > 0) chrono.start();
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(autostart == true) {
safeMutex.ReleaseLock();
RestoreLastGameSettings();
PlayNow();
}
}
catch(const std::exception &ex) {
char szBuf[1024]="";

View File

@ -132,9 +132,10 @@ private:
Texture2D *factionTexture;
MapPreview mapPreview;
bool autostart;
public:
MenuStateCustomGame(Program *program, MainMenu *mainMenu ,bool openNetworkSlots= false, bool parentMenuIsMasterserver=false);
MenuStateCustomGame(Program *program, MainMenu *mainMenu ,bool openNetworkSlots= false, bool parentMenuIsMasterserver=false, bool autostart=false);
~MenuStateCustomGame();
void mouseClick(int x, int y, MouseButton mouseButton);
@ -172,6 +173,9 @@ private:
void cleanupFactionTexture();
void loadFactionTexture(string filepath);
void RestoreLastGameSettings();
void PlayNow();
};
}}//end namespace