-void CPicoModel::load(const char *name, const int frame)
-{
- CPicoSurface *surf;
- picoSurface_t *pSurface;
- int i;
-
- m_name= new char[strlen(name)+1];
- strcpy(m_name,name);
-
- m_frame = frame;
-
- if( !(m_pModel = PicoLoadModel(m_name, frame)) )
- {
- int len = strlen(m_name);
-
- // Try loading an mdc if md3 fails and vice-versa (fixme: only do this for games with mdc support)
- if( !strcmp( m_name + len - 4, ".md3" ) )
- {
- m_name[len - 1] = 'c';
- m_pModel = PicoLoadModel(m_name, frame);
- } else if( !strcmp( m_name + len - 4, ".mdc" ) )
- {
- m_name[len - 1] = '3';
- m_pModel = PicoLoadModel(m_name, frame);
- }
- }
-
- if( m_pModel )
- {
- m_children = g_ptr_array_new();
- aabb_clear(&m_BBox);
- for (i = 0; i < PicoGetModelNumSurfaces(m_pModel); i++ )
- {
- pSurface = PicoGetModelSurface(m_pModel,i);
- surf = new CPicoSurface(pSurface);
- g_ptr_array_add(m_children, surf);
- aabb_extend_by_aabb(&m_BBox, surf->GetAABB());
- }
- }
- else
- {
- m_BBox.origin[0] = m_BBox.origin[1] = m_BBox.origin[2] = 0;
- m_BBox.extents[0] = m_BBox.extents[1] = m_BBox.extents[2] = 0;
- }
-
- m_parents = g_ptr_array_new();
+void CPicoModel::load( const char *name, const int frame ){
+ CPicoSurface *surf;
+ picoSurface_t *pSurface;
+ int i;
+
+ m_name = new char[strlen( name ) + 1];
+ strcpy( m_name,name );
+
+ m_frame = frame;
+
+ if ( !( m_pModel = PicoLoadModel( m_name, frame ) ) ) {
+ int len = strlen( m_name );
+
+ // Try loading an mdc if md3 fails and vice-versa (fixme: only do this for games with mdc support)
+ if ( !strcmp( m_name + len - 4, ".md3" ) ) {
+ m_name[len - 1] = 'c';
+ m_pModel = PicoLoadModel( m_name, frame );
+ }
+ else if ( !strcmp( m_name + len - 4, ".mdc" ) ) {
+ m_name[len - 1] = '3';
+ m_pModel = PicoLoadModel( m_name, frame );
+ }
+ }
+
+ if ( m_pModel ) {
+ m_children = g_ptr_array_new();
+ aabb_clear( &m_BBox );
+ for ( i = 0; i < PicoGetModelNumSurfaces( m_pModel ); i++ )
+ {
+ pSurface = PicoGetModelSurface( m_pModel,i );
+ surf = new CPicoSurface( pSurface );
+ g_ptr_array_add( m_children, surf );
+ aabb_extend_by_aabb( &m_BBox, surf->GetAABB() );
+ }
+ }
+ else
+ {
+ m_BBox.origin[0] = m_BBox.origin[1] = m_BBox.origin[2] = 0;
+ m_BBox.extents[0] = m_BBox.extents[1] = m_BBox.extents[2] = 0;
+ }
+
+ m_parents = g_ptr_array_new();