Skip to content

Commit

Permalink
Merge branch 'master' into swrenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed Jan 1, 2014
2 parents 768c902 + c272ff7 commit 15c3154
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
31 changes: 31 additions & 0 deletions Sources/Gui/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,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 )
Expand Down Expand Up @@ -104,6 +126,12 @@ LONG WINAPI UnhandledExceptionProc( LPEXCEPTION_POINTERS lpEx )
ExitProcess( -1 );
//return EXCEPTION_EXECUTE_HANDLER;
}
#else

class ThreadQuantumSetter {

};

#endif

//fltk
Expand All @@ -113,6 +141,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
}

Expand Down Expand Up @@ -360,6 +389,8 @@ int main(int argc, char ** argv)
delete outs;
return 0;*/

ThreadQuantumSetter quantumSetter;

MainWindow* win = NULL;
if( !cg_autoConnect ) {
if(!((int)cl_showStartupWindow != 0 ||
Expand Down

0 comments on commit 15c3154

Please sign in to comment.