You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Ported CPU particles to 2D
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "visual_server_canvas.h"
|
||||
#include "visual_server_global.h"
|
||||
#include "visual_server_raster.h"
|
||||
#include "visual_server_viewport.h"
|
||||
|
||||
void VisualServerCanvas::_render_canvas_item_tree(Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, RasterizerCanvas::Light *p_lights) {
|
||||
@@ -119,6 +120,10 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor
|
||||
ci->copy_back_buffer->screen_rect = xform.xform(ci->copy_back_buffer->rect).clip(p_clip_rect);
|
||||
}
|
||||
|
||||
if (ci->update_when_visible) {
|
||||
VisualServerRaster::redraw_request();
|
||||
}
|
||||
|
||||
if ((!ci->commands.empty() && p_clip_rect.intersects(global_rect)) || ci->vp_render || ci->copy_back_buffer) {
|
||||
//something to draw?
|
||||
ci->final_transform = xform;
|
||||
@@ -390,6 +395,14 @@ void VisualServerCanvas::canvas_item_set_draw_behind_parent(RID p_item, bool p_e
|
||||
canvas_item->behind = p_enable;
|
||||
}
|
||||
|
||||
void VisualServerCanvas::canvas_item_set_update_when_visible(RID p_item, bool p_update) {
|
||||
|
||||
Item *canvas_item = canvas_item_owner.getornull(p_item);
|
||||
ERR_FAIL_COND(!canvas_item);
|
||||
|
||||
canvas_item->update_when_visible = p_update;
|
||||
}
|
||||
|
||||
void VisualServerCanvas::canvas_item_add_line(RID p_item, const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width, bool p_antialiased) {
|
||||
|
||||
Item *canvas_item = canvas_item_owner.getornull(p_item);
|
||||
|
||||
Reference in New Issue
Block a user