Esempio n. 1
0
void Window::setDebugInfoFont(std::string const& filename)
{
    if (mDebugInfoFont.loadFromFile(filename))
    {
        updateDebugInfo();
    }
}
	void cNoAlphaShaderAccumulate::update(float elapsedtime)
	{
		/// shader
		iter_shadercol it_shader = m_list.begin();
		for (; it_shader != m_list.end(); ++it_shader)
		{
			cUberShader* shader = _getUberShaderMgr()->get(it_shader->first);
			if (!shader)
				continue;

			/// material
			map_mtlcol& mtlList = it_shader->second->m_mtlColList;
			iter_mtlcol it_mtl = mtlList.begin();
			for (; it_mtl != mtlList.end(); ++it_mtl)
			{
				/// mesh
				vec_meshcol& meshList = it_mtl->second->m_meshColList;
				iter_meshcol it_mesh = meshList.begin();
				for (; it_mesh != meshList.end(); ++it_mesh)
				{
					shader->update(elapsedtime, (*it_mesh)->m_mesh, it_mtl->second->m_mtl, (*it_mesh)->m_entity);
				}			
			}
		}

		if (_getIsRender(RENDER_NORMAL) || _getIsRender(RENDER_TANGENT) || _getIsRender(RENDER_BINORMAL))
		{
			updateDebugInfo();
		}
	}
Esempio n. 3
0
void Window::setDebugInfoFont(sf::Font* font)
{
    if (font != nullptr)
    {
        mDebugInfoFont = *font;
        updateDebugInfo();
    }
}
Esempio n. 4
0
void Window::setDebugInfo(std::string const& id, std::string const& value)
{
    auto itr = mDebugInfo.find(id);
    mDebugInfo[id].setString(id + " : " + value);
    if (itr == mDebugInfo.end())
    {
        updateDebugInfo();
    }
}
Esempio n. 5
0
void Window::removeDebugInfo(std::string const& id)
{
    for (auto itr = mDebugInfo.begin(); itr != mDebugInfo.end(); itr++)
    {
        if (itr->first == id)
        {
            mDebugInfo.erase(itr);
            updateDebugInfo();
        }
    }
}
Esempio n. 6
0
void KonvergoWindow::toggleDebug()
{
  if (property("showDebugLayer").toBool())
  {
    m_infoTimer->stop();
    setProperty("showDebugLayer", false);
  }
  else
  {
    m_infoTimer->start();
    updateDebugInfo();
    setProperty("showDebugLayer", true);
  }
}
Esempio n. 7
0
void Window::removeDebugInfos()
{
    mDebugInfo.clear();
    updateDebugInfo();
}
Esempio n. 8
0
void Window::setDebugInfoCharsize(std::size_t charsize)
{
    mDebugInfoCharsize = charsize;
    updateDebugInfo();
}
Esempio n. 9
0
void Window::setDebugInfoColor(sf::Color const& color)
{
    mDebugInfoColor = color;
    updateDebugInfo();
}
void KonvergoWindow::handleHostCommand(QString hostCommand)
{
  QLOG_DEBUG() << "Got command:" << hostCommand;
  QString arguments = "";
  int arguments_start = hostCommand.indexOf(":");
  if (arguments_start > 0)
  {
    arguments = hostCommand.mid(arguments_start + 1);
    hostCommand = hostCommand.mid(0, arguments_start);
  }
  if (hostCommand == "fullscreen")
  {
    SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", !SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "fullscreen").toBool());
  }
  else if (hostCommand == "close")
  {
    close();
  }
  else if (hostCommand == "player")
  {
    PlayerComponent::Get().userCommand(arguments);
  }
  else if (hostCommand == "toggleDebug")
  {
    if (property("showDebugLayer").toBool())
    {
      m_infoTimer->stop();
      setProperty("showDebugLayer", false);
    }
    else
    {
      m_infoTimer->start();
      updateDebugInfo();
      setProperty("showDebugLayer", true);
    }
  }
  else if (hostCommand == "recreateRpiUi")
  {
    DisplayManager* display_manager = DisplayComponent::Get().getDisplayManager();
    if (display_manager)
      display_manager->resetRendering();
  }
  else if (hostCommand == "reload")
  {
    emit reloadWebClient();
  }
  else if (hostCommand == "crash!")
  {
    *(volatile int*)0=0;
  }
  else if (hostCommand == "poweroff")
  {
    PowerComponent::Get().PowerOff();
  }
  else if (hostCommand == "suspend")
  {
    PowerComponent::Get().Suspend();
  }
  else if (hostCommand == "reboot")
  {
    PowerComponent::Get().Reboot();
  }
  else
  {
    QLOG_WARN() << "unknown host command" << hostCommand;
  }
}