diff options
author | letheed <letheed@outlook.com> | 2017-09-10 15:37:49 +0200 |
---|---|---|
committer | letheed <letheed@outlook.com> | 2017-09-20 13:11:10 +0200 |
commit | 5ad9be4c24e9d7dc5672fdc42cea896622fe5685 (patch) | |
tree | a8811a50265edd940b00e12b9bd522e3e9b4694e /modules | |
parent | ecd226c6a751f8a20766363fd1f2e1e0e2da8fba (diff) |
Rename pos to position in user facing methods and variables
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:
* pos -> position
* rot -> rotation
* loc -> location
C++ variables are left as is.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/dds/texture_loader_dds.cpp | 2 | ||||
-rw-r--r-- | modules/opus/audio_stream_opus.cpp | 6 | ||||
-rw-r--r-- | modules/opus/audio_stream_opus.h | 2 | ||||
-rw-r--r-- | modules/pvr/texture_loader_pvr.cpp | 2 | ||||
-rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 2 | ||||
-rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.h | 2 | ||||
-rw-r--r-- | modules/tga/image_loader_tga.cpp | 4 | ||||
-rw-r--r-- | modules/theora/video_stream_theora.cpp | 2 | ||||
-rw-r--r-- | modules/theora/video_stream_theora.h | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script.cpp | 10 | ||||
-rw-r--r-- | modules/visual_script/visual_script.h | 4 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 22 | ||||
-rw-r--r-- | modules/vorbis/audio_stream_ogg_vorbis.cpp | 6 | ||||
-rw-r--r-- | modules/vorbis/audio_stream_ogg_vorbis.h | 2 | ||||
-rw-r--r-- | modules/webm/video_stream_webm.cpp | 4 | ||||
-rw-r--r-- | modules/webm/video_stream_webm.h | 2 |
16 files changed, 37 insertions, 37 deletions
diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 95d93e6af6..ae9daa802f 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -152,7 +152,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, */ //must avoid this later - while (f->get_pos() < 128) + while (f->get_position() < 128) f->get_8(); DDSFormat dds_format; diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp index 1dac890eb8..995f4ddcc6 100644 --- a/modules/opus/audio_stream_opus.cpp +++ b/modules/opus/audio_stream_opus.cpp @@ -56,7 +56,7 @@ int AudioStreamPlaybackOpus::_op_seek_func(void *_stream, opus_int64 _offset, in fa->seek(_offset); } break; case SEEK_CUR: { - fa->seek(fa->get_pos() + _offset); + fa->seek(fa->get_position() + _offset); } break; case SEEK_END: { fa->seek_end(_offset); @@ -83,7 +83,7 @@ int AudioStreamPlaybackOpus::_op_close_func(void *_stream) { opus_int64 AudioStreamPlaybackOpus::_op_tell_func(void *_stream) { FileAccess *_fa = (FileAccess *)_stream; - return (opus_int64)_fa->get_pos(); + return (opus_int64)_fa->get_position(); } void AudioStreamPlaybackOpus::_clear_stream() { @@ -340,7 +340,7 @@ float AudioStreamPlaybackOpus::get_length() const { return length; } -float AudioStreamPlaybackOpus::get_pos() const { +float AudioStreamPlaybackOpus::get_position() const { int32_t frames = int32_t(frames_mixed); if (frames < 0) diff --git a/modules/opus/audio_stream_opus.h b/modules/opus/audio_stream_opus.h index ccfe04e84e..c7a053acd3 100644 --- a/modules/opus/audio_stream_opus.h +++ b/modules/opus/audio_stream_opus.h @@ -99,7 +99,7 @@ public: virtual int get_loop_count() const { return repeats; } - virtual float get_pos() const; + virtual float get_position() const; virtual void seek_pos(float p_time); virtual int get_channels() const { return stream_channels; } diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 90ee164b6f..03592047ad 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -74,7 +74,7 @@ RES ResourceFormatPVR::load(const String &p_path, const String &p_original_path, uint32_t mipmaps = f->get_32(); uint32_t flags = f->get_32(); uint32_t surfsize = f->get_32(); - f->seek(f->get_pos() + 20); // bpp, rmask, gmask, bmask, amask + f->seek(f->get_position() + 20); // bpp, rmask, gmask, bmask, amask uint8_t pvrid[5] = { 0, 0, 0, 0, 0 }; f->get_buffer(pvrid, 4); ERR_FAIL_COND_V(String((char *)pvrid) != "PVR!", RES()); diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 9457fbfaf6..a3206187c0 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -97,7 +97,7 @@ int AudioStreamPlaybackOGGVorbis::get_loop_count() const { return loops; } -float AudioStreamPlaybackOGGVorbis::get_pos() const { +float AudioStreamPlaybackOGGVorbis::get_position() const { return float(frames_mixed) / vorbis_stream->sample_rate; } diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.h b/modules/stb_vorbis/audio_stream_ogg_vorbis.h index bcd829a56a..c38402fb3a 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.h +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.h @@ -67,7 +67,7 @@ public: virtual int get_loop_count() const; //times it looped - virtual float get_pos() const; + virtual float get_position() const; virtual void seek_pos(float p_time); virtual float get_length() const; //if supported, otherwise return 0 diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index 7c7cf5bcbe..d7a1ce7308 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -253,7 +253,7 @@ Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force err = FAILED; if (err == OK) { - f->seek(f->get_pos() + tga_header.id_length); + f->seek(f->get_position() + tga_header.id_length); PoolVector<uint8_t> palette; @@ -269,7 +269,7 @@ Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force } PoolVector<uint8_t>::Write src_image_w = src_image.write(); - f->get_buffer(&src_image_w[0], src_image_len - f->get_pos()); + f->get_buffer(&src_image_w[0], src_image_len - f->get_position()); PoolVector<uint8_t>::Read src_image_r = src_image.read(); diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 02b994f8db..603c31195d 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -634,7 +634,7 @@ int VideoStreamPlaybackTheora::get_loop_count() const { return 0; }; -float VideoStreamPlaybackTheora::get_pos() const { +float VideoStreamPlaybackTheora::get_position() const { return get_time(); }; diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index f04e49c662..aeb5fa3511 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -140,7 +140,7 @@ public: virtual int get_loop_count() const; - virtual float get_pos() const; + virtual float get_position() const; virtual void seek_pos(float p_time); void set_file(const String &p_file); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 88012d2031..c665fa12cf 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -423,7 +423,7 @@ Ref<VisualScriptNode> VisualScript::get_node(const StringName &p_func, int p_id) return func.nodes[p_id].node; } -void VisualScript::set_node_pos(const StringName &p_func, int p_id, const Point2 &p_pos) { +void VisualScript::set_node_position(const StringName &p_func, int p_id, const Point2 &p_pos) { ERR_FAIL_COND(instances.size()); ERR_FAIL_COND(!functions.has(p_func)); @@ -433,7 +433,7 @@ void VisualScript::set_node_pos(const StringName &p_func, int p_id, const Point2 func.nodes[p_id].pos = p_pos; } -Point2 VisualScript::get_node_pos(const StringName &p_func, int p_id) const { +Point2 VisualScript::get_node_position(const StringName &p_func, int p_id) const { ERR_FAIL_COND_V(!functions.has(p_func), Point2()); const Function &func = functions[p_func]; @@ -1273,14 +1273,14 @@ void VisualScript::_bind_methods() { ClassDB::bind_method(D_METHOD("set_function_scroll", "name", "ofs"), &VisualScript::set_function_scroll); ClassDB::bind_method(D_METHOD("get_function_scroll", "name"), &VisualScript::get_function_scroll); - ClassDB::bind_method(D_METHOD("add_node", "func", "id", "node", "pos"), &VisualScript::add_node, DEFVAL(Point2())); + ClassDB::bind_method(D_METHOD("add_node", "func", "id", "node", "position"), &VisualScript::add_node, DEFVAL(Point2())); ClassDB::bind_method(D_METHOD("remove_node", "func", "id"), &VisualScript::remove_node); ClassDB::bind_method(D_METHOD("get_function_node_id", "name"), &VisualScript::get_function_node_id); ClassDB::bind_method(D_METHOD("get_node", "func", "id"), &VisualScript::get_node); ClassDB::bind_method(D_METHOD("has_node", "func", "id"), &VisualScript::has_node); - ClassDB::bind_method(D_METHOD("set_node_pos", "func", "id", "pos"), &VisualScript::set_node_pos); - ClassDB::bind_method(D_METHOD("get_node_pos", "func", "id"), &VisualScript::get_node_pos); + ClassDB::bind_method(D_METHOD("set_node_position", "func", "id", "position"), &VisualScript::set_node_position); + ClassDB::bind_method(D_METHOD("get_node_position", "func", "id"), &VisualScript::get_node_position); ClassDB::bind_method(D_METHOD("sequence_connect", "func", "from_node", "from_output", "to_node"), &VisualScript::sequence_connect); ClassDB::bind_method(D_METHOD("sequence_disconnect", "func", "from_node", "from_output", "to_node"), &VisualScript::sequence_disconnect); diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 297e9e510f..4ae50ee829 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -278,8 +278,8 @@ public: void remove_node(const StringName &p_func, int p_id); bool has_node(const StringName &p_func, int p_id) const; Ref<VisualScriptNode> get_node(const StringName &p_func, int p_id) const; - void set_node_pos(const StringName &p_func, int p_id, const Point2 &p_pos); - Point2 get_node_pos(const StringName &p_func, int p_id) const; + void set_node_position(const StringName &p_func, int p_id, const Point2 &p_pos); + Point2 get_node_position(const StringName &p_func, int p_id) const; void get_node_list(const StringName &p_func, List<int> *r_nodes) const; void sequence_connect(const StringName &p_func, int p_from_node, int p_from_output, int p_to_node); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index ee83c44793..d0ab29f184 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -481,7 +481,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { continue; Ref<VisualScriptNode> node = script->get_node(edited_func, E->get()); - Vector2 pos = script->get_node_pos(edited_func, E->get()); + Vector2 pos = script->get_node_position(edited_func, E->get()); GraphNode *gnode = memnew(GraphNode); gnode->set_title(node->get_caption()); @@ -1065,7 +1065,7 @@ void VisualScriptEditor::_available_node_doubleclicked() { List<int> existing; script->get_node_list(edited_func, &existing); for (List<int>::Element *E = existing.front(); E; E = E->next()) { - Point2 pos = script->get_node_pos(edited_func, E->get()); + Point2 pos = script->get_node_position(edited_func, E->get()); if (pos.distance_to(ofs) < 15) { ofs += Vector2(graph->get_snap(), graph->get_snap()); exists = true; @@ -1186,7 +1186,7 @@ void VisualScriptEditor::_on_nodes_delete() { for (List<int>::Element *F = to_erase.front(); F; F = F->next()) { undo_redo->add_do_method(script.ptr(), "remove_node", edited_func, F->get()); - undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, F->get(), script->get_node(edited_func, F->get()), script->get_node_pos(edited_func, F->get())); + undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, F->get(), script->get_node(edited_func, F->get()), script->get_node_position(edited_func, F->get())); List<VisualScript::SequenceConnection> sequence_conns; script->get_sequence_connection_list(edited_func, &sequence_conns); @@ -1243,7 +1243,7 @@ void VisualScriptEditor::_on_nodes_duplicate() { int new_id = idc++; to_select.insert(new_id); - undo_redo->add_do_method(script.ptr(), "add_node", edited_func, new_id, dupe, script->get_node_pos(edited_func, F->get()) + Vector2(20, 20)); + undo_redo->add_do_method(script.ptr(), "add_node", edited_func, new_id, dupe, script->get_node_position(edited_func, F->get()) + Vector2(20, 20)); undo_redo->add_undo_method(script.ptr(), "remove_node", edited_func, new_id); } undo_redo->add_do_method(this, "_update_graph"); @@ -1277,7 +1277,7 @@ Variant VisualScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_f if (p_from == nodes) { - TreeItem *it = nodes->get_item_at_pos(p_point); + TreeItem *it = nodes->get_item_at_position(p_point); if (!it) return Variant(); String type = it->get_metadata(0); @@ -1296,7 +1296,7 @@ Variant VisualScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_f if (p_from == members) { - TreeItem *it = members->get_item_at_pos(p_point); + TreeItem *it = members->get_item_at_position(p_point); if (!it) return Variant(); @@ -2197,7 +2197,7 @@ void VisualScriptEditor::_move_node(String func, int p_id, const Vector2 &p_to) if (Object::cast_to<GraphNode>(node)) Object::cast_to<GraphNode>(node)->set_offset(p_to); } - script->set_node_pos(edited_func, p_id, p_to / EDSCALE); + script->set_node_position(edited_func, p_id, p_to / EDSCALE); } void VisualScriptEditor::_node_moved(Vector2 p_from, Vector2 p_to, int p_id) { @@ -2211,7 +2211,7 @@ void VisualScriptEditor::_remove_node(int p_id) { undo_redo->create_action(TTR("Remove VisualScript Node")); undo_redo->add_do_method(script.ptr(), "remove_node", edited_func, p_id); - undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, p_id, script->get_node(edited_func, p_id), script->get_node_pos(edited_func, p_id)); + undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, p_id, script->get_node(edited_func, p_id), script->get_node_position(edited_func, p_id)); List<VisualScript::SequenceConnection> sequence_conns; script->get_sequence_connection_list(edited_func, &sequence_conns); @@ -2895,7 +2895,7 @@ void VisualScriptEditor::_menu_option(int p_what) { } if (node.is_valid()) { clipboard->nodes[id] = node->duplicate(); - clipboard->nodes_positions[id] = script->get_node_pos(edited_func, id); + clipboard->nodes_positions[id] = script->get_node_position(edited_func, id); } } } @@ -2955,7 +2955,7 @@ void VisualScriptEditor::_menu_option(int p_what) { List<int> nodes; script->get_node_list(edited_func, &nodes); for (List<int>::Element *E = nodes.front(); E; E = E->next()) { - Vector2 pos = script->get_node_pos(edited_func, E->get()).snapped(Vector2(2, 2)); + Vector2 pos = script->get_node_position(edited_func, E->get()).snapped(Vector2(2, 2)); existing_positions.insert(pos); } } @@ -3069,7 +3069,7 @@ void VisualScriptEditor::_member_option(int p_option) { List<int> nodes; script->get_node_list(name, &nodes); for (List<int>::Element *E = nodes.front(); E; E = E->next()) { - undo_redo->add_undo_method(script.ptr(), "add_node", name, E->get(), script->get_node(name, E->get()), script->get_node_pos(name, E->get())); + undo_redo->add_undo_method(script.ptr(), "add_node", name, E->get(), script->get_node(name, E->get()), script->get_node_position(name, E->get())); } List<VisualScript::SequenceConnection> seq_connections; diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 6389c286c2..52aa2c5ee0 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -58,7 +58,7 @@ int AudioStreamPlaybackOGGVorbis::_ov_seek_func(void *_f, ogg_int64_t offs, int fa->seek(offs); } else if (whence == SEEK_CUR) { - fa->seek(fa->get_pos() + offs); + fa->seek(fa->get_position() + offs); } else if (whence == SEEK_END) { fa->seek_end(offs); @@ -89,7 +89,7 @@ long AudioStreamPlaybackOGGVorbis::_ov_tell_func(void *_f) { //printf("close %p\n",_f); FileAccess *fa = (FileAccess *)_f; - return fa->get_pos(); + return fa->get_position(); } int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) { @@ -203,7 +203,7 @@ void AudioStreamPlaybackOGGVorbis::stop() { //_clear(); } -float AudioStreamPlaybackOGGVorbis::get_pos() const { +float AudioStreamPlaybackOGGVorbis::get_position() const { int32_t frames = int32_t(frames_mixed); if (frames < 0) diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h index 03b3726b52..9f1d78850d 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.h +++ b/modules/vorbis/audio_stream_ogg_vorbis.h @@ -96,7 +96,7 @@ public: virtual int get_loop_count() const; - virtual float get_pos() const; + virtual float get_position() const; virtual void seek_pos(float p_time); virtual int get_channels() const { return stream_channels; } diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 0178ebab84..0b33ab6a70 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -59,7 +59,7 @@ public: if (file) { - if (file->get_pos() != (size_t)pos) + if (file->get_position() != (size_t)pos) file->seek(pos); if (file->get_buffer(buf, len) == len) return 0; @@ -204,7 +204,7 @@ float VideoStreamPlaybackWebm::get_length() const { return 0.0f; } -float VideoStreamPlaybackWebm::get_pos() const { +float VideoStreamPlaybackWebm::get_position() const { return video_pos; } diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h index 9a331849be..36b0f02c5c 100644 --- a/modules/webm/video_stream_webm.h +++ b/modules/webm/video_stream_webm.h @@ -81,7 +81,7 @@ public: virtual float get_length() const; - virtual float get_pos() const; + virtual float get_position() const; virtual void seek_pos(float p_time); virtual void set_audio_track(int p_idx); |