mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fixed bug in love.event. Started on error screen.
This commit is contained in:
@@ -44,9 +44,8 @@ namespace sdl
|
||||
|
||||
int Event::wait(lua_State * L)
|
||||
{
|
||||
static SDL_Event e;
|
||||
SDL_WaitEvent(&e);
|
||||
return pushEvent(L, e);
|
||||
lua_pushcclosure(L, &wait_i, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Event::quit()
|
||||
@@ -83,6 +82,20 @@ namespace sdl
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Event::wait_i(lua_State * L)
|
||||
{
|
||||
SDL_EnableUNICODE(1);
|
||||
|
||||
// The union used to get SDL events.
|
||||
static SDL_Event e;
|
||||
|
||||
SDL_WaitEvent(&e);
|
||||
|
||||
int args = Event::pushEvent(L, e);
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
int Event::pushEvent(lua_State * L, SDL_Event & e)
|
||||
{
|
||||
switch(e.type)
|
||||
|
||||
Reference in New Issue
Block a user