Changeset 252 for trunk/src/gfx


Ignore:
Timestamp:
06/12/14 12:08:33 (11 years ago)
Author:
epyon
Message:
  • animation may be nullptr
Location:
trunk/src/gfx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gfx/keyframed_mesh.cc

    r251 r252  
    118118void nv::keyframed_mesh::run_animation( animation_entry* a_anim )
    119119{
    120         keyframed_animation_entry * anim = down_cast<keyframed_animation_entry>(a_anim);
    121         setup_animation( anim->m_start, anim->m_frames, anim->m_fps, anim->m_looping );
     120        if ( a_anim )
     121        {
     122                keyframed_animation_entry * anim = down_cast<keyframed_animation_entry>(a_anim);
     123                m_active = true;
     124                setup_animation( anim->m_start, anim->m_frames, anim->m_fps, anim->m_looping );
     125        }
     126        else
     127        {
     128                m_active = false;
     129        }
    122130}
    123131
  • trunk/src/gfx/skeletal_mesh.cc

    r241 r252  
    5858void nv::skeletal_mesh::run_animation( animation_entry* a_anim )
    5959{
    60         skeletal_animation_entry * anim = down_cast<skeletal_animation_entry>(a_anim);
    61         setup_animation( anim->m_animation );
     60        if ( a_anim != nullptr )
     61        {
     62                skeletal_animation_entry * anim = down_cast<skeletal_animation_entry>(a_anim);
     63                setup_animation( anim->m_animation );
     64        }
     65        else
     66        {
     67                setup_animation( nullptr );
     68        }
    6269}
Note: See TracChangeset for help on using the changeset viewer.