| 1494 | } |
| 1495 | |
| 1496 | void AppFrame::Run()LNOEXCEPT |
| 1497 | { |
| 1498 | LASSERT(m_iStatus == AppStatus::Initialized); |
| 1499 | LINFO("开始执行游戏循环"); |
| 1500 | |
| 1501 | m_fFPS = 0.f; |
| 1502 | #if (defined LDEVVERSION) || (defined LDEBUG) |
| 1503 | m_UpdateTimer = 0.f; |
| 1504 | m_RenderTimer = 0.f; |
| 1505 | m_PerformanceUpdateTimer = 0.f; |
| 1506 | m_PerformanceUpdateCounter = 0.f; |
| 1507 | m_FPSTotal = 0.f; |
| 1508 | m_ObjectTotal = 0.f; |
| 1509 | m_UpdateTimerTotal = 0.f; |
| 1510 | m_RenderTimerTotal = 0.f; |
| 1511 | #endif |
| 1512 | |
| 1513 | if (m_bSplashWindowEnabled) // 显示过载入窗口 |
| 1514 | { |
| 1515 | // 显示窗口 |
| 1516 | m_pMainWindow->MoveToCenter(); |
| 1517 | m_pMainWindow->SetVisiable(true); |
| 1518 | |
| 1519 | // 改变显示模式到全屏 |
| 1520 | if (!m_OptionWindowed) |
| 1521 | ChangeVideoMode((int)m_OptionResolution.x, (int)m_OptionResolution.y, m_OptionWindowed, m_OptionVsync); |
| 1522 | } |
| 1523 | m_bSplashWindowEnabled = false; |
| 1524 | |
| 1525 | // 窗口前移、显示、隐藏鼠标指针 |
| 1526 | SetActiveWindow((HWND)m_pMainWindow->GetHandle()); // 然并卵 |
| 1527 | // SetForegroundWindow((HWND)m_pMainWindow->GetHandle()); |
| 1528 | // BringWindowToTop((HWND)m_pMainWindow->GetHandle()); |
| 1529 | m_pMainWindow->SetHideIME(true); |
| 1530 | m_pMainWindow->HideMouse(!m_OptionSplash); |
| 1531 | |
| 1532 | // 启动游戏循环 |
| 1533 | m_pEngine->Run(F2DENGTHREADMODE_MULTITHREAD, m_OptionFPSLimit); |
| 1534 | |
| 1535 | LINFO("退出游戏循环"); |
| 1536 | } |
| 1537 | |
| 1538 | bool AppFrame::SafeCallScript(const char* source, size_t len, const char* desc)LNOEXCEPT |
| 1539 | { |