aboutsummaryrefslogtreecommitdiff
path: root/build/android/src/main/java
Commit message (Collapse)AuthorAge
* Tell irrlicht if we handle a key or not.est312016-05-26
| | | | | | | | | We can remove the function in MtNativeActivity now as it serves precisely that purpose: to tell irrlicht that we handled the esc key. TODO for later: * Perhaps try to find a more performant container than KeyList
* Fix locked hardware buttons on AndroidMaksim Gamarnik2016-05-14
| | | | | | | | | | | | | | | | | Fixes #2122 Fixes #1454 Addendum (est31) According from its docs in android_native_app_glue.h (from the NDK), the onInputEvent should "Return 1 if you have handled the event, 0 for any default dispatching". Before, we always returned 1, meaning we blocked all hardware keys to be given to the OS. This broke the volume keys and has caused #2122 and #1454. Although it bases on lots of guesswork, it can probably safely be said that CGUIEnvironment::postEventFromUser returns true if the event was handled, and false if not. Therefore, set the status variable depending on what postEventFromUser returned.
* Upgrade Android build to Gradle build systemShadowNinja2016-04-28
The old Ant build system has been deprecated for a while and new development is focused on Gradle. I also removed a hardcoded string that lint caught and moved the patch files to a subdirectory. I left the JNI files in the root directory.
d">get_scriptapi(lua_State *L) { // Get server from registry lua_getfield(L, LUA_REGISTRYINDEX, "scriptapi"); ScriptApi* sapi_ptr = (ScriptApi*) lua_touserdata(L, -1); lua_pop(L, 1); return sapi_ptr; } std::string script_get_backtrace(lua_State *L) { std::string s; lua_getfield(L, LUA_GLOBALSINDEX, "debug"); if(lua_istable(L, -1)){ lua_getfield(L, -1, "traceback"); if(lua_isfunction(L, -1)){ lua_call(L, 0, 1); if(lua_isstring(L, -1)){ s += lua_tostring(L, -1); } lua_pop(L, 1); } else{ lua_pop(L, 1); } } lua_pop(L, 1); return s; } void script_error(lua_State* L,const char *fmt, ...) { va_list argp; va_start(argp, fmt); char buf[10000]; vsnprintf(buf, 10000, fmt, argp); va_end(argp); //errorstream<<"SCRIPT ERROR: "<<buf; throw LuaError(L, buf); }