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 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 #include "tetris.h" CTetrisGame::CTetrisGame(int screenX, int screenY, int bitDepth, bool fullscreen, CTetrisTheme *theme, const list &fieldOffsets) @@ -159,6 +160,7 @@ while (!done && SDL_PollEvent(&event)) { handleEvent(event); + usleep(200); } switch(state) @@ -281,6 +283,7 @@ ct = 0; (static_cast (*(sprites.begin())))->setText(ss.str()); }*/ + usleep(3000); } return true;