summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r--platform/linuxbsd/detect.py2
-rw-r--r--platform/linuxbsd/detect_prime_x11.cpp11
-rw-r--r--platform/linuxbsd/display_server_x11.cpp24
-rw-r--r--platform/linuxbsd/os_linuxbsd.cpp8
4 files changed, 24 insertions, 21 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 07e16a982b..ab643b254a 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -161,7 +161,7 @@ def configure(env):
env.Append(LINKFLAGS=["-ftest-coverage", "-fprofile-arcs"])
if env["use_ubsan"] or env["use_asan"] or env["use_lsan"] or env["use_tsan"] or env["use_msan"]:
- env.extra_suffix += "s"
+ env.extra_suffix += ".san"
if env["use_ubsan"]:
env.Append(
diff --git a/platform/linuxbsd/detect_prime_x11.cpp b/platform/linuxbsd/detect_prime_x11.cpp
index c775546f15..5bcfc44f12 100644
--- a/platform/linuxbsd/detect_prime_x11.cpp
+++ b/platform/linuxbsd/detect_prime_x11.cpp
@@ -91,7 +91,7 @@ void create_context() {
};
int fbcount;
- GLXFBConfig fbconfig = 0;
+ GLXFBConfig fbconfig = nullptr;
XVisualInfo *vi = nullptr;
XSetWindowAttributes swa;
@@ -100,8 +100,9 @@ void create_context() {
unsigned long valuemask = CWBorderPixel | CWColormap | CWEventMask;
GLXFBConfig *fbc = glXChooseFBConfig(x11_display, DefaultScreen(x11_display), visual_attribs, &fbcount);
- if (!fbc)
+ if (!fbc) {
exit(1);
+ }
vi = glXGetVisualFromFBConfig(x11_display, fbc[0]);
@@ -120,8 +121,9 @@ void create_context() {
swa.colormap = XCreateColormap(x11_display, RootWindow(x11_display, vi->screen), vi->visual, AllocNone);
x11_window = XCreateWindow(x11_display, RootWindow(x11_display, vi->screen), 0, 0, 10, 10, 0, vi->depth, InputOutput, vi->visual, valuemask, &swa);
- if (!x11_window)
+ if (!x11_window) {
exit(1);
+ }
glXMakeCurrent(x11_display, x11_window, glx_context);
XFree(vi);
@@ -179,8 +181,9 @@ int detect_prime() {
close(fdset[0]);
- if (i)
+ if (i) {
setenv("DRI_PRIME", "1", 1);
+ }
create_context();
const char *vendor = (const char *)glGetString(GL_VENDOR);
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp
index 74ec8b652f..247665e313 100644
--- a/platform/linuxbsd/display_server_x11.cpp
+++ b/platform/linuxbsd/display_server_x11.cpp
@@ -1150,7 +1150,7 @@ void DisplayServerX11::delete_sub_window(WindowID p_id) {
}
#ifdef VULKAN_ENABLED
- if (rendering_driver == "vulkan") {
+ if (context_vulkan) {
context_vulkan->window_destroy(p_id);
}
#endif
@@ -2927,7 +2927,7 @@ void DisplayServerX11::_window_changed(XEvent *event) {
wd.size = new_rect.size;
#if defined(VULKAN_ENABLED)
- if (rendering_driver == "vulkan") {
+ if (context_vulkan) {
context_vulkan->window_resize(window_id, wd.size.width, wd.size.height);
}
#endif
@@ -4672,12 +4672,12 @@ DisplayServerX11::~DisplayServerX11() {
//destroy all windows
for (KeyValue<WindowID, WindowData> &E : windows) {
#ifdef VULKAN_ENABLED
- if (rendering_driver == "vulkan") {
+ if (context_vulkan) {
context_vulkan->window_destroy(E.key);
}
#endif
#ifdef GLES3_ENABLED
- if (rendering_driver == "opengl3") {
+ if (gl_manager) {
gl_manager->window_destroy(E.key);
}
#endif
@@ -4693,15 +4693,15 @@ DisplayServerX11::~DisplayServerX11() {
//destroy drivers
#if defined(VULKAN_ENABLED)
- if (rendering_driver == "vulkan") {
- if (rendering_device_vulkan) {
- rendering_device_vulkan->finalize();
- memdelete(rendering_device_vulkan);
- }
+ if (rendering_device_vulkan) {
+ rendering_device_vulkan->finalize();
+ memdelete(rendering_device_vulkan);
+ rendering_device_vulkan = nullptr;
+ }
- if (context_vulkan) {
- memdelete(context_vulkan);
- }
+ if (context_vulkan) {
+ memdelete(context_vulkan);
+ context_vulkan = nullptr;
}
#endif
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index 69474c6dec..c39b5cb784 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -419,7 +419,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
String mnt = get_mountpoint(p_path);
// If there is a directory "[Mountpoint]/.Trash-[UID], use it as the trash can.
- if (mnt != "") {
+ if (!mnt.is_empty()) {
String path(mnt + "/.Trash-" + itos(getuid()));
struct stat s;
if (!stat(path.utf8().get_data(), &s)) {
@@ -428,7 +428,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
}
// Otherwise, if ${XDG_DATA_HOME} is defined, use "${XDG_DATA_HOME}/Trash" as the trash can.
- if (trash_path == "") {
+ if (trash_path.is_empty()) {
char *dhome = getenv("XDG_DATA_HOME");
if (dhome) {
trash_path = String(dhome) + "/Trash";
@@ -436,7 +436,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
}
// Otherwise, if ${HOME} is defined, use "${HOME}/.local/share/Trash" as the trash can.
- if (trash_path == "") {
+ if (trash_path.is_empty()) {
char *home = getenv("HOME");
if (home) {
trash_path = String(home) + "/.local/share/Trash";
@@ -444,7 +444,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
}
// Issue an error if none of the previous locations is appropriate for the trash can.
- ERR_FAIL_COND_V_MSG(trash_path == "", FAILED, "Could not determine the trash can location");
+ ERR_FAIL_COND_V_MSG(trash_path.is_empty(), FAILED, "Could not determine the trash can location");
// Create needed directories for decided trash can location.
{