void TIM5_IRQHandler(void) { unsigned char num_entities; struct ImageEntry entity; unsigned char i; unsigned char begin = 0x55; if (TIM_GetITStatus(TIM5, TIM_IT_Update) != RESET){ TIM_ClearITPendingBit(TIM5, TIM_IT_Update); if(TableReady){ TableReady = 0; num_entities = getchar(); for(i = 0; i < num_entities; i++){ USART_readData(&entity, sizeof(struct ImageEntry), 1); processEntity(&entity); } SwitchFlag = !SwitchFlag; putchar(begin); } } }
void InputMovementSystem::processEntities(artemis::ImmutableBag<artemis::Entity*> & bag) { for (int i = 0; i < bag.getCount; i++) { processEntity(*bag.get(i)); } }
/** Process iteratively all the directories within the given directory. Inside each directory, all the files are processed. The name of the file processed is saved in a file. @param path: path to the directory to process @param name: name of the directory to process */ void DatasetGenerator::processDirectory(string &path, const string &directory) { //Save dir name if file dirNames<<path+directory<<endl; //Open directory and add dir to the path string dirToOpen=path+directory; auto dir=opendir(dirToOpen.c_str()); path=dirToOpen+'/'; if(dir==NULL){ cout << "Could not open directory "<<dirToOpen<<endl; return; } //Read directory and process items struct dirent* entity=readdir(dir); while(entity!=NULL) { processEntity(path, entity); entity= readdir(dir); } //Remove dir from the path path.resize(path.length() -1 -directory.length()); closedir(dir); }
void processReceive(ENetEvent& evt) { switch (evt.channelID) { case narf::net::CHAN_CHAT: processChat(evt); break; case narf::net::CHAN_PLAYERCMD: processPlayerCmd(evt); break; case narf::net::CHAN_CHUNK: processChunk(evt); break; case narf::net::CHAN_ENTITY: processEntity(evt); break; } }
void XMLTreeBuilder::processToken(const AtomicXMLToken& token) { switch (token.type()) { case XMLTokenTypes::Uninitialized: ASSERT_NOT_REACHED(); break; case XMLTokenTypes::ProcessingInstruction: processProcessingInstruction(token); break; case XMLTokenTypes::XMLDeclaration: processXMLDeclaration(token); break; case XMLTokenTypes::DOCTYPE: processDOCTYPE(token); break; case XMLTokenTypes::StartTag: processStartTag(token); break; case XMLTokenTypes::EndTag: processEndTag(token); break; case XMLTokenTypes::CDATA: processCDATA(token); break; case XMLTokenTypes::Character: processCharacter(token); break; case XMLTokenTypes::Comment: processComment(token); break; case XMLTokenTypes::Entity: processEntity(token); break; case XMLTokenTypes::EndOfFile: exitText(); return; } }
void DotSceneLoader::processNode(rapidxml::xml_node<>* XMLNode, Ogre::SceneNode *pParent) { // Construct the node's name Ogre::String name = m_sPrependNode + getAttrib(XMLNode, "name"); // Create the scene node Ogre::SceneNode *pNode; if (name.empty()) { // Let Ogre choose the name if (pParent) pNode = pParent->createChildSceneNode(); else pNode = mAttachNode->createChildSceneNode(); } else { // Provide the name if (pParent) pNode = pParent->createChildSceneNode(name); else pNode = mAttachNode->createChildSceneNode(name); } // Process other attributes Ogre::String id = getAttrib(XMLNode, "id"); bool isTarget = getAttribBool(XMLNode, "isTarget"); rapidxml::xml_node<>* pElement; // Process position (?) pElement = XMLNode->first_node("position"); if (pElement) { pNode->setPosition(parseVector3(pElement)); pNode->setInitialState(); } // Process rotation (?) pElement = XMLNode->first_node("rotation"); if (pElement) { pNode->setOrientation(parseQuaternion(pElement)); pNode->setInitialState(); } // Process scale (?) pElement = XMLNode->first_node("scale"); if (pElement) { pNode->setScale(parseVector3(pElement)); pNode->setInitialState(); } // Process lookTarget (?) pElement = XMLNode->first_node("lookTarget"); if (pElement) processLookTarget(pElement, pNode); // Process trackTarget (?) pElement = XMLNode->first_node("trackTarget"); if (pElement) processTrackTarget(pElement, pNode); // Process node (*) pElement = XMLNode->first_node("node"); while (pElement) { processNode(pElement, pNode); pElement = pElement->next_sibling("node"); } // Process entity (*) pElement = XMLNode->first_node("entity"); while (pElement) { processEntity(pElement, pNode); pElement = pElement->next_sibling("entity"); } // Process light (*) //pElement = XMLNode->first_node("light"); //while(pElement) //{ // processLight(pElement, pNode); // pElement = pElement->next_sibling("light"); //} // Process camera (*) pElement = XMLNode->first_node("camera"); while (pElement) { processCamera(pElement, pNode); pElement = pElement->next_sibling("camera"); } // Process particleSystem (*) pElement = XMLNode->first_node("particleSystem"); while (pElement) { processParticleSystem(pElement, pNode); pElement = pElement->next_sibling("particleSystem"); } // Process billboardSet (*) pElement = XMLNode->first_node("billboardSet"); while (pElement) { processBillboardSet(pElement, pNode); pElement = pElement->next_sibling("billboardSet"); } // Process plane (*) pElement = XMLNode->first_node("plane"); while (pElement) { processPlane(pElement, pNode); pElement = pElement->next_sibling("plane"); } // Process userDataReference (?) pElement = XMLNode->first_node("userDataReference"); if (pElement) processUserDataReference(pElement, pNode); }
void DelayedEntityProcessingSystem::processEntities(ImmutableBag<Entity*>& bag, float accumulatedDelta) { for(int i=0; i< bag.getCount(); i++) processEntity(*bag.get(i), accumulatedDelta); }
void EntityProcessingSystem::processEntities(ImmutableBag<Entity*>& bag) { for(int i=0; i < bag.getCount(); i++) {processEntity(*bag.get(i));} }
void DotSceneLoader::processNode(TiXmlElement *xmlNode, Node *pParent) { // Construct the node's name std::string name = getAttrib(xmlNode, "name"); // Create the scene node Node *node; if(name.empty()) { // Let Ogre choose the name if(pParent) { node = scene->createNode(); pParent->addChild(node); } else { node = scene->createNode(); rootNode->addChild(node); } } else { // Provide the name if(pParent) { node = scene->createNode(/*name*/); pParent->addChild(node); } else { node = scene->createNode(/*name*/); rootNode->addChild(node); } } // Process other attributes std::string id = getAttrib(xmlNode, "id"); bool isTarget = getAttribBool(xmlNode, "isTarget"); TiXmlElement *element; // Process position (?) element = xmlNode->FirstChildElement("position"); if(element) { node->setPosition(parseVector3(element)); } // Process rotation (?) element = xmlNode->FirstChildElement("rotation"); if(element) { node->setOrientation(parseQuaternion(element)); } // Process scale (?) element = xmlNode->FirstChildElement("scale"); if(element) { node->setScale(parseVector3(element)); } // Process lookTarget (?) element = xmlNode->FirstChildElement("lookTarget"); if(element) processLookTarget(element, node); // Process trackTarget (?) element = xmlNode->FirstChildElement("trackTarget"); if(element) processTrackTarget(element, node); // Process node (*) element = xmlNode->FirstChildElement("node"); while(element) { processNode(element, node); element = element->NextSiblingElement("node"); } // Process entity (*) element = xmlNode->FirstChildElement("entity"); while(element) { processEntity(element, node); element = element->NextSiblingElement("entity"); } // Process light (*) element = xmlNode->FirstChildElement("light"); while(element) { processLight(element, node); element = element->NextSiblingElement("light"); } // Process camera (*) element = xmlNode->FirstChildElement("camera"); while(element) { processCamera(element, node); element = element->NextSiblingElement("camera"); } // Process particleSystem (*) element = xmlNode->FirstChildElement("particleSystem"); while(element) { processParticleSystem(element, node); element = element->NextSiblingElement("particleSystem"); } // Process billboardSet (*) element = xmlNode->FirstChildElement("billboardSet"); while(element) { processBillboardSet(element, node); element = element->NextSiblingElement("billboardSet"); } // Process plane (*) element = xmlNode->FirstChildElement("plane"); while(element) { processPlane(element, node); element = element->NextSiblingElement("plane"); } // Process userDataReference (?) element = xmlNode->FirstChildElement("userDataReference"); if(element) processUserDataReference(element, node); }
void Level::parseLevelObject(TiXmlElement *XMLNode, Ogre::SceneNode *parent) { Ogre::Vector3 spawnPosition; Ogre::Quaternion spawnRotation; Ogre::SceneNode* node; Ogre::String name = getAttribute(XMLNode, "name"); Ogre::String mesh = name; if(name.empty()) { // Let Ogre choose the name if(parent) node = parent->createChildSceneNode(); else node = mAttachNode->createChildSceneNode(); } else { // Provide the name if(parent) node = parent->createChildSceneNode(name); else node = mAttachNode->createChildSceneNode(name); } Ogre::String id = getAttribute(XMLNode, "id"); TiXmlElement *element; element = XMLNode->FirstChildElement("position"); if(element) { spawnPosition = parseVector3(element); node->setPosition(spawnPosition); node->setInitialState(); } element = XMLNode->FirstChildElement("rotation"); if(element) { node->setOrientation(parseQuaternion(element)); spawnRotation = parseQuaternion(element); } element = XMLNode->FirstChildElement("scale"); if(element) { node->setScale(parseVector3(element)); node->setInitialState(); } element = XMLNode->FirstChildElement("node"); while(element) { parseLevelObject(element, node); element = element->NextSiblingElement("node"); } element = XMLNode->FirstChildElement("entity"); while(element) { processEntity(element, node); element = element->NextSiblingElement("entity"); } }
void ashley::IntervalIteratingSystem::updateInterval() { for (auto &entity : *entities) { processEntity(entity); } }
bool LevelGeometryLoader::processNode(TiXmlElement *XMLNode, Ogre::SceneNode *&pNode) { ASSERT(XMLNode); ASSERT(pNode == 0); pNode = 0; // create the node pNode = GLOBAL_SCN_MNGR->getRootSceneNode()->createChildSceneNode(); // Process other attributes TiXmlElement *pElement; // Process position (?) pElement = XMLNode->FirstChildElement("position"); if(pElement) { pNode->setPosition(Ogre::DotSceneLoader::parseVector3(pElement)); pNode->setInitialState(); } // Process rotation (?) pElement = XMLNode->FirstChildElement("rotation"); if(pElement) { pNode->setOrientation(Ogre::DotSceneLoader::parseQuaternion(pElement)); pNode->setInitialState(); } // Process scale (?) pElement = XMLNode->FirstChildElement("scale"); if(pElement) { pNode->setScale(Ogre::DotSceneLoader::parseVector3(pElement)); pNode->setInitialState(); } #ifdef DEBUG // no animations for this pElement = XMLNode->FirstChildElement("animations"); if(pElement) { debugERROR("Animation en geometry... algo ta mal...\n"); ASSERT(false); } // Process lookTarget (?) pElement = XMLNode->FirstChildElement("lookTarget"); if(pElement){ debugERROR("lookTarget en geometry... algo ta mal...\n"); ASSERT(false); } // Process trackTarget (?) pElement = XMLNode->FirstChildElement("trackTarget"); if(pElement){ debugERROR("trackTarget en geometry... algo ta mal...\n"); ASSERT(false); } #endif // Process node (*) pElement = XMLNode->FirstChildElement("node"); while(pElement) { debugERROR("Estamos teniendo Nested Nodes, por ahora no queremos eso " "xD\n"); ASSERT(false); // processNode(pElement, pNode); // pElement = pElement->NextSiblingElement("node"); } // Process entity (*) pElement = XMLNode->FirstChildElement("entity"); while(pElement) { Ogre::Entity *ent = processEntity(pElement); ASSERT(ent); pNode->attachObject(ent); pElement = pElement->NextSiblingElement("entity"); } #ifdef DEBUG // Process light (*) pElement = XMLNode->FirstChildElement("light"); ASSERT(!pElement); // Process camera (*) pElement = XMLNode->FirstChildElement("camera"); ASSERT(!pElement); // Process particleSystem (*) pElement = XMLNode->FirstChildElement("particleSystem"); ASSERT(!pElement); // Process billboardSet (*) pElement = XMLNode->FirstChildElement("billboardSet"); ASSERT(!pElement); // Process plane (*) pElement = XMLNode->FirstChildElement("plane"); ASSERT(!pElement); // Process userDataReference (?) pElement = XMLNode->FirstChildElement("userDataReference"); ASSERT(!pElement); #endif return true; }
void ashley::IteratingSystem::update(float deltaTime) { std::for_each(entities->begin(), entities->end(), [&](ashley::Entity * found) { processEntity(found, deltaTime); }); }