From: <hi...@us...> - 2013-07-12 15:03:35
|
Revision: 13195 http://sourceforge.net/p/supertuxkart/code/13195 Author: hilnius Date: 2013-07-12 15:03:32 +0000 (Fri, 12 Jul 2013) Log Message: ----------- reducing thread consumption. One thread is still updated as often as possible, but i don't know which. Modified Paths: -------------- main/branches/hilnius/src/network/protocol_manager.cpp main/branches/hilnius/src/network/stk_host.cpp Modified: main/branches/hilnius/src/network/protocol_manager.cpp =================================================================== --- main/branches/hilnius/src/network/protocol_manager.cpp 2013-07-12 14:08:33 UTC (rev 13194) +++ main/branches/hilnius/src/network/protocol_manager.cpp 2013-07-12 15:03:32 UTC (rev 13195) @@ -21,6 +21,7 @@ #include "network/protocol.hpp" #include "network/network_manager.hpp" #include "utils/log.hpp" +#include "graphics/irr_driver.hpp" #include <assert.h> #include <cstdlib> @@ -33,6 +34,7 @@ while(!manager->exit()) { manager->update(); + irr_driver->getDevice()->sleep(20); } return NULL; } Modified: main/branches/hilnius/src/network/stk_host.cpp =================================================================== --- main/branches/hilnius/src/network/stk_host.cpp 2013-07-12 14:08:33 UTC (rev 13194) +++ main/branches/hilnius/src/network/stk_host.cpp 2013-07-12 15:03:32 UTC (rev 13195) @@ -40,7 +40,7 @@ ENetHost* host = (((STKHost*)(self))->m_host); while (1) { - while (enet_host_service(host, &event, 0) != 0) { + while (enet_host_service(host, &event, 20) != 0) { Event* evt = new Event(&event); if (event.type != ENET_EVENT_TYPE_NONE) NetworkManager::getInstance()->notifyEvent(evt); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |