Commit cb85699e authored by Gerstrong's avatar Gerstrong

adaptations to the first time dialog

parent 07637dbb
......@@ -13,16 +13,16 @@
#include "Menu/CLoadMenu.h"
#include "Menu/CSelectionMenu.h"
CMenu::CMenu(char menu_mode, CExeFile &ExeFile,
CMenu::CMenu(char menu_mode,
CSavedGame &SavedGame,
Uint8 DlgTheme,
bool &restartVideo) :
CBaseMenu(DlgTheme),
m_demoback(false),
mp_Dialog(NULL),
m_Episode(ExeFile.getEpisode()),
m_ExeFile(ExeFile),
m_GamePath(ExeFile.getDataDirectory()),
m_ExeFile(g_pBehaviorEngine->m_ExeFile),
m_Episode(m_ExeFile.getEpisode()),
m_GamePath(m_ExeFile.getDataDirectory()),
m_SavedGame(SavedGame),
m_menu_mode(menu_mode),
m_choosegame(false),
......
......@@ -21,7 +21,7 @@
class CMenu : public CBaseMenu
{
public:
CMenu(char menu_mode, CExeFile &ExeFile,
CMenu(char menu_mode,
CSavedGame &SavedGame,
Uint8 DlgTheme,
bool &restartVideo );
......@@ -56,8 +56,8 @@ public:
CDialog *mp_Dialog;
protected:
char m_Episode;
CExeFile &m_ExeFile;
char m_Episode;
std::string m_GamePath;
CSavedGame &m_SavedGame;
char m_menu_mode;
......
......@@ -9,7 +9,7 @@
#define CSAVEMENU_H_
#include "CConfirmMenu.h"
#include "../../fileio/CSavedGame.h"
#include "fileio/CSavedGame.h"
class CSaveMenu : public CBaseMenu
{
......
......@@ -21,8 +21,7 @@
CGameControl::CGameControl(bool &firsttime) :
m_firsttime(firsttime),
m_show_finale(false),
m_episode(0)
m_show_finale(false)
{}
////
......@@ -30,12 +29,12 @@ m_episode(0)
////
bool CGameControl::init(int argc, char *argv[])
{
bool ok;
bool ok = true;
std::string argument;
argument = getArgument( argc, argv, "-game" );
mp_GameMode = new CGameLauncherMenu(m_firsttime, m_episode, m_Numplayers, m_Difficulty, m_DataDirectory);
ok = mp_GameMode->init();
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
EventContainer.add( new GMSwitchToGameLauncher() );
// Check if some arguments were given.
/*if(argument != "")
......@@ -70,31 +69,33 @@ void CGameControl::process()
{
// process any triggered Game Control related event
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
if( ChangeMode* p_mode = EventContainer.occurredEvent<ChangeMode>() )
{
mp_GameMode.tryDeleteData();
if(p_mode->Mode == GM_GAMELAUNCHER)
{
mp_GameMode = new CGameLauncherMenu(m_firsttime, m_episode, m_Numplayers, m_Difficulty, m_DataDirectory);
}
else if(p_mode->Mode == GM_PASSIVE)
{
mp_GameMode = new CGamePassiveMode(m_episode, m_Numplayers, m_Difficulty, m_DataDirectory);
}
else if(p_mode->Mode == GM_PLAYGAME)
{
mp_GameMode = new CGamePlayMode(m_show_finale, m_episode, m_Numplayers, m_Difficulty, m_DataDirectory);
}
else if(p_mode->Mode == GM_QUIT)
{
mp_GameMode = NULL;
return;
}
if( GMSwitchToGameLauncher* p_Launcher = EventContainer.occurredEvent<GMSwitchToGameLauncher>() )
{
mp_GameMode = new CGameLauncherMenu( m_firsttime, p_Launcher->m_ChosenGame, p_Launcher->m_StartLevel );
mp_GameMode->init();
EventContainer.pop_Event();
}
else if( GMSwitchToPassiveMode* p_Passive = EventContainer.occurredEvent<GMSwitchToPassiveMode>() )
{
mp_GameMode = new CGamePassiveMode( p_Passive->m_DataDirectory, p_Passive->m_Episode );
mp_GameMode->init();
EventContainer.pop_Event();
}
else if( GMSwitchToPlayGameMode* p_PlayGame = EventContainer.occurredEvent<GMSwitchToPlayGameMode>() )
{
mp_GameMode = new CGamePlayMode( p_PlayGame->m_Episode, p_PlayGame->m_Numplayers,
p_PlayGame->m_Difficulty, p_PlayGame->m_DataDirectory,
p_PlayGame->m_SavedGame);
mp_GameMode->init();
EventContainer.pop_Event();
}
else if( EventContainer.occurredEvent<GMQuit>() )
{
mp_GameMode.tryDeleteData();
EventContainer.pop_Event();
return;
}
// Process the game control object
mp_GameMode->process();
......
......@@ -40,12 +40,7 @@ protected:
SmartPointer<CGameMode> mp_GameMode;
bool &m_firsttime;
bool m_show_finale;
Uint8 m_episode;
Uint8 m_Numplayers;
Uint8 m_Difficulty;
std::string m_DataDirectory;
};
#endif /* CGAMECONTROL_H_ */
......@@ -13,14 +13,14 @@
#include "engine/galaxy/CEGAGraphicsGalaxy.h"
#include "engine/CMessages.h"
#include "sdl/sound/CSound.h"
#include "common/CBehaviorEngine.h"
#include "fileio/CSavedGame.h"
#include "SmartPointer.h"
#include "CLogFile.h"
CGameLauncherMenu::CGameLauncherMenu(bool &firsttime, Uint8& Episode, Uint8& Numplayers,
Uint8& Difficulty, std::string& DataDirectory,
const int start_game_no, const int start_level) :
CGameMode(Episode, Numplayers, Difficulty, DataDirectory),
CGameLauncherMenu::CGameLauncherMenu(bool& first_time, const int start_game_no, const int start_level) :
mp_GameLauncher(NULL),
m_firsttime(firsttime),
m_firsttime(first_time),
m_start_game_no(start_game_no),
m_start_level(start_level)
{}
......@@ -38,7 +38,7 @@ bool CGameLauncherMenu::loadMenuResources()
return true;
}
bool CGameLauncherMenu::init()
void CGameLauncherMenu::init()
{
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
......@@ -54,8 +54,8 @@ bool CGameLauncherMenu::init()
if(!loadMenuResources())
{
g_pLogFile->textOut(RED, "Sorry, but the basic for creating the menu is missing, please reinstall CG with all the data.<br>");
EventContainer.add( new ChangeMode(GM_QUIT) );
return false;
EventContainer.add( new GMQuit() );
return;
}
struct GamesScan: public Action
......@@ -81,17 +81,17 @@ bool CGameLauncherMenu::init()
g_pResourceLoader->setStyle(PROGRESS_STYLE_TEXT);
if(g_pResourceLoader->RunLoadAction(new GamesScan(mp_GameLauncher), threadname) == 0)
{
EventContainer.add( new ChangeMode(GM_QUIT) );
EventContainer.add( new GMQuit() );
}
return true;
return;
}
///
// This is used for loading all the resources of the game the use has chosen.
// It loads graphics, sound and text into the memory
///
bool CGameLauncherMenu::loadResources(const Uint8 flags)
bool CGameLauncherMenu::loadResources( const std::string& DataDirectory, const int& Episode, const Uint8 flags )
{
int version;
unsigned char *p_exedata;
......@@ -99,19 +99,12 @@ bool CGameLauncherMenu::loadResources(const Uint8 flags)
CExeFile &ExeFile = g_pBehaviorEngine->m_ExeFile;
m_SavedGame.setGameDirectory(m_DataDirectory);
m_SavedGame.setEpisode(m_Episode);
// TODO: not very readable. Check if there is a function for handling that.
if( m_DataDirectory.size() > 0 && m_DataDirectory[m_DataDirectory.size()-1] != '/' )
m_DataDirectory += "/";
version = ExeFile.getEXEVersion();
p_exedata = ExeFile.getRawData();
p_exeheader = ExeFile.getHeaderData();
g_pLogFile->ftextOut("Commander Keen Episode %d (Version %d.%d) was detected.<br>", m_Episode, version/100, version%100);
if( m_Episode == 1 && version == 134) g_pLogFile->ftextOut("This version of the game is not supported!<br>");
g_pLogFile->ftextOut("Commander Keen Episode %d (Version %d.%d) was detected.<br>", Episode, version/100, version%100);
if( Episode == 1 && version == 134) g_pLogFile->ftextOut("This version of the game is not supported!<br>");
if(p_exeheader == NULL) {
g_pLogFile->textOut(RED, "CGameControl::loadResources: Could not load data from the EXE File<br>");
......@@ -122,9 +115,9 @@ bool CGameLauncherMenu::loadResources(const Uint8 flags)
CPatcher Patcher(ExeFile, g_pBehaviorEngine->m_is_a_mod);
Patcher.patchMemory();
g_pBehaviorEngine->setEpisode(m_Episode);
g_pBehaviorEngine->setEpisode(Episode);
if( m_Episode == 1 || m_Episode == 2 || m_Episode == 3 ) // Vorticon resources
if( Episode == 1 || Episode == 2 || Episode == 3 ) // Vorticon resources
{
g_pBehaviorEngine->readTeleporterTable(p_exedata);
......@@ -133,7 +126,7 @@ bool CGameLauncherMenu::loadResources(const Uint8 flags)
// Decode the entire graphics for the game (EGALATCH, EGASPRIT, etc.)
// This will also read the Tile-Properties
mp_EGAGraphics.tryDeleteData(); // except for the first start of a game this always happens
mp_EGAGraphics = new vorticon::CEGAGraphicsVort(m_Episode, m_DataDirectory);
mp_EGAGraphics = new vorticon::CEGAGraphicsVort(Episode, DataDirectory);
if(!mp_EGAGraphics.get())
return false;
......@@ -143,7 +136,7 @@ bool CGameLauncherMenu::loadResources(const Uint8 flags)
if( (flags & LOADSTR) == LOADSTR )
{
// load the strings.
CMessages Messages(p_exedata, m_Episode, version);
CMessages Messages(p_exedata, Episode, version);
Messages.extractGlobalStrings();
}
......@@ -153,11 +146,11 @@ bool CGameLauncherMenu::loadResources(const Uint8 flags)
g_pSound->loadSoundData(ExeFile);
}
g_pBehaviorEngine->getPhysicsSettings().loadGameConstants(m_Episode, p_exedata);
g_pBehaviorEngine->getPhysicsSettings().loadGameConstants(Episode, p_exedata);
return true;
}
else if( m_Episode == 4 || m_Episode == 5 || m_Episode == 6 ) // Galaxy resources
else if( Episode == 4 || Episode == 5 || Episode == 6 ) // Galaxy resources
{
// TODO: Lots of coding
if( (flags & LOADGFX) == LOADGFX )
......@@ -210,39 +203,34 @@ void CGameLauncherMenu::process()
{
//// Game has been chosen. Launch it!
// Get the path were to Launch the game
m_DataDirectory = mp_GameLauncher->getDirectory( m_start_game_no );
const std::string DataDirectory = mp_GameLauncher->getDirectory( m_start_game_no );
// We have to check which Episode will be used
m_Episode = mp_GameLauncher->getEpisode( m_start_game_no );
const int Episode = mp_GameLauncher->getEpisode( m_start_game_no );
if( m_Episode > 0 ) // The game has to have a valid episode!
if( Episode > 0 ) // The game has to have a valid episode!
{
// Get the EXE-Data of the game and load it into the memory.
if(!g_pBehaviorEngine->m_ExeFile.readData(m_Episode, m_DataDirectory))
if(!g_pBehaviorEngine->m_ExeFile.readData(Episode, DataDirectory))
{
mp_GameLauncher->letchooseagain();
}
else
{
// Load the Resources
if( loadResources() )
if( loadResources(DataDirectory, Episode) )
{
// Now look if there are any old savegames that need to be converted
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
CSavedGame savedgames;
savedgames.setGameDirectory(m_DataDirectory);
savedgames.setEpisode(m_Episode);
savedgames.setGameDirectory(DataDirectory);
savedgames.setEpisode(Episode);
savedgames.convertAllOldFormats();
if(m_start_level == -1) // Starts normally
{
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
EventContainer.add( new ChangeMode(GM_PASSIVE) );
}
EventContainer.add( new GMSwitchToPassiveMode(DataDirectory, Episode) );
else // This happens, when a level was passed as argument when launching CG
{
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
EventContainer.add( new ChangeMode(GM_PLAYGAME) );
}
EventContainer.add( new GMSwitchToPlayGameMode(Episode, 1, 1, DataDirectory, savedgames) );
}
}
}
......@@ -256,7 +244,7 @@ void CGameLauncherMenu::process()
{
// User chose "exit". So make CG quit...
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
EventContainer.add( new ChangeMode(GM_QUIT) );
EventContainer.add( new GMQuit() );
}
}
......
......@@ -11,6 +11,7 @@
#include "CGameMode.h"
#include "common/CGameLauncher.h"
#include "common/Menu/CProfilesMenu.h"
#include "engine/CEGAGraphics.h"
#include "SmartPointer.h"
enum load_states{
......@@ -22,13 +23,11 @@ LOADALL=0xFF
class CGameLauncherMenu : public CGameMode {
public:
CGameLauncherMenu(bool &firsttime, Uint8& Episode, Uint8& Numplayers,
Uint8& Difficulty, std::string& DataDirectory,
const int start_game_no = -1, const int start_level = -1);
CGameLauncherMenu(bool& first_time, const int start_game_no = -1, const int start_level = -1);
bool loadMenuResources();
bool init();
bool loadResources(const Uint8 flags = LOADALL);
bool loadResources( const std::string& DataDirectory, const int& Episode, const Uint8 flags = LOADALL);
void init();
void process();
private:
......
......@@ -17,18 +17,7 @@
#include "engine/galaxy/CPlayGameGalaxy.h"
CGameMode::CGameMode(Uint8& Episode, Uint8& Numplayers,
Uint8& Difficulty, std::string& DataDirectory):
mp_PlayGame(NULL),
m_Episode(Episode),
m_Numplayers(Numplayers),
m_Difficulty(Difficulty),
m_DataDirectory(DataDirectory)
CGameMode::CGameMode()
{
// TODO Auto-generated constructor stub
m_endgame = false;
}
CGameMode::~CGameMode() {
// TODO Auto-generated destructor stub
}
......@@ -11,43 +11,59 @@
#define CGAMEMODE_H_
#include "engine/CEvent.h"
#include "engine/playgame/CPlayGame.h"
#include "engine/CEGAGraphics.h"
#include "fileio/CSavedGame.h"
#include <string>
// CG Core Modi
enum GameMode{
GM_GAMELAUNCHER, GM_PASSIVE, GM_PLAYGAME, GM_QUIT
///////////////////////
// Events Structure //
///////////////////////
// This event switches to the GameLauncher
struct GMSwitchToGameLauncher : CEvent {
const int m_ChosenGame;
const int m_StartLevel;
GMSwitchToGameLauncher( const int ChosenGame=-1, const int StartLevel=-1 ) :
m_ChosenGame(ChosenGame),
m_StartLevel(StartLevel){}
};
// There is only one event that is triggered called ChangeMode.
// It is passed with the Mode which tells to what mode to change...
struct ChangeMode : CEvent {
const GameMode Mode;
ChangeMode(const GameMode &l_Mode) : Mode(l_Mode){}
// This event switches to the PassiveMode
struct GMSwitchToPassiveMode : CEvent {
const std::string m_DataDirectory;
const int m_Episode;
GMSwitchToPassiveMode( const std::string& DataDirectory, const int& Episode ) :
m_DataDirectory(DataDirectory),
m_Episode(Episode){}
};
class CGameMode {
public:
CGameMode(Uint8& Episode, Uint8& Numplayers,
Uint8& Difficulty, std::string& DataDirectory);
virtual ~CGameMode();
virtual void process() = 0;
virtual bool init() = 0;
// This event switches to the PlayGameMode
struct GMSwitchToPlayGameMode : CEvent {
const int m_Episode;
const int m_Numplayers;
const int m_Difficulty;
const std::string m_DataDirectory;
CSavedGame m_SavedGame;
CPlayGame *mp_PlayGame;
GMSwitchToPlayGameMode( const int Episode, const int Numplayers,
const int Difficulty, const std::string& DataDirectory, CSavedGame& SavedGame ) :
m_Episode(Episode),
m_Numplayers(Numplayers),
m_Difficulty(Difficulty),
m_DataDirectory(DataDirectory),
m_SavedGame(SavedGame){}
};
CSavedGame m_SavedGame;
// It's a simple quit event which will force CG to close the App
struct GMQuit : CEvent {};
bool m_endgame;
///////
// Base Class for the modes
//////
class CGameMode {
public:
CGameMode();
Uint8& m_Episode;
Uint8& m_Numplayers;
Uint8& m_Difficulty;
std::string& m_DataDirectory;
int current_demo;
virtual void process() = 0;
virtual void init() = 0;
};
#endif /* CGAMEMODE_H_ */
......@@ -10,78 +10,67 @@
#include "engine/vorticon/CPassiveVort.h"
#include "engine/galaxy/CPassive.h"
CGamePassiveMode::CGamePassiveMode(Uint8& episode, Uint8& Numplayers,
Uint8& Difficulty, std::string& DataDirectory) :
CGameMode(episode, Numplayers, Difficulty, DataDirectory),
mp_PassiveMode(NULL)
CGamePassiveMode::CGamePassiveMode(const std::string& DataDirectory, const int& Episode) :
m_DataDirectory(DataDirectory),
m_Episode(Episode),
m_Endgame(false),
m_Difficulty(0)
{}
bool CGamePassiveMode::init()
void CGamePassiveMode::init()
{
CExeFile &ExeFile = g_pBehaviorEngine->m_ExeFile;
// Create mp_PassiveMode object used for the screens while Player is not playing
if(m_Episode >= 4)
mp_PassiveMode = new galaxy::CPassiveGalaxy( ExeFile, m_SavedGame, m_Difficulty );
mp_Passive = new galaxy::CPassiveGalaxy();
else
mp_PassiveMode = new vorticon::CPassiveVort( ExeFile, m_SavedGame, m_Difficulty );
mp_Passive = new vorticon::CPassiveVort();
if( m_endgame == true )
if( m_Endgame == true )
{
m_endgame = false;
m_Endgame = false;
// TODO: Overload this function for galaxy
if( mp_PassiveMode->init(mp_PassiveMode->TITLE) ) return true;
if( mp_Passive->init(mp_Passive->TITLE) ) return;
}
else
{
if( mp_PassiveMode->init() ) return true;
if( mp_Passive->init() ) return;
}
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
EventContainer.add( new ChangeMode(GM_GAMELAUNCHER) );
return false;
EventContainer.add( new GMSwitchToGameLauncher(-1, -1) );
}
void CGamePassiveMode::process()
{
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
if(mp_PlayGame != NULL)
{
if( mp_PlayGame->getEndGame() )
{
EventContainer.add( new ChangeMode(GM_PLAYGAME) );
}
}
mp_PassiveMode->process();
mp_Passive->process();
// check here what the player chose from the menu over the passive mode.
// NOTE: Demo is not part of playgame anymore!!
if(mp_PassiveMode->getchooseGame())
if(mp_Passive->getchooseGame())
{
// TODO: Some of game resources are still not cleaned up here!
g_pSound->unloadSoundData();
EventContainer.add( new ChangeMode(GM_GAMELAUNCHER) );
EventContainer.add( new GMSwitchToGameLauncher(-1, -1) );
return;
}
if(mp_PassiveMode->mustStartGame())
if(mp_Passive->mustStartGame())
{
m_Episode = mp_PassiveMode->getEpisode();
m_Numplayers = mp_PassiveMode->getNumPlayers();
m_Difficulty = mp_PassiveMode->getDifficulty();
m_DataDirectory = mp_PassiveMode->getGamePath();
const int Episode = mp_Passive->getEpisode();
const int Numplayers = mp_Passive->getNumPlayers();
const int Difficulty = mp_Passive->getDifficulty();
std::string DataDirectory = mp_Passive->getGamePath();
CSavedGame SavedGame = mp_Passive->getSavedGameBlock();
EventContainer.add( new ChangeMode(GM_PLAYGAME) );
EventContainer.add( new GMSwitchToPlayGameMode( Episode, Numplayers, Difficulty, DataDirectory, SavedGame ) );
return;
}
// User wants to exit. Called from the PassiveMode
if(mp_PassiveMode->getExitEvent())
if(mp_Passive->getExitEvent())
{
EventContainer.add( new ChangeMode(GM_QUIT) );
EventContainer.add( new GMQuit() );
}
}
......@@ -10,19 +10,23 @@
#include "CGameMode.h"
#include "engine/CPassive.h"
#include "SmartPointer.h"
class CGamePassiveMode : public CGameMode {
public:
CGamePassiveMode(Uint8& episode, Uint8& Numplayers,
Uint8& Difficulty, std::string& DataDirectory);
CGamePassiveMode(const std::string& DataDirectory, const int& Episode);
bool init();
void init();
void process();
private:
CPassive *mp_PassiveMode;
SmartPointer<CPassive> mp_Passive;
const std::string m_DataDirectory;
const int m_Episode;
bool m_Endgame;
CSavedGame m_SavedGame;
int m_Difficulty;
};
#endif /* CGAMEPASSIVEMODE_H_ */
......@@ -10,15 +10,18 @@
#include "engine/vorticon/playgame/CPlayGameVorticon.h"
#include "graphics/effects/CColorMerge.h"
CGamePlayMode::CGamePlayMode(bool& show_finale, Uint8& episode,
Uint8& Numplayers, Uint8& Difficulty,
std::string& DataDirectory) :
CGameMode(episode, Numplayers, Difficulty, DataDirectory),
CGamePlayMode::CGamePlayMode(const int Episode, const int Numplayers,
const int Difficulty, const std::string& DataDirectory, CSavedGame& SavedGame) :
m_startLevel(0),
m_show_finale(show_finale)
m_show_finale(false),
m_Episode(Episode),
m_Numplayers(Numplayers),
m_Difficulty(Difficulty),
m_DataDirectory(DataDirectory),
m_SavedGame(SavedGame)
{}
bool CGamePlayMode::init()
void CGamePlayMode::init()
{
CExeFile &ExeFile = g_pBehaviorEngine->m_ExeFile;
......@@ -59,10 +62,8 @@ bool CGamePlayMode::init()
if(!ok)
{
CEventContainer& EventContainer = g_pBehaviorEngine->m_EventList;
EventContainer.add( new ChangeMode(GM_PASSIVE));
EventContainer.add( new GMSwitchToPassiveMode(m_DataDirectory, m_Episode));
}
return ok;
}
void CGamePlayMode::process()
......@@ -75,22 +76,18 @@ void CGamePlayMode::process()
if( mp_PlayGame->getEndGame() )
{
m_startLevel = 0;
m_endgame = true;
EventContainer.add( new ChangeMode(GM_PASSIVE) );
EventContainer.add( new GMSwitchToPassiveMode(m_DataDirectory, m_Episode) );
}
/*else if( mp_PlayGame->getStartGame() )
else if( mp_PlayGame->getStartGame() )
{ // Start another new game
m_Numplayers = mp_PlayGame->getNumPlayers();
m_Difficulty = mp_PlayGame->getDifficulty();
m_SavedGame = mp_PlayGame->getSavedGameBlock();
EventContainer.add( new ChangeMode(GM_PLAYGAME) );
}*/
EventContainer.add( new GMSwitchToPlayGameMode(m_Episode, m_Numplayers, m_Difficulty, m_DataDirectory, m_SavedGame) );
}
else if( mp_PlayGame->getExitEvent() )
{
EventContainer.add( new ChangeMode(GM_QUIT) );
EventContainer.add( new GMQuit() );
}
}
CGamePlayMode::~CGamePlayMode() {
// TODO Auto-generated destructor stub
}
......@@ -9,20 +9,28 @@
#define CGAMEPLAYMODE_H_
#include "CGameMode.h"
#include "engine/playgame/CPlayGame.h"
#include "fileio/CSavedGame.h"
#include "SmartPointer.h"
#include <string>
class CGamePlayMode : public CGameMode {
public:
CGamePlayMode(bool& show_finale, Uint8& episode,
Uint8& Numplayers, Uint8& Difficulty,
std::string& DataDirectory);
virtual ~CGamePlayMode();
CGamePlayMode( const int Episode, const int Numplayers,
const int Difficulty, const std::string& DataDirectory, CSavedGame& SavedGame);
bool init();
void init();
void process();
private:
int m_startLevel;
bool& m_show_finale;
bool m_show_finale;
int m_Episode;
Uint8 m_Numplayers;
Uint8 m_Difficulty;
std::string m_DataDirectory;
CSavedGame m_SavedGame;
SmartPointer<CPlayGame> mp_PlayGame;
};
#endif /* CGAMEPLAYMODE_H_ */
......@@ -7,18 +7,16 @@
*/
#include "CPassive.h"
#include "common/CBehaviorEngine.h"
CPassive::CPassive(CExeFile &Exefile,
CSavedGame &SavedGame, Uint8& difficulty) :
m_Difficulty(difficulty),
m_SavedGame(SavedGame)
CPassive::CPassive()
{
CExeFile &ExeFile = g_pBehaviorEngine->m_ExeFile;
mp_Menu = NULL;
m_modeg = false;
m_mode = INTRO;
m_Episode = Exefile.getEpisode();
m_DataDirectory = Exefile.getDataDirectory();
m_Episode = ExeFile.getEpisode();
m_DataDirectory = ExeFile.getDataDirectory();
m_NumPlayers = 0; // because no game chosen
}