Commit 1308e3df authored by Gerhard Stein's avatar Gerhard Stein

Cleanups

parent 7e53e66b
......@@ -17,30 +17,20 @@
namespace vorticon
{
CPassiveVort::CPassiveVort() :
mp_Option(g_pBehaviorEngine->m_option),
m_RestartVideo(false)
{
mp_IntroScreen = NULL;
mp_TitleScreen = NULL;
m_GoDemo = false;
m_textsize = 0;
}
bool CPassiveVort::init(char mode)
{
mp_Scrollsurface = g_pVideoDriver->mp_VideoEngine->getScrollSurface();
//mp_Scrollsurface = g_pVideoDriver->mp_VideoEngine->getScrollSurface();
m_mode = mode;
if( m_mode == INTRO )
{
mp_IntroScreen = new CIntro();
mpIntroScreen = new CIntro();
mpMap = new CMap;
CMapLoader MapLoader( mpMap );
MapLoader.load( m_Episode, 90, m_DataDirectory);
mpMap->gotoPos( 64+5*320, 32); // Coordinates of star sky
mpMap->drawAll();
mp_IntroScreen->init();
mpIntroScreen->init();
mpMap->changeTileArrayY(8, 15, 2, 560);
}
else if( m_mode == TITLE )
......@@ -50,8 +40,8 @@ bool CPassiveVort::init(char mode)
MapLoader.load( m_Episode, 90, m_DataDirectory);
mpMap->gotoPos( 32, 32 ); // Coordinates of title screen
mpMap->drawAll();
mp_TitleScreen = new CTitle( *mpMap.get() );
mp_TitleScreen->init(m_Episode);
mpTitleScreen = new CTitle( *mpMap.get() );
mpTitleScreen->init(m_Episode);
}
else if( m_mode == DEMO )
{
......@@ -88,40 +78,25 @@ void CPassiveVort::process()
if( m_mode == INTRO )
{
// Intro code goes here!
mp_IntroScreen->process();
mpIntroScreen->process();
if( mp_IntroScreen->isFinished() )
if( mpIntroScreen->isFinished() )
{
// Shutdown mp_IntroScreen and show load Title Screen
cleanup();
init(TITLE);
}
}
else if( m_mode == TITLE )
{
mp_TitleScreen->process();
mpTitleScreen->process();
}
else if( m_mode == DEMO )
{
// TODO: Demo modes are processed here!
// TODO: Implement Demos here!
cleanup();
init(TITLE);
}
}
void CPassiveVort::cleanup()
{
/*if(!m_object.empty())
{
for(std::vector<CObject*>::iterator obj = m_object.begin() ; obj!=m_object.end() ; obj++)
SAFE_DELETE(*obj);
m_object.clear();
}*/
SAFE_DELETE(mp_IntroScreen);
SAFE_DELETE(mp_TitleScreen);
}
}
......@@ -18,28 +18,15 @@ namespace vorticon
class CPassiveVort : public CPassive
{
public:
CPassiveVort();
bool init(char mode = INTRO);
void process();
void cleanup();
private:
CIntro *mp_IntroScreen;
CTitle *mp_TitleScreen;
CTilemap *mp_Tilemap;
SmartPointer<CIntro> mpIntroScreen;
SmartPointer<CTitle> mpTitleScreen;
SmartPointer<CMap> mpMap;
stOption *mp_Option;
SDL_Surface *mp_Scrollsurface;
int m_textsize;
bool m_GoDemo;
char *m_text;
bool m_RestartVideo;
std::vector<CObject*> mObject;
};
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment