Ejemplo n.º 1
0
void VisualDebugger::draw()
{
 
 ArrayIterator<Scene*> iterator = mWorld->getScenes();
 mMeshData->mLines.clear();
 mMeshData->mColours.clear();
 mMeshData->mNbLines = 0;

 for (Scene* scene = iterator.begin(); scene = iterator.next();)
 {
  const NxDebugRenderable* renderable = scene->getScene()->getDebugRenderable();
  
  if (renderable == 0)
   continue;
  
  unsigned int nbLines = renderable->getNbLines();
  const NxDebugLine* lines = renderable->getLines();
  while(nbLines--)
  {
   mMeshData->mLines.append(lines->p0.x);
   mMeshData->mLines.append(lines->p0.y);
   mMeshData->mLines.append(lines->p0.z);
   mMeshData->mLines.append(lines->p1.x);
   mMeshData->mLines.append(lines->p1.y);
   mMeshData->mLines.append(lines->p1.z);
   mMeshData->mColours.append(lines->color);
   mMeshData->mColours.append(lines->color);
   lines++;
  }
  mMeshData->mNbLines += renderable->getNbLines();
 }

 
 mRenderable->drawVisualDebugger(mMeshData);
}
Ejemplo n.º 2
0
Archive* ResourceSystem::openArchive(const String& name, const UniformResourceIdentifier& uri)
{
 ResourceProtocol* requestedProtocol = 0;
 ArrayIterator<ResourceProtocol*> iterator = mProtocols.getIterator();
 for (ResourceProtocol* protocol = iterator.begin(); protocol = iterator.next();)
 {
  if (protocol->getProtocolHash() == uri.getProtocolHash())
  {
   requestedProtocol = protocol;
   break;
  }
 }
  
 if (requestedProtocol == 0)
 {
  SharedStringStream ss(200);
  ss << "Could not open archive '" << uri.getLocation() << ":" << uri.getLocation() << "\n"
     << "Reason: Protocol could not be found.";
  NxOgre_ThrowError(ss.get());
  return 0;
 }
  
 Archive* archive = requestedProtocol->openArchive(name, uri);
  
 if (archive == 0)
 {
  SharedStringStream ss(200);
  ss << "Could not open archive '" << uri.getLocation() << ":" << uri.getLocation() << "\n"
     << "Reason: Protocol could not open archive.";
  NxOgre_ThrowError(ss.get());
  return 0;
 }
 
 mArchives.insert(archive);
 return archive;
}