Changeset 519
- Timestamp:
- 08/26/16 21:56:27 (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/core/types.hh
r518 r519 150 150 type_entry* i_type = new type_entry; 151 151 i_type->type_db = this; 152 i_type->hash = thash64 ( shash64( name ).value());152 i_type->hash = thash64::create< TYPE >(); 153 153 i_type->name = m_names.insert( name ); 154 154 i_type->size = sizeof( TYPE ); … … 168 168 } 169 169 170 const type_entry* get_type( shash64 name ) const 171 { 172 auto it = m_index_by_name.find( name ); 173 return it != m_index_by_name.end() ? it->second : nullptr; 174 } 175 170 176 type_entry* get_type( thash64 hash ) 177 { 178 auto it = m_index_by_type.find( hash ); 179 return it != m_index_by_type.end() ? it->second : nullptr; 180 } 181 182 const type_entry* get_type( thash64 hash ) const 171 183 { 172 184 auto it = m_index_by_type.find( hash ); -
trunk/nv/engine/particle_engine.hh
r518 r519 203 203 static string_view get_debug_name( particle_emitter_func f ); 204 204 static string_view get_debug_name( particle_affector_func f ); 205 static const vector< particle_emitter_func >* get_debug_emitter_list() { return m_debug_emitter_list; } 206 static const vector< particle_affector_func >* get_debug_affector_list() { return m_debug_affector_list; } 205 207 static const type_entry* get_debug_type( particle_affector_init_func f ); 206 208 static void register_types( type_database* db ); … … 225 227 static hash_store< shash64, particle_affector_funcs > m_affectors; 226 228 229 static vector< particle_emitter_func >* m_debug_emitter_list; 230 static vector< particle_affector_func >* m_debug_affector_list; 227 231 static hash_map< particle_emitter_func, const_string >* m_debug_emitter_names; 228 232 static hash_map< particle_affector_func, const_string >* m_debug_affector_names; -
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.