X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Ftcontrl.c;h=2ce441639b8d0f4e13349b502da627a955e2b389;hb=7b316f96d850ca6807fb2a6e86f0c35a0c7d9858;hp=a9ec0d346a20f9f3c0d08e0f89083df4e84eaf03;hpb=68c554411d120d163045f77a80ad9009f7a73841;p=gnushogi.git diff --git a/gnushogi/tcontrl.c b/gnushogi/tcontrl.c index a9ec0d3..2ce4416 100644 --- a/gnushogi/tcontrl.c +++ b/gnushogi/tcontrl.c @@ -346,7 +346,7 @@ CheckForTimeout(int score, int globalscore, int Jscore, int zwndw) #endif if (flag.timeout) - ShowMessage("timeout"); + dsp->ShowMessage("timeout"); } @@ -366,7 +366,7 @@ ElapsedTime(ElapsedTime_mode iop) struct timeval tv; #endif - PollForInput(); + dsp->PollForInput(); #ifdef HAVE_GETTIMEOFDAY gettimeofday(&tv, NULL); @@ -411,6 +411,27 @@ ElapsedTime(ElapsedTime_mode iop) #ifdef QUIETBACKGROUND if (!background) #endif - UpdateClocks(); + dsp->UpdateClocks(); } } + + +void +SetTimeControl(void) +{ + if (TCflag) + { + TimeControl.moves[black] = TimeControl.moves[white] = TCmoves; + TimeControl.clock[black] += 6000L * TCminutes + TCseconds * 100; + TimeControl.clock[white] += 6000L * TCminutes + TCseconds * 100; + } + else + { + TimeControl.moves[black] = TimeControl.moves[white] = 0; + TimeControl.clock[black] = TimeControl.clock[white] = 0; + } + + flag.onemove = (TCmoves == 1); + et = 0; + ElapsedTime(COMPUTE_AND_INIT_MODE); +}