void Modex:: initModexConfig(XMLConfigurationFileParser& configParser) { MODEXLOGINIT; LINFO << "intialize Modex" << LENDL; try { const deque<string>& modexList= configParser.getModuleConfiguration("modex").getGroupNamed("modexDefinitions").getListsValueAtKey("modexList"); for (deque<string>::const_iterator it=modexList.begin(), it_end=modexList.end(); it!=it_end; it++) { const std::string& modexName=(*it); // get module for this modex ModuleConfigurationStructure& modexConf=configParser.getModuleConfiguration(modexName); // get group for general modex definition GroupConfigurationStructure& modexDef=modexConf.getGroupNamed("modexDefinition"); // initialize all needed entities const deque<string>& includeEntities=modexDef.getListsValueAtKey("includeEntities"); for (deque<string>::const_iterator entityFile=includeEntities.begin(), entityFile_end=includeEntities.end(); entityFile!=entityFile_end; entityFile++) { if (*entityFile == "this") { initEntities(configParser); } else { // open file initEntities(*entityFile); } } // initialize entities in modex definition // const deque<string>& entities=modexDef.getListsValueAtKey("entities"); // TODO... (is this necessary ?) // initialize pipeline const string& pipelineName=modexDef.getParamsValueAtKey("pipeline"); m_pipeline=MediaProcessors::changeable().initPipeline(m_language,pipelineName); } } catch (NoSuchModule &) { LERROR << "missing module 'modex' in modex configuration file" << LENDL; throw InvalidConfiguration(); } catch (NoSuchGroup& e) { LERROR << "missing group 'modexDefinitions' in modex configuration file" << LENDL; throw InvalidConfiguration(); } catch (NoSuchList& ) { LERROR << "missing list 'modexList' in modex configuration file" << LENDL; throw InvalidConfiguration(); } }
GameWidget::GameWidget(QWidget *parent): QWidget(parent), gameRunning(true), FPS(60), TARGETTIME(1000/FPS), pressCount(1), waitingForKeyPressed(true),message("") { qsrand((uint)QTime::currentTime().msec()); setFixedSize(WIDTH, HEIGHT); setFocusPolicy(Qt::StrongFocus); setFocus(); initEntities(); Timer::startTimer(); spawn = enemyTrigger = false; }
void initRoomEdition(void) { initLights(); initBlocks(); initEntities(); initInterface(); initEditorRoom(&editorRoom); initContextButtons(); initSelection(NULL); initCamera(&editorCamera); // initProjectionMatrixOrtho(&editorCamera, inttof32(-128), inttof32(127),inttof32(-96), inttof32(95), inttof32(-1000), inttof32(1000)); initProjectionMatrix(&editorCamera, 70*90, inttof32(4)/3, inttof32(1)/10, inttof32(1000)); //TEMP? editorCamera.position=vect(0,0,0); editorTranslation=vect(0,0,inttof32(-1)); editorScale=inttof32(1); lineOfTouchOrigin=vect(0,0,0); lineOfTouchVector=vect(0,0,0); currentScreen=false; //initial camera setup rotateMatrixY(editorCamera.transformationMatrix, 2048+384, true); rotateMatrixX(editorCamera.transformationMatrix, 1024+128, false); editorScale=inttof32(8*20); //controls stuff touchRead(¤tTouch); oldTouch=currentTouch; //cosmetics glSetOutlineColor(0,RGB15(0,0,0)); glSetOutlineColor(1,RGB15(29,15,3)); glMaterialf(GL_AMBIENT, RGB15(8,8,8)); glMaterialf(GL_DIFFUSE, RGB15(24,24,24)); glMaterialf(GL_SPECULAR, RGB15(0,0,0)); glMaterialf(GL_EMISSION, RGB15(0,0,0)); glSetToonTableRange(0, 2, RGB15(8,8,8)); glSetToonTableRange(3, 31, RGB15(24,24,24)); glLight(0, RGB15(31,31,31), cosLerp(4096)>>3, 0, sinLerp(4096)>>3); }
void GameWidget::startGame(){ entities.clear(); initEntities(); }
void Modex:: initEntities(const std::string& filename) { XMLConfigurationFileParser configuration(LinguisticData::single().getConfigPath() + "/" + filename); initEntities(configuration); }