Fixed usage of usleep and round for visual studio.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@13561 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-08-25 12:02:18 +00:00
parent ff1ef8b0b6
commit 9896c7ae3b
3 changed files with 15 additions and 6 deletions

View File

@ -19,13 +19,22 @@
#include "guiengine/modaldialog.hpp"
#include "guiengine/widgets/rating_bar_widget.hpp"
#include "utils/string_utils.hpp"
#include <string.h>
#include <IGUIEnvironment.h>
#include <IGUIElement.h>
#include <IGUIButton.h>
#include <cmath>
#ifdef WIN32
// VS up to and including VS 2012 do not provide the normal round function
static inline double round(double val)
{
return floor(val + 0.5);
}
#endif
#include <string.h>
using namespace GUIEngine;
using namespace irr::core;
using namespace irr;

View File

@ -34,7 +34,7 @@ void* protocolManagerUpdate(void* data)
while(!manager->exit())
{
manager->update();
usleep(20000);
irr_driver->getDevice()->sleep(20);
}
return NULL;
}
@ -44,7 +44,7 @@ void* protocolManagerAsynchronousUpdate(void* data)
while(!manager->exit())
{
manager->asynchronousUpdate();
usleep(20000);
irr_driver->getDevice()->sleep(20);
}
return NULL;
}

View File

@ -161,7 +161,7 @@ uint8_t* STKHost::receiveRawPacket()
{
i++;
len = recv(m_host->socket,(char*)buffer,2048, 0);
usleep(1000);
irr_driver->getDevice()->sleep(1);
}
return buffer;
}
@ -186,7 +186,7 @@ uint8_t* STKHost::receiveRawPacket(TransportAddress* sender)
{
i++;
len = recvfrom(m_host->socket, (char*)buffer, 2048, 0, &addr, &from_len);
usleep(1000); // wait 1 millisecond between two checks
irr_driver->getDevice()->sleep(1); // wait 1 millisecond between two checks
}
struct sockaddr_in *sin = (struct sockaddr_in *) (&addr);
// we received the data
@ -226,7 +226,7 @@ uint8_t* STKHost::receiveRawPacket(TransportAddress sender)
{
i++;
len = recvfrom(m_host->socket, (char*)buffer, 2048, 0, &addr, &from_len);
usleep(1000); // wait 1 millisecond between two checks
irr_driver->getDevice()->sleep(1); // wait 1 millisecond between two checks
}
if (addr.sa_family == AF_INET)
{