From d4325ffa78ac24c8fa52dc679d545d3bd4087025 Mon Sep 17 00:00:00 2001 From: yvt Date: Wed, 1 Jan 2014 20:43:06 +0900 Subject: [PATCH 1/2] Raised version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 544271432..bb6d5ff68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(OpenSpades) set(OpenSpades_VERSION_MAJOR 0) set(OpenSpades_VERSION_MINOR 0) -set(OpenSpades_VERSION_REVISION 95) +set(OpenSpades_VERSION_REVISION 10) set(OS_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) From c272ff723c9f5090842681175887a4ba0c6eef38 Mon Sep 17 00:00:00 2001 From: yvt Date: Wed, 1 Jan 2014 20:43:46 +0900 Subject: [PATCH 2/2] time slice is shortened on windows --- Sources/Gui/Main.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Sources/Gui/Main.cpp b/Sources/Gui/Main.cpp index 512aa3015..c0cb80142 100644 --- a/Sources/Gui/Main.cpp +++ b/Sources/Gui/Main.cpp @@ -51,6 +51,28 @@ SPADES_SETTING(cl_showStartupWindow, ""); #define strncasecmp(x,y,z) _strnicmp(x,y,z) #define strcasecmp(x,y) _stricmp(x,y) +SPADES_SETTING(core_win32BeginPeriod, "1"); + +class ThreadQuantumSetter { +public: + ThreadQuantumSetter() { + if(core_win32BeginPeriod){ + timeBeginPeriod(1); + SPLog("Thread quantum was modified to 1ms by timeBeginPeriod"); + SPLog("(to disable this behavior, set core_win32BeginPeriod to 0)"); + }else{ + SPLog("Thread quantum is not modified"); + SPLog("(to enable this behavior, set core_win32BeginPeriod to 1)"); + } + } + ~ThreadQuantumSetter() { + if(core_win32BeginPeriod){ + timeEndPeriod(1); + SPLog("Thread quantum was restored"); + } + } +}; + //lm: without doing it this way, we will get a low-res icon or an ugly resampled icon in our window. //we cannot use the fltk function on the console window, because it's not an Fl_Window... void setIcon( HWND hWnd ) @@ -103,6 +125,12 @@ LONG WINAPI UnhandledExceptionProc( LPEXCEPTION_POINTERS lpEx ) ExitProcess( -1 ); //return EXCEPTION_EXECUTE_HANDLER; } +#else + +class ThreadQuantumSetter { + +}; + #endif //fltk @@ -112,6 +140,7 @@ void setWindowIcon( Fl_Window* window ) window->icon( (char *)LoadIconA( GetModuleHandle(NULL), "AppIcon" ) ); #else //check for mac / linux icon with fltk? + // yvt: no window icon on os x. #endif } @@ -336,6 +365,8 @@ int main(int argc, char ** argv) delete outs; return 0;*/ + ThreadQuantumSetter quantumSetter; + MainWindow* win = NULL; if( !cg_autoConnect ) { if(!((int)cl_showStartupWindow != 0 ||