diff options
author | Anton Yabchinskiy <arn@bestmx.ru> | 2015-07-29 23:01:36 +0300 |
---|---|---|
committer | Anton Yabchinskiy <arn@bestmx.ru> | 2015-07-29 23:01:36 +0300 |
commit | dc8df8a91a995796f0f330bf6bb6b209f6dfce08 (patch) | |
tree | 46cfe09124703b07860754d6b44e0289422e0573 /platform/x11 | |
parent | 16746f157f83d666079ba3266acec13d35b84c3f (diff) | |
parent | 922356b903061cda7591090bf19e8346c3a78cf5 (diff) |
Merge branch 'master' of github.com:okamstudio/godot
Diffstat (limited to 'platform/x11')
-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/detect.py | 15 | ||||
-rw-r--r-- | platform/x11/godot_x11.cpp | 2 | ||||
-rw-r--r-- | platform/x11/key_mapping_x11.cpp | 2 | ||||
-rw-r--r-- | platform/x11/key_mapping_x11.h | 2 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 30 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 6 | ||||
-rw-r--r-- | platform/x11/platform_config.h | 2 |
9 files changed, 48 insertions, 15 deletions
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/detect.py b/platform/x11/detect.py index 185ca04a1e..66b4a7ee8c 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -53,8 +53,10 @@ 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'), + ('debug_release', 'Add debug symbols to release version','no'), ] def get_flags(): @@ -95,6 +97,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'] @@ -102,8 +110,11 @@ def configure(env): if (env["target"]=="release"): - - env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer']) + + if (env["debug_release"]=="yes"): + env.Append(CCFLAGS=['-g2']) + else: + env.Append(CCFLAGS=['-O3','-ffast-math']) elif (env["target"]=="release_debug"): 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 680d0bfdc5..1084d619e1 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 */ @@ -36,6 +36,7 @@ #include "print_string.h" #include "servers/physics/physics_server_sw.h" + #include "X11/Xutil.h" #include "X11/Xatom.h" @@ -259,9 +260,27 @@ 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) { - ERR_PRINT("Initializing audio failed."); + bool success=false; + audio_driver_index=-1; + for(int i=0;i<AudioDriverManagerSW::get_driver_count();i++) { + if (i==p_audio_driver) + continue; + 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())); + print_line("Using alternate audio driver: "+String(AudioDriverManagerSW::get_driver(i)->get_name())); + audio_driver_index=i; + break; + } + } + if (!success) { + ERR_PRINT("Initializing audio failed."); + } + } sample_manager = memnew( SampleManagerMallocSW ); @@ -301,8 +320,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); @@ -410,7 +429,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<Physics2DServerSW>(); physics_2d_server->init(); input = memnew( InputDefault ); diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 456a203380..7c3dab5554 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 */ @@ -46,6 +46,7 @@ #include "drivers/ao/audio_driver_ao.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 <X11/keysym.h> #include <X11/Xlib.h> @@ -162,9 +163,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); diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h index 4ec87b9a97..1556b56058 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 */ |