diff options
-rw-r--r-- | doc/base/classes.xml | 11 | ||||
-rw-r--r-- | drivers/unix/dir_access_unix.cpp | 7 | ||||
-rw-r--r-- | drivers/windows/dir_access_windows.cpp | 7 | ||||
-rw-r--r-- | platform/flash/dir_access_flash.cpp | 4 | ||||
-rw-r--r-- | platform/javascript/javascript_main.cpp | 19 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 6 | ||||
-rw-r--r-- | platform/javascript/os_javascript.h | 4 | ||||
-rw-r--r-- | platform/osx/dir_access_osx.mm | 7 | ||||
-rw-r--r-- | tools/editor/editor_node.cpp | 19 |
9 files changed, 54 insertions, 30 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index e658e2ad96..fe755d520e 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -490,6 +490,7 @@ <argument index="1" name="..." type="Variant"> </argument> <description> + Print one or more arguments to the console with a space between each argument. </description> </method> <method name="printerr"> @@ -520,7 +521,7 @@ <argument index="0" name="var" type="Variant"> </argument> <description> - Converts the value of a variable to a String. + Converts a value to a string that can later be parsed using str2var. </description> </method> <method name="str2var"> @@ -529,6 +530,7 @@ <argument index="0" name="string" type="String"> </argument> <description> + Converts a string that was returned by var2str to the original value. </description> </method> <method name="var2bytes"> @@ -537,6 +539,7 @@ <argument index="0" name="var" type="Variant"> </argument> <description> + Encodes a variable to a byte array. </description> </method> <method name="bytes2var"> @@ -545,6 +548,7 @@ <argument index="0" name="bytes" type="RawArray"> </argument> <description> + Decodes a byte array back to a variable. </description> </method> <method name="range"> @@ -604,6 +608,7 @@ <argument index="3" name="a8" type="int"> </argument> <description> + Makes a color from red, green, blue and alpha. Arguments can range from 0 to 255. </description> </method> <method name="print_stack"> @@ -619,6 +624,7 @@ <argument index="0" name="instance_id" type="int"> </argument> <description> + Get an object by its ID. </description> </method> <method name="preload"> @@ -627,6 +633,7 @@ <argument index="0" name="path" type="String"> </argument> <description> + Preload and get a resource. The resource is loaded during script parsing. </description> </method> <method name="yield"> @@ -637,6 +644,7 @@ <argument index="1" name="signal" type="String"> </argument> <description> + Stops function execution and return current state. Call resume on the state to resume execution. </description> </method> <method name="assert"> @@ -645,6 +653,7 @@ <argument index="0" name="condition" type="bool"> </argument> <description> + If the condition is false, generates an error. </description> </method> </methods> diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 23a63be339..8b097ad25e 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -292,8 +292,11 @@ Error DirAccessUnix::rename(String p_path,String p_new_path) { } Error DirAccessUnix::remove(String p_path) { - p_path=fix_path(p_path); - + if (p_path.is_rel_path()) + p_path=get_current_dir().plus_file(p_path); + else + p_path=fix_path(p_path); + struct stat flags; if ((stat(p_path.utf8().get_data(),&flags)!=0)) return FAILED; diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 0a413979fc..b9476b870b 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -310,8 +310,11 @@ Error DirAccessWindows::rename(String p_path,String p_new_path) { Error DirAccessWindows::remove(String p_path) { - p_path=fix_path(p_path); - + if (p_path.is_rel_path()) + p_path=get_current_dir().plus_file(p_path); + else + p_path=fix_path(p_path); + printf("erasing %s\n",p_path.utf8().get_data()); //WIN32_FILE_ATTRIBUTE_DATA fileInfo; //DWORD fileAttr = GetFileAttributesExW(p_path.c_str(), GetFileExInfoStandard, &fileInfo); diff --git a/platform/flash/dir_access_flash.cpp b/platform/flash/dir_access_flash.cpp index 443242fd99..ce9eed2c59 100644 --- a/platform/flash/dir_access_flash.cpp +++ b/platform/flash/dir_access_flash.cpp @@ -183,12 +183,12 @@ size_t DirAccessFlash::get_space_left() { Error DirAccessFlash::rename(String p_from, String p_to) { - return FAILED; + ERR_FAIL_V(ERR_UNAVAILABLE); }; Error DirAccessFlash::remove(String p_name) { - return FAILED; + ERR_FAIL_V(ERR_UNAVAILABLE); }; extern char* psp_drive; diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index e66110b655..632ef2b6b2 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -74,6 +74,15 @@ static void _glut_skey(bool pressed,int key) { case GLUT_KEY_INSERT: ev.key.scancode=KEY_INSERT; break; } + if (pressed) { + if (os->skey_pressed[key]) + ev.key.echo = true; + else + os->skey_pressed[key] = true; + } + else { + os->skey_pressed[key] = false; + } uint32_t m = glutGetModifiers(); ev.key.mod.alt=(m&GLUT_ACTIVE_ALT)!=0; @@ -107,6 +116,16 @@ static void _glut_key(bool pressed,unsigned char key) { default: { ev.key.unicode=key; } + + if (pressed) { + if (os->key_pressed[key]) + ev.key.echo = true; + else + os->key_pressed[key] = true; + } + else { + os->key_pressed[key] = false; + } } diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 562733ab89..413d88ee23 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -693,7 +693,11 @@ OS_JavaScript::OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, Ope time_to_save_sync=-1; - + for (int i = 0; i < 256; i++) { + key_pressed[i] = false; + if (i < 121) + skey_pressed[i] = false; + } } OS_JavaScript::~OS_JavaScript() { diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index ec3a6cf911..4a8265b9d9 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -56,10 +56,12 @@ public: Point2 pos; }; + bool skey_pressed[121]; + bool key_pressed[256]; + private: Vector<TouchPos> touch; - Point2 last_mouse; unsigned int last_id; GFXInitFunc gfx_init_func; diff --git a/platform/osx/dir_access_osx.mm b/platform/osx/dir_access_osx.mm index e345bea60a..29f8fda663 100644 --- a/platform/osx/dir_access_osx.mm +++ b/platform/osx/dir_access_osx.mm @@ -297,8 +297,11 @@ Error DirAccessOSX::rename(String p_path,String p_new_path) { } Error DirAccessOSX::remove(String p_path) { - p_path=fix_path(p_path); - + if (p_path.is_rel_path()) + p_path=get_current_dir().plus_file(p_path); + else + p_path=fix_path(p_path); + struct stat flags; if ((stat(p_path.utf8().get_data(),&flags)!=0)) return FAILED; diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 61d6d74d1e..24df4544ec 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -981,11 +981,6 @@ void EditorNode::_save_scene(String p_file) { editor_data.apply_changes_in_editors(); - if (editor_plugin_screen) { - scene->set_meta("__editor_plugin_screen__",editor_plugin_screen->get_name()); - } - - _set_scene_metadata(p_file); @@ -3692,26 +3687,12 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo */ editor_data.set_edited_scene_import_metadata( sdata->get_import_metadata() ); - // editor_data.get_undo_redo().clear_history(); saved_version=editor_data.get_undo_redo().get_version(); _update_title(); _update_scene_tabs(); _add_to_recent_scenes(lpath); - if (new_scene->has_meta("__editor_plugin_screen__")) { - - String editor = new_scene->get_meta("__editor_plugin_screen__"); - - for(int i=0;i<editor_table.size();i++) { - - if (editor_table[i]->get_name()==editor) { - _editor_select(i); - break; - } - } - } - prev_scene->set_disabled(previous_scenes.size()==0); opening_prev=false; |