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:
@@ -23,8 +23,8 @@ SCA_2DFilterActuator::SCA_2DFilterActuator(
|
|||||||
: SCA_IActuator(gameobj, T),
|
: SCA_IActuator(gameobj, T),
|
||||||
m_type(type),
|
m_type(type),
|
||||||
m_flag(flag),
|
m_flag(flag),
|
||||||
m_int_arg(int_arg),
|
|
||||||
m_float_arg(float_arg),
|
m_float_arg(float_arg),
|
||||||
|
m_int_arg(int_arg),
|
||||||
m_rasterizer(rasterizer),
|
m_rasterizer(rasterizer),
|
||||||
m_rendertools(rendertools)
|
m_rendertools(rendertools)
|
||||||
{
|
{
|
||||||
@@ -64,13 +64,11 @@ bool SCA_2DFilterActuator::Update()
|
|||||||
if( m_type == RAS_2DFilterManager::RAS_2DFILTER_MOTIONBLUR )
|
if( m_type == RAS_2DFilterManager::RAS_2DFILTER_MOTIONBLUR )
|
||||||
{
|
{
|
||||||
if(!m_flag)
|
if(!m_flag)
|
||||||
{
|
|
||||||
m_rasterizer->EnableMotionBlur(m_float_arg);
|
m_rasterizer->EnableMotionBlur(m_float_arg);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
m_rasterizer->DisableMotionBlur();
|
m_rasterizer->DisableMotionBlur();
|
||||||
}
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS)
|
else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS)
|
||||||
{
|
{
|
||||||
|
@@ -949,7 +949,10 @@ void RAS_OpenGLRasterizer::SetPolygonOffset(float mult, float add)
|
|||||||
|
|
||||||
void RAS_OpenGLRasterizer::EnableMotionBlur(float motionblurvalue)
|
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;
|
m_motionblurvalue = motionblurvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user