diff options
Diffstat (limited to 'platform/iphone')
-rw-r--r-- | platform/iphone/SCsub | 2 | ||||
-rw-r--r-- | platform/iphone/audio_driver_iphone.cpp | 39 | ||||
-rw-r--r-- | platform/iphone/audio_driver_iphone.h | 4 | ||||
-rw-r--r-- | platform/iphone/detect.py | 11 | ||||
-rw-r--r-- | platform/iphone/globals/global_defaults.cpp | 1 |
5 files changed, 49 insertions, 8 deletions
diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub index 0113f75697..d30d101e1b 100644 --- a/platform/iphone/SCsub +++ b/platform/iphone/SCsub @@ -35,7 +35,7 @@ if env['ios_appirater'] == "yes": obj = env_ios.Object('godot_iphone.cpp') prog = None -if env["target"]=="release": +if env["target"]=="release" or env["target"] == "release_debug": prog = env_ios.Program('#bin/godot_opt', [obj] + iphone_lib) #action = "dsymutil "+File(prog)[0].path+" -o ../build/script_exec/build/Debug-iphoneos/script_exec.app.dSYM" #env.AddPostAction(prog, action) diff --git a/platform/iphone/audio_driver_iphone.cpp b/platform/iphone/audio_driver_iphone.cpp index d39b8f3c4d..c3ba0e6944 100644 --- a/platform/iphone/audio_driver_iphone.cpp +++ b/platform/iphone/audio_driver_iphone.cpp @@ -99,7 +99,16 @@ OSStatus AudioDriverIphone::output_callback(void *inRefCon, AudioBuffer *abuf; AudioDriverIphone* ad = (AudioDriverIphone*)inRefCon; - if (!ad->active) { + bool mix = true; + + if (!ad->active) + mix = false; + else if (ad->mutex) { + mix = ad->mutex->try_lock() == OK; + }; + + + if (!mix) { for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) { abuf = &ioData->mBuffers[i]; zeromem(abuf->mData, abuf->mDataByteSize); @@ -118,9 +127,9 @@ OSStatus AudioDriverIphone::output_callback(void *inRefCon, while (frames_left) { int frames = MIN(frames_left, ad->buffer_frames); - ad->lock(); + //ad->lock(); ad->audio_server_process(frames, ad->samples_in); - ad->unlock(); + //ad->unlock(); for(int i = 0; i < frames * ad->channels; i++) { @@ -132,6 +141,9 @@ OSStatus AudioDriverIphone::output_callback(void *inRefCon, }; }; + if (ad->mutex) + ad->mutex->unlock(); + return 0; }; @@ -147,11 +159,28 @@ AudioDriverSW::OutputFormat AudioDriverIphone::get_output_format() const { return OUTPUT_STEREO; }; -void AudioDriverIphone::lock() {}; -void AudioDriverIphone::unlock() {}; +void AudioDriverIphone::lock() { + + if (active && mutex) + mutex->lock(); +}; + +void AudioDriverIphone::unlock() { + if (active && mutex) + mutex->unlock(); +}; void AudioDriverIphone::finish() { memdelete_arr(samples_in); }; + +AudioDriverIphone::AudioDriverIphone() { + + mutex=Mutex::create();//NULL; +}; + +AudioDriverIphone::~AudioDriverIphone() { + +}; diff --git a/platform/iphone/audio_driver_iphone.h b/platform/iphone/audio_driver_iphone.h index eec54d9ee3..05fa741282 100644 --- a/platform/iphone/audio_driver_iphone.h +++ b/platform/iphone/audio_driver_iphone.h @@ -34,6 +34,7 @@ class AudioDriverIphone : public AudioDriverSW { AudioComponentInstance audio_unit; bool active; + Mutex *mutex; int channels; int32_t* samples_in; @@ -59,5 +60,8 @@ public: virtual void lock(); virtual void unlock(); virtual void finish(); + + AudioDriverIphone(); + ~AudioDriverIphone(); }; diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index ec6e4c98f1..9df9dc16c1 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -35,7 +35,7 @@ def get_flags(): return [ ('lua', 'no'), - ('tools', 'yes'), + ('tools', 'no'), ('nedmalloc', 'no'), ('webp', 'yes'), ('openssl','builtin'), #use builtin openssl @@ -104,10 +104,17 @@ def configure(env): env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] + elif env["target"] == "release_debug": + env.Append(CCFLAGS=['-Os', '-ffast-math', '-DNS_BLOCK_ASSERTIONS=1','-Wall','-DDEBUG_ENABLED']) + env.Append(LINKFLAGS=['-Os', '-ffast-math']) + env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) + env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] + env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] + elif (env["target"]=="debug"): env.Append(CCFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-Wall', '-O0', '-DDEBUG_ENABLED']) - env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) + env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) elif (env["target"]=="profile"): diff --git a/platform/iphone/globals/global_defaults.cpp b/platform/iphone/globals/global_defaults.cpp index 63463ab366..a4929c57dc 100644 --- a/platform/iphone/globals/global_defaults.cpp +++ b/platform/iphone/globals/global_defaults.cpp @@ -6,6 +6,7 @@ void register_iphone_global_defaults() { GLOBAL_DEF("rasterizer.iOS/use_fragment_lighting",false); + GLOBAL_DEF("rasterizer.iOS/fp16_framebuffer",false); GLOBAL_DEF("display.iOS/driver","GLES2"); Globals::get_singleton()->set_custom_property_info("display.iOS/driver",PropertyInfo(Variant::STRING,"display.iOS/driver",PROPERTY_HINT_ENUM,"GLES1,GLES2")); } |