diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/java/src/org/godotengine/godot/Godot.java | 10 | ||||
-rw-r--r-- | platform/android/java/src/org/godotengine/godot/GodotView.java | 8 | ||||
-rw-r--r-- | platform/haiku/context_gl_haiku.cpp | 2 | ||||
-rw-r--r-- | platform/haiku/context_gl_haiku.h | 2 | ||||
-rw-r--r-- | platform/haiku/os_haiku.cpp | 4 | ||||
-rw-r--r-- | platform/haiku/os_haiku.h | 2 | ||||
-rw-r--r-- | platform/windows/context_gl_win.cpp | 2 | ||||
-rw-r--r-- | platform/windows/context_gl_win.h | 2 | ||||
-rw-r--r-- | platform/windows/key_mapping_win.cpp | 2 | ||||
-rw-r--r-- | platform/x11/context_gl_x11.cpp | 2 | ||||
-rw-r--r-- | platform/x11/context_gl_x11.h | 2 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 4 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 2 |
13 files changed, 23 insertions, 21 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 053dfa631a..59fefc498f 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -191,6 +191,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC protected void onMainPause() {} protected void onMainResume() {} protected void onMainDestroy() {} + protected boolean onMainBackPressed() { return false; } protected void onGLDrawFrame(GL10 gl) {} protected void onGLSurfaceChanged(GL10 gl, int width, int height) {} // singletons will always miss first onGLSurfaceChanged call @@ -767,9 +768,16 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC */ @Override public void onBackPressed() { + boolean shouldQuit = true; + + for(int i=0;i<singleton_count;i++) { + if (singletons[i].onMainBackPressed()) { + shouldQuit = false; + } + } System.out.printf("** BACK REQUEST!\n"); - if (mView != null) { + if (shouldQuit && mView != null) { mView.queueEvent(new Runnable() { @Override public void run() { diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java index 3c2ad7cc59..b807b952d4 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotView.java +++ b/platform/android/java/src/org/godotengine/godot/GodotView.java @@ -285,13 +285,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { @Override public boolean onKeyDown(final int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { - queueEvent(new Runnable() { - @Override - public void run() { - GodotLib.back(); - } - }); - + activity.onBackPressed(); // press 'back' button should not terminate program //normal handle 'back' event in game logic return true; diff --git a/platform/haiku/context_gl_haiku.cpp b/platform/haiku/context_gl_haiku.cpp index 2b943df5ba..80d0bd78d5 100644 --- a/platform/haiku/context_gl_haiku.cpp +++ b/platform/haiku/context_gl_haiku.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "context_gl_haiku.h" -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) ContextGL_Haiku::ContextGL_Haiku(HaikuDirectWindow *p_window) { window = p_window; diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h index 40daf43ab9..a9a13a2b7f 100644 --- a/platform/haiku/context_gl_haiku.h +++ b/platform/haiku/context_gl_haiku.h @@ -30,7 +30,7 @@ #ifndef CONTEXT_GL_HAIKU_H #define CONTEXT_GL_HAIKU_H -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) #include "drivers/gl_context/context_gl.h" diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 9f2f88bb4e..1d52752f21 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -105,7 +105,7 @@ void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_ window->SetFlags(flags); } -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) context_gl = memnew(ContextGL_Haiku(window)); context_gl->initialize(); context_gl->make_current(); @@ -161,7 +161,7 @@ void OS_Haiku::finalize() { memdelete(input); -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) memdelete(context_gl); #endif } diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h index d2fafb9129..d929f7e43b 100644 --- a/platform/haiku/os_haiku.h +++ b/platform/haiku/os_haiku.h @@ -60,7 +60,7 @@ private: AudioDriverMediaKit driver_media_kit; #endif -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) ContextGL_Haiku *context_gl; #endif diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index 8640f27699..64b6d202a1 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) || defined(GLES2_ENABLED) +#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED) // // C++ Implementation: context_gl_x11 diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h index 912d4d0133..0059cbc311 100644 --- a/platform/windows/context_gl_win.h +++ b/platform/windows/context_gl_win.h @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) || defined(GLES2_ENABLED) +#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED) // // C++ Interface: context_gl_x11 // diff --git a/platform/windows/key_mapping_win.cpp b/platform/windows/key_mapping_win.cpp index 57f8e965de..76bb5d5723 100644 --- a/platform/windows/key_mapping_win.cpp +++ b/platform/windows/key_mapping_win.cpp @@ -50,7 +50,7 @@ static _WinTranslatePair _vk_to_keycode[] = { { KEY_CONTROL, VK_CONTROL }, //(0x11) - { KEY_MENU, VK_MENU }, //(0x12) + { KEY_ALT, VK_MENU }, //(0x12) { KEY_PAUSE, VK_PAUSE }, //(0x13) diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index 0cc9734119..4f9d4a84b9 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -30,7 +30,7 @@ #include "context_gl_x11.h" #ifdef X11_ENABLED -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) #include <stdio.h> #include <stdlib.h> #include <unistd.h> diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h index ba01b51d59..c37bac5e9b 100644 --- a/platform/x11/context_gl_x11.h +++ b/platform/x11/context_gl_x11.h @@ -35,7 +35,7 @@ */ #ifdef X11_ENABLED -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) #include "drivers/gl_context/context_gl.h" #include "os/os.h" diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 041666a594..e389c6932e 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -235,7 +235,7 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au // maybe contextgl wants to be in charge of creating the window //print_line("def videomode "+itos(current_videomode.width)+","+itos(current_videomode.height)); -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) context_gl = memnew(ContextGL_X11(x11_display, x11_window, current_videomode, true)); context_gl->initialize(); @@ -533,7 +533,7 @@ void OS_X11::finalize() { XUnmapWindow(x11_display, x11_window); XDestroyWindow(x11_display, x11_window); -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) memdelete(context_gl); #endif for (int i = 0; i < CURSOR_MAX; i++) { diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 0d5c272ed4..36355f11bc 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -94,7 +94,7 @@ class OS_X11 : public OS_Unix { int xdnd_version; -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) +#if defined(OPENGL_ENABLED) ContextGL_X11 *context_gl; #endif //Rasterizer *rasterizer; |