2013-11-05 01:14:22 +08:00
|
|
|
//
|
|
|
|
// Created by NiTe Luo on 10/31/13.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#include "RenderCommand.h"
|
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
|
|
|
RenderCommand::RenderCommand()
|
|
|
|
{
|
2013-11-07 06:57:42 +08:00
|
|
|
_id = 0;
|
|
|
|
_type = UNKNOWN_COMMAND;
|
2013-11-05 01:14:22 +08:00
|
|
|
}
|
|
|
|
|
2013-11-08 02:09:53 +08:00
|
|
|
RenderCommand::~RenderCommand()
|
|
|
|
{
|
|
|
|
}
|
2013-11-05 01:14:22 +08:00
|
|
|
|
|
|
|
void printBits(size_t const size, void const * const ptr)
|
|
|
|
{
|
|
|
|
unsigned char *b = (unsigned char*) ptr;
|
|
|
|
unsigned char byte;
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
for (i=size-1;i>=0;i--)
|
|
|
|
{
|
|
|
|
for (j=7;j>=0;j--)
|
|
|
|
{
|
|
|
|
byte = b[i] & (1<<j);
|
|
|
|
byte >>= j;
|
|
|
|
printf("%u", byte);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
puts("");
|
|
|
|
}
|
|
|
|
|
|
|
|
void RenderCommand::printID()
|
|
|
|
{
|
|
|
|
printf("CommandID: ");
|
2013-11-07 06:57:42 +08:00
|
|
|
printBits(sizeof(_id), &_id);
|
2013-11-05 01:14:22 +08:00
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_CC_END
|