mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 13:22:28 +02:00
Initialize the timers subsystem of SDL at the beginning
This fixes a bug where disabling the backlight timeout would prevent the clock from working correctly.
This commit is contained in:
parent
47bbc0b673
commit
e0109dfe55
@ -85,7 +85,6 @@ void Clock::addTimer(int timeout)
|
||||
|
||||
Clock::Clock(void)
|
||||
{
|
||||
SDL_InitSubSystem(SDL_INIT_TIMER);
|
||||
tzset();
|
||||
|
||||
int sec = update();
|
||||
@ -95,7 +94,6 @@ Clock::Clock(void)
|
||||
Clock::~Clock()
|
||||
{
|
||||
SDL_RemoveTimer(timer);
|
||||
SDL_QuitSubSystem(SDL_INIT_TIMER);
|
||||
instance = NULL;
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ GMenu2X::GMenu2X()
|
||||
setenv("SDL_FBCON_DONT_CLEAR", "1", 0);
|
||||
|
||||
//Screen
|
||||
if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK)<0 ) {
|
||||
if( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER) < 0) {
|
||||
ERROR("Could not initialize SDL: %s\n", SDL_GetError());
|
||||
quit();
|
||||
}
|
||||
|
@ -36,14 +36,12 @@ bool PowerSaver::isRunning() {
|
||||
}
|
||||
|
||||
PowerSaver::PowerSaver() {
|
||||
SDL_InitSubSystem(SDL_INIT_TIMER);
|
||||
setScreenTimeout(0);
|
||||
screenTimer = NULL;
|
||||
}
|
||||
|
||||
PowerSaver::~PowerSaver() {
|
||||
SDL_RemoveTimer(screenTimer);
|
||||
SDL_QuitSubSystem(SDL_INIT_TIMER);
|
||||
instance = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user