From 87c51b6fc0504e4943ee3edec5e0fa06097d8b96 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 12 Apr 2015 16:11:26 -0300 Subject: Modified OSX11 to try alternative audio drivers if pulseaudio does not work or user dislikes lennart potering , fixes #1511 --- platform/x11/os_x11.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'platform/x11') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 92b0abff37..4dc10c5b36 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -260,7 +260,20 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi if (AudioDriverManagerSW::get_driver(p_audio_driver)->init()!=OK) { - ERR_PRINT("Initializing audio failed."); + bool success=false; + for(int i=0;iinit()==OK) { + success=true; + print_line("Using alternate audio driver: "+String(AudioDriverManagerSW::get_driver(i)->get_name())); + break; + } + } + if (!success) { + ERR_PRINT("Initializing audio failed."); + } + } sample_manager = memnew( SampleManagerMallocSW ); -- cgit v1.2.3 From 2dfa1279eaed14c4d42d431fc62f3e8c881c2d38 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 12 Apr 2015 16:45:59 -0300 Subject: improved save path error messages for scene, textures and audio, fixes #1514 --- platform/x11/os_x11.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'platform/x11') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 4dc10c5b36..e65503e710 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -266,6 +266,7 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi continue; if (AudioDriverManagerSW::get_driver(i)->init()==OK) { success=true; + print_line("Audio Driver Failed: "+String(AudioDriverManagerSW::get_driver(p_audio_driver)->get_name())); print_line("Using alternate audio driver: "+String(AudioDriverManagerSW::get_driver(i)->get_name())); break; } -- cgit v1.2.3 From fdaa2920eb21fff3320a17e9239e04dfadecdb00 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 18 Apr 2015 14:38:54 -0300 Subject: Updated copyright year in all headers --- platform/x11/context_gl_x11.cpp | 2 +- platform/x11/context_gl_x11.h | 2 +- platform/x11/godot_x11.cpp | 2 +- platform/x11/key_mapping_x11.cpp | 2 +- platform/x11/key_mapping_x11.h | 2 +- platform/x11/os_x11.cpp | 2 +- platform/x11/os_x11.h | 2 +- platform/x11/platform_config.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'platform/x11') diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index 38e3479e5d..dc0dc063b9 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h index 20a858bcdd..8b81db9160 100644 --- a/platform/x11/context_gl_x11.h +++ b/platform/x11/context_gl_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp index 3b50e8e515..f90d40fa5c 100644 --- a/platform/x11/godot_x11.cpp +++ b/platform/x11/godot_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/key_mapping_x11.cpp b/platform/x11/key_mapping_x11.cpp index 2f109355b8..9c68ac1a2c 100644 --- a/platform/x11/key_mapping_x11.cpp +++ b/platform/x11/key_mapping_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/key_mapping_x11.h b/platform/x11/key_mapping_x11.h index 97393d92f3..7ab883878f 100644 --- a/platform/x11/key_mapping_x11.h +++ b/platform/x11/key_mapping_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index e65503e710..413d845bf3 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index ebcb0dc2fc..59cda21cad 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h index f372f8c2cb..c01d0aa380 100644 --- a/platform/x11/platform_config.h +++ b/platform/x11/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3 From 59154cccf9fcf814a21a2596993fb1b6777d3bb7 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 20 Apr 2015 19:38:02 -0300 Subject: -Changed Godot exit to be clean. -Added more debug information on memory cleanliness on exit (if run with -v) -Fixed several memory leaks, fixes #1731, fixes #755 --- platform/x11/detect.py | 7 +++++++ platform/x11/os_x11.cpp | 3 +++ platform/x11/os_x11.h | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'platform/x11') diff --git a/platform/x11/detect.py b/platform/x11/detect.py index b0876d7fc6..4ecd23204f 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -52,6 +52,7 @@ def get_opts(): return [ ('use_llvm','Use llvm compiler','no'), ('use_sanitizer','Use llvm compiler sanitize address','no'), + ('use_leak_sanitizer','Use llvm compiler sanitize memory leaks','no'), ('pulseaudio','Detect & Use pulseaudio','yes'), ('new_wm_api', 'Use experimental window management API','no'), ] @@ -94,6 +95,12 @@ def configure(env): env.Append(LINKFLAGS=['-fsanitize=address']) env.extra_suffix+="s" + if (env["use_leak_sanitizer"]=="yes"): + env.Append(CXXFLAGS=['-fsanitize=address','-fno-omit-frame-pointer']) + env.Append(LINKFLAGS=['-fsanitize=address']) + env.extra_suffix+="s" + + #if (env["tools"]=="no"): # #no tools suffix # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 413d845bf3..67ec33f3a3 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -258,9 +258,11 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton(); + audio_driver_index=p_audio_driver; if (AudioDriverManagerSW::get_driver(p_audio_driver)->init()!=OK) { bool success=false; + audio_driver_index=-1; for(int i=0;iget_name())); print_line("Using alternate audio driver: "+String(AudioDriverManagerSW::get_driver(i)->get_name())); + audio_driver_index=i; break; } } diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 59cda21cad..0036485f3f 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -157,9 +157,10 @@ class OS_X11 : public OS_Unix { int joystick_count; - Joystick joysticks[JOYSTICKS_MAX]; + Joystick joysticks[JOYSTICKS_MAX]; + int audio_driver_index; unsigned int capture_idle; bool maximized; //void set_wm_border(bool p_enabled); -- cgit v1.2.3 From 21939ce08b042b8cfcff16da780a4595aac500cd Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 30 Apr 2015 10:06:18 -0300 Subject: -some cleanups -added tesselation function to curve and curve2d --- platform/x11/detect.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'platform/x11') diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 4ecd23204f..7fa1666c59 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -55,6 +55,7 @@ def get_opts(): ('use_leak_sanitizer','Use llvm compiler sanitize memory leaks','no'), ('pulseaudio','Detect & Use pulseaudio','yes'), ('new_wm_api', 'Use experimental window management API','no'), + ('debug_release', 'Add debug symbols to release version','no'), ] def get_flags(): @@ -109,7 +110,10 @@ def configure(env): if (env["target"]=="release"): - env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer']) + if (env["debug_release"]): + env.Append(CCFLAGS=['-g2','-fomit-frame-pointer']) + else: + env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer']) elif (env["target"]=="release_debug"): -- cgit v1.2.3 From 897a1aade5332753d9fda950d80495798cdc85b4 Mon Sep 17 00:00:00 2001 From: ehriche Date: Wed, 6 May 2015 00:56:59 +0200 Subject: optional formal changes --- platform/x11/os_x11.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/x11') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 67ec33f3a3..28427fa2f0 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -317,8 +317,8 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi /* set the name and class hints for the window manager to use */ classHint = XAllocClassHint(); if (classHint) { - classHint->res_name = "Godot"; - classHint->res_class = "Godot"; + classHint->res_name = (char *)"Godot"; + classHint->res_class = (char *)"Godot"; } XSetClassHint(x11_display, x11_window, classHint); XFree(classHint); -- cgit v1.2.3 From 5f0bb18d55130d0f5d20552b9b19aef2ffe6f309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 22 May 2015 22:14:16 +0200 Subject: Fix building release target with debug symbols This forced the -g2 CCFLAG in release builds, making them relatively heavy. Fixes #1781. --- platform/x11/detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/x11') diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 7fa1666c59..85714c46bb 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -109,8 +109,8 @@ def configure(env): if (env["target"]=="release"): - - if (env["debug_release"]): + + if (env["debug_release"]=="yes"): env.Append(CCFLAGS=['-g2','-fomit-frame-pointer']) else: env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer']) -- cgit v1.2.3 From 9df77d276593ef7082e3971d1c180b8f74b0cb2e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 26 May 2015 01:05:08 -0300 Subject: ability to run 2D physics in a thread also, 2D physics is now thread safe too. see physics_2d/thread_model --- platform/x11/os_x11.cpp | 4 +++- platform/x11/os_x11.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'platform/x11') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 28427fa2f0..f8c570a5c0 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -35,6 +35,7 @@ #include "print_string.h" #include "servers/physics/physics_server_sw.h" + #include "X11/Xutil.h" #include "X11/Xatom.h" @@ -426,7 +427,8 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi // physics_server = memnew( PhysicsServerSW ); physics_server->init(); - physics_2d_server = memnew( Physics2DServerSW ); + //physics_2d_server = memnew( Physics2DServerSW ); + physics_2d_server = Physics2DServerWrapMT::init_server(); physics_2d_server->init(); input = memnew( InputDefault ); diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 0036485f3f..261a54dd25 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -45,6 +45,7 @@ #include "drivers/alsa/audio_driver_alsa.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h" #include "servers/physics_2d/physics_2d_server_sw.h" +#include "servers/physics_2d/physics_2d_server_wrap_mt.h" #include #include -- cgit v1.2.3 From 4e46143499be0e40ae29eff550cbeec4ebde3d85 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 12 Jun 2015 18:27:48 -0300 Subject: some optimizations in godot memory handling --- platform/x11/detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/x11') diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 85714c46bb..ff85e286db 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -111,9 +111,9 @@ def configure(env): if (env["target"]=="release"): if (env["debug_release"]=="yes"): - env.Append(CCFLAGS=['-g2','-fomit-frame-pointer']) + env.Append(CCFLAGS=['-g2']) else: - env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer']) + env.Append(CCFLAGS=['-O3','-ffast-math']) elif (env["target"]=="release_debug"): -- cgit v1.2.3 From 8027a3f00489cd4a5a6d4c85d1ab943cfef1c9db Mon Sep 17 00:00:00 2001 From: Jari Ronkainen Date: Thu, 23 Jul 2015 19:32:10 +0300 Subject: Fix audio driver setup if the first driver fails. --- platform/x11/os_x11.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'platform/x11') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index f8c570a5c0..2f35cebee8 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -267,6 +267,7 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi for(int i=0;iset_singleton(); if (AudioDriverManagerSW::get_driver(i)->init()==OK) { success=true; print_line("Audio Driver Failed: "+String(AudioDriverManagerSW::get_driver(p_audio_driver)->get_name())); -- cgit v1.2.3 From 983fd0dfc3d9bb9c99ebbbd6dd9d312561980ecb Mon Sep 17 00:00:00 2001 From: Jari Ronkainen Date: Thu, 23 Jul 2015 19:35:47 +0300 Subject: Use tabs instead of spaces. --- platform/x11/os_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/x11') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 2f35cebee8..b34d1ba7c8 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -267,7 +267,7 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi for(int i=0;iset_singleton(); + AudioDriverManagerSW::get_driver(i)->set_singleton(); if (AudioDriverManagerSW::get_driver(i)->init()==OK) { success=true; print_line("Audio Driver Failed: "+String(AudioDriverManagerSW::get_driver(p_audio_driver)->get_name())); -- cgit v1.2.3