Ignore:
Timestamp:
01/12/17 14:41:17 (8 years ago)
Author:
epyon
Message:

CONTINUED:

  • getting rid of size_t
  • datatypes now restricted to uint32 size
  • 64-bit compatibility
  • copyright updates where modified
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/gui_gfx_renderer.cc

    r501 r534  
    109109{
    110110public:
    111         screen_render_data( context* actx, nv::size_t initial_size )
     111        screen_render_data( context* actx, nv::uint32 initial_size )
    112112                : buffer( actx, VERTEX_BUFFER, DYNAMIC_DRAW, initial_size ), ctx( actx ), varray(), shader()
    113113        {
     
    147147        m_area.dim( dimension( w->get_width(), w->get_height() ) );
    148148        region white = m_atlas.get_region( ivec2( 3, 3 ) );
    149         size_t wsize = m_atlas.get_depth() * 4 * 4;
     149        uint32 wsize = m_atlas.get_depth() * 4 * 4;
    150150        uint8* wfill = new uint8[m_atlas.get_depth() * 4 * 4];
    151151        raw_fill( wfill, wfill + wsize, 255 );
     
    178178}
    179179
    180 texture_font* gfx_renderer::get_font( nv::size_t name ) const
     180texture_font* gfx_renderer::get_font( nv::uint32 name ) const
    181181{
    182182        if ( name >= m_fonts.size() ) return nullptr;
     
    184184}
    185185
    186 const image_info* gfx_renderer::get_image( nv::size_t name ) const
     186const image_info* gfx_renderer::get_image( nv::uint32 name ) const
    187187{
    188188        if ( name >= m_images.size() ) return nullptr;
     
    190190}
    191191
    192 nv::size_t gfx_renderer::load_font( const string_view& filename, nv::size_t size )
     192nv::uint32 gfx_renderer::load_font( const string_view& filename, nv::uint32 size )
    193193{
    194194        string128 id( filename );
     
    199199                return i->second;
    200200        }
    201         size_t result = m_fonts.size();
     201        uint32 result = m_fonts.size();
    202202        texture_font* f = new texture_font( &m_atlas, filename.data(), static_cast<float>( size ) );
    203203        f->load_glyphs( "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ " );
     
    208208}
    209209
    210 nv::size_t gfx_renderer::load_image( const string_view& filename )
     210nv::uint32 gfx_renderer::load_image( const string_view& filename )
    211211{
    212212        auto i = m_image_names.find( filename );
     
    215215                return i->second;
    216216        }
    217         size_t result = m_images.size();
     217        uint32 result = m_images.size();
    218218        image_data* data = m_window->get_device()->create_image_data( filename );
    219219        // TODO: Repitching
     
    236236        }
    237237        element_render_data* er = reinterpret_cast< element_render_data* >( e->m_render_data );
    238         size_t size_before = er->buffer.data().size();
     238        uint32 size_before = er->buffer.data().size();
    239239
    240240        vector< gui_quad >& qvec = er->buffer.lock();
     
    254254                if ( m_style.get( e, "skin", selector, path ) )
    255255                {
    256                         size_t image_id = load_image( path );
     256                        uint32 image_id = load_image( path );
    257257                        const image_info* image = get_image( image_id );
    258258                        if ( image )
     
    319319                        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 ) )
    320320                        {
    321                                 size_t font_id = load_font( path, size_t( border ) );
     321                                uint32 font_id = load_font( path, uint32( border ) );
    322322                                texture_font* font = get_font( font_id );
    323323                                position p = abs.ul + position( 0, border );
Note: See TracChangeset for help on using the changeset viewer.