Esempio n. 1
0
LogMessageWindow::LogMessageWindow(Ogre::Real aW, Ogre::Real aH):
	m_width(aW),
	m_height(aH),
	m_log(""),
	m_displaylog("")
{
	m_console = NULL;
	initialize();
	Ogre::TextAreaOverlayElement* textArea = static_cast<Ogre::TextAreaOverlayElement*>(m_textarea);
	m_displaylinenum = (int)(m_height/textArea->getCharHeight());
	show(false);
}
Esempio n. 2
0
void gkDebugScreen::pushText(const gkString& text)
{
	utStringUtils::split(m_splitBuf, text, "\n\r");
	Ogre::TextAreaOverlayElement* textArea = static_cast<Ogre::TextAreaOverlayElement*>(m_ele);

	const gkVector2& winSize = gkWindowSystem::getSingleton().getMouse()->winsize;



	gkScalar che = textArea->getCharHeight();

	for (UTsize i = 0; i < m_splitBuf.size(); ++i)
	{
		ScreenBufferItem* item  = m_lineBuffer.alloc();
		item->clear();
		item->m_buf = m_splitBuf.at(i);

		m_lines.push_back(item);
		gkScalar size = gkScalar(m_lines.size()) * che;
		if (size > winSize.y)
			m_lineBuffer.dealloc(m_lines.pop_front());
	}


	m_splitBuf.clear(true);

	if (!m_lines.empty())
	{
		// write lines
		m_txtBuffer.resize(0);


		ScreenBufferItem* node = m_lines.begin();
		while (node)
		{
			m_txtBuffer += node->m_buf + "\n";
			node = node->getNext();
		}
	}


	_getClipped();
}