/[usata]/usata2/src/scene-loader.cpp
ViewVC logotype

Diff of /usata2/src/scene-loader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by skunix, Wed Feb 23 16:52:07 2005 UTC revision 1.2 by skunix, Fri Feb 25 18:08:01 2005 UTC
# Line 56  SceneLoader::thread_load(const std::stri Line 56  SceneLoader::thread_load(const std::stri
56          }          }
57                                    
58          ObjectVector loading;          ObjectVector loading;
59            std::auto_ptr <ObjectVector> LoadedObjects(new ObjectVector);
60          std::string native_path = file.native_file_string();          std::string native_path = file.native_file_string();
61                    
62          std::ifstream is(native_path.c_str());          std::ifstream is(native_path.c_str());
# Line 85  SceneLoader::thread_load(const std::stri Line 86  SceneLoader::thread_load(const std::stri
86                  if (no_gci)                  if (no_gci)
87                  {                  {
88                          no_gci->construct(odp->props);                          no_gci->construct(odp->props);
89                          loading.push_back(Object_sp(no));                          LoadedObjects->push_back(Object_sp(no));
90                          ls << "successfully loaded and initialized " << odp->type                          ls << "successfully loaded and initialized " << odp->type
91                                  <<log::commit;                                  <<log::commit;
92                  }                  }
# Line 96  SceneLoader::thread_load(const std::stri Line 97  SceneLoader::thread_load(const std::stri
97                                                    
98          }          }
99    
100            if (success)
101            {
102                    boost::mutex::scoped_lock lockit(mRealizeQueueM);
103                    mRealizeQueue.push(LoadedObjects.release());
104            }
105          is.close();          is.close();
106          return;          return;
107  }  }
# Line 126  SceneLoader::thread_main() Line 132  SceneLoader::thread_main()
132          }          }
133  }  }
134    
135    //      virtual void    realize(Usata&, const Object_sp& );
136  void  void
137  SceneLoader::update()  SceneLoader::update(Usata& us)
138  {  {
139            boost::mutex::scoped_lock lock1(mRealizeQueueM);
140    
141            log::BufferedStream ls;
142    
143            while (!mRealizeQueue.empty())
144            {
145                    ObjectVector* ovp;
146                    ovp = mRealizeQueue.front();
147                    mRealizeQueue.pop();
148            
149                    ObjectVector::iterator it = ovp->begin(), ite=ovp->end();
150                    for (; it!= ite; ++it)
151                    {
152                            GCInterface * gci_object =
153                                    dynamic_cast<GCInterface*>(it->get());
154                            if (!gci_object)
155                                    continue;
156                            
157                            gci_object->realize(us, *it);
158                    }
159                                                    
160    
161                    delete ovp;
162            }
163  }  }
164    
165  void  void

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26