mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'nodecloner' into sim
This commit is contained in:
@@ -145,24 +145,38 @@ node_groups::insert( scene::group_handle const Group, basic_event *Event ) {
|
||||
|
||||
// sends basic content of the class in legacy (text) format to provided stream
|
||||
void
|
||||
node_groups::export_as_text( std::ostream &Output ) const {
|
||||
node_groups::export_as_text( std::ostream &Output, bool Dirty ) const {
|
||||
|
||||
for( auto const &group : m_groupmap ) {
|
||||
|
||||
Output << "group\n";
|
||||
bool any = false;
|
||||
for( auto *node : group.second.nodes ) {
|
||||
if (node->dirty() != Dirty)
|
||||
continue;
|
||||
// HACK: auto-generated memory cells aren't exported, so we check for this
|
||||
// TODO: is_exportable as basic_node method
|
||||
if( ( typeid( *node ) == typeid( TMemCell ) )
|
||||
&& ( false == static_cast<TMemCell *>( node )->is_exportable ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!any)
|
||||
Output << "group\n";
|
||||
any = true;
|
||||
|
||||
node->export_as_text( Output );
|
||||
}
|
||||
for( auto *event : group.second.events ) {
|
||||
if (Dirty)
|
||||
continue;
|
||||
|
||||
if (!any)
|
||||
Output << "group\n";
|
||||
any = true;
|
||||
|
||||
event->export_as_text( Output );
|
||||
}
|
||||
Output << "endgroup\n";
|
||||
if (any)
|
||||
Output << "endgroup\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user