MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Flush

Method Flush

code/icarus/Sequencer.cpp:149–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147*/
148
149int CSequencer::Flush( CSequence *owner, CIcarus* icarus )
150{
151 if ( owner == NULL )
152 return SEQ_FAILED;
153
154 Recall(icarus);
155
156
157 //Flush the sequences
158/* sequenceID_m::iterator iterSeq = NULL;
159 for ( iterSeq = m_sequenceMap.begin(); iterSeq != m_sequenceMap.end(); )
160 {
161 if ( ( (*iterSeq).second == owner ) || ( owner->HasChild( (*iterSeq).second ) ) || ( (*iterSeq).second->HasFlag( CSequence::SQ_PENDING ) ) || ( (*iterSeq).second->HasFlag( CSequence::SQ_TASK ) ) )
162 {
163 iterSeq++;
164 continue;
165 }
166
167 //Delete it, and remove all references
168 RemoveSequence( (*iterSeq).second, icarus );
169 icarus->DeleteSequence( (*iterSeq).second );
170
171 //Remove it from the map
172 //Delete from the sequence list and move on
173 iterSeq = m_sequenceMap.erase( iterSeq );
174 }*/
175
176
177 // OLD STUFF!
178 //Flush the sequences
179 sequence_l::iterator sli;
180 for ( sli = m_sequences.begin(); sli != m_sequences.end(); )
181 {
182 if ( ( (*sli) == owner ) || ( owner->HasChild( (*sli) ) ) || ( (*sli)->HasFlag( CSequence::SQ_PENDING ) ) || ( (*sli)->HasFlag( CSequence::SQ_TASK ) ) )
183 {
184 ++sli;
185 continue;
186 }
187
188 //Remove it from the map
189 //m_sequenceMap.erase( (*sli)->GetID() );
190
191 //Delete it, and remove all references
192 RemoveSequence( (*sli), icarus );
193 icarus->DeleteSequence( (*sli) );
194
195 //Delete from the sequence list and move on
196 sli = m_sequences.erase( sli );
197 }
198
199 //Make sure this owner knows it's now the root sequence
200 owner->SetParent( NULL );
201 owner->SetReturn( NULL );
202
203 return SEQ_OK;
204}
205
206/*

Callers

nothing calls this directly

Calls 8

beginMethod · 0.45
endMethod · 0.45
HasChildMethod · 0.45
HasFlagMethod · 0.45
DeleteSequenceMethod · 0.45
eraseMethod · 0.45
SetParentMethod · 0.45
SetReturnMethod · 0.45

Tested by

no test coverage detected