diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/SCsub | 14 | ||||
-rw-r--r-- | platform/android/audio_driver_opensl.cpp | 17 | ||||
-rw-r--r-- | platform/android/audio_driver_opensl.h | 11 | ||||
-rw-r--r-- | platform/android/export/export.cpp | 5 | ||||
-rw-r--r-- | platform/android/godot_android.cpp | 2 | ||||
-rw-r--r-- | platform/android/java/src/org/godotengine/godot/Godot.java | 5 | ||||
-rw-r--r-- | platform/android/java/src/org/godotengine/godot/GodotView.java | 20 | ||||
-rw-r--r-- | platform/android/java_glue.cpp | 14 | ||||
-rw-r--r-- | platform/android/os_android.cpp | 5 | ||||
-rw-r--r-- | platform/android/os_android.h | 4 | ||||
-rw-r--r-- | platform/haiku/context_gl_haiku.h | 6 | ||||
-rw-r--r-- | platform/haiku/haiku_direct_window.cpp | 2 | ||||
-rw-r--r-- | platform/iphone/gl_view.mm | 12 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 31 | ||||
-rw-r--r-- | platform/server/os_server.cpp | 2 | ||||
-rw-r--r-- | platform/uwp/gl_context_egl.h | 6 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 2 | ||||
-rw-r--r-- | platform/windows/context_gl_win.h | 2 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 4 | ||||
-rw-r--r-- | platform/x11/context_gl_x11.h | 2 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 6 |
21 files changed, 77 insertions, 95 deletions
diff --git a/platform/android/SCsub b/platform/android/SCsub index 807506000f..da2219b9e4 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -18,14 +18,17 @@ android_files = [ 'dir_access_jandroid.cpp', 'thread_jandroid.cpp', 'audio_driver_jandroid.cpp', - 'ifaddrs_android.cpp', - 'android_native_app_glue.c', 'java_glue.cpp', - 'cpu-features.c', 'java_class_wrapper.cpp', # 'power_android.cpp' ] +thirdparty_files = [ + 'ifaddrs_android.cpp', + 'android_native_app_glue.c', + 'cpu-features.c', +] + env_android = env.Clone() if env['target'] == "profile": env_android.Append(CPPFLAGS=['-DPROFILER_ENABLED']) @@ -34,6 +37,11 @@ android_objects = [] for x in android_files: android_objects.append(env_android.SharedObject(x)) +env_thirdparty = env_android.Clone() +env_thirdparty.disable_warnings() +for x in thirdparty_files: + android_objects.append(env_thirdparty.SharedObject(x)) + prog = None abspath = env.Dir(".").abspath diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp index 28e3ea962f..21c61f6ca0 100644 --- a/platform/android/audio_driver_opensl.cpp +++ b/platform/android/audio_driver_opensl.cpp @@ -38,12 +38,7 @@ /* Structure for passing information to callback function */ void AudioDriverOpenSL::_buffer_callback( - SLAndroidSimpleBufferQueueItf queueItf - /* SLuint32 eventFlags, - const void * pBuffer, - SLuint32 bufferSize, - SLuint32 dataUsed*/ -) { + SLAndroidSimpleBufferQueueItf queueItf) { bool mix = true; @@ -85,7 +80,6 @@ void AudioDriverOpenSL::_buffer_callbacks( AudioDriverOpenSL *ad = (AudioDriverOpenSL *)pContext; - //ad->_buffer_callback(queueItf,eventFlags,pBuffer,bufferSize,dataUsed); ad->_buffer_callback(queueItf); } @@ -98,12 +92,9 @@ const char *AudioDriverOpenSL::get_name() const { Error AudioDriverOpenSL::init() { - SLresult - res; + SLresult res; SLEngineOption EngineOption[] = { - (SLuint32)SL_ENGINEOPTION_THREADSAFE, - (SLuint32)SL_BOOLEAN_TRUE - + { (SLuint32)SL_ENGINEOPTION_THREADSAFE, (SLuint32)SL_BOOLEAN_TRUE } }; res = slCreateEngine(&sl, 1, EngineOption, 0, NULL, NULL); if (res != SL_RESULT_SUCCESS) { @@ -126,8 +117,6 @@ void AudioDriverOpenSL::start() { mutex = Mutex::create(); active = false; - SLint32 numOutputs = 0; - SLuint32 deviceID = 0; SLresult res; buffer_size = 1024; diff --git a/platform/android/audio_driver_opensl.h b/platform/android/audio_driver_opensl.h index 8e879b27c5..39e1315a02 100644 --- a/platform/android/audio_driver_opensl.h +++ b/platform/android/audio_driver_opensl.h @@ -70,19 +70,10 @@ class AudioDriverOpenSL : public AudioDriver { static AudioDriverOpenSL *s_ad; void _buffer_callback( - SLAndroidSimpleBufferQueueItf queueItf - /* SLuint32 eventFlags, - const void * pBuffer, - SLuint32 bufferSize, - SLuint32 dataUsed*/ - ); + SLAndroidSimpleBufferQueueItf queueItf); static void _buffer_callbacks( SLAndroidSimpleBufferQueueItf queueItf, - /*SLuint32 eventFlags, - const void * pBuffer, - SLuint32 bufferSize, - SLuint32 dataUsed,*/ void *pContext); public: diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 021a92ca1e..3b503e2657 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1085,6 +1085,7 @@ public: r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_normal"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_large"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/opengl_debug"), false)); for (unsigned int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) { r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_icons[i].option_id, PROPERTY_HINT_FILE, "*.png"), "")); @@ -1438,6 +1439,7 @@ public: bool use_32_fb = p_preset->get("graphics/32_bits_framebuffer"); bool immersive = p_preset->get("screen/immersive_mode"); + bool debug_opengl = p_preset->get("screen/opengl_debug"); bool _signed = p_preset->get("package/signed"); @@ -1639,6 +1641,9 @@ public: if (immersive) cl.push_back("--use_immersive"); + if (debug_opengl) + cl.push_back("--debug_opengl"); + if (cl.size()) { //add comandline Vector<uint8_t> clf; diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index 54692dc831..c46c6f7804 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -408,7 +408,7 @@ static void engine_draw_frame(struct engine *engine) { // Just fill the screen with a color. //glClearColor(0,1,0,1); //glClear(GL_COLOR_BUFFER_BIT); - if (engine->os && engine->os->main_loop_iterate() == true) { + if (engine->os && engine->os->main_loop_iterate()) { engine->requested_quit = true; return; //should exit instead diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index c23037f3e0..ab37f7a02c 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -116,6 +116,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC private boolean use_32_bits = false; private boolean use_immersive = false; + private boolean use_debug_opengl = false; private boolean mStatePaused; private int mState; private boolean keep_screen_on = true; @@ -278,7 +279,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC // ...add to FrameLayout layout.addView(edittext); - mView = new GodotView(getApplication(), io, use_gl3, use_32_bits, this); + mView = new GodotView(getApplication(), io, use_gl3, use_32_bits, use_debug_opengl,this); layout.addView(mView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); edittext.setView(mView); io.setEdit(edittext); @@ -471,6 +472,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC boolean has_extra = i < command_line.length - 1; if (command_line[i].equals("--use_depth_32")) { use_32_bits = true; + } else if (command_line[i].equals("--debug_opengl")) { + use_debug_opengl = true; } else if (command_line[i].equals("--use_immersive")) { use_immersive = true; if (Build.VERSION.SDK_INT >= 19.0) { // check if the application runs on an android 4.4+ diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java index 23723c2696..181ffc3b4b 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotView.java +++ b/platform/android/java/src/org/godotengine/godot/GodotView.java @@ -81,16 +81,18 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { private static boolean firsttime = true; private static boolean use_gl3 = false; private static boolean use_32 = false; + private static boolean use_debug_opengl = false; private Godot activity; private InputManagerCompat mInputManager; - public GodotView(Context context, GodotIO p_io, boolean p_use_gl3, boolean p_use_32_bits, Godot p_activity) { + public GodotView(Context context, GodotIO p_io, boolean p_use_gl3, boolean p_use_32_bits, boolean p_use_debug_opengl,Godot p_activity) { super(context); ctx = context; io = p_io; use_gl3 = p_use_gl3; use_32 = p_use_32_bits; + use_debug_opengl = p_use_debug_opengl; activity = p_activity; @@ -406,6 +408,9 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { setRenderer(new Renderer()); } + private static final int _EGL_CONTEXT_FLAGS_KHR = 0x30FC; + private static final int _EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR= 0x00000001; + private static class ContextFactory implements GLSurfaceView.EGLContextFactory { private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098; public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { @@ -415,9 +420,16 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { Log.w(TAG, "creating OpenGL ES 2.0 context :"); checkEglError("Before eglCreateContext", egl); - int[] attrib_list2 = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; - int[] attrib_list3 = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL10.EGL_NONE }; - EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, use_gl3 ? attrib_list3 : attrib_list2); + EGLContext context; + if (use_debug_opengl) { + int[] attrib_list2 = { EGL_CONTEXT_CLIENT_VERSION, 2,_EGL_CONTEXT_FLAGS_KHR,_EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR, EGL10.EGL_NONE }; + int[] attrib_list3 = { EGL_CONTEXT_CLIENT_VERSION, 3,_EGL_CONTEXT_FLAGS_KHR,_EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR, EGL10.EGL_NONE }; + context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, use_gl3 ? attrib_list3 : attrib_list2); + } else { + int[] attrib_list2 = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; + int[] attrib_list3 = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL10.EGL_NONE }; + context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, use_gl3 ? attrib_list3 : attrib_list2); + } checkEglError("After eglCreateContext", egl); return context; } diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 6cf49758bc..ad8f21785d 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -589,8 +589,6 @@ TST tst; static bool initialized = false; static int step = 0; -static bool resized = false; -static bool resized_reload = false; static Size2 new_size; static Vector3 accelerometer; static Vector3 gravity; @@ -792,7 +790,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en _getClipboard = env->GetMethodID(cls, "getClipboard", "()Ljava/lang/String;"); _setClipboard = env->GetMethodID(cls, "setClipboard", "(Ljava/lang/String;)V"); - jclass clsio = env->FindClass("org/godotengine/godot/Godot"); if (cls) { jclass c = env->GetObjectClass(gob); _openURI = env->GetMethodID(c, "openURI", "(Ljava/lang/String;)I"); @@ -886,8 +883,6 @@ static void _initialize_java_modules() { ERR_EXPLAIN("Couldn't find proper initialize function 'public static Godot.SingletonBase Class::initialize(Activity p_activity)' initializer for singleton class: " + m); ERR_CONTINUE(!initialize); } - jobject obj = env->CallStaticObjectMethod(singletonClass, initialize, _godot_instance); - jobject gob = env->NewGlobalRef(obj); } } } @@ -931,13 +926,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, j if (os_android) os_android->set_display_size(Size2(width, height)); - - /*input_mutex->lock(); - resized=true; - if (reload) - resized_reload=true; - new_size=Size2(width,height); - input_mutex->unlock();*/ } JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_newcontext(JNIEnv *env, jobject obj, bool p_32_bits) { @@ -986,7 +974,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job os_android->process_gyroscope(gyroscope); - if (os_android->main_loop_iterate() == true) { + if (os_android->main_loop_iterate()) { jclass cls = env->FindClass("org/godotengine/godot/Godot"); jmethodID _finish = env->GetMethodID(cls, "forceQuit", "()V"); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 484ca4fff8..30bc413459 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -677,13 +677,14 @@ String OS_Android::get_unique_id() const { return OS::get_unique_id(); } -Error OS_Android::native_video_play(String p_path, float p_volume) { +Error OS_Android::native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track) { + // FIXME: Add support for volume, audio and subtitle tracks if (video_play_func) video_play_func(p_path); return OK; } -bool OS_Android::native_video_is_playing() { +bool OS_Android::native_video_is_playing() const { if (video_is_playing_func) return video_is_playing_func(); return false; diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 9594c6fdf4..e89a380e4c 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -237,8 +237,8 @@ public: void process_event(Ref<InputEvent> p_event); void init_video_mode(int p_video_width, int p_video_height); - virtual Error native_video_play(String p_path, float p_volume); - virtual bool native_video_is_playing(); + virtual Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track); + virtual bool native_video_is_playing() const; virtual void native_video_pause(); virtual void native_video_stop(); diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h index 74f09984f2..2c20570a8d 100644 --- a/platform/haiku/context_gl_haiku.h +++ b/platform/haiku/context_gl_haiku.h @@ -46,9 +46,6 @@ private: bool use_vsync; public: - ContextGL_Haiku(HaikuDirectWindow *p_window); - ~ContextGL_Haiku(); - virtual Error initialize(); virtual void release_current(); virtual void make_current(); @@ -58,6 +55,9 @@ public: virtual void set_use_vsync(bool p_use); virtual bool is_using_vsync() const; + + ContextGL_Haiku(HaikuDirectWindow *p_window); + virtual ~ContextGL_Haiku(); }; #endif diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp index 150e90be65..6b64082250 100644 --- a/platform/haiku/haiku_direct_window.cpp +++ b/platform/haiku/haiku_direct_window.cpp @@ -86,7 +86,7 @@ void HaikuDirectWindow::DirectConnected(direct_buffer_info *info) { void HaikuDirectWindow::MessageReceived(BMessage *message) { switch (message->what) { case REDRAW_MSG: - if (Main::iteration() == true) { + if (Main::iteration()) { view->EnableDirectMode(false); Quit(); } diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 478a3125af..2925b46007 100644 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -53,7 +53,6 @@ static GLView *_instance = NULL; static bool video_found_error = false; static bool video_playing = false; -static float video_previous_volume = 0.0f; static CMTime video_current_time; void _show_keyboard(String); @@ -248,16 +247,6 @@ static int remove_touch(UITouch *p_touch) { return remaining; }; -static int get_first_id(UITouch *p_touch) { - - for (int i = 0; i < max_touches; i++) { - - if (touches[i] != NULL) - return i; - }; - return -1; -}; - static void clear_touches() { for (int i = 0; i < max_touches; i++) { @@ -751,7 +740,6 @@ static void clear_touches() { [_instance.moviePlayerController stop]; [_instance.moviePlayerController.view removeFromSuperview]; - //[[MPMusicPlayerController applicationMusicPlayer] setVolume: video_previous_volume]; video_playing = false; } */ diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 886ff4b332..6ab433203f 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -76,11 +76,6 @@ #define NSWindowStyleMaskBorderless NSBorderlessWindowMask #endif -static NSRect convertRectToBacking(NSRect contentRect) { - - return [OS_OSX::singleton->window_view convertRectToBacking:contentRect]; -} - static void get_key_modifier_state(unsigned int p_osx_state, Ref<InputEventWithModifiers> state) { state->set_shift((p_osx_state & NSEventModifierFlagShift)); @@ -271,7 +266,7 @@ static Vector2 get_mouse_pos(NSEvent *event) { float newDisplayScale = OS_OSX::singleton->is_hidpi_allowed() ? newBackingScaleFactor : 1.0; const NSRect contentRect = [OS_OSX::singleton->window_view frame]; - const NSRect fbRect = contentRect; //convertRectToBacking(contentRect); + const NSRect fbRect = contentRect; OS_OSX::singleton->window_size.width = fbRect.size.width * newDisplayScale; OS_OSX::singleton->window_size.height = fbRect.size.height * newDisplayScale; @@ -292,7 +287,7 @@ static Vector2 get_mouse_pos(NSEvent *event) { [OS_OSX::singleton->context update]; const NSRect contentRect = [OS_OSX::singleton->window_view frame]; - const NSRect fbRect = contentRect; //convertRectToBacking(contentRect); + const NSRect fbRect = contentRect; float displayScale = OS_OSX::singleton->_display_scale(); OS_OSX::singleton->window_size.width = fbRect.size.width * displayScale; @@ -1864,28 +1859,30 @@ bool OS_OSX::can_draw() const { void OS_OSX::set_clipboard(const String &p_text) { - NSArray *types = [NSArray arrayWithObjects:NSStringPboardType, nil]; + NSString *copiedString = [NSString stringWithUTF8String:p_text.utf8().get_data()]; + NSArray *copiedStringArray = [NSArray arrayWithObject:copiedString]; NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; - [pasteboard declareTypes:types owner:nil]; - [pasteboard setString:[NSString stringWithUTF8String:p_text.utf8().get_data()] - forType:NSStringPboardType]; + [pasteboard clearContents]; + [pasteboard writeObjects:copiedStringArray]; } String OS_OSX::get_clipboard() const { NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; + NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; + NSDictionary *options = [NSDictionary dictionary]; - if (![[pasteboard types] containsObject:NSStringPboardType]) { - return ""; - } + BOOL ok = [pasteboard canReadObjectForClasses:classArray options:options]; - NSString *object = [pasteboard stringForType:NSStringPboardType]; - if (!object) { + if (!ok) { return ""; } - char *utfs = strdup([object UTF8String]); + NSArray *objectsToPaste = [pasteboard readObjectsForClasses:classArray options:options]; + NSString *string = [objectsToPaste objectAtIndex:0]; + + char *utfs = strdup([string UTF8String]); String ret; ret.parse_utf8(utfs); free(utfs); diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 1069d6bbed..6a7038e946 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -221,7 +221,7 @@ void OS_Server::run() { while (!force_quit) { - if (Main::iteration() == true) + if (Main::iteration()) break; }; diff --git a/platform/uwp/gl_context_egl.h b/platform/uwp/gl_context_egl.h index 3e3c4a0f57..3c7115cc34 100644 --- a/platform/uwp/gl_context_egl.h +++ b/platform/uwp/gl_context_egl.h @@ -71,8 +71,8 @@ public: virtual int get_window_height(); virtual void swap_buffers(); - void set_use_vsync(bool use) { vsync = use; } - bool is_using_vsync() const { return vsync; } + virtual void set_use_vsync(bool use) { vsync = use; } + virtual bool is_using_vsync() const { return vsync; } virtual Error initialize(); void reset(); @@ -80,7 +80,7 @@ public: void cleanup(); ContextEGL(CoreWindow ^ p_window, Driver p_driver); - ~ContextEGL(); + virtual ~ContextEGL(); }; #endif diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index f489c0894f..6410378593 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -864,7 +864,7 @@ void OSUWP::run() { CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); if (managed_object->alert_close_handle) continue; process_events(); // get rid of pending events - if (Main::iteration() == true) + if (Main::iteration()) break; }; diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h index af2f89568e..5bcdb433b3 100644 --- a/platform/windows/context_gl_win.h +++ b/platform/windows/context_gl_win.h @@ -69,7 +69,7 @@ public: virtual bool is_using_vsync() const; ContextGL_Win(HWND hwnd, bool p_opengl_3_context); - ~ContextGL_Win(); + virtual ~ContextGL_Win(); }; #endif diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index e8c209c0fc..739fcbacda 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1744,7 +1744,7 @@ void OS_Windows::set_window_size(const Size2 p_size) { RECT rect; GetWindowRect(hWnd, &rect); - if (video_mode.borderless_window == false) { + if (!video_mode.borderless_window) { RECT crect; GetClientRect(hWnd, &crect); @@ -2737,7 +2737,7 @@ void OS_Windows::run() { while (!force_quit) { process_events(); // get rid of pending events - if (Main::iteration() == true) + if (Main::iteration()) break; }; diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h index ab0379a2fe..be3083d957 100644 --- a/platform/x11/context_gl_x11.h +++ b/platform/x11/context_gl_x11.h @@ -79,7 +79,7 @@ public: virtual bool is_using_vsync() const; ContextGL_X11(::Display *p_x11_display, ::Window &p_x11_window, const OS::VideoMode &p_default_video_mode, ContextType p_context_type); - ~ContextGL_X11(); + virtual ~ContextGL_X11(); }; #endif diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 5be0b9304a..7c4c8f0eff 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1096,7 +1096,7 @@ void OS_X11::set_window_size(const Size2 p_size) { int old_h = xwa.height; // If window resizable is disabled we need to update the attributes first - if (is_window_resizable() == false) { + if (!is_window_resizable()) { XSizeHints *xsh; xsh = XAllocSizeHints(); xsh->flags = PMinSize | PMaxSize; @@ -1688,7 +1688,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { } } else { //ignore - if (last_is_pressed == false) { + if (!last_is_pressed) { return; } } @@ -2814,7 +2814,7 @@ void OS_X11::run() { #ifdef JOYDEV_ENABLED joypad->process_joypads(); #endif - if (Main::iteration() == true) + if (Main::iteration()) break; }; |