示例#1
0
Bool TApplication::TApplicationState_Bootup::OnBegin(TRefRef PreviousMode)
{
	TApplication* pApp = GetStateMachine<TApplication>();
	// TODO:

	//	gr: if this fails (e.g. no logo asset) skip onto next mode
	Bool bSuccess = CreateIntroScreen();
	
	if(!bSuccess)
		return FALSE;
	

	// Subscribe to the asset manager
	TLMessaging::g_pEventChannelManager->SubscribeTo(this, "Asset", "OnAssetChanged"); 

	// TODO:
	// Setup language
	// Setup Audio - language specific
	// Load Text - language specific
	// Setup global settings

	// Obtain list of files to load at startup
	pApp->GetPreloadFiles(m_PreloadFiles);

	
	if(m_PreloadFiles.GetSize() > 0)
	{
		// Request the load of the assets
		for ( s32 i=m_PreloadFiles.GetLastIndex();	i>=0;	i-- )
			TLAsset::LoadAsset( m_PreloadFiles[i], FALSE );
	}
	
	return TStateMode::OnBegin(PreviousMode);
}