attempt to reduce "script is not responding" when debugging (valgrind / breakpoints)

This commit is contained in:
jacob1 2017-07-28 20:32:46 -04:00
parent b02a72a77b
commit adb39b91a9
3 changed files with 4 additions and 3 deletions

View File

@ -1735,7 +1735,7 @@ void GameView::OnTick(float dt)
if (foundSign) if (foundSign)
{ {
const char* str = foundSign->text.c_str(); const char* str = foundSign->text.c_str();
char type; char type = '\0';
int pos = sign::splitsign(str, &type); int pos = sign::splitsign(str, &type);
if (type == 'c' || type == 't' || type == 's') if (type == 'c' || type == 't' || type == 's')
{ {

View File

@ -446,6 +446,7 @@ int luacon_elementwrite(lua_State* l)
bool shortcuts = true; bool shortcuts = true;
int luacon_keyevent(int key, Uint16 character, int modifier, int event) int luacon_keyevent(int key, Uint16 character, int modifier, int event)
{ {
ui::Engine::Ref().LastTick(Platform::GetTime());
int kycontinue = 1; int kycontinue = 1;
lua_State* l=luacon_ci->l; lua_State* l=luacon_ci->l;
lua_pushstring(l, "keyfunctions"); lua_pushstring(l, "keyfunctions");
@ -501,6 +502,7 @@ int luacon_keyevent(int key, Uint16 character, int modifier, int event)
int luacon_mouseevent(int mx, int my, int mb, int event, int mouse_wheel) int luacon_mouseevent(int mx, int my, int mb, int event, int mouse_wheel)
{ {
ui::Engine::Ref().LastTick(Platform::GetTime());
int mpcontinue = 1; int mpcontinue = 1;
lua_State* l=luacon_ci->l; lua_State* l=luacon_ci->l;
lua_pushstring(l, "mousefunctions"); lua_pushstring(l, "mousefunctions");
@ -554,6 +556,7 @@ int luacon_mouseevent(int mx, int my, int mb, int event, int mouse_wheel)
int luacon_step(int mx, int my) int luacon_step(int mx, int my)
{ {
ui::Engine::Ref().LastTick(Platform::GetTime());
lua_State* l = luacon_ci->l; lua_State* l = luacon_ci->l;
lua_pushinteger(l, my); lua_pushinteger(l, my);
lua_pushinteger(l, mx); lua_pushinteger(l, mx);

View File

@ -3473,7 +3473,6 @@ bool LuaScriptInterface::OnKeyRelease(int key, Uint16 character, bool shift, boo
bool LuaScriptInterface::OnMouseTick() bool LuaScriptInterface::OnMouseTick()
{ {
ui::Engine::Ref().LastTick(Platform::GetTime());
if (luacon_mousedown) if (luacon_mousedown)
return luacon_mouseevent(luacon_mousex, luacon_mousey, luacon_mousebutton, LUACON_MPRESS, 0); return luacon_mouseevent(luacon_mousex, luacon_mousey, luacon_mousebutton, LUACON_MPRESS, 0);
return true; return true;
@ -3488,7 +3487,6 @@ void LuaScriptInterface::OnTick()
lua_setfield(l, -2, "NUM_PARTS"); lua_setfield(l, -2, "NUM_PARTS");
} }
lua_pop(l, 1); lua_pop(l, 1);
ui::Engine::Ref().LastTick(Platform::GetTime());
luacon_step(luacon_mousex, luacon_mousey); luacon_step(luacon_mousex, luacon_mousey);
} }