diff options
| author | Rémi Verschelde | 2017-08-25 08:37:38 +0200 |
|---|---|---|
| committer | GitHub | 2017-08-25 08:37:38 +0200 |
| commit | 490aef93699abc00da58f73b1596fb3473fd53c6 (patch) | |
| tree | 7912c7a540eca6b09392bbd2aa2f30fefe37f51a /editor/plugins/texture_editor_plugin.cpp | |
| parent | b1c0e45b03aa14453846c9a888763077eef2476b (diff) | |
| parent | cacced7e507f7603bacc03ae2616e58f0ede122a (diff) | |
| download | godot-490aef93699abc00da58f73b1596fb3473fd53c6.tar.gz godot-490aef93699abc00da58f73b1596fb3473fd53c6.tar.zst godot-490aef93699abc00da58f73b1596fb3473fd53c6.zip | |
Merge pull request #10581 from hpvb/fix-gcc6+
Make cast_to a static member of Object.
Diffstat (limited to '')
| -rw-r--r-- | editor/plugins/texture_editor_plugin.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 57c27a8a7..5648ee510 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -70,7 +70,7 @@ void TextureEditor::_notification(int p_what) { int ofs_x = (size.width - tex_width) / 2; int ofs_y = (size.height - tex_height) / 2; - if (texture->cast_to<CurveTexture>()) { + if (Object::cast_to<CurveTexture>(*texture)) { // In the case of CurveTextures we know they are 1 in height, so fill the preview to see the gradient ofs_y = 0; tex_height = size.height; @@ -81,10 +81,10 @@ void TextureEditor::_notification(int p_what) { Ref<Font> font = get_font("font", "Label"); String format; - if (texture->cast_to<ImageTexture>()) { - format = Image::get_format_name(texture->cast_to<ImageTexture>()->get_format()); - } else if (texture->cast_to<StreamTexture>()) { - format = Image::get_format_name(texture->cast_to<StreamTexture>()->get_format()); + if (Object::cast_to<ImageTexture>(*texture)) { + format = Image::get_format_name(Object::cast_to<ImageTexture>(*texture)->get_format()); + } else if (Object::cast_to<StreamTexture>(*texture)) { + format = Image::get_format_name(Object::cast_to<StreamTexture>(*texture)->get_format()); } else { format = texture->get_class(); } @@ -136,7 +136,7 @@ TextureEditor::TextureEditor() { void TextureEditorPlugin::edit(Object *p_object) { - Texture *s = p_object->cast_to<Texture>(); + Texture *s = Object::cast_to<Texture>(p_object); if (!s) return; |
