예제 #1
0
파일: ConLog.cpp 프로젝트: 252525fb/rpcs3
	LogPacket _pop()
	{
		LogPacket ret;

		u32 c_get = m_get;

		const u32& sprefix = *(u32*)&m_buffer[c_get];
		c_get += sizeof(u32);
		if(sprefix) memcpy(wxStringBuffer(ret.m_prefix, sprefix), &m_buffer[c_get], sprefix);
		c_get += sprefix;

		const u32& stext = *(u32*)&m_buffer[c_get];
		c_get += sizeof(u32);
		if(stext) memcpy(wxStringBuffer(ret.m_text, stext), &m_buffer[c_get], stext);
		c_get += stext;

		const u32& scolour = *(u32*)&m_buffer[c_get];
		c_get += sizeof(u32);
		if(scolour) memcpy(wxStringBuffer(ret.m_colour, scolour), &m_buffer[c_get], scolour);
		c_get += scolour;

		m_get = c_get;
		if(!HasNewPacket()) Flush();

		return ret;
	}
예제 #2
0
파일: ConLog.cpp 프로젝트: bsaetia/rpcs3
	LogPacket _pop()
	{
		u32 c_get = m_get;

		const u32& sprefix = *(u32*)&m_buffer[c_get];
		c_get += sizeof(u32);
		const std::string prefix( (const char*) &m_buffer[c_get], sprefix);
		c_get += sprefix;

		const u32& stext = *(u32*)&m_buffer[c_get];
		c_get += sizeof(u32);
		const std::string text( (const char*) &m_buffer[c_get], stext);
		c_get += stext;

		const u32& scolour = *(u32*)&m_buffer[c_get];
		c_get += sizeof(u32);
		const std::string colour( (const char*) &m_buffer[c_get], scolour);
		c_get += scolour;

		m_get = c_get;
		if(!HasNewPacket()) Flush();

		return LogPacket(prefix, text, colour);
	}