Skip to content

Commit

Permalink
order main entity tree
Browse files Browse the repository at this point in the history
  • Loading branch information
bobke committed Jun 20, 2024
1 parent 116860b commit e5a5d4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions src/bengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ int main(int argc, char* argv[])
std::cout << "bengine3 starting..." << std::endl;

// TOP PARENT ENTITY
BEntityTop* toptop = new BEntityTop(); // in this entity we do slower mem saving stuff
BEntityTop* toptop = new BEntityTop();
toptop->setName("root");
toptop->construct();
toptop->enableLoopManager();
toptop->spawnChildrenManager();
toptop->spawnCommandBuffer();
toptop->spawnPluginManager();

// assure bin directory comes firs
auto bin = toptop->addChild( "bin", new BEntity() );

// plugin manager (spawns /lib)
toptop->spawnPluginManager();

// PLUGIN MANAGER
BEntity_Plugin_Manager* plugin_manager = toptop->pluginManager();
Expand All @@ -33,7 +37,6 @@ int main(int argc, char* argv[])
sys->addChild( "timer", new BTimer() );
sys->addChild( "sleeper", new BSleeper() );


// binary path
char buf3[1024];
readlink("/proc/self/exe", buf3, 1024);
Expand All @@ -45,12 +48,10 @@ int main(int argc, char* argv[])
sys->addChild( "binary_path", new BEntity_string() )->set( buff2.c_str() );
}

// binary
// binary relative path
std::string binary( argv[0] );
sys->addChild( "binary", new BEntity_string() )->set( binary.c_str() );

std::cout << binary.c_str() << std::endl;

// LOAD SCENE
if ( argc > 1 )
{
Expand All @@ -66,10 +67,8 @@ int main(int argc, char* argv[])
plugin_manager->load( "app_admin window", "src/plugins/be_plugin_app_admin_window", "be_plugin_app_admin_window" );
}


// LOADING OBJECT FROM CLASS NAMED SCENE FROM LIBRARY
// BEntity* scene = toptop->addChild("bin", "Scene");
BEntity* bin = toptop->addChild( "bin", "entity" );
BEntity* scene = bin->addChild( "", "Scene" );

if ( scene != 0 )
Expand Down Expand Up @@ -108,7 +107,7 @@ int main(int argc, char* argv[])
std::cout << "running..." << std::endl;
toptop->process_general();
}

delete toptop;

// FINISH
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/be_plugin_app_admin_window/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

setAdminWindow( this );

setName( "Admin Window" );
setName( "Entity Tree" );
// std::cout << "Scene::construct()" << std::endl;

// LOAD QT APP FIXME THIS DOESN'T NEED TO GET ONTO THE TREE
Expand Down Expand Up @@ -101,7 +101,7 @@

auto qwindow = addChild( "QMainWindow", "QMainWindow" );

qwindow->addChild( "title", "string_property" )->set("Admin Window");
qwindow->addChild( "title", "string_property" )->set("Entity Tree");
qwindow->addChild( "x", "uint_property" )->set(Buint(100));
qwindow->addChild( "y", "uint_property" )->set(Buint(30));
qwindow->addChild( "width", "uint_property" )->set(Buint(500));
Expand Down Expand Up @@ -138,7 +138,7 @@

// CREATE LEFT ENTITIES
auto entity_groupbox = general_layout_H->addChild( "Entity Groupbox", "QGroupBox" );
entity_groupbox->addChild( "title", "string_property" )->set("Entities");
// entity_groupbox->addChild( "title", "string_property" )->set("Entities");
auto groupVbox = entity_groupbox->addChild( "QT VBoxlayout", "QVBoxLayout" );
entity_groupbox->addChild( "QGroupBox_end", "QGroupBox_end" );

Expand Down Expand Up @@ -405,7 +405,7 @@

// CREATE LEFT ENTITIES
auto entity_groupbox = general_layout_H->addChild( "Entity Groupbox", "QGroupBox" );
entity_groupbox->addChild( "title", "string_property" )->set("Entities");
// entity_groupbox->addChild( "title", "string_property" )->set("Entities");
auto groupVbox = entity_groupbox->addChild( "QT VBoxlayout", "QVBoxLayout" );

add_admin_entity_groupbox(groupVbox, entity);
Expand Down

0 comments on commit e5a5d4d

Please sign in to comment.