Changeset 352


Ignore:
Timestamp:
02/17/15 05:54:44 (10 years ago)
Author:
epyon
Message:
  • rocket utility classes
  • wx utility classes
  • various utilities
  • handle_test
  • various more changes
Location:
trunk
Files:
20 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/core/string.hh

    r319 r352  
    210210        }
    211211
     212        inline std::string extract_extension( const std::string& filename )
     213        {
     214                size_t lastdot = filename.find_last_of( "." );
     215                std::string ext;
     216                if ( std::string::npos != lastdot )
     217                        ext = filename.substr( lastdot + 1 );
     218                std::transform( ext.begin(), ext.end(), ext.begin(), ::tolower );
     219                return ext;
     220        }
     221
    212222        inline std::string remove_chars_copy( std::string s, const std::string& chars )
    213223        {
  • trunk/src/formats/md3_loader.cc

    r323 r352  
    204204        source.read( md3->frames, sizeof( md3_frame_t ), static_cast<size_t>( md3->header.num_frames ) );
    205205
    206         source.seek( md3->header.ofs_tags, origin::SET );
    207         source.read( md3->tags, sizeof( md3_tag_t ), static_cast<size_t>( md3->header.num_tags * md3->header.num_frames ) );
     206        if ( md3->header.num_tags > 0 )
     207        {
     208                source.seek( md3->header.ofs_tags, origin::SET );
     209                source.read( md3->tags, sizeof( md3_tag_t ), static_cast<size_t>( md3->header.num_tags * md3->header.num_frames ) );
     210        }
    208211
    209212        source.seek( md3->header.ofs_surfaces, origin::SET );
Note: See TracChangeset for help on using the changeset viewer.