diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/java_glue.cpp | 12 | ||||
-rw-r--r-- | platform/android/os_android.cpp | 2 | ||||
-rw-r--r-- | platform/bb10/export/export.cpp | 1 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 3 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 48 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 16 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 2 | ||||
-rw-r--r-- | platform/x11/detect.py | 4 | ||||
-rw-r--r-- | platform/x11/joystick_linux.cpp | 3 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 5 |
10 files changed, 63 insertions, 33 deletions
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 5fd2ab8910..45d02876ba 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -238,6 +238,10 @@ String _get_class_name(JNIEnv * env, jclass cls, bool* array) { Variant _jobject_to_variant(JNIEnv * env, jobject obj) { + if (obj == NULL) { + return Variant(); + } + jclass c = env->GetObjectClass(obj); bool array; String name = _get_class_name(env, c, &array); @@ -259,8 +263,7 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { for (int i=0; i<stringCount; i++) { jstring string = (jstring) env->GetObjectArrayElement(arr, i); - const char *rawString = env->GetStringUTFChars(string, 0); - sarr.push_back(String(rawString)); + sarr.push_back(String::utf8(env->GetStringUTFChars(string, NULL))); env->DeleteLocalRef(string); } @@ -506,7 +509,7 @@ public: } break; case Variant::BOOL: { - ret = env->CallBooleanMethodA(instance,E->get().method,v); + ret = env->CallBooleanMethodA(instance,E->get().method,v)==JNI_TRUE; //print_line("call bool"); } break; case Variant::INT: { @@ -521,8 +524,7 @@ public: case Variant::STRING: { jobject o = env->CallObjectMethodA(instance,E->get().method,v); - String str = env->GetStringUTFChars((jstring)o, NULL ); - ret=str; + ret = String::utf8(env->GetStringUTFChars((jstring)o, NULL)); env->DeleteLocalRef(o); } break; case Variant::STRING_ARRAY: { diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index c464caff94..13cdf2a020 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -731,7 +731,7 @@ String OS_Android::get_data_dir() const { //restore original dir so we don't mess things up chdir(real_current_dir_name); - return data_dir_cache + return data_dir_cache; } diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index 7cb0aa3607..14d87aef41 100644 --- a/platform/bb10/export/export.cpp +++ b/platform/bb10/export/export.cpp @@ -714,7 +714,6 @@ Error EditorExportPlatformBB10::run(int p_device, int p_flags) { args.push_back("-installApp"); args.push_back("-launchApp"); args.push_back("-device"); - int idx = devices[p_device].index; String host = EditorSettings::get_singleton()->get("blackberry/device_"+itos(p_device+1)+"/host"); String pass = EditorSettings::get_singleton()->get("blackberry/device_"+itos(p_device+1)+"/password"); args.push_back(host); diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 2e42e79996..1defcb7cb2 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -415,6 +415,9 @@ void OS_JavaScript::push_input(const InputEvent& p_ev) { InputEvent ev = p_ev; ev.ID=last_id++; + if (ev.type==InputEvent::MOUSE_MOTION) { + input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y)); + } input->parse_input_event(p_ev); } diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index cb0514da9d..47b0392b25 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -48,6 +48,11 @@ class EditorExportPlatformOSX : public EditorExportPlatform { String custom_release_package; String custom_debug_package; + enum BitsMode { + BITS_FAT, + BITS_64, + BITS_32 + }; int version_code; @@ -59,8 +64,7 @@ class EditorExportPlatformOSX : public EditorExportPlatform { String version; String signature; String copyright; - bool use64; - bool useFat; + BitsMode bits_mode; bool high_resolution; Ref<ImageTexture> logo; @@ -83,7 +87,7 @@ public: virtual bool poll_devices() { return false;} - virtual int get_device_count() const { return 0; }; + virtual int get_device_count() const { return 0; } virtual String get_device_name(int p_device) const { return String(); } virtual String get_device_info(int p_device) const { return String(); } virtual Error run(int p_device,int p_flags=0); @@ -122,10 +126,8 @@ bool EditorExportPlatformOSX::_set(const StringName& p_name, const Variant& p_va version=p_value; else if (n=="application/copyright") copyright=p_value; - else if (n=="application/64_bits") - use64=p_value; - else if (n=="application/fat_bits") - useFat=p_value; + else if (n=="application/bits_mode") + bits_mode=BitsMode(int(p_value)); else if (n=="display/high_res") high_resolution=p_value; else @@ -158,10 +160,8 @@ bool EditorExportPlatformOSX::_get(const StringName& p_name,Variant &r_ret) cons r_ret=version; else if (n=="application/copyright") r_ret=copyright; - else if (n=="application/64_bits") - r_ret=use64; - else if (n=="application/fat_bits") - r_ret=useFat; + else if (n=="application/bits_mode") + r_ret=bits_mode; else if (n=="display/high_res") r_ret=high_resolution; else @@ -182,13 +182,9 @@ void EditorExportPlatformOSX::_get_property_list( List<PropertyInfo> *p_list) co p_list->push_back( PropertyInfo( Variant::STRING, "application/short_version") ); p_list->push_back( PropertyInfo( Variant::STRING, "application/version") ); p_list->push_back( PropertyInfo( Variant::STRING, "application/copyright") ); - p_list->push_back( PropertyInfo( Variant::BOOL, "application/64_bits") ); - p_list->push_back( PropertyInfo( Variant::BOOL, "application/fat_bits") ); + p_list->push_back( PropertyInfo( Variant::INT, "application/bits_mode", PROPERTY_HINT_ENUM, "Fat (32 & 64 bits),64 bits,32 bits") ); p_list->push_back( PropertyInfo( Variant::BOOL, "display/high_res") ); - - //p_list->push_back( PropertyInfo( Variant::INT, "resources/pack_mode", PROPERTY_HINT_ENUM,"Copy,Single Exec.,Pack (.pck),Bundles (Optical)")); - } void EditorExportPlatformOSX::_make_icon(const Image& p_icon,Vector<uint8_t>& icon) { @@ -321,7 +317,8 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug io2.opaque=&dst_f; zipFile dpkg=zipOpen2(p_path.utf8().get_data(),APPEND_STATUS_CREATE,NULL,&io2); - String binary_to_use="godot_osx_"+String(p_debug?"debug":"release")+"."+String(useFat?"fat":use64?"64":"32"); + String binary_to_use = "godot_osx_" + String(p_debug ? "debug" : "release") + "."; + binary_to_use += String(bits_mode==BITS_FAT ? "fat" : bits_mode==BITS_64 ? "64" : "32"); print_line("binary: "+binary_to_use); String pkg_name; @@ -333,6 +330,8 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug pkg_name="Unnamed"; + bool found_binary = false; + while(ret==UNZ_OK) { //get filename @@ -366,6 +365,7 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug ret = unzGoToNextFile(pkg); continue; //ignore! } + found_binary = true; file="Contents/MacOS/"+pkg_name; } @@ -420,6 +420,13 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug ret = unzGoToNextFile(pkg); } + if (!found_binary) { + ERR_PRINTS("Requested template binary '"+binary_to_use+"' not found. It might be missing from your template archive."); + zipClose(dpkg,NULL); + unzClose(pkg); + return ERR_FILE_NOT_FOUND; + } + ep.step("Making PKG",1); @@ -487,13 +494,12 @@ EditorExportPlatformOSX::EditorExportPlatformOSX() { logo = Ref<ImageTexture>( memnew( ImageTexture )); logo->create_from_image(img); - info="This Game is Nice"; - identifier="com.godot.macgame"; + info="Made with Godot Engine"; + identifier="org.godotengine.macgame"; signature="godotmacgame"; short_version="1.0"; version="1.0"; - use64=false; - useFat=false; + bits_mode=BITS_FAT; high_resolution=false; } diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index e494c0db0e..b0a50ca4b8 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -612,6 +612,20 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { } //return 0; // Jump Back } break; + + case WM_ENTERSIZEMOVE: { + move_timer_id = SetTimer(hWnd, 1, USER_TIMER_MINIMUM,(TIMERPROC) NULL); + } break; + case WM_EXITSIZEMOVE: { + KillTimer(hWnd, move_timer_id); + } break; + case WM_TIMER: { + if (wParam == move_timer_id) { + process_key_events(); + Main::iteration(); + } + } break; + case WM_SYSKEYDOWN: case WM_SYSKEYUP: case WM_KEYUP: @@ -1140,7 +1154,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_ DragAcceptFiles(hWnd,true); - + move_timer_id = 1; } void OS_Windows::set_clipboard(const String& p_text) { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 3880c2c08c..5acb300c0f 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -104,6 +104,8 @@ class OS_Windows : public OS { HINSTANCE hInstance; // Holds The Instance Of The Application HWND hWnd; + uint32_t move_timer_id; + HCURSOR hCursor; Size2 window_rect; diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 54940866b2..3c50e2cf5b 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -182,7 +182,9 @@ def configure(env): print("PulseAudio development libraries not found, disabling driver") env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES_OVER_GL']) - env.Append(LIBS=['GL', 'GLU', 'pthread', 'z', 'dl']) + env.Append(LIBS=['GL', 'GLU', 'pthread', 'z']) + if (platform.system() == "Linux"): + env.Append(LIBS='dl') #env.Append(CPPFLAGS=['-DMPC_FIXED_POINT']) #host compiler is default.. diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joystick_linux.cpp index 82f79c2640..4a6a4f3a52 100644 --- a/platform/x11/joystick_linux.cpp +++ b/platform/x11/joystick_linux.cpp @@ -45,7 +45,9 @@ #define test_bit(nr, addr) (((1UL << ((nr) % LONG_BITS)) & ((addr)[(nr) / LONG_BITS])) != 0) #define NBITS(x) ((((x)-1)/LONG_BITS)+1) +#ifdef UDEV_ENABLED static const char* ignore_str = "/dev/input/js"; +#endif joystick_linux::Joystick::Joystick() { fd = -1; @@ -198,7 +200,6 @@ void joystick_linux::monitor_joysticks(udev *p_udev) { } usleep(50000); } - //printf("exit udev\n"); udev_monitor_unref(mon); } #endif diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 12957b81b7..20fae72abd 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -116,7 +116,9 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi x11_display = XOpenDisplay(NULL); char * modifiers = XSetLocaleModifiers ("@im=none"); - ERR_FAIL_COND( modifiers == NULL ); + if (modifiers==NULL) { + WARN_PRINT("Error setting locale modifiers"); + } const char* err; xrr_get_monitors = NULL; @@ -1771,7 +1773,6 @@ static String _get_clipboard(Atom p_source, Window x11_window, ::Display* x11_di if (Sown == x11_window) { - printf("returning internal clipboard\n"); return p_internal_clipboard; }; |