Commit 9e3a1e54 by Juan Linietsky

Add base support for 2D meshes in Godot, including Sprite -> Mesh2D conversion.

parent 1c77fdcc
......@@ -68,6 +68,7 @@ thirdparty_sources = [
"md5.cpp",
"pcg.cpp",
"triangulator.cpp",
"clipper.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env.add_source_files(env.core_sources, thirdparty_sources)
......
......@@ -1607,6 +1607,8 @@ Variant::operator Vector3() const {
if (type == VECTOR3)
return *reinterpret_cast<const Vector3 *>(_data._mem);
else if (type == VECTOR2)
return Vector3(reinterpret_cast<const Vector2 *>(_data._mem)->x, reinterpret_cast<const Vector2 *>(_data._mem)->y, 0.0);
else
return Vector3();
}
......
......@@ -450,6 +450,16 @@ void RasterizerCanvasGLES3::_draw_gui_primitive(int p_points, const Vector2 *p_v
storage->frame.canvas_draw_commands++;
}
static const GLenum gl_primitive[] = {
GL_POINTS,
GL_LINES,
GL_LINE_STRIP,
GL_LINE_LOOP,
GL_TRIANGLES,
GL_TRIANGLE_STRIP,
GL_TRIANGLE_FAN
};
void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *current_clip, bool &reclip) {
int cc = p_item->commands.size();
......@@ -735,6 +745,36 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
#endif
} break;
case Item::Command::TYPE_MESH: {
Item::CommandMesh *mesh = static_cast<Item::CommandMesh *>(c);
_set_texture_rect_mode(false);
RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(mesh->texture, mesh->normal_map);
if (texture) {
Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height);
state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, texpixel_size);
}
RasterizerStorageGLES3::Mesh *mesh_data = storage->mesh_owner.getornull(mesh->mesh);
if (mesh_data) {
for (int j = 0; j < mesh_data->surfaces.size(); j++) {
RasterizerStorageGLES3::Surface *s = mesh_data->surfaces[j];
// materials are ignored in 2D meshes, could be added but many things (ie, lighting mode, reading from screen, etc) would break as they are not meant be set up at this point of drawing
glBindVertexArray(s->array_id);
if (s->index_array_len) {
glDrawElements(gl_primitive[s->primitive], s->index_array_len, (s->array_len >= (1 << 16)) ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, 0);
} else {
glDrawArrays(gl_primitive[s->primitive], 0, s->array_len);
}
glBindVertexArray(0);
}
}
} break;
case Item::Command::TYPE_PARTICLES: {
Item::CommandParticles *particles_cmd = static_cast<Item::CommandParticles *>(c);
......
......@@ -100,6 +100,7 @@
#include "editor/plugins/shader_editor_plugin.h"
#include "editor/plugins/shader_graph_editor_plugin.h"
#include "editor/plugins/spatial_editor_plugin.h"
#include "editor/plugins/sprite_editor_plugin.h"
#include "editor/plugins/sprite_frames_editor_plugin.h"
#include "editor/plugins/style_box_editor_plugin.h"
#include "editor/plugins/texture_editor_plugin.h"
......@@ -5671,6 +5672,7 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(AnimationTreeEditorPlugin(this)));
add_editor_plugin(memnew(MeshLibraryEditorPlugin(this)));
add_editor_plugin(memnew(StyleBoxEditorPlugin(this)));
add_editor_plugin(memnew(SpriteEditorPlugin(this)));
add_editor_plugin(memnew(ParticlesEditorPlugin(this)));
add_editor_plugin(memnew(ResourcePreloaderEditorPlugin(this)));
add_editor_plugin(memnew(ItemListEditorPlugin(this)));
......@@ -5693,7 +5695,7 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(CollisionShape2DEditorPlugin(this)));
add_editor_plugin(memnew(CurveEditorPlugin(this)));
add_editor_plugin(memnew(TextureEditorPlugin(this)));
add_editor_plugin(memnew(MeshEditorPlugin(this)));
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
add_editor_plugin(memnew(NavigationMeshEditorPlugin(this)));
......
#ifndef SPRITE_EDITOR_PLUGIN_H
#define SPRITE_EDITOR_PLUGIN_H
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
#include "scene/2d/sprite.h"
#include "scene/gui/spin_box.h"
class SpriteEditor : public Control {
GDCLASS(SpriteEditor, Control);
enum Menu {
MENU_OPTION_CREATE_MESH_2D,
};
Sprite *node;
MenuButton *options;
ConfirmationDialog *outline_dialog;
AcceptDialog *err_dialog;
ConfirmationDialog *debug_uv_dialog;
Control *debug_uv;
Vector<Vector2> uv_lines;
Vector<Vector2> computed_vertices;
Vector<Vector2> computed_uv;
Vector<int> computed_indices;
SpinBox *simplification;
SpinBox *island_merging;
Button *update_preview;
void _menu_option(int p_option);
//void _create_uv_lines();
friend class SpriteEditorPlugin;
void _debug_uv_draw();
void _update_mesh_data();
void _create_mesh_node();
protected:
void _node_removed(Node *p_node);
static void _bind_methods();
public:
void edit(Sprite *p_sprite);
SpriteEditor();
};
class SpriteEditorPlugin : public EditorPlugin {
GDCLASS(SpriteEditorPlugin, EditorPlugin);
SpriteEditor *sprite_editor;
EditorNode *editor;
public:
virtual String get_name() const { return "Sprite"; }
bool has_main_screen() const { return false; }
virtual void edit(Object *p_object);
virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
SpriteEditorPlugin(EditorNode *p_node);
~SpriteEditorPlugin();
};
#endif // SPRITE_EDITOR_PLUGIN_H
......@@ -1402,70 +1402,77 @@ void SceneTreeDock::_create() {
Node *newnode = Object::cast_to<Node>(c);
ERR_FAIL_COND(!newnode);
List<PropertyInfo> pinfo;
n->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE))
continue;
if (E->get().name == "__meta__")
continue;
newnode->set(E->get().name, n->get(E->get().name));
}
replace_node(n, newnode);
}
}
}
editor->push_item(NULL);
void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node) {
//reconnect signals
List<MethodInfo> sl;
Node *n = p_node;
Node *newnode = p_by_node;
List<PropertyInfo> pinfo;
n->get_property_list(&pinfo);
n->get_signal_list(&sl);
for (List<MethodInfo>::Element *E = sl.front(); E; E = E->next()) {
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (!(E->get().usage & PROPERTY_USAGE_STORAGE))
continue;
if (E->get().name == "__meta__")
continue;
newnode->set(E->get().name, n->get(E->get().name));
}
List<Object::Connection> cl;
n->get_signal_connection_list(E->get().name, &cl);
editor->push_item(NULL);
for (List<Object::Connection>::Element *F = cl.front(); F; F = F->next()) {
//reconnect signals
List<MethodInfo> sl;
Object::Connection &c = F->get();
if (!(c.flags & Object::CONNECT_PERSIST))
continue;
newnode->connect(c.signal, c.target, c.method, varray(), Object::CONNECT_PERSIST);
}
}
n->get_signal_list(&sl);
for (List<MethodInfo>::Element *E = sl.front(); E; E = E->next()) {
String newname = n->get_name();
List<Object::Connection> cl;
n->get_signal_connection_list(E->get().name, &cl);
List<Node *> to_erase;
for (int i = 0; i < n->get_child_count(); i++) {
if (n->get_child(i)->get_owner() == NULL && n->is_owned_by_parent()) {
to_erase.push_back(n->get_child(i));
}
}
n->replace_by(newnode, true);
for (List<Object::Connection>::Element *F = cl.front(); F; F = F->next()) {
if (n == edited_scene) {
edited_scene = newnode;
editor->set_edited_scene(newnode);
newnode->set_editable_instances(n->get_editable_instances());
}
Object::Connection &c = F->get();
if (!(c.flags & Object::CONNECT_PERSIST))
continue;
newnode->connect(c.signal, c.target, c.method, varray(), Object::CONNECT_PERSIST);
}
}
//small hack to make collisionshapes and other kind of nodes to work
for (int i = 0; i < newnode->get_child_count(); i++) {
Node *c = newnode->get_child(i);
c->call("set_transform", c->call("get_transform"));
}
editor_data->get_undo_redo().clear_history();
newnode->set_name(newname);
String newname = n->get_name();
List<Node *> to_erase;
for (int i = 0; i < n->get_child_count(); i++) {
if (n->get_child(i)->get_owner() == NULL && n->is_owned_by_parent()) {
to_erase.push_back(n->get_child(i));
}
}
n->replace_by(newnode, true);
editor->push_item(newnode);
if (n == edited_scene) {
edited_scene = newnode;
editor->set_edited_scene(newnode);
newnode->set_editable_instances(n->get_editable_instances());
}
memdelete(n);
//small hack to make collisionshapes and other kind of nodes to work
for (int i = 0; i < newnode->get_child_count(); i++) {
Node *c = newnode->get_child(i);
c->call("set_transform", c->call("get_transform"));
}
editor_data->get_undo_redo().clear_history();
newnode->set_name(newname);
while (to_erase.front()) {
memdelete(to_erase.front()->get());
to_erase.pop_front();
}
}
editor->push_item(newnode);
memdelete(n);
while (to_erase.front()) {
memdelete(to_erase.front()->get());
to_erase.pop_front();
}
}
......
......@@ -208,6 +208,8 @@ public:
void show_tab_buttons();
void hide_tab_buttons();
void replace_node(Node *p_node, Node *p_by_node);
void open_script_dialog(Node *p_for_node);
SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSelection *p_editor_selection, EditorData &p_editor_data);
};
......
......@@ -684,7 +684,7 @@ void CanvasItem::draw_texture(const Ref<Texture> &p_texture, const Point2 &p_pos
ERR_FAIL_COND(p_texture.is_null());
p_texture->draw(canvas_item, p_pos, p_modulate);
p_texture->draw(canvas_item, p_pos, p_modulate, false, p_normal_map);
}
void CanvasItem::draw_texture_rect(const Ref<Texture> &p_texture, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture> &p_normal_map) {
......@@ -779,6 +779,22 @@ void CanvasItem::draw_colored_polygon(const Vector<Point2> &p_points, const Colo
VisualServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, colors, p_uvs, rid, rid_normal, p_antialiased);
}
void CanvasItem::draw_mesh(const Ref<Mesh> &p_mesh, const Ref<Texture> &p_texture, const Ref<Texture> &p_normal_map, RID p_skeleton) {
ERR_FAIL_COND(p_mesh.is_null());
RID texture_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
RID normal_map_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
VisualServer::get_singleton()->canvas_item_add_mesh(canvas_item, p_mesh->get_rid(), texture_rid, normal_map_rid, p_skeleton);
}
void CanvasItem::draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Texture> &p_texture, const Ref<Texture> &p_normal_map) {
ERR_FAIL_COND(p_multimesh.is_null());
RID texture_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
RID normal_map_rid = p_normal_map.is_valid() ? p_normal_map->get_rid() : RID();
VisualServer::get_singleton()->canvas_item_add_multimesh(canvas_item, p_multimesh->get_rid(), texture_rid, normal_map_rid);
}
void CanvasItem::draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate, int p_clip_w) {
if (!drawing) {
......@@ -1016,6 +1032,8 @@ void CanvasItem::_bind_methods() {
ClassDB::bind_method(D_METHOD("draw_colored_polygon", "points", "color", "uvs", "texture", "normal_map", "antialiased"), &CanvasItem::draw_colored_polygon, DEFVAL(PoolVector2Array()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(false));
ClassDB::bind_method(D_METHOD("draw_string", "font", "position", "text", "modulate", "clip_w"), &CanvasItem::draw_string, DEFVAL(Color(1, 1, 1)), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("draw_char", "font", "position", "char", "next", "modulate"), &CanvasItem::draw_char, DEFVAL(Color(1, 1, 1)));
ClassDB::bind_method(D_METHOD("draw_mesh", "mesh", "texture", "normal_map", "skeleton"), &CanvasItem::draw_mesh, DEFVAL(Ref<Texture>()), DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("draw_multimesh", "mesh", "texture", "normal_map"), &CanvasItem::draw_mesh, DEFVAL(Ref<Texture>()));
ClassDB::bind_method(D_METHOD("draw_set_transform", "position", "rotation", "scale"), &CanvasItem::draw_set_transform);
ClassDB::bind_method(D_METHOD("draw_set_transform_matrix", "xform"), &CanvasItem::draw_set_transform_matrix);
......
......@@ -34,6 +34,7 @@
#include "scene/main/node.h"
#include "scene/main/scene_tree.h"
#include "scene/resources/material.h"
#include "scene/resources/multimesh.h"
#include "scene/resources/shader.h"
#include "scene/resources/texture.h"
......@@ -282,6 +283,9 @@ public:
void draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), Ref<Texture> p_texture = Ref<Texture>(), const Ref<Texture> &p_normal_map = Ref<Texture>(), bool p_antialiased = false);
void draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs = Vector<Point2>(), Ref<Texture> p_texture = Ref<Texture>(), const Ref<Texture> &p_normal_map = Ref<Texture>(), bool p_antialiased = false);
void draw_mesh(const Ref<Mesh> &p_mesh, const Ref<Texture> &p_texture, const Ref<Texture> &p_normal_map, RID p_skeleton);
void draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Texture> &p_texture, const Ref<Texture> &p_normal_map);
void draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, const Color &p_modulate = Color(1, 1, 1), int p_clip_w = -1);
float draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, const String &p_next = "", const Color &p_modulate = Color(1, 1, 1));
......
#include "mesh_instance_2d.h"
void MeshInstance2D::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW) {
if (mesh.is_valid()) {
draw_mesh(mesh, texture, normal_map, RID());
}
}
}
void MeshInstance2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_mesh", "mesh"), &MeshInstance2D::set_mesh);
ClassDB::bind_method(D_METHOD("get_mesh"), &MeshInstance2D::get_mesh);
ClassDB::bind_method(D_METHOD("set_texture", "texture"), &MeshInstance2D::set_texture);
ClassDB::bind_method(D_METHOD("get_texture"), &MeshInstance2D::get_texture);
ClassDB::bind_method(D_METHOD("set_normal_map", "normal_map"), &MeshInstance2D::set_normal_map);
ClassDB::bind_method(D_METHOD("get_normal_map"), &MeshInstance2D::get_normal_map);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh"), "set_mesh", "get_mesh");
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture");
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_normal_map", "get_normal_map");
}
void MeshInstance2D::set_mesh(const Ref<Mesh> &p_mesh) {
mesh = p_mesh;
update();
}
Ref<Mesh> MeshInstance2D::get_mesh() const {
return mesh;
}
void MeshInstance2D::set_texture(const Ref<Texture> &p_texture) {
if (p_texture == texture)
return;
texture = p_texture;
update();
emit_signal("texture_changed");
_change_notify("texture");
}
void MeshInstance2D::set_normal_map(const Ref<Texture> &p_texture) {
normal_map = p_texture;
update();
}
Ref<Texture> MeshInstance2D::get_normal_map() const {
return normal_map;
}
Ref<Texture> MeshInstance2D::get_texture() const {
return texture;
}
Rect2 MeshInstance2D::_edit_get_rect() const {
if (mesh.is_valid()) {
AABB aabb = mesh->get_aabb();
return Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y);
}
return Node2D::_edit_get_rect();
}
MeshInstance2D::MeshInstance2D() {
}
#ifndef MESH_INSTANCE_2D_H
#define MESH_INSTANCE_2D_H
#include "scene/2d/node_2d.h"
class MeshInstance2D : public Node2D {
GDCLASS(MeshInstance2D, Node2D)
Ref<Mesh> mesh;
Ref<Texture> texture;
Ref<Texture> normal_map;
protected:
void _notification(int p_what);
static void _bind_methods();
public:
void set_mesh(const Ref<Mesh> &p_mesh);
Ref<Mesh> get_mesh() const;
void set_texture(const Ref<Texture> &p_texture);
Ref<Texture> get_texture() const;
void set_normal_map(const Ref<Texture> &p_texture);
Ref<Texture> get_normal_map() const;
virtual Rect2 _edit_get_rect() const;
MeshInstance2D();
};
#endif // MESH_INSTANCE_2D_H
......@@ -46,6 +46,7 @@
#include "scene/2d/light_2d.h"
#include "scene/2d/light_occluder_2d.h"
#include "scene/2d/line_2d.h"
#include "scene/2d/mesh_instance_2d.h"
#include "scene/2d/navigation2d.h"
#include "scene/2d/parallax_background.h"
#include "scene/2d/parallax_layer.h"
......@@ -434,6 +435,7 @@ void register_scene_types() {
ClassDB::register_class<AnimatedSprite>();
ClassDB::register_class<Position2D>();
ClassDB::register_class<Line2D>();
ClassDB::register_class<MeshInstance2D>();
ClassDB::register_virtual_class<CollisionObject2D>();
ClassDB::register_virtual_class<PhysicsBody2D>();
ClassDB::register_class<StaticBody2D>();
......
......@@ -44,6 +44,8 @@ class BitMap : public Resource {
int width;
int height;
Vector<Vector2> _march_square(const Rect2i &rect, const Point2i &start) const;
protected:
void _set_data(const Dictionary &p_d);
Dictionary _get_data() const;
......@@ -52,7 +54,7 @@ protected:
public:
void create(const Size2 &p_size);
void create_from_image_alpha(const Ref<Image> &p_image);
void create_from_image_alpha(const Ref<Image> &p_image, float p_treshold = 0.1);
void set_bit(const Point2 &p_pos, bool p_value);
bool get_bit(const Point2 &p_pos) const;
......@@ -61,6 +63,10 @@ public:
Size2 get_size() const;
void grow_mask(int p_pixels, const Rect2 &p_rect);
Vector<Vector<Vector2> > clip_opaque_to_polygons(const Rect2 &p_rect, float p_epsilon = 2.0) const;
BitMap();
};
......
......@@ -750,6 +750,8 @@ public:
RID mesh;
RID skeleton;
RID texture;
RID normal_map;
CommandMesh() { type = TYPE_MESH; }
};
......@@ -757,6 +759,8 @@ public:
RID multimesh;
RID skeleton;
RID texture;
RID normal_map;
CommandMultiMesh() { type = TYPE_MULTIMESH; }
};
......
......@@ -742,7 +742,7 @@ void VisualServerCanvas::canvas_item_add_set_transform(RID p_item, const Transfo
canvas_item->commands.push_back(tr);
}
void VisualServerCanvas::canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_skeleton) {
void VisualServerCanvas::canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_texture, RID p_normal_map, RID p_skeleton) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
......@@ -750,6 +750,8 @@ void VisualServerCanvas::canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID
Item::CommandMesh *m = memnew(Item::CommandMesh);
ERR_FAIL_COND(!m);
m->mesh = p_mesh;
m->texture = p_texture;
m->normal_map = p_normal_map;
m->skeleton = p_skeleton;
canvas_item->commands.push_back(m);
......@@ -774,7 +776,7 @@ void VisualServerCanvas::canvas_item_add_particles(RID p_item, RID p_particles,
canvas_item->commands.push_back(part);
}
void VisualServerCanvas::canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_skeleton) {
void VisualServerCanvas::canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture, RID p_normal_map, RID p_skeleton) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
......@@ -783,6 +785,8 @@ void VisualServerCanvas::canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p
ERR_FAIL_COND(!mm);
mm->multimesh = p_mesh;
mm->skeleton = p_skeleton;
mm->texture = p_texture;
mm->normal_map = p_normal_map;
canvas_item->rect_dirty = true;
canvas_item->commands.push_back(mm);
......
......@@ -182,8 +182,8 @@ public:
void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID());
void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID(), bool p_antialiased = false);
void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID());
void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_skeleton = RID());
void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_skeleton = RID());
void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_texture = RID(), RID p_normal_map = RID(), RID p_skeleton = RID());
void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID(), RID p_skeleton = RID());
void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal, int p_h_frames, int p_v_frames);
void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform);
void canvas_item_add_clip_ignore(RID p_item, bool p_ignore);
......
......@@ -581,8 +581,8 @@ public:
BIND7(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float, RID)
BIND7(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, RID, bool)
BIND8(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, int, RID)
BIND3(canvas_item_add_mesh, RID, const RID &, RID)
BIND3(canvas_item_add_multimesh, RID, RID, RID)
BIND5(canvas_item_add_mesh, RID, const RID &, RID, RID, RID)
BIND5(canvas_item_add_multimesh, RID, RID, RID, RID, RID)
BIND6(canvas_item_add_particles, RID, RID, RID, RID, int, int)
BIND2(canvas_item_add_set_transform, RID, const Transform2D &)
BIND2(canvas_item_add_clip_ignore, RID, bool)
......
......@@ -499,8 +499,8 @@ public:
FUNC7(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float, RID)
FUNC7(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, RID, bool)
FUNC8(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, int, RID)
FUNC3(canvas_item_add_mesh, RID, const RID &, RID)
FUNC3(canvas_item_add_multimesh, RID, RID, RID)
FUNC5(canvas_item_add_mesh, RID, const RID &, RID, RID, RID)
FUNC5(canvas_item_add_multimesh, RID, RID, RID, RID, RID)
FUNC6(canvas_item_add_particles, RID, RID, RID, RID, int, int)
FUNC2(canvas_item_add_set_transform, RID, const Transform2D &)
FUNC2(canvas_item_add_clip_ignore, RID, bool)
......
......@@ -846,8 +846,8 @@ public:
virtual void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID(), bool p_antialiased = false) = 0;
virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_skeleton = RID()) = 0;
virtual void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_skeleton = RID()) = 0;
virtual void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_texture = RID(), RID p_normal_map = RID(), RID p_skeleton = RID()) = 0;
virtual void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID(), RID p_skeleton = RID()) = 0;
virtual void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map, int p_h_frames, int p_v_frames) = 0;
virtual void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform) = 0;
virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore) = 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment