diff options
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r-- | platform/linuxbsd/godot_linuxbsd.cpp | 2 | ||||
-rw-r--r-- | platform/linuxbsd/tts_linux.cpp | 10 | ||||
-rw-r--r-- | platform/linuxbsd/x11/display_server_x11.cpp | 16 | ||||
-rw-r--r-- | platform/linuxbsd/x11/gl_manager_x11.cpp | 8 |
4 files changed, 18 insertions, 18 deletions
diff --git a/platform/linuxbsd/godot_linuxbsd.cpp b/platform/linuxbsd/godot_linuxbsd.cpp index d059d60b72..efad9c8594 100644 --- a/platform/linuxbsd/godot_linuxbsd.cpp +++ b/platform/linuxbsd/godot_linuxbsd.cpp @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) { TEST_MAIN_OVERRIDE char *cwd = (char *)malloc(PATH_MAX); - ERR_FAIL_COND_V(!cwd, ERR_OUT_OF_MEMORY); + ERR_FAIL_NULL_V(cwd, ERR_OUT_OF_MEMORY); char *ret = getcwd(cwd, PATH_MAX); Error err = Main::setup(argv[0], argc - 1, &argv[1]); diff --git a/platform/linuxbsd/tts_linux.cpp b/platform/linuxbsd/tts_linux.cpp index 8bc83f5b9c..96745ab8ae 100644 --- a/platform/linuxbsd/tts_linux.cpp +++ b/platform/linuxbsd/tts_linux.cpp @@ -186,7 +186,7 @@ bool TTS_Linux::is_paused() const { Array TTS_Linux::get_voices() const { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND_V(!synth, Array()); + ERR_FAIL_NULL_V(synth, Array()); const_cast<TTS_Linux *>(this)->_load_voices(); Array list; @@ -204,7 +204,7 @@ Array TTS_Linux::get_voices() const { void TTS_Linux::speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND(!synth); + ERR_FAIL_NULL(synth); if (p_interrupt) { stop(); } @@ -233,7 +233,7 @@ void TTS_Linux::speak(const String &p_text, const String &p_voice, int p_volume, void TTS_Linux::pause() { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND(!synth); + ERR_FAIL_NULL(synth); if (spd_pause(synth) == 0) { paused = true; } @@ -242,7 +242,7 @@ void TTS_Linux::pause() { void TTS_Linux::resume() { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND(!synth); + ERR_FAIL_NULL(synth); spd_resume(synth); paused = false; } @@ -250,7 +250,7 @@ void TTS_Linux::resume() { void TTS_Linux::stop() { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND(!synth); + ERR_FAIL_NULL(synth); for (DisplayServer::TTSUtterance &message : queue) { DisplayServer::get_singleton()->tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, message.id); } diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index f38a9dd278..d20a591299 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -307,37 +307,37 @@ void DisplayServerX11::_flush_mouse_motion() { #ifdef SPEECHD_ENABLED bool DisplayServerX11::tts_is_speaking() const { - ERR_FAIL_COND_V_MSG(!tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); + ERR_FAIL_NULL_V_MSG(tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); return tts->is_speaking(); } bool DisplayServerX11::tts_is_paused() const { - ERR_FAIL_COND_V_MSG(!tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); + ERR_FAIL_NULL_V_MSG(tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); return tts->is_paused(); } TypedArray<Dictionary> DisplayServerX11::tts_get_voices() const { - ERR_FAIL_COND_V_MSG(!tts, TypedArray<Dictionary>(), "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); + ERR_FAIL_NULL_V_MSG(tts, TypedArray<Dictionary>(), "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); return tts->get_voices(); } void DisplayServerX11::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) { - ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); + ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); tts->speak(p_text, p_voice, p_volume, p_pitch, p_rate, p_utterance_id, p_interrupt); } void DisplayServerX11::tts_pause() { - ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); + ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); tts->pause(); } void DisplayServerX11::tts_resume() { - ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); + ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); tts->resume(); } void DisplayServerX11::tts_stop() { - ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); + ERR_FAIL_NULL_MSG(tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); tts->stop(); } @@ -5100,7 +5100,7 @@ DisplayServerX11::WindowID DisplayServerX11::_create_window(WindowMode p_mode, V XVisualInfo vInfoTemplate = {}; vInfoTemplate.screen = DefaultScreen(x11_display); XVisualInfo *vi_list = XGetVisualInfo(x11_display, visualMask, &vInfoTemplate, &numberOfVisuals); - ERR_FAIL_COND_V(!vi_list, INVALID_WINDOW_ID); + ERR_FAIL_NULL_V(vi_list, INVALID_WINDOW_ID); visualInfo = vi_list[0]; if (OS::get_singleton()->is_layered_allowed()) { diff --git a/platform/linuxbsd/x11/gl_manager_x11.cpp b/platform/linuxbsd/x11/gl_manager_x11.cpp index f24bac5e19..13b5dedb1e 100644 --- a/platform/linuxbsd/x11/gl_manager_x11.cpp +++ b/platform/linuxbsd/x11/gl_manager_x11.cpp @@ -103,7 +103,7 @@ Error GLManager_X11::_create_context(GLDisplay &gl_display) { GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = (GLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((const GLubyte *)"glXCreateContextAttribsARB"); - ERR_FAIL_COND_V(!glXCreateContextAttribsARB, ERR_UNCONFIGURED); + ERR_FAIL_NULL_V(glXCreateContextAttribsARB, ERR_UNCONFIGURED); static int visual_attribs[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT, @@ -134,7 +134,7 @@ Error GLManager_X11::_create_context(GLDisplay &gl_display) { if (OS::get_singleton()->is_layered_allowed()) { GLXFBConfig *fbc = glXChooseFBConfig(x11_display, DefaultScreen(x11_display), visual_attribs_layered, &fbcount); - ERR_FAIL_COND_V(!fbc, ERR_UNCONFIGURED); + ERR_FAIL_NULL_V(fbc, ERR_UNCONFIGURED); for (int i = 0; i < fbcount; i++) { vi = (XVisualInfo *)glXGetVisualFromFBConfig(x11_display, fbc[i]); @@ -156,10 +156,10 @@ Error GLManager_X11::_create_context(GLDisplay &gl_display) { } XFree(fbc); - ERR_FAIL_COND_V(!fbconfig, ERR_UNCONFIGURED); + ERR_FAIL_NULL_V(fbconfig, ERR_UNCONFIGURED); } else { GLXFBConfig *fbc = glXChooseFBConfig(x11_display, DefaultScreen(x11_display), visual_attribs, &fbcount); - ERR_FAIL_COND_V(!fbc, ERR_UNCONFIGURED); + ERR_FAIL_NULL_V(fbc, ERR_UNCONFIGURED); vi = glXGetVisualFromFBConfig(x11_display, fbc[0]); |