control: tags -1 +patch

Am Donnerstag, den 29.06.2017, 12:04 +0100 schrieb James Cowgill:
> It looks to me like the game loop has no sleeps or other waiting in
> it.
> It has probably always consumed 100% CPU.

Good catch! I have simply added a usleep(10) call in the main loop,
effectively capping the game at about 100 FPS, and it settled at around
4% CPU consumption:

--- 3dchess-0.8.1.orig/src/main.c
+++ 3dchess-0.8.1/src/main.c
@@ -201,6 +201,7 @@ DoMain3DcLoop(void)
           XtDispatchEvent(&event);
         }
 
+    usleep(10);
     } /* End game loop */
 
   return;

Cheers,

 - Fabian

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to