diff --git a/source/SkyXEngine.h b/source/SkyXEngine.h index bbba1e82d05609cdb4c2193a6676c056127ed46b..17c3b78428d385a0498ced1a3b77dc7714af249a 100644 --- a/source/SkyXEngine.h +++ b/source/SkyXEngine.h @@ -292,7 +292,7 @@ QT стиль документирования (!) и QT_AUTOBRIEF - корот #ifndef __SKYXENGINE_H #define __SKYXENGINE_H -#define SKYXENGINE_VERSION "X.1.1-dev" +#define SKYXENGINE_VERSION "X.1.2-dev" #define SKYXENGINE_VERSION4EDITORS "SkyXEngine version " ## SKYXENGINE_VERSION diff --git a/source/core/Core.cpp b/source/core/Core.cpp index 80fa9562d7715d271a67da737f0b41d5bd54de26..edd460248cfe0f0b9270a265da49b0615235276b 100644 --- a/source/core/Core.cpp +++ b/source/core/Core.cpp @@ -206,14 +206,18 @@ void CCore::initUpdatable() { return(a.uPriority < b.uPriority); }); + + m_tLastUpdateTime = std::chrono::high_resolution_clock::now(); } void CCore::runUpdate() { static Array<ID> s_aIdToWait; ID idTask; - //@FIXME: Change to actual value! - float fDeltaTime = 0.016f; + time_point tNow = std::chrono::high_resolution_clock::now(); + float fDeltaTime = (float)std::chrono::duration_cast<std::chrono::microseconds>(tNow - m_tLastUpdateTime).count() / 1000000.0f; + m_tLastUpdateTime = tNow; + for(UINT i = 0, l = m_aUpdatables.size(); i < l; ++i) { idTask = m_aUpdatables[i].pUpdatable->run(fDeltaTime); diff --git a/source/core/Core.h b/source/core/Core.h index a76ee7b4312f2795994ecfdab49e797ed8772d42..5a9f00d56bb5d03f5772a75b5ca389a6e3002a4a 100644 --- a/source/core/Core.h +++ b/source/core/Core.h @@ -59,9 +59,12 @@ protected: Array<_update_sys> m_aUpdatables; + CPerfMon *m_pPerfMon = NULL; CTimeManager *m_pTimers = NULL; CTaskManager *m_pTaskManager = NULL; + + std::chrono::system_clock::time_point m_tLastUpdateTime; }; #endif diff --git a/source/xWindow/Window.cpp b/source/xWindow/Window.cpp index 96e665c94a1db8be571850f3c7b2bacc44e1e960..ce50ef6213a9926475802c9c974e8029aef2f835 100644 --- a/source/xWindow/Window.cpp +++ b/source/xWindow/Window.cpp @@ -203,6 +203,14 @@ void XMETHODCALLTYPE CWindow::setTitle(const char *szTitle) } void XMETHODCALLTYPE CWindow::update(const XWINDOW_DESC *pWindowDesc) { + HMONITOR monitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST); + MONITORINFO info; + info.cbSize = sizeof(MONITORINFO); + GetMonitorInfo(monitor, &info); + bool bForceNoBorder = (pWindowDesc->iSizeX == info.rcMonitor.right - info.rcMonitor.left + && pWindowDesc->iSizeY == info.rcMonitor.bottom - info.rcMonitor.top); + + if(pWindowDesc->flags & XWF_BUTTON_CLOSE) { SetClassLong(m_hWnd, GCL_STYLE, GetClassLong(m_hWnd, GCL_STYLE) & ~CS_NOCLOSE); @@ -226,7 +234,7 @@ void XMETHODCALLTYPE CWindow::update(const XWINDOW_DESC *pWindowDesc) { wndStyle |= WS_SYSMENU; } - if(pWindowDesc->flags & XWF_NOBORDER) + if((pWindowDesc->flags & XWF_NOBORDER) || bForceNoBorder) { wndStyle &= ~(WS_SYSMENU | WS_CAPTION | WS_MAXIMIZE | WS_MINIMIZE | WS_THICKFRAME); }