1+ #include < hyperlib/assets/scenery.hpp>
2+ #include < hyperlib/streamer/sections.hpp>
3+ #include < hyperlib/streamer/track_path.hpp>
14#include < hyperlib/world/world.hpp>
25
36namespace hyper
@@ -19,4 +22,45 @@ namespace hyper
1922 {
2023 call_function<void (__cdecl*)()>(0x007AF8F0 )();
2124 }
25+
26+ void world::enable_barrier_scenery_group (const char * name, bool flip_artwork)
27+ {
28+ if (visible_section::manager::get_group_info (name) != nullptr )
29+ {
30+ std::uint32_t key = hashing::bin (name);
31+
32+ visible_section::manager::instance.enable_group (key);
33+
34+ scenery::group::enable (key, flip_artwork);
35+
36+ track_path::manager::instance.enable_barriers (name);
37+ }
38+ }
39+
40+ void world::disable_all_scenery_groups ()
41+ {
42+ for (const scenery::group* i = scenery::group::list.begin (); i != scenery::group::list.end (); i = i->next ())
43+ {
44+ if (scenery::group::enabled_table[i->group_number ])
45+ {
46+ i->disable_rendering ();
47+
48+ scenery::group::enabled_table[i->group_number ] = 0 ;
49+ }
50+ }
51+ }
52+
53+ void world::redo_topology_and_scenery_groups ()
54+ {
55+ track_path::manager::instance.disable_all_barriers ();
56+
57+ visible_section::manager::instance.disable_all_groups ();
58+
59+ world::disable_all_scenery_groups ();
60+
61+ if (scenery::group::find (hashing::bin_const (" SCENERY_GROUP_DOOR" )) != nullptr )
62+ {
63+ world::enable_barrier_scenery_group (" SCENERY_GROUP_DOOR" , false );
64+ }
65+ }
2266}
0 commit comments