creatures, fixe

This commit is contained in:
Henrique
2011-08-15 02:09:27 -03:00
parent 92b54b6f55
commit e8448cddb9
24 changed files with 428 additions and 278 deletions

View File

@@ -11,6 +11,11 @@ Connection::Connection() :
{
}
Connection::~Connection()
{
disconnect();
}
void Connection::poll()
{
ioService.poll();
@@ -28,6 +33,11 @@ void Connection::connect(const std::string& host, uint16 port, const ConnectCall
m_timer.async_wait(std::bind(&Connection::onTimeout, shared_from_this(), std::placeholders::_1));
}
void Connection::disconnect()
{
m_socket.close();
}
void Connection::send(uint8* buffer, uint16 size)
{
asio::async_write(m_socket,

View File

@@ -11,10 +11,12 @@ class Connection : public std::enable_shared_from_this<Connection>, boost::nonco
public:
Connection();
~Connection();
static void poll();
void connect(const std::string& host, uint16 port, const ConnectCallback& connectCallback);
void disconnect();
void send(uint8* buffer, uint16 size);
void recv(uint16 bytes, uint32 timeout, const RecvCallback& callback);

View File

@@ -1,9 +1,10 @@
#include "color.h"
Color Color::white(0xFF, 0xFF, 0xFF, 0xFF);
Color Color::black(0x00, 0x00, 0x00, 0xFF);
Color Color::alpha(0x00, 0x00, 0x00, 0x00);
Color Color::red (0xFF, 0x00, 0x00, 0xFF);
Color Color::green(0x00, 0xFF, 0x00, 0xFF);
Color Color::blue (0x00, 0x00, 0xFF, 0xFF);
Color Color::pink (0xFF, 0x00, 0xFF, 0xFF);
Color Color::white (0xFF, 0xFF, 0xFF, 0xFF);
Color Color::black (0x00, 0x00, 0x00, 0xFF);
Color Color::alpha (0x00, 0x00, 0x00, 0x00);
Color Color::red (0xFF, 0x00, 0x00, 0xFF);
Color Color::green (0x00, 0xFF, 0x00, 0xFF);
Color Color::blue (0x00, 0x00, 0xFF, 0xFF);
Color Color::pink (0xFF, 0x00, 0xFF, 0xFF);
Color Color::yellow (0x00, 0xFF, 0xFF, 0xFF);

View File

@@ -39,6 +39,7 @@ public:
static Color green;
static Color blue;
static Color pink;
static Color yellow;
private:
RGBA color;