|
|
@ -323,17 +323,11 @@ void Core::Resume()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// should always be from simulation thread!
|
|
|
|
// should always be from simulation thread!
|
|
|
|
static bool flip2 = false;
|
|
|
|
|
|
|
|
int Core::Update()
|
|
|
|
int Core::Update()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!started) Init();
|
|
|
|
if(!started) Init();
|
|
|
|
if(errorstate)
|
|
|
|
if(errorstate)
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
if(!flip2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
std::cerr << "Update from Thread " << SDL_ThreadID() << std::endl;
|
|
|
|
|
|
|
|
flip2 = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// notify all the plugins that a game tick is finished
|
|
|
|
// notify all the plugins that a game tick is finished
|
|
|
|
plug_mgr->OnUpdate();
|
|
|
|
plug_mgr->OnUpdate();
|
|
|
@ -380,16 +374,10 @@ int Core::Shutdown ( void )
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool flip3 = 0;
|
|
|
|
|
|
|
|
int Core::SDL_Event(SDL::Event* ev, int orig_return)
|
|
|
|
int Core::SDL_Event(SDL::Event* ev, int orig_return)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// do NOT process events before we are ready.
|
|
|
|
// do NOT process events before we are ready.
|
|
|
|
if(!started) return orig_return;
|
|
|
|
if(!started) return orig_return;
|
|
|
|
if(!flip3)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
std::cerr << "Event from Thread " << SDL_ThreadID() << std::endl;
|
|
|
|
|
|
|
|
flip3 = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!ev)
|
|
|
|
if(!ev)
|
|
|
|
return orig_return;
|
|
|
|
return orig_return;
|
|
|
|
if(ev && ev->type == SDL::ET_KEYDOWN || ev->type == SDL::ET_KEYUP)
|
|
|
|
if(ev && ev->type == SDL::ET_KEYDOWN || ev->type == SDL::ET_KEYUP)
|
|
|
@ -413,7 +401,6 @@ int Core::SDL_Event(SDL::Event* ev, int orig_return)
|
|
|
|
return orig_return;
|
|
|
|
return orig_return;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::cerr << "Hotkey " << idx << " triggered. Thread " << SDL_ThreadID() << std::endl;
|
|
|
|
|
|
|
|
t_hotkey & hotkey = (*g->hotkeys)[idx];
|
|
|
|
t_hotkey & hotkey = (*g->hotkeys)[idx];
|
|
|
|
setHotkeyCmd(hotkey.name);
|
|
|
|
setHotkeyCmd(hotkey.name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|