Changeset 486 for trunk/src/engine
- Timestamp:
- 02/24/16 18:47:54 (9 years ago)
- Location:
- trunk/src/engine
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/engine/material_manager.cc
r485 r486 12 12 using namespace nv; 13 13 14 15 nv::gpu_material_manager::gpu_material_manager( context* context, material_manager* matmgr, image_manager* imgmgr ) 16 : m_context( context ) 17 , m_material_manager( matmgr ) 18 , m_image_manager( imgmgr ) 19 { 20 uint8 data[2 * 2 * 3]; 21 nv::raw_fill_n( data, 2 * 2 * 3, 0 ); 22 m_default = m_context->get_device()->create_texture( ivec2(2,2), nv::image_format( nv::RGB ), nv::sampler(), data ); 23 } 24 14 25 bool gpu_material_manager::load_resource( const string_view& id ) 15 26 { … … 20 31 for ( uint32 i = 0; i < size( mat->paths ); ++i ) 21 32 if ( !mat->paths[i].empty() ) 33 { 22 34 if ( auto data = m_image_manager->get( mat->paths[i] ).lock() ) 23 35 { 24 36 result->textures[i] = m_context->get_device()->create_texture( &*data, smp ); 25 37 } 38 } 39 40 // HACK 41 for ( uint32 i = 0; i < 5; ++i ) 42 if ( result->textures[i].is_nil() ) 43 result->textures[i] = m_default; 44 26 45 add( id, result ); 27 46 return true; … … 44 63 m->paths[ TEX_SPECULAR ] = table.get_string128( "specular" ); 45 64 m->paths[ TEX_NORMAL ] = table.get_string128( "normal" ); 65 m->paths[ TEX_EMISSIVE ] = table.get_string128( "emissive" ); 46 66 m->paths[ TEX_GLOSS ] = table.get_string128( "gloss" ); 47 67 add( id, m ); -
trunk/src/engine/resource_system.cc
r485 r486 23 23 } 24 24 25 void nv::lua_resource_manager_base::load_all( )25 void nv::lua_resource_manager_base::load_all( bool do_clear ) 26 26 { 27 clear();27 if ( do_clear ) clear(); 28 28 lua::table_guard table( m_lua, get_storage_name() ); 29 29 uint32 count = table.get_unsigned( "__counter" );
Note: See TracChangeset
for help on using the changeset viewer.