summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct2
-rw-r--r--doc/classes/CameraFeed.xml4
-rw-r--r--doc/classes/CameraServer.xml4
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp8
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp8
-rw-r--r--editor/animation_track_editor.cpp46
-rw-r--r--editor/animation_track_editor.h8
-rw-r--r--editor/plugins/spatial_editor_plugin.h12
-rw-r--r--editor/scene_tree_dock.cpp29
-rw-r--r--editor/scene_tree_dock.h1
-rw-r--r--main/tests/test_string.cpp12
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp6
-rw-r--r--scene/gui/color_picker.cpp9
-rw-r--r--scene/gui/color_picker.h3
-rw-r--r--servers/camera/camera_feed.cpp18
-rw-r--r--servers/camera/camera_feed.h4
-rw-r--r--servers/camera_server.cpp4
-rw-r--r--servers/camera_server.h4
18 files changed, 127 insertions, 55 deletions
diff --git a/SConstruct b/SConstruct
index ce2566559c..7358494123 100644
--- a/SConstruct
+++ b/SConstruct
@@ -327,6 +327,8 @@ if selected_platform in platform_list:
env.Append(CCFLAGS=['/EHsc'])
if (env["werror"]):
env.Append(CCFLAGS=['/WX'])
+ # Force to use Unicode encoding
+ env.Append(MSVC_FLAGS=['/utf8'])
else: # Rest of the world
shadow_local_warning = []
all_plus_warnings = ['-Wwrite-strings']
diff --git a/doc/classes/CameraFeed.xml b/doc/classes/CameraFeed.xml
index 7f353f7a05..4611b9c507 100644
--- a/doc/classes/CameraFeed.xml
+++ b/doc/classes/CameraFeed.xml
@@ -45,10 +45,10 @@
<constant name="FEED_RGB" value="1" enum="FeedDataType">
Feed supplies RGB images.
</constant>
- <constant name="FEED_YCbCr" value="2" enum="FeedDataType">
+ <constant name="FEED_YCBCR" value="2" enum="FeedDataType">
Feed supplies YCbCr images that need to be converted to RGB.
</constant>
- <constant name="FEED_YCbCr_Sep" value="3" enum="FeedDataType">
+ <constant name="FEED_YCBCR_SEP" value="3" enum="FeedDataType">
Feed supplies separate Y and CbCr images that need to be combined and converted to RGB.
</constant>
<constant name="FEED_UNSPECIFIED" value="0" enum="FeedPosition">
diff --git a/doc/classes/CameraServer.xml b/doc/classes/CameraServer.xml
index f492bda74f..ee41f08ec6 100644
--- a/doc/classes/CameraServer.xml
+++ b/doc/classes/CameraServer.xml
@@ -70,13 +70,13 @@
<constant name="FEED_RGBA_IMAGE" value="0" enum="FeedImage">
The RGBA camera image.
</constant>
- <constant name="FEED_YCbCr_IMAGE" value="0" enum="FeedImage">
+ <constant name="FEED_YCBCR_IMAGE" value="0" enum="FeedImage">
The YCbCr camera image.
</constant>
<constant name="FEED_Y_IMAGE" value="0" enum="FeedImage">
The Y component camera image.
</constant>
- <constant name="FEED_CbCr_IMAGE" value="1" enum="FeedImage">
+ <constant name="FEED_CBCR_IMAGE" value="1" enum="FeedImage">
The CbCr component camera image.
</constant>
</constants>
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index a07c6832dc..ea29af7d9e 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -2920,16 +2920,16 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
VS::get_singleton()->texture_bind(camera_RGBA, 0);
- } else if (feed->get_datatype() == CameraFeed::FEED_YCbCr) {
- RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCbCr_IMAGE);
+ } else if (feed->get_datatype() == CameraFeed::FEED_YCBCR) {
+ RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCBCR_IMAGE);
VS::get_singleton()->texture_bind(camera_YCbCr, 0);
storage->shaders.copy.set_conditional(CopyShaderGLES2::YCBCR_TO_RGB, true);
- } else if (feed->get_datatype() == CameraFeed::FEED_YCbCr_Sep) {
+ } else if (feed->get_datatype() == CameraFeed::FEED_YCBCR_SEP) {
RID camera_Y = feed->get_texture(CameraServer::FEED_Y_IMAGE);
- RID camera_CbCr = feed->get_texture(CameraServer::FEED_CbCr_IMAGE);
+ RID camera_CbCr = feed->get_texture(CameraServer::FEED_CBCR_IMAGE);
VS::get_singleton()->texture_bind(camera_Y, 0);
VS::get_singleton()->texture_bind(camera_CbCr, 1);
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 7acb8a22bc..c7ef5cded4 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -4454,16 +4454,16 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
RID camera_RGBA = feed->get_texture(CameraServer::FEED_RGBA_IMAGE);
VS::get_singleton()->texture_bind(camera_RGBA, 0);
- } else if (feed->get_datatype() == CameraFeed::FEED_YCbCr) {
- RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCbCr_IMAGE);
+ } else if (feed->get_datatype() == CameraFeed::FEED_YCBCR) {
+ RID camera_YCbCr = feed->get_texture(CameraServer::FEED_YCBCR_IMAGE);
VS::get_singleton()->texture_bind(camera_YCbCr, 0);
storage->shaders.copy.set_conditional(CopyShaderGLES3::YCBCR_TO_SRGB, true);
- } else if (feed->get_datatype() == CameraFeed::FEED_YCbCr_Sep) {
+ } else if (feed->get_datatype() == CameraFeed::FEED_YCBCR_SEP) {
RID camera_Y = feed->get_texture(CameraServer::FEED_Y_IMAGE);
- RID camera_CbCr = feed->get_texture(CameraServer::FEED_CbCr_IMAGE);
+ RID camera_CbCr = feed->get_texture(CameraServer::FEED_CBCR_IMAGE);
VS::get_singleton()->texture_bind(camera_Y, 0);
VS::get_singleton()->texture_bind(camera_CbCr, 1);
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 3295753bda..6e47fadb20 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -2083,8 +2083,6 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
moving_selection_from_ofs = (mb->get_position().x - timeline->get_name_limit()) / timeline->get_zoom_scale();
}
accept_event();
- } else {
- emit_signal("clear_selection");
}
}
@@ -2326,7 +2324,7 @@ void AnimationTrackEdit::set_in_group(bool p_enable) {
update();
}
-void AnimationTrackEdit::append_to_selection(const Rect2 &p_box) {
+void AnimationTrackEdit::append_to_selection(const Rect2 &p_box, bool p_deselection) {
Rect2 select_rect(timeline->get_name_limit(), 0, get_size().width - timeline->get_name_limit() - timeline->get_buttons_width(), get_size().height);
select_rect = select_rect.clip(p_box);
@@ -2339,7 +2337,10 @@ void AnimationTrackEdit::append_to_selection(const Rect2 &p_box) {
rect.position.x += offset;
if (select_rect.intersects(rect)) {
- emit_signal("select_key", i, false);
+ if (p_deselection)
+ emit_signal("deselect_key", i);
+ else
+ emit_signal("select_key", i, false);
}
}
}
@@ -4342,7 +4343,7 @@ void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) {
Rect2 local_rect = box_select_rect;
local_rect.position -= track_edits[i]->get_global_position();
- track_edits[i]->append_to_selection(local_rect);
+ track_edits[i]->append_to_selection(local_rect, mb->get_command());
}
if (_get_track_selected() == -1 && track_edits.size() > 0) { //minimal hack to make shortcuts work
@@ -4374,8 +4375,8 @@ void AnimationTrackEditor::_scroll_input(const Ref<InputEvent> &p_event) {
}
if (!box_selection->is_visible_in_tree()) {
- if (!mm->get_shift()) {
- _clear_selection(); //only append if shift is pressed
+ if (!mm->get_command() && !mm->get_shift()) {
+ _clear_selection();
}
box_selection->show();
}
@@ -4568,7 +4569,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
it->set_metadata(0, md);
}
- track_copy_dialog->popup_centered_minsize(Size2(300, 500) * EDSCALE);
+ track_copy_dialog->popup_centered_minsize(Size2(350, 500) * EDSCALE);
} break;
case EDIT_COPY_TRACKS_CONFIRM: {
@@ -4962,6 +4963,19 @@ void AnimationTrackEditor::_show_imported_anim_warning() const {
TTR("Warning: Editing imported animation"));
}
+void AnimationTrackEditor::_select_all_tracks_for_copy() {
+ TreeItem *track = track_copy_select->get_root()->get_children();
+ while (track) {
+ track->set_checked(0, selected_all_tracks);
+ track = track->get_next();
+ }
+ selected_all_tracks = !selected_all_tracks;
+ if (selected_all_tracks)
+ select_all_button->set_text(TTR("Select All"));
+ else
+ select_all_button->set_text(TTR("Select None"));
+}
+
void AnimationTrackEditor::_bind_methods() {
ClassDB::bind_method("_animation_changed", &AnimationTrackEditor::_animation_changed);
@@ -5002,6 +5016,7 @@ void AnimationTrackEditor::_bind_methods() {
ClassDB::bind_method("_selection_changed", &AnimationTrackEditor::_selection_changed);
ClassDB::bind_method("_snap_mode_changed", &AnimationTrackEditor::_snap_mode_changed);
ClassDB::bind_method("_show_imported_anim_warning", &AnimationTrackEditor::_show_imported_anim_warning);
+ ClassDB::bind_method("_select_all_tracks_for_copy", &AnimationTrackEditor::_select_all_tracks_for_copy);
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag")));
ADD_SIGNAL(MethodInfo("keying_changed"));
@@ -5284,9 +5299,22 @@ AnimationTrackEditor::AnimationTrackEditor() {
track_copy_dialog->set_title(TTR("Select tracks to copy:"));
track_copy_dialog->get_ok()->set_text(TTR("Copy"));
+ VBoxContainer *track_vbox = memnew(VBoxContainer);
+ track_copy_dialog->add_child(track_vbox);
+
+ selected_all_tracks = true;
+
track_copy_select = memnew(Tree);
+ track_copy_select->set_h_size_flags(SIZE_EXPAND_FILL);
+ track_copy_select->set_v_size_flags(SIZE_EXPAND_FILL);
track_copy_select->set_hide_root(true);
- track_copy_dialog->add_child(track_copy_select);
+ track_vbox->add_child(track_copy_select);
+ track_copy_options = memnew(HBoxContainer);
+ track_vbox->add_child(track_copy_options);
+ select_all_button = memnew(Button);
+ select_all_button->set_text(TTR("Select All"));
+ select_all_button->connect("pressed", this, "_select_all_tracks_for_copy");
+ track_copy_options->add_child(select_all_button);
track_copy_dialog->connect("confirmed", this, "_edit_menu_pressed", varray(EDIT_COPY_TRACKS_CONFIRM));
animation_changing_awaiting_update = false;
}
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 0ea64254f4..1452d5519c 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -231,7 +231,7 @@ public:
void cancel_drop();
void set_in_group(bool p_enable);
- void append_to_selection(const Rect2 &p_box);
+ void append_to_selection(const Rect2 &p_box, bool p_deselection);
AnimationTrackEdit();
};
@@ -446,6 +446,8 @@ class AnimationTrackEditor : public VBoxContainer {
ConfirmationDialog *scale_dialog;
SpinBox *scale;
+ void _select_all_tracks_for_copy();
+
void _edit_menu_pressed(int p_option);
int last_menu_track_opt;
@@ -459,8 +461,12 @@ class AnimationTrackEditor : public VBoxContainer {
void _selection_changed();
+ bool selected_all_tracks;
ConfirmationDialog *track_copy_dialog;
Tree *track_copy_select;
+ HBoxContainer *track_copy_options;
+ Button *select_all_button;
+
struct TrackClipboard {
NodePath full_path;
NodePath base_path;
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index d8507fe16e..701b9e8144 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -178,6 +178,12 @@ public:
GIZMO_GRID_LAYER = 25
};
+ enum NavigationScheme {
+ NAVIGATION_GODOT,
+ NAVIGATION_MAYA,
+ NAVIGATION_MODO,
+ };
+
private:
int index;
String name;
@@ -260,12 +266,6 @@ private:
PopupMenu *selection_menu;
- enum NavigationScheme {
- NAVIGATION_GODOT,
- NAVIGATION_MAYA,
- NAVIGATION_MODO,
- };
-
enum NavigationZoomStyle {
NAVIGATION_ZOOM_VERTICAL,
NAVIGATION_ZOOM_HORIZONTAL
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index e8f5139cd5..a15ae2efda 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -269,7 +269,7 @@ void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base)
bool SceneTreeDock::_cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node) {
int childCount = p_desired_node->get_child_count();
- if (p_desired_node->get_filename() == p_target_scene_path) {
+ if (_track_inherit(p_target_scene_path, p_desired_node)) {
return true;
}
@@ -284,6 +284,33 @@ bool SceneTreeDock::_cyclical_dependency_exists(const String &p_target_scene_pat
return false;
}
+bool SceneTreeDock::_track_inherit(const String &p_target_scene_path, Node *p_desired_node) {
+ Node *p = p_desired_node;
+ bool result = false;
+ Vector<Node *> instances;
+ while (true) {
+ if (p->get_filename() == p_target_scene_path) {
+ result = true;
+ break;
+ }
+ Ref<SceneState> ss = p->get_scene_inherited_state();
+ if (ss.is_valid()) {
+ String path = ss->get_path();
+ Ref<PackedScene> data = ResourceLoader::load(path);
+ if (data.is_valid()) {
+ p = data->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
+ instances.push_back(p);
+ } else
+ break;
+ } else
+ break;
+ }
+ for (int i = 0; i < instances.size(); i++) {
+ memdelete(instances[i]);
+ }
+ return result;
+}
+
void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
current_option = p_tool;
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h
index 9f9e93f2df..b645c22295 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -165,6 +165,7 @@ class SceneTreeDock : public VBoxContainer {
void _script_open_request(const Ref<Script> &p_script);
bool _cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node);
+ bool _track_inherit(const String &p_target_scene_path, Node *p_desired_node);
void _node_selected();
void _node_renamed();
diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp
index 531887a452..a107fd738f 100644
--- a/main/tests/test_string.cpp
+++ b/main/tests/test_string.cpp
@@ -1017,8 +1017,8 @@ bool test_32() {
STRIP_TEST(String("abca").lstrip("a") == "bca");
STRIP_TEST(String("abc").rstrip("a") == "abc");
STRIP_TEST(String("abca").rstrip("a") == "abc");
- // in utf-8 "¿" has the same first byte as "µ"
- // and the same second as "ÿ"
+ // in utf-8 "¿" (\u00bf) has the same first byte as "µ" (\u00b5)
+ // and the same second as "ÿ" (\u00ff)
STRIP_TEST(String::utf8("¿").lstrip(String::utf8("µÿ")) == String::utf8("¿"));
STRIP_TEST(String::utf8("¿").rstrip(String::utf8("µÿ")) == String::utf8("¿"));
STRIP_TEST(String::utf8("µ¿ÿ").lstrip(String::utf8("µÿ")) == String::utf8("¿ÿ"));
@@ -1046,8 +1046,8 @@ bool test_32() {
STRIP_TEST(String("abca").lstrip("qwajkl") == "bca");
STRIP_TEST(String("abc").rstrip("qwajkl") == "abc");
STRIP_TEST(String("abca").rstrip("qwajkl") == "abc");
- // in utf-8 "¿" has the same first byte as "µ"
- // and the same second as "ÿ"
+ // in utf-8 "¿" (\u00bf) has the same first byte as "µ" (\u00b5)
+ // and the same second as "ÿ" (\u00ff)
STRIP_TEST(String::utf8("¿").lstrip(String::utf8("qwaµÿjkl")) == String::utf8("¿"));
STRIP_TEST(String::utf8("¿").rstrip(String::utf8("qwaµÿjkl")) == String::utf8("¿"));
STRIP_TEST(String::utf8("µ¿ÿ").lstrip(String::utf8("qwaµÿjkl")) == String::utf8("¿ÿ"));
@@ -1068,8 +1068,8 @@ bool test_33() {
bool test_34() {
OS::get_singleton()->print("\n\nTest 34: Cyrillic to_lower()\n");
- String upper = L"АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
- String lower = L"абвгдеёжзийклмнопрстуфхцчшщъыьэюя";
+ String upper = String::utf8("АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ");
+ String lower = String::utf8("абвгдеёжзийклмнопрстуфхцчшщъыьэюя");
String test = upper.to_lower();
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 890bd730f7..6b9a97efb4 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -664,8 +664,10 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
}
if (mb->is_pressed()) {
-
- if (mb->get_button_index() == BUTTON_LEFT) {
+ SpatialEditorViewport::NavigationScheme nav_scheme = (SpatialEditorViewport::NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int();
+ if ((nav_scheme == SpatialEditorViewport::NAVIGATION_MAYA || nav_scheme == SpatialEditorViewport::NAVIGATION_MODO) && mb->get_alt()) {
+ input_action = INPUT_NONE;
+ } else if (mb->get_button_index() == BUTTON_LEFT) {
if (input_action == INPUT_PASTE) {
_do_paste();
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index b6abfdd6a8..58a0762469 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -126,7 +126,7 @@ void ColorPicker::_update_controls() {
}
}
-void ColorPicker::set_pick_color(const Color &p_color, bool p_update_sliders) {
+void ColorPicker::_set_pick_color(const Color &p_color, bool p_update_sliders) {
color = p_color;
if (color != last_hsv) {
@@ -142,6 +142,11 @@ void ColorPicker::set_pick_color(const Color &p_color, bool p_update_sliders) {
_update_color(p_update_sliders);
}
+void ColorPicker::set_pick_color(const Color &p_color) {
+
+ _set_pick_color(p_color, true); //because setters can't have more arguments
+}
+
void ColorPicker::set_edit_alpha(bool p_show) {
edit_alpha = p_show;
@@ -175,7 +180,7 @@ void ColorPicker::_value_changed(double) {
}
}
- set_pick_color(color, false);
+ _set_pick_color(color, false);
emit_signal("color_changed", color);
}
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index 94640be4f0..3af27a9856 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -108,7 +108,8 @@ public:
void set_edit_alpha(bool p_show);
bool is_editing_alpha() const;
- void set_pick_color(const Color &p_color, bool p_update_sliders = true);
+ void _set_pick_color(const Color &p_color, bool p_update_sliders);
+ void set_pick_color(const Color &p_color);
Color get_pick_color() const;
void add_preset(const Color &p_color);
diff --git a/servers/camera/camera_feed.cpp b/servers/camera/camera_feed.cpp
index 31b8b2874f..094c83cd7c 100644
--- a/servers/camera/camera_feed.cpp
+++ b/servers/camera/camera_feed.cpp
@@ -60,8 +60,8 @@ void CameraFeed::_bind_methods() {
BIND_ENUM_CONSTANT(FEED_NOIMAGE);
BIND_ENUM_CONSTANT(FEED_RGB);
- BIND_ENUM_CONSTANT(FEED_YCbCr);
- BIND_ENUM_CONSTANT(FEED_YCbCr_Sep);
+ BIND_ENUM_CONSTANT(FEED_YCBCR);
+ BIND_ENUM_CONSTANT(FEED_YCBCR_SEP);
BIND_ENUM_CONSTANT(FEED_UNSPECIFIED);
BIND_ENUM_CONSTANT(FEED_FRONT);
@@ -145,7 +145,7 @@ CameraFeed::CameraFeed() {
// create a texture object
VisualServer *vs = VisualServer::get_singleton();
texture[CameraServer::FEED_Y_IMAGE] = vs->texture_create(); // also used for RGBA
- texture[CameraServer::FEED_CbCr_IMAGE] = vs->texture_create();
+ texture[CameraServer::FEED_CBCR_IMAGE] = vs->texture_create();
}
CameraFeed::CameraFeed(String p_name, FeedPosition p_position) {
@@ -162,14 +162,14 @@ CameraFeed::CameraFeed(String p_name, FeedPosition p_position) {
// create a texture object
VisualServer *vs = VisualServer::get_singleton();
texture[CameraServer::FEED_Y_IMAGE] = vs->texture_create(); // also used for RGBA
- texture[CameraServer::FEED_CbCr_IMAGE] = vs->texture_create();
+ texture[CameraServer::FEED_CBCR_IMAGE] = vs->texture_create();
}
CameraFeed::~CameraFeed() {
// Free our textures
VisualServer *vs = VisualServer::get_singleton();
vs->free(texture[CameraServer::FEED_Y_IMAGE]);
- vs->free(texture[CameraServer::FEED_CbCr_IMAGE]);
+ vs->free(texture[CameraServer::FEED_CBCR_IMAGE]);
}
void CameraFeed::set_RGB_img(Ref<Image> p_rgb_img) {
@@ -208,7 +208,7 @@ void CameraFeed::set_YCbCr_img(Ref<Image> p_ycbcr_img) {
}
vs->texture_set_data(texture[CameraServer::FEED_RGBA_IMAGE], p_ycbcr_img);
- datatype = CameraFeed::FEED_YCbCr;
+ datatype = CameraFeed::FEED_YCBCR;
}
}
@@ -233,12 +233,12 @@ void CameraFeed::set_YCbCr_imgs(Ref<Image> p_y_img, Ref<Image> p_cbcr_img) {
vs->texture_allocate(texture[CameraServer::FEED_Y_IMAGE], new_y_width, new_y_height, 0, Image::FORMAT_R8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_USED_FOR_STREAMING);
///@TODO GLES2 doesn't support FORMAT_RG8, need to do some form of conversion
- vs->texture_allocate(texture[CameraServer::FEED_CbCr_IMAGE], new_cbcr_width, new_cbcr_height, 0, Image::FORMAT_RG8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_USED_FOR_STREAMING);
+ vs->texture_allocate(texture[CameraServer::FEED_CBCR_IMAGE], new_cbcr_width, new_cbcr_height, 0, Image::FORMAT_RG8, VS::TEXTURE_TYPE_2D, VS::TEXTURE_FLAG_USED_FOR_STREAMING);
}
vs->texture_set_data(texture[CameraServer::FEED_Y_IMAGE], p_y_img);
- vs->texture_set_data(texture[CameraServer::FEED_CbCr_IMAGE], p_cbcr_img);
- datatype = CameraFeed::FEED_YCbCr_Sep;
+ vs->texture_set_data(texture[CameraServer::FEED_CBCR_IMAGE], p_cbcr_img);
+ datatype = CameraFeed::FEED_YCBCR_SEP;
}
}
diff --git a/servers/camera/camera_feed.h b/servers/camera/camera_feed.h
index 90c076071c..0c53ff9309 100644
--- a/servers/camera/camera_feed.h
+++ b/servers/camera/camera_feed.h
@@ -50,8 +50,8 @@ public:
enum FeedDataType {
FEED_NOIMAGE, // we don't have an image yet
FEED_RGB, // our texture will contain a normal RGB texture that can be used directly
- FEED_YCbCr, // our texture will contain a YCbCr texture that needs to be converted to RGB before output
- FEED_YCbCr_Sep // our camera is split into two textures, first plane contains Y data, second plane contains CbCr data
+ FEED_YCBCR, // our texture will contain a YCbCr texture that needs to be converted to RGB before output
+ FEED_YCBCR_SEP // our camera is split into two textures, first plane contains Y data, second plane contains CbCr data
};
enum FeedPosition {
diff --git a/servers/camera_server.cpp b/servers/camera_server.cpp
index 8d2ae37001..0f93221072 100644
--- a/servers/camera_server.cpp
+++ b/servers/camera_server.cpp
@@ -47,9 +47,9 @@ void CameraServer::_bind_methods() {
ADD_SIGNAL(MethodInfo("camera_feed_removed", PropertyInfo(Variant::INT, "id")));
BIND_ENUM_CONSTANT(FEED_RGBA_IMAGE);
- BIND_ENUM_CONSTANT(FEED_YCbCr_IMAGE);
+ BIND_ENUM_CONSTANT(FEED_YCBCR_IMAGE);
BIND_ENUM_CONSTANT(FEED_Y_IMAGE);
- BIND_ENUM_CONSTANT(FEED_CbCr_IMAGE);
+ BIND_ENUM_CONSTANT(FEED_CBCR_IMAGE);
};
CameraServer *CameraServer::singleton = NULL;
diff --git a/servers/camera_server.h b/servers/camera_server.h
index d204142c7d..5a62af3d60 100644
--- a/servers/camera_server.h
+++ b/servers/camera_server.h
@@ -53,9 +53,9 @@ class CameraServer : public Object {
public:
enum FeedImage {
FEED_RGBA_IMAGE = 0,
- FEED_YCbCr_IMAGE = 0,
+ FEED_YCBCR_IMAGE = 0,
FEED_Y_IMAGE = 0,
- FEED_CbCr_IMAGE = 1,
+ FEED_CBCR_IMAGE = 1,
FEED_IMAGES = 2
};