mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 02:42:46 +01:00
Merge remote-tracking branch 'origin/feat/eu07m-gref' into feat/eu07m-geometry-streaming
# Conflicts: # model/Model3d.h # model/eu07m/eu07m_load.cpp
This commit is contained in:
+5
-2
@@ -820,7 +820,7 @@ void TAnimModel::light_parts_shown( int const Light, bool &Lit, bool &Dark ) con
|
||||
}
|
||||
}
|
||||
|
||||
bool TAnimModel::play_clip( std::string_view const Name, float const Speed ) {
|
||||
bool TAnimModel::play_clip( std::string_view const Name, float const Speed, float const From ) {
|
||||
|
||||
if( pModel == nullptr ) { return false; }
|
||||
auto const &clips { pModel->clips() };
|
||||
@@ -832,7 +832,10 @@ bool TAnimModel::play_clip( std::string_view const Name, float const Speed ) {
|
||||
if( found == clips.end() ) { return false; }
|
||||
auto const index { static_cast<std::size_t>( std::distance( clips.begin(), found ) ) };
|
||||
std::erase_if( m_clips, [ index ]( clip_playing const &Playing ) { return Playing.clip == index; } );
|
||||
m_clips.push_back( { index, Timer::GetTime(), Speed } );
|
||||
// started as long before now as From takes at the pace; a pace of 0 holds the clip at its start and a negative one runs it
|
||||
// backwards, as before, From counted only for a clip going forwards
|
||||
auto const ahead { Speed > 0.f ? static_cast<double>( From / Speed ) : 0.0 };
|
||||
m_clips.push_back( { index, Timer::GetTime() - ahead, Speed } );
|
||||
m_autoplaystarted = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user