//=========================================================================== void CSMLoginScene::StartEntry() { WriteCon( "@@ CSMLoginScene::StartEntry()\r\n" ); CCLog( "@@login04: StartEntry()\r\n" ); #if 1 if (m_pLabelPromtp) { m_pLabelPromtp->SetText( NDCommonCString2(SZ_SETUP).c_str() ); m_pLabelPromtp->SetVisible( true ); } ShowWaitingAni(); { WriteCon( "@@ NDLocalXmlString::LoadData()...\r\n" ); TIME_SLICE("NDLocalXmlString::LoadData()"); NDLocalXmlString::GetSingleton().LoadData(); } { WriteCon( "@@ ScriptMgrObj.Load()...\r\n" ); TIME_SLICE("ScriptMgrObj.Load()"); ScriptMgrObj.Load(); //加载LUA脚本 } ScriptMgrObj.excuteLuaFunc( "LoadData", "GameSetting" ); CloseUpdateUILayer(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) //if ( m_iAccountID == 0 ) m_iAccountID = ScriptMgrObj.excuteLuaFuncRetN( "GetAccountID", "Login_ServerUI" ); #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) m_iAccountID = NDBeforeGameMgrObj.GetCurrentUser(); #endif ScriptMgrObj.excuteLuaFunc( "ShowUI", "Entry", m_iAccountID ); // ScriptMgrObj.excuteLuaFunc("ProecssLocalNotification", "MsgLoginSuc"); #else //多线程不会有什么好处,反而是崩溃和不稳定, //实际上网络线程和控制台线程都是多余的!单线程足够了! if (m_pLabelPromtp) { m_pLabelPromtp->SetText( NDCommonCString2(SZ_SETUP).c_str() ); m_pLabelPromtp->SetVisible( true ); } ShowWaitingAni(); NDLocalXmlString::GetSingleton(); ScriptMgrObj; pthread_t pid; pthread_create(&pid, NULL, CSMLoginScene::LoadTextAndLua, (void*)this); #endif CCLOG( "@@ CSMLoginScene::StartEntry() -- done.\r\n" ); }
void StartLoading::regLua() { //@reglua: 注册C++类到LUA { WriteCon( "@@ ScriptMgrObj.RegLua_Class()\r\n" ); TIME_SLICE("ScriptMgrObj.RegLua_Class()"); ScriptFramework::RegLua_Class(); ScriptMgrObj.RegLua_Class_Commit(); } //注册C++函数到LUA { WriteCon( "@@ ScriptMgrObj.RegLua_Func()\r\n" ); TIME_SLICE("ScriptMgrObj.RegLua_Func()"); ScriptMgr::RegLua_Func(); } }
bool StartLoading::loadInner() { // 加载Xml字符串 { WriteCon( "@@ NDLocalXmlString::LoadData()...\r\n" ); TIME_SLICE("NDLocalXmlString::LoadData()"); NDLocalXmlString::GetSingleton().LoadData(); } // 加载ini格式的字符串 GStr.load(); // 加载所有Lua脚本 { WriteCon( "@@ ScriptMgrObj.LoadEntryLua()\r\n" ); TIME_SLICE("ScriptMgrObj.LoadLua()"); ScriptMgr::LoadEntryLua(); } // 加载地图配置文件 NDTileMapConfigObj.load(); return true; }