diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/detect.py | 4 | ||||
-rw-r--r-- | platform/android/export/export.cpp | 29 | ||||
-rw-r--r-- | platform/android/java/src/com/android/godot/GodotLib.java | 2 | ||||
-rw-r--r-- | platform/android/java/src/com/android/godot/GodotView.java | 26 | ||||
-rw-r--r-- | platform/android/java_glue.cpp | 8 | ||||
-rw-r--r-- | platform/android/java_glue.h | 2 | ||||
-rw-r--r-- | platform/android/os_android.cpp | 9 | ||||
-rw-r--r-- | platform/android/os_android.h | 3 | ||||
-rw-r--r-- | platform/bb10/export/export.cpp | 18 | ||||
-rw-r--r-- | platform/javascript/export/export.cpp | 27 | ||||
-rw-r--r-- | platform/osx/detect.py | 2 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 23 | ||||
-rw-r--r-- | platform/windows/SCsub | 10 | ||||
-rw-r--r-- | platform/windows/detect.py | 3 | ||||
-rw-r--r-- | platform/windows/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/windows/godot_res.rc | 2 | ||||
-rw-r--r-- | platform/x11/detect.py | 4 |
17 files changed, 117 insertions, 57 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py index 9db5d02b48..66097a5149 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -98,6 +98,7 @@ def configure(env): if env['android_arch']=='x86': env['NDK_TARGET']=env['NDK_TARGET_X86'] + env["x86_opt_gcc"]=True if env['PLATFORM'] == 'win32': import methods @@ -210,7 +211,8 @@ def configure(env): # env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT']) if(env["opus"]=="yes"): - env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) + if (env["android_arch"]=="armv6" or env["android_arch"]=="armv7"): + env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) env.opus_fixed_point="yes" if (env['android_stl']=='yes'): diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 1deeb3457a..7d550f4fa0 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1020,18 +1020,24 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d EditorProgress ep("export","Exporting for Android",104); - String apk_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - - if (p_debug) { - - src_apk=custom_debug_package!=""?custom_debug_package:apk_path+"android_debug.apk"; - } else { - - src_apk=custom_release_package!=""?custom_release_package:apk_path+"android_release.apk"; + if (p_debug) + src_apk=custom_debug_package; + else + src_apk=custom_release_package; + if (src_apk=="") { + String err; + if (p_debug) { + src_apk=find_export_template("android_debug.apk", &err); + } else { + src_apk=find_export_template("android_release.apk", &err); + } + if (src_apk=="") { + EditorNode::add_io_error(err); + return ERR_FILE_NOT_FOUND; + } } - FileAccess *src_f=NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); @@ -1659,10 +1665,7 @@ bool EditorExportPlatformAndroid::can_export(String *r_error) const { err+="Debug Keystore not configured in editor settings.\n"; } - - String exe_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - - if (!FileAccess::exists(exe_path+"android_debug.apk") || !FileAccess::exists(exe_path+"android_release.apk")) { + if (!exists_export_template("android_debug.apk") || !exists_export_template("android_release.apk")) { valid=false; err+="No export templates found.\nDownload and install export templates.\n"; } diff --git a/platform/android/java/src/com/android/godot/GodotLib.java b/platform/android/java/src/com/android/godot/GodotLib.java index f099e0feff..3d870b3b1f 100644 --- a/platform/android/java/src/com/android/godot/GodotLib.java +++ b/platform/android/java/src/com/android/godot/GodotLib.java @@ -46,7 +46,7 @@ public class GodotLib { public static native void initialize(Godot p_instance,boolean need_reload_hook,String[] p_cmdline,Object p_asset_manager); public static native void resize(int width, int height,boolean reload); - public static native void newcontext(); + public static native void newcontext(boolean p_32_bits); public static native void quit(); public static native void step(); public static native void touch(int what,int pointer,int howmany, int[] arr); diff --git a/platform/android/java/src/com/android/godot/GodotView.java b/platform/android/java/src/com/android/godot/GodotView.java index ad0354e624..bc249d46c6 100644 --- a/platform/android/java/src/com/android/godot/GodotView.java +++ b/platform/android/java/src/com/android/godot/GodotView.java @@ -371,8 +371,8 @@ public class GodotView extends GLSurfaceView { if (use_32) { setEGLConfigChooser( translucent ? - new ConfigChooser(8, 8, 8, 8, 24, stencil) : - new ConfigChooser(8, 8, 8, 8, 24, stencil) ); + new FallbackConfigChooser(8, 8, 8, 8, 24, stencil, new ConfigChooser(8, 8, 8, 8, 16, stencil)) : + new FallbackConfigChooser(8, 8, 8, 8, 24, stencil, new ConfigChooser(5, 6, 5, 0, 16, stencil)) ); } else { setEGLConfigChooser( translucent ? @@ -410,6 +410,26 @@ public class GodotView extends GLSurfaceView { Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error)); } } + /* Fallback if 32bit View is not supported*/ + private static class FallbackConfigChooser extends ConfigChooser { + private ConfigChooser fallback; + + public FallbackConfigChooser(int r, int g, int b, int a, int depth, int stencil, ConfigChooser fallback) { + super(r, g, b, a, depth, stencil); + this.fallback = fallback; + } + + @Override + public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display, EGLConfig[] configs) { + EGLConfig ec = super.chooseConfig(egl, display, configs); + if (ec == null) { + Log.w(TAG, "Trying ConfigChooser fallback"); + ec = fallback.chooseConfig(egl, display, configs); + use_32=false; + } + return ec; + } + } private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser { @@ -635,7 +655,7 @@ public class GodotView extends GLSurfaceView { } public void onSurfaceCreated(GL10 gl, EGLConfig config) { - GodotLib.newcontext(); + GodotLib.newcontext(use_32); } } } diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index d001cface2..2cc74c3bb0 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -920,14 +920,20 @@ JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_resize(JNIEnv * env, jobj } -JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, jobject obj) { +JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, jobject obj,bool p_32_bits) { __android_log_print(ANDROID_LOG_INFO,"godot","^_^_^_^_^ newcontext %lld\n",Thread::get_caller_ID()); + + if (os_android) { + os_android->set_context_is_16_bits(!p_32_bits); + } + if (os_android && step > 0) { os_android->reload_gfx(); } + } diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h index 9410fe7132..e22b6775d8 100644 --- a/platform/android/java_glue.h +++ b/platform/android/java_glue.h @@ -38,7 +38,7 @@ extern "C" { JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager); JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_resize(JNIEnv * env, jobject obj, jint width, jint height, jboolean reload); - JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_newcontext(JNIEnv * env, jobject obj, bool p_32_bits); JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_step(JNIEnv * env, jobject obj); JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_quit(JNIEnv * env, jobject obj); JNIEXPORT void JNICALL Java_com_android_godot_GodotLib_touch(JNIEnv * env, jobject obj, jint ev,jint pointer, jint count, jintArray positions); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index e2ff128f0d..e5d11bef69 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -141,6 +141,8 @@ void OS_Android::initialize(const VideoMode& p_desired,int p_video_driver,int p_ } + rasterizer->set_force_16_bits_fbo(use_16bits_fbo); + visual_server = memnew( VisualServerRaster(rasterizer) ); if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) { @@ -725,6 +727,13 @@ void OS_Android::native_video_stop() { video_stop_func(); } +void OS_Android::set_context_is_16_bits(bool p_is_16) { + + use_16bits_fbo=p_is_16; + if (rasterizer) + rasterizer->set_force_16_bits_fbo(p_is_16); +} + OS_Android::OS_Android(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func,GetModelFunc p_get_model_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient,GetUniqueIDFunc p_get_unique_id,GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func,bool p_use_apk_expansion) { diff --git a/platform/android/os_android.h b/platform/android/os_android.h index dcaa1db654..94c6250ae8 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -95,6 +95,8 @@ private: bool use_reload_hooks; bool use_apk_expansion; + bool use_16bits_fbo; + Rasterizer *rasterizer; VisualServer *visual_server; AudioServerSW *audio_server; @@ -200,6 +202,7 @@ public: void set_display_size(Size2 p_size); void reload_gfx(); + void set_context_is_16_bits(bool p_is_16); void set_need_reload_hooks(bool p_needs_them); virtual void set_screen_orientation(ScreenOrientation p_orientation); diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index 434aaff414..2acd920f31 100644 --- a/platform/bb10/export/export.cpp +++ b/platform/bb10/export/export.cpp @@ -275,10 +275,16 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu EditorProgress ep("export","Exporting for BlackBerry 10",104); - String template_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - - String src_template=custom_package!=""?custom_package:template_path.plus_file("bb10.zip"); - + String src_template=custom_package; + + if (src_template=="") { + String err; + src_template = find_export_template("bb10.zip", &err); + if (src_template=="") { + EditorNode::add_io_error(err); + return ERR_FILE_NOT_FOUND; + } + } FileAccess *src_f=NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); @@ -733,9 +739,7 @@ bool EditorExportPlatformBB10::can_export(String *r_error) const { err+="Blackberry host tools not configured in editor settings.\n"; } - String exe_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - - if (!FileAccess::exists(exe_path+"bb10.zip")) { + if (!exists_export_template("bb10.zip")) { valid=false; err+="No export template found.\nDownload and install export templates.\n"; } diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 9e2595f4a1..acbcbb4652 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -205,18 +205,24 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool EditorProgress ep("export","Exporting for javascript",104); - String template_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - - if (p_debug) { - - src_template=custom_debug_package!=""?custom_debug_package:template_path+"javascript_debug.zip"; - } else { - - src_template=custom_release_package!=""?custom_release_package:template_path+"javascript_release.zip"; + if (p_debug) + src_template=custom_debug_package; + else + src_template=custom_release_package; + if (src_template=="") { + String err; + if (p_debug) { + src_template=find_export_template("javascript_debug.zip", &err); + } else { + src_template=find_export_template("javascript_release.zip", &err); + } + if (src_template=="") { + EditorNode::add_io_error(err); + return ERR_FILE_NOT_FOUND; + } } - FileAccess *src_f=NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); @@ -337,9 +343,8 @@ bool EditorExportPlatformJavaScript::can_export(String *r_error) const { bool valid=true; String err; - String exe_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - if (!FileAccess::exists(exe_path+"javascript_debug.zip") || !FileAccess::exists(exe_path+"javascript_release.zip")) { + if (!exists_export_template("javascript_debug.zip") || !exists_export_template("javascript_release.zip")) { valid=false; err+="No export templates found.\nDownload and install export templates.\n"; } diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 22cee0527e..f7cf5111f5 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -116,4 +116,4 @@ def configure(env): env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) - + env["x86_opt_gcc"]=True diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 79ee91bc61..0bece6ec76 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -251,15 +251,19 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug EditorProgress ep("export","Exporting for OSX",104); - String pkg_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/osx.zip"; - - if (p_debug) { - - src_pkg=custom_debug_package!=""?custom_debug_package:pkg_path; - } else { - - src_pkg=custom_release_package!=""?custom_release_package:pkg_path; + if (p_debug) + src_pkg=custom_debug_package; + else + src_pkg=custom_release_package; + + if (src_pkg=="") { + String err; + src_pkg=find_export_template("osx.zip", &err); + if (src_pkg=="") { + EditorNode::add_io_error(err); + return ERR_FILE_NOT_FOUND; + } } @@ -464,9 +468,8 @@ bool EditorExportPlatformOSX::can_export(String *r_error) const { bool valid=true; String err; - String exe_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - if (!FileAccess::exists(exe_path+"osx.zip")) { + if (!exists_export_template("osx.zip")) { valid=false; err+="No export templates found.\nDownload and install export templates.\n"; } diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 1fa793e2de..f98c1b01ff 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -11,11 +11,11 @@ common_win=[ "stream_peer_winsock.cpp", ] -env.RES('godot_res.rc') -if env["is_mingw"]: - common_win.append("godot_res.o") -else: - common_win.append("godot_res.res") +restarget="godot_res"+env["OBJSUFFIX"] + +obj = env.RES(restarget,'godot_res.rc') + +common_win.append(obj) env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX"]) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index fcde14030f..3193a2acbb 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -170,7 +170,6 @@ def get_flags(): return [ ('freetype','builtin'), #use builtin freetype ('openssl','builtin'), #use builtin openssl - ('theora','no'), ] def build_res_file( target, source, env ): @@ -263,6 +262,7 @@ def configure(env): env.Append(CCFLAGS=["/I"+DIRECTX_PATH+"/Include"]) env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x86"]) env['ENV'] = os.environ; + env["x86_opt_vc"]=True else: # Workaround for MinGW. See: @@ -361,6 +361,7 @@ def configure(env): env['AR'] = mingw_prefix+"ar" env['RANLIB'] = mingw_prefix+"ranlib" env['LD'] = mingw_prefix+"g++" + env["x86_opt_gcc"]=True #env['CC'] = "winegcc" #env['CXX'] = "wineg++" diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 29f21bf227..9cfd475091 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -327,7 +327,7 @@ EditorExportPlatformWindows::EditorExportPlatformWindows() { icon128=true; icon256=true; product_name="$genname"; - company_name="Okam Studio"; + company_name="Godot Engine"; file_description="Created With Godot Engine"; version_text="1.0"; OS::Date date = OS::get_singleton()->get_date(); diff --git a/platform/windows/godot_res.rc b/platform/windows/godot_res.rc index 73f36e5e59..f77182f909 100644 --- a/platform/windows/godot_res.rc +++ b/platform/windows/godot_res.rc @@ -16,7 +16,7 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "Okam Studio" + VALUE "CompanyName", "Godot Engine" VALUE "FileDescription", _MKSTR(VERSION_NAME) " Editor (" _MKSTR(VERSION_STATUS) ")" VALUE "FileVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "."_MKSTR(VERSION_REVISION) VALUE "ProductName", _MKSTR(VERSION_NAME) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 5ec7eb1afc..349e58cd7a 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -119,6 +119,8 @@ def configure(env): elif (env["target"]=="release_debug"): env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED']) + if (env["debug_release"]=="yes"): + env.Append(CCFLAGS=['-g2']) elif (env["target"]=="debug"): @@ -183,3 +185,5 @@ def configure(env): env.Append(CPPFLAGS=['-DNEW_WM_API']) env.ParseConfig('pkg-config xinerama --cflags --libs') + env["x86_opt_gcc"]=True + |