diff options
-rw-r--r-- | core/io/file_access_network.cpp | 4 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 8 | ||||
-rw-r--r-- | platform/android/export/export.cpp | 37 | ||||
-rw-r--r-- | scene/gui/control.cpp | 24 | ||||
-rw-r--r-- | scene/gui/control.h | 2 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 16 | ||||
-rw-r--r-- | scene/main/viewport.h | 4 | ||||
-rw-r--r-- | tools/editor/editor_import_export.cpp | 4 | ||||
-rw-r--r-- | tools/editor/editor_import_export.h | 5 |
9 files changed, 89 insertions, 15 deletions
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 10667a4187..e63b57533f 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -34,9 +34,9 @@ -#define DEBUG_PRINT(m_p) print_line(m_p) +//#define DEBUG_PRINT(m_p) print_line(m_p) //#define DEBUG_TIME(m_what) printf("MS: %s - %lli\n",m_what,OS::get_singleton()->get_ticks_usec()); -//#define DEBUG_PRINT(m_p) +#define DEBUG_PRINT(m_p) #define DEBUG_TIME(m_what) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 58d5c307f0..f0978228ff 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -6755,7 +6755,13 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans if (e->instance->billboard) { Vector3 scale = xf.basis.get_scale(); - xf.set_look_at(xf.origin,xf.origin+p_view_transform.get_basis().get_axis(2),p_view_transform.get_basis().get_axis(1)); + + if (current_rt && current_rt_vflip) { + xf.set_look_at(xf.origin, xf.origin + p_view_transform.get_basis().get_axis(2), -p_view_transform.get_basis().get_axis(1)); + } else { + xf.set_look_at(xf.origin, xf.origin + p_view_transform.get_basis().get_axis(2), p_view_transform.get_basis().get_axis(1)); + } + xf.basis.scale(scale); } material_shader.set_uniform(MaterialShaderGLES2::WORLD_TRANSFORM, xf); diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index c908f6729b..40b125e391 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1513,6 +1513,13 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { //export_temp ep.step("Exporting APK",0); + + bool use_adb_over_usb = bool(EDITOR_DEF("android/use_remote_debug_over_adb",true)); + + if (use_adb_over_usb) { + p_flags|=EXPORT_REMOTE_DEBUG_LOCALHOST; + } + String export_to=EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmpexport.apk"; Error err = export_project(export_to,true,p_flags); if (err) { @@ -1559,6 +1566,35 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { return ERR_CANT_CREATE; } + if (use_adb_over_usb) { + + args.clear(); + args.push_back("reverse"); + args.push_back("--remove-all"); + err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); + + int port = Globals::get_singleton()->get("debug/debug_port"); + args.clear(); + args.push_back("reverse"); + args.push_back("tcp:"+itos(port)); + args.push_back("tcp:"+itos(port)); + + err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); + print_line("Reverse result: "+itos(rv)); + + int fs_port = EditorSettings::get_singleton()->get("file_server/port"); + + args.clear(); + args.push_back("reverse"); + args.push_back("tcp:"+itos(fs_port)); + args.push_back("tcp:"+itos(fs_port)); + + err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); + print_line("Reverse result2: "+itos(rv)); + + } + + ep.step("Running on Device..",3); args.clear(); args.push_back("-s"); @@ -1724,6 +1760,7 @@ void register_android_exporter() { //EDITOR_DEF("android/release_username",""); //EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"android/release_keystore",PROPERTY_HINT_GLOBAL_FILE,"*.keystore")); EDITOR_DEF("android/timestamping_authority_url",""); + EDITOR_DEF("android/use_remote_debug_over_adb",false); Ref<EditorExportPlatformAndroid> exporter = Ref<EditorExportPlatformAndroid>( memnew(EditorExportPlatformAndroid) ); EditorImportExport::get_singleton()->add_export_platform(exporter); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 90c72989bd..8f6a0b4d53 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -606,14 +606,14 @@ void Control::force_drag(const Variant& p_data,Control *p_control) { ERR_FAIL_COND(!is_inside_tree()); ERR_FAIL_COND(p_data.get_type()==Variant::NIL); - get_viewport()->_gui_force_drag(p_data,p_control); + get_viewport()->_gui_force_drag(this,p_data,p_control); } void Control::set_drag_preview(Control *p_control) { ERR_FAIL_COND(!is_inside_tree()); - get_viewport()->_gui_set_drag_preview(p_control); + get_viewport()->_gui_set_drag_preview(this,p_control); } @@ -2046,6 +2046,26 @@ Vector2 Control::get_scale() const{ return data.scale; } +Control *Control::get_root_parent_control() const { + + const CanvasItem *ci=this; + const Control *root=this; + + while(ci) { + + const Control *c = ci->cast_to<Control>(); + if (c) { + root=c; + + if (c->data.RI || c->data.MI || c->is_toplevel_control()) + break; + } + + ci=ci->get_parent_item(); + } + + return const_cast<Control*>(root); +} void Control::_bind_methods() { diff --git a/scene/gui/control.h b/scene/gui/control.h index ab777a6a6c..a16d88a6df 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -360,6 +360,8 @@ public: virtual bool is_text_field() const; + Control *get_root_parent_control() const; + Control(); ~Control(); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index eab62c0dcb..5e8868c326 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1279,9 +1279,11 @@ void Viewport::_vp_input(const InputEvent& p_ev) { if (disable_input) return; +#ifdef TOOLS_ENABLED if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { return; } +#endif if (parent_control && !parent_control->is_visible()) return; @@ -1304,9 +1306,11 @@ void Viewport::_vp_unhandled_input(const InputEvent& p_ev) { if (disable_input) return; +#ifdef TOOLS_ENABLED if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { return; } +#endif if (parent_control && !parent_control->is_visible()) return; @@ -1456,7 +1460,7 @@ Control* Viewport::_gui_find_control(const Point2& p_global) { Matrix32 xform; CanvasItem *pci = sw->get_parent_item(); if (pci) - xform=pci->get_global_transform(); + xform=pci->get_global_transform_with_canvas(); Control *ret = _gui_find_control_at_pos(sw,p_global,xform,gui.focus_inv_xform); @@ -1473,7 +1477,7 @@ Control* Viewport::_gui_find_control(const Point2& p_global) { Matrix32 xform; CanvasItem *pci = sw->get_parent_item(); if (pci) - xform=pci->get_global_transform(); + xform=pci->get_global_transform_with_canvas(); Control *ret = _gui_find_control_at_pos(sw,p_global,xform,gui.focus_inv_xform); @@ -1975,17 +1979,17 @@ void Viewport::_gui_remove_from_modal_stack(List<Control*>::Element *MI,ObjectID } } -void Viewport::_gui_force_drag(const Variant& p_data,Control *p_control) { +void Viewport::_gui_force_drag(Control *p_base, const Variant& p_data, Control *p_control) { gui.drag_data=p_data; gui.mouse_focus=NULL; if (p_control) { - _gui_set_drag_preview(p_control); + _gui_set_drag_preview(p_base,p_control); } } -void Viewport::_gui_set_drag_preview(Control *p_control) { +void Viewport::_gui_set_drag_preview(Control *p_base, Control *p_control) { ERR_FAIL_NULL(p_control); ERR_FAIL_COND( !((Object*)p_control)->cast_to<Control>()); @@ -1997,7 +2001,7 @@ void Viewport::_gui_set_drag_preview(Control *p_control) { } p_control->set_as_toplevel(true); p_control->set_pos(gui.last_mouse_pos); - add_child(p_control); //add as child of viewport + p_base->get_root_parent_control()->add_child(p_control); //add as child of viewport p_control->raise(); if (gui.drag_preview) { memdelete( gui.drag_preview ); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 50e1f0e0f0..89e053d607 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -246,8 +246,8 @@ friend class Control; void _gui_remove_control(Control *p_control); void _gui_hid_control(Control *p_control); - void _gui_force_drag(const Variant& p_data,Control *p_control); - void _gui_set_drag_preview(Control *p_control); + void _gui_force_drag(Control *p_base,const Variant& p_data,Control *p_control); + void _gui_set_drag_preview(Control *p_base,Control *p_control); bool _gui_is_modal_on_top(const Control* p_control); List<Control*>::Element* _gui_show_modal(Control* p_control); diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index 5203ace125..77331256f3 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -1000,6 +1000,9 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags String host = EditorSettings::get_singleton()->get("network/debug_host"); + if (p_flags&EXPORT_REMOTE_DEBUG_LOCALHOST) + host="localhost"; + if (p_flags&EXPORT_DUMB_CLIENT) { int port = EditorSettings::get_singleton()->get("file_server/port"); String passwd = EditorSettings::get_singleton()->get("file_server/password"); @@ -1014,6 +1017,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags if (p_flags&EXPORT_REMOTE_DEBUG) { r_flags.push_back("-rdebug"); + r_flags.push_back(host+":"+String::num(GLOBAL_DEF("debug/debug_port", 6007))); List<String> breakpoints; diff --git a/tools/editor/editor_import_export.h b/tools/editor/editor_import_export.h index 1a0686fb50..272464d9b0 100644 --- a/tools/editor/editor_import_export.h +++ b/tools/editor/editor_import_export.h @@ -136,8 +136,9 @@ public: enum ExportFlags { EXPORT_DUMB_CLIENT=1, EXPORT_REMOTE_DEBUG=2, - EXPORT_VIEW_COLLISONS=4, - EXPORT_VIEW_NAVIGATION=8 + EXPORT_REMOTE_DEBUG_LOCALHOST=4, + EXPORT_VIEW_COLLISONS=8, + EXPORT_VIEW_NAVIGATION=16, }; |