summaryrefslogtreecommitdiff
path: root/scene/2d/particles_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/particles_2d.cpp')
-rw-r--r--scene/2d/particles_2d.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index c9d5bebe56..b91d9b835c 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -6,6 +6,7 @@
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -570,13 +571,13 @@ void Particles2D::_notification(int p_what) {
src_rect.pos.x = size.x * (frame % h_frames);
src_rect.pos.y = size.y * (frame / h_frames);
}
-
+ Rect2 dst_rect(Point2(), size);
if (flip_h)
- src_rect.size.x = -src_rect.size.x;
+ dst_rect.size.x = -dst_rect.size.x;
if (flip_v)
- src_rect.size.y = -src_rect.size.y;
+ dst_rect.size.y = -dst_rect.size.y;
- texture->draw_rect_region(ci, Rect2(Point2(), size), src_rect, color);
+ texture->draw_rect_region(ci, dst_rect, src_rect, color);
//VisualServer::get_singleton()->canvas_item_add_texture_rect(ci,r,texrid,false,color);
} else {
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(), size), color);
@@ -1045,7 +1046,7 @@ void Particles2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "config/amount", PROPERTY_HINT_EXP_RANGE, "1,1024"), "set_amount", "get_amount");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "config/lifetime", PROPERTY_HINT_EXP_RANGE, "0.1,3600,0.1"), "set_lifetime", "get_lifetime");
ADD_PROPERTYNO(PropertyInfo(Variant::REAL, "config/time_scale", PROPERTY_HINT_EXP_RANGE, "0.01,128,0.01"), "set_time_scale", "get_time_scale");
- ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "config/preprocess", PROPERTY_HINT_EXP_RANGE, "0.1,3600,0.1"), "set_pre_process_time", "get_pre_process_time");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "config/preprocess", PROPERTY_HINT_EXP_RANGE, "0,3600,0.1"), "set_pre_process_time", "get_pre_process_time");
ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "config/emit_timeout", PROPERTY_HINT_RANGE, "0,3600,0.1"), "set_emit_timeout", "get_emit_timeout");
ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "config/emitting"), "set_emitting", "is_emitting");
ADD_PROPERTY(PropertyInfo(Variant::INT, "config/process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), "set_process_mode", "get_process_mode");