Changeset 433 for trunk/src/gui
- Timestamp:
- 07/21/15 19:40:00 (10 years ago)
- Location:
- trunk/src/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/gui_environment.cc
r401 r433 30 30 } 31 31 32 void nv::gui::environment::load_style( const st d::string& filename )32 void nv::gui::environment::load_style( const string_view& filename ) 33 33 { 34 34 m_renderer->load_style( filename ); -
trunk/src/gui/gui_gfx_renderer.cc
r406 r433 187 187 } 188 188 189 nv::size_t gfx_renderer::load_font( const st d::string& filename, nv::size_t size )190 { 191 std::string id_name( filename );189 nv::size_t gfx_renderer::load_font( const string_view& filename, nv::size_t size ) 190 { 191 std::string id_name( filename.data(), filename.size() ); 192 192 char buffer[8]; size_t len = nv::sint32_to_buffer( sint32( size ), buffer ); 193 193 id_name.append( std::string( buffer, len ) ); 194 auto i = m_font_names.find( id_name ); 194 string_view id( id_name.c_str(), id_name.size() ); 195 auto i = m_font_names.find( id ); 195 196 if ( i != m_font_names.end() ) 196 197 { … … 198 199 } 199 200 size_t result = m_fonts.size(); 200 texture_font* f = new texture_font( &m_atlas, filename. c_str(), static_cast<float>( size ) );201 texture_font* f = new texture_font( &m_atlas, filename.data(), static_cast<float>( size ) ); 201 202 f->load_glyphs( "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ " ); 202 203 m_fonts.push_back( f ); 203 204 m_reupload = true; 204 m_font_names[ id_name] = result;205 m_font_names[ id ] = result; 205 206 return result; 206 207 } 207 208 208 nv::size_t gfx_renderer::load_image( const st d::string& filename )209 nv::size_t gfx_renderer::load_image( const string_view& filename ) 209 210 { 210 211 auto i = m_image_names.find( filename ); … … 253 254 if ( m_style.get( e, "skin", selector, path ) ) 254 255 { 255 size_t image_id = load_image( path);256 size_t image_id = load_image( string_view( path.c_str(), path.size() ) ); 256 257 const image_info* image = get_image( image_id ); 257 258 if ( image ) … … 318 319 if ( m_style.get( e, "text_color", selector, color ) && m_style.get( e, "text_font", selector, path ) && m_style.get( e, "text_size", selector, border ) ) 319 320 { 320 size_t font_id = load_font( path, size_t( border ) );321 size_t font_id = load_font( string_view( path.c_str(), path.size() ), size_t( border ) ); 321 322 texture_font* font = get_font( font_id ); 322 323 position p = abs.ul + position( 0, border ); -
trunk/src/gui/gui_renderer.cc
r395 r433 7 7 #include "nv/gui/gui_renderer.hh" 8 8 9 void nv::gui::renderer::load_style( const st d::string& filename )9 void nv::gui::renderer::load_style( const string_view& filename ) 10 10 { 11 11 m_style.load_style( filename ); -
trunk/src/gui/gui_style.cc
r406 r433 16 16 } 17 17 18 void style::load_style( const st d::string& filename )18 void style::load_style( const string_view& filename ) 19 19 { 20 20 m_lua.do_file( filename );
Note: See TracChangeset
for help on using the changeset viewer.