Skip to content

Commit

Permalink
Materials: Fixed animation of layer and decoration stages
Browse files Browse the repository at this point in the history
The interpolation point between the current and next stage was not
calculated correctly.
  • Loading branch information
danij-deng committed Mar 7, 2013
1 parent 91db71b commit 233fc91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doomsday/client/src/resource/materialanimation.cpp
Expand Up @@ -48,8 +48,8 @@ DENG2_PIMPL(Material::Animation)
: Base(i), material(_material), context(_context)
{}

template <typename Type>
void resetLayer(Material::Animation::LayerState &ls, Type const &stage)
template <typename StageType>
void resetLayer(Material::Animation::LayerState &ls, StageType const &stage)
{
ls.stage = 0;
ls.tics = stage.tics;
Expand Down Expand Up @@ -86,7 +86,7 @@ DENG2_PIMPL(Material::Animation)
else
{
typename LayerType::Stage const *lsCur = layer.stages()[ls.stage];
ls.inter = 1 - (ls.tics - frameTimePos) / float( lsCur->tics );
ls.inter = 1.f - ls.tics / float( lsCur->tics );
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ DENG2_PIMPL(Material::Animation)
else
{
Material::Decoration::Stage const *lsCur = decor.stages()[ds.stage];
ds.inter = 1 - (ds.tics - frameTimePos) / float( lsCur->tics );
ds.inter = 1.f - ds.tics / float( lsCur->tics );
}
}
};
Expand Down

0 comments on commit 233fc91

Please sign in to comment.