Package: blocks-of-the-undead / 1.0-7

01-sleep_a_bit.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: Sleep between handling events
 These can't accour that often and without a sleep we use way too much CPU.
Forwarded: no
Author: Evgeni Golov <evgeni@debian.org>
Last-Update: 2012-05-01

Index: blocks-of-the-undead-1.0/TetrisAttack/src/CTetrisGame.cpp
===================================================================
--- blocks-of-the-undead-1.0.orig/TetrisAttack/src/CTetrisGame.cpp	2005-01-17 05:49:02.000000000 +0100
+++ blocks-of-the-undead-1.0/TetrisAttack/src/CTetrisGame.cpp	2012-05-01 20:13:20.321936666 +0200
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "tetris.h"
 
 CTetrisGame::CTetrisGame(int screenX, int screenY, int bitDepth, bool fullscreen, CTetrisTheme *theme, const list<CVector> &fieldOffsets)
@@ -159,6 +160,7 @@
 		while (!done && SDL_PollEvent(&event))
 		{
 			handleEvent(event);
+			usleep(200);
 		}
 		
 		switch(state)
@@ -281,6 +283,7 @@
 			ct = 0;
 			(static_cast<CText*> (*(sprites.begin())))->setText(ss.str());
 		}*/
+		usleep(3000);
 	}
 
 	return true;