Changeset 519 for trunk/src/engine
- Timestamp:
- 08/26/16 21:56:27 (9 years ago)
- Location:
- trunk/src/engine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/engine/default_resource_manager.cc
r518 r519 27 27 { 28 28 m_lua = lua; 29 30 particle_engine::register_types( const_cast< type_database* >( lua->get_type_data()->get_type_database() ) );31 29 32 30 int below_already_registered; -
trunk/src/engine/particle_engine.cc
r518 r519 15 15 nv::hash_store< nv::shash64, nv::particle_emitter_func > nv::particle_engine::m_emitters; 16 16 nv::hash_store< nv::shash64, nv::particle_affector_funcs > nv::particle_engine::m_affectors; 17 18 nv::vector< nv::particle_emitter_func >* nv::particle_engine::m_debug_emitter_list; 19 nv::vector< nv::particle_affector_func >* nv::particle_engine::m_debug_affector_list; 20 17 21 18 22 nv::hash_map< nv::particle_emitter_func, nv::const_string >* nv::particle_engine::m_debug_emitter_names = nullptr; … … 158 162 }; 159 163 164 NV_RTTI_DECLARE( nvpe_linear_force_data ) 165 160 166 static bool nv_particle_affector_linear_force_init( lua::table_guard* table, particle_affector_data* data ) 161 167 { … … 189 195 float distance; 190 196 }; 197 198 NV_RTTI_DECLARE( nvpe_deflector_plane_data ) 191 199 192 200 static bool nv_particle_affector_deflector_plane_init( lua::table_guard* table, particle_affector_data* data ) … … 226 234 }; 227 235 236 NV_RTTI_DECLARE( nvpe_color_fader_data ) 237 228 238 static bool nv_particle_affector_color_fader_init( lua::table_guard* table, particle_affector_data* data ) 229 239 { … … 247 257 nv::vec2 adjustment; 248 258 }; 259 260 NV_RTTI_DECLARE( nvpe_scaler_data ) 249 261 250 262 static bool nv_particle_affector_scaler_init( lua::table_guard* table, particle_affector_data* data ) … … 274 286 m_debug_affector_names = new nv::hash_map< nv::particle_affector_func, nv::const_string >; 275 287 m_debug_affector_types = new nv::hash_map< nv::particle_affector_func, nv::type_entry* >; 288 m_debug_emitter_list = new nv::vector< nv::particle_emitter_func >; 289 m_debug_affector_list = new nv::vector< nv::particle_affector_func >; 276 290 } 277 291 … … 695 709 if ( m_debug_emitter_names ) 696 710 ( *m_debug_emitter_names )[func] = name; 711 if ( m_debug_emitter_list ) 712 ( *m_debug_emitter_list ).push_back( func ); 713 697 714 m_emitters[ name ] = func; 698 715 } … … 716 733 if ( m_debug_affector_names ) 717 734 ( *m_debug_affector_names )[process] = name; 735 if ( m_debug_affector_list ) 736 ( *m_debug_affector_list ).push_back( process ); 718 737 719 738 m_affectors[ name ].init = init; … … 777 796 void nv::particle_engine::register_types( type_database* db ) 778 797 { 779 db->create_type< nv::particle_orientation>()798 db->create_type<particle_orientation>() 780 799 .value( "PS_POINT", sint32( particle_orientation::POINT ), "Point" ) 781 800 .value( "PS_ORIENTED", sint32( particle_orientation::ORIENTED ), "Oriented" ) … … 785 804 ; 786 805 787 db->create_type< nv::particle_origin>()806 db->create_type<particle_origin>() 788 807 .value( "PS_CENTER", sint32( particle_origin::CENTER ), "Center" ) 789 808 .value( "PS_TOP_LEFT", sint32( particle_origin::TOP_LEFT ), "Top left" ) … … 800 819 { 801 820 int you_could_get_rid_of_the_init_function_using_these; int error; 821 int universal_vm_based_affector; 822 // compile_affector( ... ) in lua, returns array of bytecode 823 // function is a normal bytecode runner! 824 802 825 803 826 (*m_debug_affector_types)[ nv_particle_affector_linear_force ]
Note: See TracChangeset
for help on using the changeset viewer.