void CSceneManager::ChangeScene()
{
	Safe_Delete(m_pCurScene);

	CScene* pScene = NULL;
	switch(m_eNextScene)
	{
	case STYPE_INIT:
		pScene = new CInitScene;
		break;
	case STYPE_EDIT:
		pScene = new CEditorScene;
		break;
	case STYPE_MAIN1:
		pScene = new CMainGameScene;
		break;
	}
	if(FAILED(pScene->Init()))
	{
		Safe_Delete(pScene);
		return;
	}

	m_pCurScene = pScene;
	m_pNextScene = NULL;
}
void CSceneManager::CreateScene(const eSCENE_TYPE& eScene)
{
	CScene* pScene = NULL;
	switch(eScene)
	{
	case STYPE_INIT:
		pScene = new CInitScene;
		break;
	case STYPE_EDIT:
		pScene = new CEditorScene;
		break;
	case STYPE_MAIN1:
		pScene = new CMainGameScene;
		break;
	}
	if(FAILED(pScene->Init()))
	{
		Safe_Delete(pScene);
		return;
	}

	if(m_pCurScene)
	{
		Safe_Delete(m_pCurScene);
		m_pCurScene = pScene;
	}
	else
	{
		m_pCurScene = pScene;
	}
}
Exemple #3
0
BOOL CSceneManager::CreateScene( UINT32 dwSceneID )
{
	CScene *pScene = new CScene;

	if(!pScene->Init(dwSceneID, -1000, 1000, -1000, 1000))
	{
		ASSERT_FAIELD;

		delete pScene;

		return FALSE;
	}

	m_mapSceneList.insert(std::make_pair(dwSceneID, pScene));

	return TRUE;
}