summaryrefslogtreecommitdiff
path: root/scene/main/canvas_layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/canvas_layer.cpp')
-rw-r--r--scene/main/canvas_layer.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp
index 2085fa3a60..e6a665d035 100644
--- a/scene/main/canvas_layer.cpp
+++ b/scene/main/canvas_layer.cpp
@@ -35,7 +35,7 @@ void CanvasLayer::set_layer(int p_xform) {
layer = p_xform;
if (viewport.is_valid())
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
}
int CanvasLayer::get_layer() const {
@@ -48,7 +48,7 @@ void CanvasLayer::set_transform(const Transform2D &p_xform) {
transform = p_xform;
locrotscale_dirty = true;
if (viewport.is_valid())
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
}
Transform2D CanvasLayer::get_transform() const {
@@ -61,7 +61,7 @@ void CanvasLayer::_update_xform() {
transform.set_rotation_and_scale(rot, scale);
transform.set_origin(ofs);
if (viewport.is_valid())
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
}
void CanvasLayer::_update_locrotscale() {
@@ -150,16 +150,16 @@ void CanvasLayer::_notification(int p_what) {
vp->_canvas_layer_add(this);
viewport = vp->get_viewport_rid();
- VisualServer::get_singleton()->viewport_attach_canvas(viewport, canvas);
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
+ RenderingServer::get_singleton()->viewport_attach_canvas(viewport, canvas);
+ RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
_update_follow_viewport();
} break;
case NOTIFICATION_EXIT_TREE: {
vp->_canvas_layer_remove(this);
- VisualServer::get_singleton()->viewport_remove_canvas(viewport, canvas);
+ RenderingServer::get_singleton()->viewport_remove_canvas(viewport, canvas);
viewport = RID();
_update_follow_viewport(false);
@@ -167,7 +167,7 @@ void CanvasLayer::_notification(int p_what) {
case NOTIFICATION_MOVED_IN_PARENT: {
if (is_inside_tree())
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
} break;
}
@@ -191,7 +191,7 @@ void CanvasLayer::set_custom_viewport(Node *p_viewport) {
ERR_FAIL_NULL(p_viewport);
if (is_inside_tree()) {
vp->_canvas_layer_remove(this);
- VisualServer::get_singleton()->viewport_remove_canvas(viewport, canvas);
+ RenderingServer::get_singleton()->viewport_remove_canvas(viewport, canvas);
viewport = RID();
}
@@ -213,9 +213,9 @@ void CanvasLayer::set_custom_viewport(Node *p_viewport) {
vp->_canvas_layer_add(this);
viewport = vp->get_viewport_rid();
- VisualServer::get_singleton()->viewport_attach_canvas(viewport, canvas);
- VisualServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
- VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
+ RenderingServer::get_singleton()->viewport_attach_canvas(viewport, canvas);
+ RenderingServer::get_singleton()->viewport_set_canvas_stacking(viewport, canvas, layer, get_position_in_parent());
+ RenderingServer::get_singleton()->viewport_set_canvas_transform(viewport, canvas, transform);
}
}
@@ -266,9 +266,9 @@ void CanvasLayer::_update_follow_viewport(bool p_force_exit) {
return;
}
if (p_force_exit || !follow_viewport) {
- VS::get_singleton()->canvas_set_parent(canvas, RID(), 1.0);
+ RS::get_singleton()->canvas_set_parent(canvas, RID(), 1.0);
} else {
- VS::get_singleton()->canvas_set_parent(canvas, vp->get_world_2d()->get_canvas(), follow_viewport_scale);
+ RS::get_singleton()->canvas_set_parent(canvas, vp->get_world_2d()->get_canvas(), follow_viewport_scale);
}
}
@@ -325,7 +325,7 @@ CanvasLayer::CanvasLayer() {
rot = 0;
locrotscale_dirty = false;
layer = 1;
- canvas = VS::get_singleton()->canvas_create();
+ canvas = RS::get_singleton()->canvas_create();
custom_viewport = NULL;
sort_index = 0;
@@ -335,5 +335,5 @@ CanvasLayer::CanvasLayer() {
CanvasLayer::~CanvasLayer() {
- VS::get_singleton()->free(canvas);
+ RS::get_singleton()->free(canvas);
}