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()); |
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 |
} |
} |
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 |
} |
} |
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 |