Fix for bug #17620: the motion blur actuator did not work correct

with an always sensor, it kept resettting the motion blur each frame.
This commit is contained in:
Brecht Van Lommel
2008-09-15 00:57:11 +00:00
parent a24960daa8
commit 2c31cc4503
2 changed files with 7 additions and 6 deletions

View File

@@ -23,8 +23,8 @@ SCA_2DFilterActuator::SCA_2DFilterActuator(
: SCA_IActuator(gameobj, T),
m_type(type),
m_flag(flag),
m_int_arg(int_arg),
m_float_arg(float_arg),
m_int_arg(int_arg),
m_rasterizer(rasterizer),
m_rendertools(rendertools)
{
@@ -64,13 +64,11 @@ bool SCA_2DFilterActuator::Update()
if( m_type == RAS_2DFilterManager::RAS_2DFILTER_MOTIONBLUR )
{
if(!m_flag)
{
m_rasterizer->EnableMotionBlur(m_float_arg);
}
else
{
m_rasterizer->DisableMotionBlur();
}
return false;
}
else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS)
{

View File

@@ -949,7 +949,10 @@ void RAS_OpenGLRasterizer::SetPolygonOffset(float mult, float add)
void RAS_OpenGLRasterizer::EnableMotionBlur(float motionblurvalue)
{
m_motionblur = 1;
/* don't just set m_motionblur to 1, but check if it is 0 so
* we don't reset a motion blur that is already enabled */
if(m_motionblur == 0)
m_motionblur = 1;
m_motionblurvalue = motionblurvalue;
}