]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIManager.cxx
allow to trigger widgets via accelerator key, which is defined via "keynum"
[flightgear.git] / src / AIModel / AIManager.cxx
index be872c4a19c58a4d2eb274b1b15ac30f8313466f..e20376516996d86bc7d44880be7ee11c5cf42fd1 100644 (file)
@@ -352,7 +352,7 @@ FGAIManager::createStatic( FGAIModelEntity *entity ) {
         return ai_static;
 }
 
-void FGAIManager::destroyObject( void* ID ) {
+void FGAIManager::destroyObject( int ID ) {
         ai_list_iterator ai_list_itr = ai_list.begin();
         while(ai_list_itr != ai_list.end()) {
             if ((*ai_list_itr)->getID() == ID) {
@@ -397,7 +397,7 @@ void FGAIManager::processThermal( FGAIThermal* thermal ) {
 void FGAIManager::processScenario( const string &filename ) {
   FGAIScenario* s = new FGAIScenario( filename );
   for (int i=0;i<s->nEntries();i++) {
-    FGAIModelEntity* en = s->getNextEntry();
+   FGAIModelEntity* const en = s->getNextEntry();
 
     if (en) {
       if ( en->m_type == "aircraft") {
@@ -430,7 +430,7 @@ void FGAIManager::processScenario( const string &filename ) {
 // This code keeps track of models that have already been loaded
 // Eventually we'd prbably need to find a way to keep track of models
 // that are unloaded again
-ssgBranch * FGAIManager::getModel(const string& path)
+ssgBranch * FGAIManager::getModel(const string& path) const
 {
   ModelVecIterator i = loadedModels.begin();
   while (i != loadedModels.end())
@@ -444,6 +444,8 @@ ssgBranch * FGAIManager::getModel(const string& path)
 
 void FGAIManager::setModel(const string& path, ssgBranch *model)
 {
+  if (model)
+    model->ref();
   loadedModels.push_back(FGModelID(path,model));
 }