mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
src/driver/fade.cpp: fix fade. needs to be tested.
This commit is contained in:
@@ -27,6 +27,10 @@
|
|||||||
#include <driver/rcinput.h>
|
#include <driver/rcinput.h>
|
||||||
#include <driver/fade.h>
|
#include <driver/fade.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_COOL_HARDWARE
|
||||||
|
#include <cnxtfb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
COSDFader::COSDFader(unsigned char & alpha)
|
COSDFader::COSDFader(unsigned char & alpha)
|
||||||
: max_alpha(alpha)
|
: max_alpha(alpha)
|
||||||
{
|
{
|
||||||
@@ -49,7 +53,12 @@ void COSDFader::StartFadeIn()
|
|||||||
fadeIn = true;
|
fadeIn = true;
|
||||||
fadeOut = false;
|
fadeOut = false;
|
||||||
fadeValue = 100;
|
fadeValue = 100;
|
||||||
|
#ifdef HAVE_COOL_HARDWARE
|
||||||
|
frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_UNIFORM_ALPHA); // Global alpha multiplied with pixel alpha
|
||||||
|
#else
|
||||||
frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha
|
frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha
|
||||||
|
#endif
|
||||||
|
|
||||||
frameBuffer->setBlendLevel(fadeValue);
|
frameBuffer->setBlendLevel(fadeValue);
|
||||||
fadeTimer = g_RCInput->addTimer( FADE_TIME, false );
|
fadeTimer = g_RCInput->addTimer( FADE_TIME, false );
|
||||||
}
|
}
|
||||||
@@ -65,7 +74,11 @@ bool COSDFader::StartFadeOut()
|
|||||||
if ((!fadeOut) && g_settings.widget_fade) {
|
if ((!fadeOut) && g_settings.widget_fade) {
|
||||||
fadeOut = true;
|
fadeOut = true;
|
||||||
fadeTimer = g_RCInput->addTimer( FADE_TIME, false );
|
fadeTimer = g_RCInput->addTimer( FADE_TIME, false );
|
||||||
|
#ifdef HAVE_COOL_HARDWARE
|
||||||
|
frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_UNIFORM_ALPHA); // Global alpha multiplied with pixel alpha
|
||||||
|
#else
|
||||||
frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha
|
frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha
|
||||||
|
#endif
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -75,7 +88,11 @@ void COSDFader::Stop()
|
|||||||
{
|
{
|
||||||
if ( fadeIn || fadeOut ) {
|
if ( fadeIn || fadeOut ) {
|
||||||
g_RCInput->killTimer(fadeTimer);
|
g_RCInput->killTimer(fadeTimer);
|
||||||
frameBuffer->setBlendMode(1); // Set back to per pixel alpha
|
#ifdef HAVE_COOL_HARDWARE
|
||||||
|
frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha
|
||||||
|
#else
|
||||||
|
frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha
|
||||||
|
#endif
|
||||||
fadeIn = fadeOut = false;
|
fadeIn = fadeOut = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +116,11 @@ bool COSDFader::Fade()
|
|||||||
fadeValue = max_alpha;
|
fadeValue = max_alpha;
|
||||||
g_RCInput->killTimer (fadeTimer);
|
g_RCInput->killTimer (fadeTimer);
|
||||||
fadeIn = false;
|
fadeIn = false;
|
||||||
frameBuffer->setBlendMode(1); // Set back to per pixel alpha
|
#ifdef HAVE_COOL_HARDWARE
|
||||||
|
frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha
|
||||||
|
#else
|
||||||
|
frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha
|
||||||
|
#endif
|
||||||
} else
|
} else
|
||||||
frameBuffer->setBlendLevel(fadeValue);
|
frameBuffer->setBlendLevel(fadeValue);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user