diff options
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 8 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.h | 8 | ||||
-rw-r--r-- | servers/visual/rasterizer.h | 8 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 971 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 453 | ||||
-rw-r--r-- | servers/visual_server.h | 8 |
6 files changed, 270 insertions, 1186 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index b29de876a4..515db39098 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -1199,7 +1199,7 @@ RID RasterizerStorageGLES3::multimesh_get_mesh(RID p_multimesh) const{ return RID(); } -AABB RasterizerStorageGLES3::multimesh_get_custom_aabb(RID p_multimesh,const AABB& p_aabb) const{ +AABB RasterizerStorageGLES3::multimesh_get_custom_aabb(RID p_multimesh) const{ return AABB(); } @@ -1305,7 +1305,7 @@ void RasterizerStorageGLES3::skeleton_bone_set_transform(RID p_skeleton,int p_bo } -Transform RasterizerStorageGLES3::skeleton_bone_get_transform(RID p_skeleton,int p_bone){ +Transform RasterizerStorageGLES3::skeleton_bone_get_transform(RID p_skeleton,int p_bone) const{ return Transform(); } @@ -1313,7 +1313,7 @@ void RasterizerStorageGLES3::skeleton_bone_set_transform_2d(RID p_skeleton,int p } -Matrix32 RasterizerStorageGLES3::skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone){ +Matrix32 RasterizerStorageGLES3::skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone) const{ return Matrix32(); } @@ -1419,7 +1419,7 @@ void RasterizerStorageGLES3::room_add_bounds(RID p_room, const DVector<Vector2>& } -void RasterizerStorageGLES3::room_clear_bounds(){ +void RasterizerStorageGLES3::room_clear_bounds(RID p_room){ } diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 3b2d7d752c..eb6cd0bd92 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -249,7 +249,7 @@ public: virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color); virtual RID multimesh_get_mesh(RID p_multimesh) const; - virtual AABB multimesh_get_custom_aabb(RID p_multimesh,const AABB& p_aabb) const; + virtual AABB multimesh_get_custom_aabb(RID p_multimesh) const; virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const; virtual Matrix32 multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const; @@ -282,9 +282,9 @@ public: virtual void skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton=false); virtual int skeleton_get_bone_count(RID p_skeleton) const; virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform); - virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone); + virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone) const; virtual void skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Matrix32& p_transform); - virtual Matrix32 skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone); + virtual Matrix32 skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone) const; /* Light API */ @@ -321,7 +321,7 @@ public: virtual RID room_create(); virtual void room_add_bounds(RID p_room, const DVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform); - virtual void room_clear_bounds(); + virtual void room_clear_bounds(RID p_room); /* PORTAL API */ diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index df18dd1679..6a6eb7ad20 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -134,7 +134,7 @@ public: virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color)=0; virtual RID multimesh_get_mesh(RID p_multimesh) const=0; - virtual AABB multimesh_get_custom_aabb(RID p_multimesh,const AABB& p_aabb) const=0; + virtual AABB multimesh_get_custom_aabb(RID p_multimesh) const=0; virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const=0; virtual Matrix32 multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const=0; @@ -167,9 +167,9 @@ public: virtual void skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton=false)=0; virtual int skeleton_get_bone_count(RID p_skeleton) const=0; virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform)=0; - virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone)=0; + virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone) const =0; virtual void skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Matrix32& p_transform)=0; - virtual Matrix32 skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone)=0; + virtual Matrix32 skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone) const=0; /* Light API */ @@ -206,7 +206,7 @@ public: virtual RID room_create()=0; virtual void room_add_bounds(RID p_room, const DVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform)=0; - virtual void room_clear_bounds()=0; + virtual void room_clear_bounds(RID p_room)=0; /* PORTAL API */ diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 168afac77f..d6e057bb52 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -37,519 +37,7 @@ // careful, these may run in different threads than the visual server -RID VisualServerRaster::texture_create(){ - return VSG::storage->texture_create(); -} -void VisualServerRaster::texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags){ - - VSG::storage->texture_allocate(p_texture,p_width,p_height,p_format,p_flags); -} -void VisualServerRaster::texture_set_data(RID p_texture,const Image& p_image,CubeMapSide p_cube_side){ - - VSG::storage->texture_set_data(p_texture,p_image,p_cube_side); -} -Image VisualServerRaster::texture_get_data(RID p_texture,CubeMapSide p_cube_side) const{ - - return VSG::storage->texture_get_data(p_texture,p_cube_side); -} -void VisualServerRaster::texture_set_flags(RID p_texture,uint32_t p_flags) { - - VSG::storage->texture_set_flags(p_texture,p_flags); -} -uint32_t VisualServerRaster::texture_get_flags(RID p_texture) const{ - - return VSG::storage->texture_get_flags(p_texture); -} -Image::Format VisualServerRaster::texture_get_format(RID p_texture) const{ - - return VSG::storage->texture_get_format(p_texture); -} -uint32_t VisualServerRaster::texture_get_width(RID p_texture) const{ - - return VSG::storage->texture_get_width(p_texture); -} -uint32_t VisualServerRaster::texture_get_height(RID p_texture) const{ - - return VSG::storage->texture_get_height(p_texture); -} -void VisualServerRaster::texture_set_size_override(RID p_texture,int p_width, int p_height){ - VSG::storage->texture_set_size_override(p_texture,p_width,p_height); - -} - -void VisualServerRaster::texture_set_path(RID p_texture,const String& p_path){ - - VSG::storage->texture_set_path(p_texture,p_path); -} - -String VisualServerRaster::texture_get_path(RID p_texture) const{ - - return VSG::storage->texture_get_path(p_texture); -} - -void VisualServerRaster::texture_set_shrink_all_x2_on_set_data(bool p_enable){ - - VSG::storage->texture_set_shrink_all_x2_on_set_data(p_enable); -} - -void VisualServerRaster::texture_debug_usage(List<TextureInfo> *r_info){ - - VSG::storage->texture_debug_usage(r_info); -} - - -/* SHADER API */ - - -RID VisualServerRaster::shader_create(ShaderMode p_mode){ - - return VSG::storage->shader_create(p_mode); -} - -void VisualServerRaster::shader_set_mode(RID p_shader,ShaderMode p_mode){ - - VSG::storage->shader_set_mode(p_shader,p_mode); -} -VisualServerRaster::ShaderMode VisualServerRaster::shader_get_mode(RID p_shader) const{ - - return VSG::storage->shader_get_mode(p_shader); -} - -void VisualServerRaster::shader_set_code(RID p_shader, const String& p_code){ - - VSG::storage->shader_set_code(p_shader,p_code); -} -String VisualServerRaster::shader_get_code(RID p_shader) const{ - - return VSG::storage->shader_get_code(p_shader); -} -void VisualServerRaster::shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const{ - - VSG::storage->shader_get_param_list(p_shader,p_param_list); -} - -void VisualServerRaster::shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture){ - - VSG::storage->shader_set_default_texture_param(p_shader,p_name,p_texture); -} -RID VisualServerRaster::shader_get_default_texture_param(RID p_shader, const StringName& p_name) const{ - - return VSG::storage->shader_get_default_texture_param(p_shader,p_name); -} - - -/* COMMON MATERIAL API */ - -RID VisualServerRaster::material_create(){ - - return VSG::storage->material_create(); -} - -void VisualServerRaster::material_set_shader(RID p_shader_material, RID p_shader){ - - VSG::storage->material_set_shader(p_shader_material,p_shader); -} -RID VisualServerRaster::material_get_shader(RID p_shader_material) const{ - - return VSG::storage->material_get_shader(p_shader_material); -} - -void VisualServerRaster::material_set_param(RID p_material, const StringName& p_param, const Variant& p_value){ - - VSG::storage->material_set_param(p_material,p_param,p_value); -} -Variant VisualServerRaster::material_get_param(RID p_material, const StringName& p_param) const{ - - return VSG::storage->material_get_param(p_material,p_param); -} - -/* MESH API */ - -RID VisualServerRaster::mesh_create(){ - - return VSG::storage->mesh_create(); -} - -void VisualServerRaster::mesh_add_surface(RID p_mesh,uint32_t p_format,PrimitiveType p_primitive,const DVector<uint8_t>& p_array,int p_vertex_count,const DVector<uint8_t>& p_index_array,int p_index_count,const Vector<DVector<uint8_t> >& p_blend_shapes){ - - VSG::storage->mesh_add_surface(p_mesh,p_format,p_primitive,p_array,p_vertex_count,p_index_array,p_index_count,p_blend_shapes); -} - -void VisualServerRaster::mesh_set_morph_target_count(RID p_mesh,int p_amount){ - - VSG::storage->mesh_set_morph_target_count(p_mesh,p_amount); -} -int VisualServerRaster::mesh_get_morph_target_count(RID p_mesh) const{ - - return VSG::storage->mesh_get_morph_target_count(p_mesh); -} - - -void VisualServerRaster::mesh_set_morph_target_mode(RID p_mesh,MorphTargetMode p_mode){ - - VSG::storage->mesh_set_morph_target_mode(p_mesh,p_mode); -} -VisualServerRaster::MorphTargetMode VisualServerRaster::mesh_get_morph_target_mode(RID p_mesh) const{ - - return VSG::storage->mesh_get_morph_target_mode(p_mesh); -} - -void VisualServerRaster::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material){ - - VSG::storage->mesh_surface_set_material(p_mesh,p_surface,p_material); -} -RID VisualServerRaster::mesh_surface_get_material(RID p_mesh, int p_surface) const{ - - return VSG::storage->mesh_surface_get_material(p_mesh,p_surface); -} - -int VisualServerRaster::mesh_surface_get_array_len(RID p_mesh, int p_surface) const{ - - return VSG::storage->mesh_surface_get_array_len(p_mesh,p_surface); -} -int VisualServerRaster::mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const{ - - return VSG::storage->mesh_surface_get_array_index_len(p_mesh,p_surface); -} - -DVector<uint8_t> VisualServerRaster::mesh_surface_get_array(RID p_mesh, int p_surface) const{ - - return VSG::storage->mesh_surface_get_array(p_mesh,p_surface); -} -DVector<uint8_t> VisualServerRaster::mesh_surface_get_index_array(RID p_mesh, int p_surface) const{ - - return VSG::storage->mesh_surface_get_index_array(p_mesh,p_surface); -} - - -uint32_t VisualServerRaster::mesh_surface_get_format(RID p_mesh, int p_surface) const{ - - return VSG::storage->mesh_surface_get_format(p_mesh,p_surface); -} -VisualServerRaster::PrimitiveType VisualServerRaster::mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const{ - - return VSG::storage->mesh_surface_get_primitive_type(p_mesh,p_surface); -} - -void VisualServerRaster::mesh_remove_surface(RID p_mesh,int p_index){ - - VSG::storage->mesh_remove_surface(p_mesh,p_index); -} -int VisualServerRaster::mesh_get_surface_count(RID p_mesh) const{ - - return VSG::storage->mesh_get_surface_count(p_mesh); -} - -void VisualServerRaster::mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb){ - - VSG::storage->mesh_set_custom_aabb(p_mesh,p_aabb); -} -AABB VisualServerRaster::mesh_get_custom_aabb(RID p_mesh) const{ - - return VSG::storage->mesh_get_custom_aabb(p_mesh); -} - -void VisualServerRaster::mesh_clear(RID p_mesh){ - - VSG::storage->mesh_clear(p_mesh); -} - -/* MULTIMESH API */ - - -RID VisualServerRaster::multimesh_create() { - - return VSG::storage->multimesh_create(); -} - -void VisualServerRaster::multimesh_allocate(RID p_multimesh,int p_instances,MultimeshTransformFormat p_transform_format,MultimeshColorFormat p_color_format,bool p_gen_aabb){ - - VSG::storage->multimesh_allocate(p_multimesh,p_instances,p_transform_format,p_color_format,p_gen_aabb); -} -int VisualServerRaster::multimesh_get_instance_count(RID p_multimesh) const{ - - return VSG::storage->multimesh_get_instance_count(p_multimesh); -} - -void VisualServerRaster::multimesh_set_mesh(RID p_multimesh,RID p_mesh){ - - VSG::storage->multimesh_set_mesh(p_multimesh,p_mesh); -} -void VisualServerRaster::multimesh_set_custom_aabb(RID p_multimesh,const AABB& p_aabb){ - - VSG::storage->multimesh_set_custom_aabb(p_multimesh,p_aabb); -} -void VisualServerRaster::multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform){ - - VSG::storage->multimesh_instance_set_transform(p_multimesh,p_index,p_transform); -} -void VisualServerRaster::multimesh_instance_set_transform_2d(RID p_multimesh,int p_index,const Matrix32& p_transform){ - - VSG::storage->multimesh_instance_set_transform_2d(p_multimesh,p_index,p_transform); -} -void VisualServerRaster::multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color){ - - VSG::storage->multimesh_instance_set_color(p_multimesh,p_index,p_color); -} - -RID VisualServerRaster::multimesh_get_mesh(RID p_multimesh) const{ - - return VSG::storage->multimesh_get_mesh(p_multimesh); -} -AABB VisualServerRaster::multimesh_get_custom_aabb(RID p_multimesh,const AABB& p_aabb) const{ - - return VSG::storage->multimesh_get_custom_aabb(p_multimesh,p_aabb); -} - -Transform VisualServerRaster::multimesh_instance_get_transform(RID p_multimesh,int p_index) const{ - - return VSG::storage->multimesh_instance_get_transform(p_multimesh,p_index); -} -Matrix32 VisualServerRaster::multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const{ - - return VSG::storage->multimesh_instance_get_transform_2d(p_multimesh,p_index); -} -Color VisualServerRaster::multimesh_instance_get_color(RID p_multimesh,int p_index) const{ - - return VSG::storage->multimesh_instance_get_color(p_multimesh,p_index); -} - -void VisualServerRaster::multimesh_set_visible_instances(RID p_multimesh,int p_visible){ - - VSG::storage->multimesh_set_visible_instances(p_multimesh,p_visible); -} -int VisualServerRaster::multimesh_get_visible_instances(RID p_multimesh) const{ - - return VSG::storage->multimesh_get_visible_instances(p_multimesh); -} - - -/* IMMEDIATE API */ - -RID VisualServerRaster::immediate_create(){ - - return VSG::storage->immediate_create(); -} -void VisualServerRaster::immediate_begin(RID p_immediate,PrimitiveType p_rimitive,RID p_texture){ - - VSG::storage->immediate_begin(p_immediate,p_rimitive,p_texture); -} -void VisualServerRaster::immediate_vertex(RID p_immediate,const Vector3& p_vertex){ - - VSG::storage->immediate_vertex(p_immediate,p_vertex); -} -void VisualServerRaster::immediate_vertex_2d(RID p_immediate,const Vector3& p_vertex){ - - VSG::storage->immediate_vertex_2d(p_immediate,p_vertex); - -} -void VisualServerRaster::immediate_normal(RID p_immediate,const Vector3& p_normal){ - - VSG::storage->immediate_normal(p_immediate,p_normal); - -} -void VisualServerRaster::immediate_tangent(RID p_immediate,const Plane& p_tangent){ - - VSG::storage->immediate_tangent(p_immediate,p_tangent); -} -void VisualServerRaster::immediate_color(RID p_immediate,const Color& p_color){ - - VSG::storage->immediate_color(p_immediate,p_color); - -} -void VisualServerRaster::immediate_uv(RID p_immediate,const Vector2& tex_uv){ - - VSG::storage->immediate_uv(p_immediate,tex_uv); - -} -void VisualServerRaster::immediate_uv2(RID p_immediate,const Vector2& tex_uv){ - - VSG::storage->immediate_uv2(p_immediate,tex_uv); - -} -void VisualServerRaster::immediate_end(RID p_immediate){ - - VSG::storage->immediate_end(p_immediate); - -} -void VisualServerRaster::immediate_clear(RID p_immediate){ - - VSG::storage->immediate_clear(p_immediate); - -} -void VisualServerRaster::immediate_set_material(RID p_immediate,RID p_material){ - - VSG::storage->immediate_set_material(p_immediate,p_material); - -} -RID VisualServerRaster::immediate_get_material(RID p_immediate) const{ - - return VSG::storage->immediate_get_material(p_immediate); -} - -/* SKELETON API */ - -RID VisualServerRaster::skeleton_create(){ - - return VSG::storage->skeleton_create(); -} -void VisualServerRaster::skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton){ - - VSG::storage->skeleton_allocate(p_skeleton,p_bones,p_2d_skeleton); -} -int VisualServerRaster::skeleton_get_bone_count(RID p_skeleton) const{ - - return VSG::storage->skeleton_get_bone_count(p_skeleton); -} -void VisualServerRaster::skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform){ - - VSG::storage->skeleton_bone_set_transform(p_skeleton,p_bone,p_transform); -} -Transform VisualServerRaster::skeleton_bone_get_transform(RID p_skeleton,int p_bone){ - - return VSG::storage->skeleton_bone_get_transform(p_skeleton,p_bone); -} -void VisualServerRaster::skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Matrix32& p_transform){ - - VSG::storage->skeleton_bone_set_transform_2d(p_skeleton,p_bone,p_transform); -} -Matrix32 VisualServerRaster::skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone){ - - return VSG::storage->skeleton_bone_get_transform_2d(p_skeleton,p_bone); -} - -/* Light API */ - -RID VisualServerRaster::light_create(LightType p_type){ - - return VSG::storage->light_create(p_type); -} - -void VisualServerRaster::light_set_color(RID p_light,const Color& p_color){ - - VSG::storage->light_set_color(p_light,p_color); -} -void VisualServerRaster::light_set_param(RID p_light,LightParam p_param,float p_value){ - - VSG::storage->light_set_param(p_light,p_param,p_value); -} -void VisualServerRaster::light_set_shadow(RID p_light,bool p_enabled){ - - VSG::storage->light_set_shadow(p_light,p_enabled); -} -void VisualServerRaster::light_set_projector(RID p_light,RID p_texture){ - - VSG::storage->light_set_projector(p_light,p_texture); -} -void VisualServerRaster::light_set_attenuation_texure(RID p_light,RID p_texture){ - - VSG::storage->light_set_attenuation_texure(p_light,p_texture); -} -void VisualServerRaster::light_set_negative(RID p_light,bool p_enable){ - - VSG::storage->light_set_negative(p_light,p_enable); -} -void VisualServerRaster::light_set_cull_mask(RID p_light,uint32_t p_mask){ - - VSG::storage->light_set_cull_mask(p_light,p_mask); -} -void VisualServerRaster::light_set_shader(RID p_light,RID p_shader){ - - VSG::storage->light_set_shader(p_light,p_shader); -} - - -void VisualServerRaster::light_directional_set_shadow_mode(RID p_light,LightDirectionalShadowMode p_mode){ - - VSG::storage->light_directional_set_shadow_mode(p_light,p_mode); -} - -/* PROBE API */ - -RID VisualServerRaster::reflection_probe_create(){ - - return VSG::storage->reflection_probe_create(); -} - -void VisualServerRaster::reflection_probe_set_intensity(RID p_probe, float p_intensity){ - - VSG::storage->reflection_probe_set_intensity(p_probe,p_intensity); -} -void VisualServerRaster::reflection_probe_set_clip(RID p_probe, float p_near, float p_far){ - - VSG::storage->reflection_probe_set_clip(p_probe,p_near,p_far); -} -void VisualServerRaster::reflection_probe_set_min_blend_distance(RID p_probe, float p_distance){ - - VSG::storage->reflection_probe_set_min_blend_distance(p_probe,p_distance); -} -void VisualServerRaster::reflection_probe_set_extents(RID p_probe, const Vector3& p_extents){ - - VSG::storage->reflection_probe_set_extents(p_probe,p_extents); -} -void VisualServerRaster::reflection_probe_set_origin_offset(RID p_probe, const Vector3& p_offset){ - - VSG::storage->reflection_probe_set_origin_offset(p_probe,p_offset); -} -void VisualServerRaster::reflection_probe_set_enable_parallax_correction(RID p_probe, bool p_enable){ - - VSG::storage->reflection_probe_set_enable_parallax_correction(p_probe,p_enable); -} -void VisualServerRaster::reflection_probe_set_resolution(RID p_probe, int p_resolution){ - - VSG::storage->reflection_probe_set_resolution(p_probe,p_resolution); -} -void VisualServerRaster::reflection_probe_set_hide_skybox(RID p_probe, bool p_hide){ - - VSG::storage->reflection_probe_set_hide_skybox(p_probe,p_hide); -} -void VisualServerRaster::reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers){ - - VSG::storage->reflection_probe_set_cull_mask(p_probe,p_layers); -} - - -/* ROOM API */ - -RID VisualServerRaster::room_create(){ - - return VSG::storage->room_create(); -} -void VisualServerRaster::room_add_bounds(RID p_room, const DVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform){ - - VSG::storage->room_add_bounds(p_room,p_convex_polygon,p_height,p_transform); -} -void VisualServerRaster::room_clear_bounds(){ - - VSG::storage->room_clear_bounds(); -} - -/* PORTAL API */ - -// portals are only (x/y) points, forming a convex shape, which its clockwise -// order points outside. (z is 0); - -RID VisualServerRaster::portal_create(){ - - return VSG::storage->portal_create(); -} -void VisualServerRaster::portal_set_shape(RID p_portal, const Vector<Point2>& p_shape){ - - VSG::storage->portal_set_shape(p_portal,p_shape); -} -void VisualServerRaster::portal_set_enabled(RID p_portal, bool p_enabled) { - - VSG::storage->portal_set_enabled(p_portal,p_enabled); -} -void VisualServerRaster::portal_set_disable_distance(RID p_portal, float p_distance){ - - VSG::storage->portal_set_disable_distance(p_portal,p_distance); -} -void VisualServerRaster::portal_set_disabled_color(RID p_portal, const Color& p_color){ - - VSG::storage->portal_set_disabled_color(p_portal,p_color); -} /* CAMERA API */ @@ -577,118 +65,6 @@ void VisualServerRaster::camera_set_use_vertical_aspect(RID p_camera,bool p_enab } -/* VIEWPORT TARGET API */ - -RID VisualServerRaster::viewport_create(){ - - return VSG::viewport->viewport_create(); -} - -void VisualServerRaster::viewport_set_size(RID p_viewport,int p_width,int p_height){ - - VSG::viewport->viewport_set_size(p_viewport,p_width,p_height); -} - -void VisualServerRaster::viewport_set_active(RID p_viewport,bool p_active) { - - VSG::viewport->viewport_set_active(p_viewport,p_active); -} - -void VisualServerRaster::viewport_set_clear_mode(RID p_viewport,ViewportClearMode p_clear_mode) { - - VSG::viewport->viewport_set_clear_mode(p_viewport,p_clear_mode); -} - -void VisualServerRaster::viewport_attach_to_screen(RID p_viewport,const Rect2& p_rect,int p_screen){ - - VSG::viewport->viewport_attach_to_screen(p_viewport,p_rect,p_screen); - -} -void VisualServerRaster::viewport_detach(RID p_viewport){ - - VSG::viewport->viewport_detach(p_viewport); - -} - -void VisualServerRaster::viewport_set_update_mode(RID p_viewport,ViewportUpdateMode p_mode){ - - VSG::viewport->viewport_set_update_mode(p_viewport,p_mode); - -} -void VisualServerRaster::viewport_set_vflip(RID p_viewport,bool p_enable){ - - VSG::viewport->viewport_set_vflip(p_viewport,p_enable); - -} - -RID VisualServerRaster::viewport_get_texture(RID p_viewport) const{ - - return VSG::viewport->viewport_get_texture(p_viewport); - -} -Image VisualServerRaster::viewport_capture(RID p_viewport) const{ - - return VSG::viewport->viewport_capture(p_viewport); -} - -void VisualServerRaster::viewport_set_hide_scenario(RID p_viewport,bool p_hide){ - - return VSG::viewport->viewport_set_hide_scenario(p_viewport,p_hide); -} -void VisualServerRaster::viewport_set_hide_canvas(RID p_viewport,bool p_hide){ - - return VSG::viewport->viewport_set_hide_canvas(p_viewport,p_hide); - -} -void VisualServerRaster::viewport_set_disable_environment(RID p_viewport,bool p_disable){ - - return VSG::viewport->viewport_set_disable_environment(p_viewport,p_disable); - -} - -void VisualServerRaster::viewport_attach_camera(RID p_viewport,RID p_camera){ - - return VSG::viewport->viewport_attach_camera(p_viewport,p_camera); - -} -void VisualServerRaster::viewport_set_scenario(RID p_viewport,RID p_scenario){ - - return VSG::viewport->viewport_set_scenario(p_viewport,p_scenario); - -} -void VisualServerRaster::viewport_attach_canvas(RID p_viewport,RID p_canvas){ - - return VSG::viewport->viewport_attach_canvas(p_viewport,p_canvas); - -} -void VisualServerRaster::viewport_remove_canvas(RID p_viewport,RID p_canvas){ - - return VSG::viewport->viewport_remove_canvas(p_viewport,p_canvas); - -} -void VisualServerRaster::viewport_set_canvas_transform(RID p_viewport,RID p_canvas,const Matrix32& p_offset){ - - return VSG::viewport->viewport_set_canvas_transform(p_viewport,p_canvas,p_offset); - -} -void VisualServerRaster::viewport_set_transparent_background(RID p_viewport,bool p_enabled){ - - return VSG::viewport->viewport_set_transparent_background(p_viewport,p_enabled); - -} - -void VisualServerRaster::viewport_set_global_canvas_transform(RID p_viewport,const Matrix32& p_transform){ - - return VSG::viewport->viewport_set_global_canvas_transform(p_viewport,p_transform); - -} -void VisualServerRaster::viewport_set_canvas_layer(RID p_viewport,RID p_canvas,int p_layer){ - - return VSG::viewport->viewport_set_canvas_layer(p_viewport,p_canvas,p_layer); - -} - - /* ENVIRONMENT API */ RID VisualServerRaster::environment_create(){ @@ -836,349 +212,6 @@ void VisualServerRaster::instance_geometry_set_as_instance_lod(RID p_instance,RI } -/* CANVAS (2D) */ - -RID VisualServerRaster::canvas_create(){ - - return VSG::canvas->canvas_create(); - -} -void VisualServerRaster::canvas_set_item_mirroring(RID p_canvas,RID p_item,const Point2& p_mirroring){ - - VSG::canvas->canvas_set_item_mirroring(p_canvas,p_item,p_mirroring); -} -void VisualServerRaster::canvas_set_modulate(RID p_canvas,const Color& p_color){ - - VSG::canvas->canvas_set_modulate(p_canvas,p_color); -} - - -RID VisualServerRaster::canvas_item_create(){ - - return VSG::canvas->canvas_item_create(); -} -void VisualServerRaster::canvas_item_set_parent(RID p_item,RID p_parent){ - - VSG::canvas->canvas_item_set_parent(p_item,p_parent); - -} - -void VisualServerRaster::canvas_item_set_visible(RID p_item,bool p_visible){ - - VSG::canvas->canvas_item_set_visible(p_item,p_visible); - -} -void VisualServerRaster::canvas_item_set_light_mask(RID p_item,int p_mask){ - - VSG::canvas->canvas_item_set_light_mask(p_item,p_mask); - -} - -void VisualServerRaster::canvas_item_set_transform(RID p_item, const Matrix32& p_transform){ - - VSG::canvas->canvas_item_set_transform(p_item,p_transform); - -} -void VisualServerRaster::canvas_item_set_clip(RID p_item, bool p_clip){ - - VSG::canvas->canvas_item_set_clip(p_item,p_clip); - -} -void VisualServerRaster::canvas_item_set_distance_field_mode(RID p_item, bool p_enable){ - - VSG::canvas->canvas_item_set_distance_field_mode(p_item,p_enable); - -} -void VisualServerRaster::canvas_item_set_custom_rect(RID p_item, bool p_custom_rect,const Rect2& p_rect){ - - VSG::canvas->canvas_item_set_custom_rect(p_item,p_custom_rect,p_rect); - -} -void VisualServerRaster::canvas_item_set_modulate(RID p_item, const Color& p_color){ - - VSG::canvas->canvas_item_set_modulate(p_item,p_color); - -} -void VisualServerRaster::canvas_item_set_self_modulate(RID p_item, const Color& p_color){ - - VSG::canvas->canvas_item_set_self_modulate(p_item,p_color); - -} - -void VisualServerRaster::canvas_item_set_draw_behind_parent(RID p_item, bool p_enable){ - - VSG::canvas->canvas_item_set_draw_behind_parent(p_item,p_enable); - -} - - -void VisualServerRaster::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){ - - VSG::canvas->canvas_item_add_line(p_item,p_from,p_to,p_color,p_width,p_antialiased); - -} -void VisualServerRaster::canvas_item_add_rect(RID p_item, const Rect2& p_rect, const Color& p_color){ - - VSG::canvas->canvas_item_add_rect(p_item,p_rect,p_color); - -} -void VisualServerRaster::canvas_item_add_circle(RID p_item, const Point2& p_pos, float p_radius,const Color& p_color){ - - VSG::canvas->canvas_item_add_circle(p_item,p_pos,p_radius,p_color); - -} -void VisualServerRaster::canvas_item_add_texture_rect(RID p_item, const Rect2& p_rect, RID p_texture,bool p_tile,const Color& p_modulate,bool p_transpose){ - - VSG::canvas->canvas_item_add_texture_rect(p_item,p_rect,p_texture,p_tile,p_modulate,p_transpose); - -} -void VisualServerRaster::canvas_item_add_texture_rect_region(RID p_item, const Rect2& p_rect, RID p_texture,const Rect2& p_src_rect,const Color& p_modulate,bool p_transpose){ - - VSG::canvas->canvas_item_add_texture_rect_region(p_item,p_rect,p_texture,p_src_rect,p_modulate,p_transpose); - -} -void VisualServerRaster::canvas_item_add_nine_patch(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector2& p_topleft, const Vector2& p_bottomright,NinePatchAxisMode p_x_axis_mode, NinePatchAxisMode p_y_axis_mode,bool p_draw_center,const Color& p_modulate){ - - VSG::canvas->canvas_item_add_nine_patch(p_item,p_rect,p_source,p_texture,p_topleft,p_bottomright,p_x_axis_mode,p_y_axis_mode,p_draw_center,p_modulate); - -} -void VisualServerRaster::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){ - - VSG::canvas->canvas_item_add_primitive(p_item,p_points,p_colors,p_uvs,p_texture,p_width); - -} -void VisualServerRaster::canvas_item_add_polygon(RID p_item, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture){ - - VSG::canvas->canvas_item_add_polygon(p_item,p_points,p_colors,p_uvs,p_texture); - -} -void VisualServerRaster::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, RID p_texture, int p_count){ - - VSG::canvas->canvas_item_add_triangle_array(p_item,p_indices,p_points,p_colors,p_uvs,p_texture,p_count); - -} -void VisualServerRaster::canvas_item_add_mesh(RID p_item, const RID& p_mesh,RID p_skeleton){ - - VSG::canvas->canvas_item_add_mesh(p_item,p_mesh,p_skeleton); - -} -void VisualServerRaster::canvas_item_add_multimesh(RID p_item, RID p_mesh,RID p_skeleton){ - - VSG::canvas->canvas_item_add_multimesh(p_item,p_mesh,p_skeleton); - -} -void VisualServerRaster::canvas_item_add_set_transform(RID p_item,const Matrix32& p_transform){ - - VSG::canvas->canvas_item_add_set_transform(p_item,p_transform); - -} -void VisualServerRaster::canvas_item_add_clip_ignore(RID p_item, bool p_ignore){ - - VSG::canvas->canvas_item_add_clip_ignore(p_item,p_ignore); - -} -void VisualServerRaster::canvas_item_set_sort_children_by_y(RID p_item, bool p_enable){ - - VSG::canvas->canvas_item_set_sort_children_by_y(p_item,p_enable); - -} -void VisualServerRaster::canvas_item_set_z(RID p_item, int p_z){ - - VSG::canvas->canvas_item_set_z(p_item,p_z); - -} -void VisualServerRaster::canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable){ - - VSG::canvas->canvas_item_set_z_as_relative_to_parent(p_item,p_enable); - -} -void VisualServerRaster::canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable,const Rect2& p_rect){ - - VSG::canvas->canvas_item_set_copy_to_backbuffer(p_item,p_enable,p_rect); - -} - -void VisualServerRaster::canvas_item_clear(RID p_item){ - - VSG::canvas->canvas_item_clear(p_item); - -} -void VisualServerRaster::canvas_item_set_draw_index(RID p_item,int p_index){ - - VSG::canvas->canvas_item_set_draw_index(p_item,p_index); - -} - -void VisualServerRaster::canvas_item_set_material(RID p_item, RID p_material){ - - VSG::canvas->canvas_item_set_material(p_item,p_material); - -} - -void VisualServerRaster::canvas_item_set_use_parent_material(RID p_item, bool p_enable) { - - VSG::canvas->canvas_item_set_use_parent_material(p_item,p_enable); -} - -RID VisualServerRaster::canvas_light_create(){ - - return VSG::canvas->canvas_light_create(); -} - -void VisualServerRaster::canvas_light_attach_to_canvas(RID p_light,RID p_canvas){ - - VSG::canvas->canvas_light_attach_to_canvas(p_light,p_canvas); - -} -void VisualServerRaster::canvas_light_set_enabled(RID p_light, bool p_enabled){ - - VSG::canvas->canvas_light_set_enabled(p_light,p_enabled); - -} -void VisualServerRaster::canvas_light_set_scale(RID p_light, float p_scale){ - - VSG::canvas->canvas_light_set_scale(p_light,p_scale); - -} -void VisualServerRaster::canvas_light_set_transform(RID p_light, const Matrix32& p_transform){ - - VSG::canvas->canvas_light_set_transform(p_light,p_transform); - -} -void VisualServerRaster::canvas_light_set_texture(RID p_light, RID p_texture){ - - VSG::canvas->canvas_light_set_texture(p_light,p_texture); - -} -void VisualServerRaster::canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset){ - - VSG::canvas->canvas_light_set_texture_offset(p_light,p_offset); - -} -void VisualServerRaster::canvas_light_set_color(RID p_light, const Color& p_color){ - - VSG::canvas->canvas_light_set_color(p_light,p_color); - -} -void VisualServerRaster::canvas_light_set_height(RID p_light, float p_height){ - - VSG::canvas->canvas_light_set_height(p_light,p_height); - -} -void VisualServerRaster::canvas_light_set_energy(RID p_light, float p_energy){ - - VSG::canvas->canvas_light_set_energy(p_light,p_energy); - -} -void VisualServerRaster::canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z){ - - VSG::canvas->canvas_light_set_z_range(p_light,p_min_z,p_max_z); - -} -void VisualServerRaster::canvas_light_set_layer_range(RID p_light, int p_min_layer,int p_max_layer){ - - VSG::canvas->canvas_light_set_layer_range(p_light,p_min_layer,p_max_layer); - -} -void VisualServerRaster::canvas_light_set_item_cull_mask(RID p_light, int p_mask){ - - VSG::canvas->canvas_light_set_item_cull_mask(p_light,p_mask); - -} -void VisualServerRaster::canvas_light_set_item_shadow_cull_mask(RID p_light, int p_mask){ - - VSG::canvas->canvas_light_set_item_shadow_cull_mask(p_light,p_mask); - -} - -void VisualServerRaster::canvas_light_set_mode(RID p_light, CanvasLightMode p_mode){ - - VSG::canvas->canvas_light_set_mode(p_light,p_mode); - -} - - -void VisualServerRaster::canvas_light_set_shadow_enabled(RID p_light, bool p_enabled) { - - VSG::canvas->canvas_light_set_shadow_enabled(p_light,p_enabled); - -} -void VisualServerRaster::canvas_light_set_shadow_buffer_size(RID p_light, int p_size) { - - VSG::canvas->canvas_light_set_shadow_buffer_size(p_light,p_size); - -} -void VisualServerRaster::canvas_light_set_shadow_gradient_length(RID p_light, float p_length) { - - VSG::canvas->canvas_light_set_shadow_gradient_length(p_light,p_length); - -} -void VisualServerRaster::canvas_light_set_shadow_filter(RID p_light, CanvasLightShadowFilter p_filter){ - - VSG::canvas->canvas_light_set_shadow_filter(p_light,p_filter); - -} -void VisualServerRaster::canvas_light_set_shadow_color(RID p_light, const Color& p_color){ - - VSG::canvas->canvas_light_set_shadow_color(p_light,p_color); - -} - - - -RID VisualServerRaster::canvas_light_occluder_create() { - - return VSG::canvas->canvas_light_occluder_create(); -} - -void VisualServerRaster::canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas){ - - VSG::canvas->canvas_light_occluder_attach_to_canvas(p_occluder,p_canvas); - -} -void VisualServerRaster::canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled) { - - VSG::canvas->canvas_light_occluder_set_enabled(p_occluder,p_enabled); - -} -void VisualServerRaster::canvas_light_occluder_set_polygon(RID p_occluder,RID p_polygon){ - - VSG::canvas->canvas_light_occluder_set_polygon(p_occluder,p_polygon); - -} -void VisualServerRaster::canvas_light_occluder_set_transform(RID p_occluder,const Matrix32& p_xform){ - - VSG::canvas->canvas_light_occluder_set_transform(p_occluder,p_xform); - -} -void VisualServerRaster::canvas_light_occluder_set_light_mask(RID p_occluder,int p_mask){ - - VSG::canvas->canvas_light_occluder_set_light_mask(p_occluder,p_mask); - -} - -RID VisualServerRaster::canvas_occluder_polygon_create() { - - return VSG::canvas->canvas_occluder_polygon_create(); -} -void VisualServerRaster::canvas_occluder_polygon_set_shape(RID p_occluder_polygon,const DVector<Vector2>& p_shape,bool p_closed){ - - VSG::canvas->canvas_occluder_polygon_set_shape(p_occluder_polygon,p_shape,p_closed); -} -void VisualServerRaster::canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const DVector<Vector2>& p_shape){ - - VSG::canvas->canvas_occluder_polygon_set_shape_as_lines(p_occluder_polygon,p_shape); - -} - - -void VisualServerRaster::canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon,CanvasOccluderPolygonCullMode p_mode){ - - VSG::canvas->canvas_occluder_polygon_set_cull_mode(p_occluder_polygon,p_mode); - -} - - /* CURSOR */ void VisualServerRaster::cursor_set_rotation(float p_rotation, int p_cursor ){ @@ -1224,7 +257,7 @@ void VisualServerRaster::draw(){ //if (changes) // print_line("changes: "+itos(changes)); -// changes=0; + changes=0; VSG::rasterizer->begin_frame(); VSG::viewport->draw_viewports(); //_draw_cursors_and_margins(); @@ -1236,7 +269,7 @@ void VisualServerRaster::sync(){ } bool VisualServerRaster::has_changed() const{ - return false; + return changes>0; } void VisualServerRaster::init(){ diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 4cad03928b..cd6d7b38d3 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -34,7 +34,9 @@ #include "servers/visual/rasterizer.h" #include "allocators.h" #include "octree.h" - +#include "visual_server_global.h" +#include "visual_server_viewport.h" +#include "visual_server_canvas.h" /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -139,7 +141,7 @@ class VisualServerRaster : public VisualServer { Transform transform; - Camera() { + Camera() { visible_layers=0xFFFFFFFF; fov=60; @@ -148,8 +150,8 @@ class VisualServerRaster : public VisualServer { size=1.0; vaspect=false; - } - }; + } + }; struct Instance; @@ -580,188 +582,209 @@ class VisualServerRaster : public VisualServer { public: +#define DISPLAY_CHANGED changes++; + +#define BIND0R(m_r,m_name) m_r m_name() { return BINDBASE->m_name(); } +#define BIND1R(m_r,m_name,m_type1) m_r m_name(m_type1 arg1) { return BINDBASE->m_name(arg1); } +#define BIND1RC(m_r,m_name,m_type1) m_r m_name(m_type1 arg1) const { return BINDBASE->m_name(arg1); } +#define BIND2RC(m_r,m_name,m_type1,m_type2) m_r m_name(m_type1 arg1,m_type2 arg2) const { return BINDBASE->m_name(arg1,arg2); } +#define BIND3RC(m_r,m_name,m_type1,m_type2,m_type3) m_r m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3) const { return BINDBASE->m_name(arg1,arg2,arg3); } +#define BIND4RC(m_r,m_name,m_type1,m_type2,m_type3,m_type4) m_r m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4) const { return BINDBASE->m_name(arg1,arg2,arg3,arg4); } + +#define BIND1(m_name,m_type1) void m_name(m_type1 arg1) { DISPLAY_CHANGED BINDBASE->m_name(arg1); } +#define BIND2(m_name,m_type1,m_type2) void m_name(m_type1 arg1,m_type2 arg2) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2); } +#define BIND2C(m_name,m_type1,m_type2) void m_name(m_type1 arg1,m_type2 arg2) const { BINDBASE->m_name(arg1,arg2); } +#define BIND3(m_name,m_type1,m_type2,m_type3) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3); } +#define BIND4(m_name,m_type1,m_type2,m_type3,m_type4) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4); } +#define BIND5(m_name,m_type1,m_type2,m_type3,m_type4,m_type5) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5); } +#define BIND6(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6); } +#define BIND7(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6,m_type7) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6,m_type7 arg7) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6,arg7); } +#define BIND8(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6,m_type7,m_type8) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6,m_type7 arg7,m_type8 arg8) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); } +#define BIND10(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6,m_type7,m_type8,m_type9,m_type10) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6,m_type7 arg7,m_type8 arg8,m_type9 arg9,m_type10 arg10) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); } + +//from now on, calls forwarded to this singleton +#define BINDBASE VSG::storage /* TEXTURE API */ - virtual RID texture_create(); - virtual void texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags=TEXTURE_FLAGS_DEFAULT); - virtual void texture_set_data(RID p_texture,const Image& p_image,CubeMapSide p_cube_side=CUBEMAP_LEFT); - virtual Image texture_get_data(RID p_texture,CubeMapSide p_cube_side=CUBEMAP_LEFT) const; - virtual void texture_set_flags(RID p_texture,uint32_t p_flags) ; - virtual uint32_t texture_get_flags(RID p_texture) const; - virtual Image::Format texture_get_format(RID p_texture) const; - virtual uint32_t texture_get_width(RID p_texture) const; - virtual uint32_t texture_get_height(RID p_texture) const; - virtual void texture_set_size_override(RID p_texture,int p_width, int p_height); + BIND0R(RID,texture_create) + BIND5(texture_allocate,RID,int,int,Image::Format,uint32_t) + BIND3(texture_set_data,RID,const Image&,CubeMapSide) + BIND2RC(Image,texture_get_data,RID,CubeMapSide) + BIND2(texture_set_flags,RID,uint32_t) + BIND1RC(uint32_t,texture_get_flags,RID) + BIND1RC(Image::Format,texture_get_format,RID) + BIND1RC(uint32_t,texture_get_width,RID) + BIND1RC(uint32_t,texture_get_height,RID) + BIND3(texture_set_size_override,RID,int,int) - virtual void texture_set_path(RID p_texture,const String& p_path); - virtual String texture_get_path(RID p_texture) const; - virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable); + BIND2(texture_set_path,RID,const String&) + BIND1RC(String,texture_get_path,RID) + BIND1(texture_set_shrink_all_x2_on_set_data,bool) + BIND1(texture_debug_usage,List<TextureInfo>*) - virtual void texture_debug_usage(List<TextureInfo> *r_info); /* SHADER API */ + BIND1R(RID,shader_create,ShaderMode) - virtual RID shader_create(ShaderMode p_mode=SHADER_SPATIAL); - virtual void shader_set_mode(RID p_shader,ShaderMode p_mode); - virtual ShaderMode shader_get_mode(RID p_shader) const; + BIND2(shader_set_mode,RID,ShaderMode) + BIND1RC(ShaderMode,shader_get_mode,RID) - virtual void shader_set_code(RID p_shader, const String& p_code); - virtual String shader_get_code(RID p_shader) const; - virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const; + BIND2(shader_set_code,RID,const String&) + BIND1RC(String,shader_get_code,RID) - virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture); - virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const; + BIND2C(shader_get_param_list,RID, List<PropertyInfo> *) + + BIND3(shader_set_default_texture_param,RID,const StringName&,RID) + BIND2RC(RID,shader_get_default_texture_param,RID,const StringName&) /* COMMON MATERIAL API */ - virtual RID material_create(); + BIND0R(RID,material_create) - virtual void material_set_shader(RID p_shader_material, RID p_shader); - virtual RID material_get_shader(RID p_shader_material) const; + BIND2(material_set_shader,RID,RID) + BIND1RC(RID,material_get_shader,RID) - virtual void material_set_param(RID p_material, const StringName& p_param, const Variant& p_value); - virtual Variant material_get_param(RID p_material, const StringName& p_param) const; + BIND3(material_set_param,RID, const StringName&, const Variant& ) + BIND2RC(Variant,material_get_param,RID, const StringName& ) /* MESH API */ - virtual RID mesh_create(); - - virtual void mesh_add_surface(RID p_mesh,uint32_t p_format,PrimitiveType p_primitive,const DVector<uint8_t>& p_array,int p_vertex_count,const DVector<uint8_t>& p_index_array,int p_index_count,const Vector<DVector<uint8_t> >& p_blend_shapes=Vector<DVector<uint8_t> >()); + BIND0R(RID,mesh_create) - virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount); - virtual int mesh_get_morph_target_count(RID p_mesh) const; + BIND8(mesh_add_surface,RID,uint32_t,PrimitiveType,const DVector<uint8_t>&,int ,const DVector<uint8_t>& ,int ,const Vector<DVector<uint8_t> >& ) + BIND2(mesh_set_morph_target_count,RID,int) + BIND1RC(int,mesh_get_morph_target_count,RID) - virtual void mesh_set_morph_target_mode(RID p_mesh,MorphTargetMode p_mode); - virtual MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const; - virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material); - virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const; + BIND2(mesh_set_morph_target_mode,RID,MorphTargetMode) + BIND1RC(MorphTargetMode, mesh_get_morph_target_mode,RID ) - virtual int mesh_surface_get_array_len(RID p_mesh, int p_surface) const; - virtual int mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const; + BIND3(mesh_surface_set_material,RID, int , RID ) + BIND2RC(RID,mesh_surface_get_material,RID, int ) - virtual DVector<uint8_t> mesh_surface_get_array(RID p_mesh, int p_surface) const; - virtual DVector<uint8_t> mesh_surface_get_index_array(RID p_mesh, int p_surface) const; + BIND2RC(int,mesh_surface_get_array_len,RID,int) + BIND2RC(int,mesh_surface_get_array_index_len,RID,int) + BIND2RC(DVector<uint8_t>,mesh_surface_get_array,RID,int) + BIND2RC(DVector<uint8_t>,mesh_surface_get_index_array,RID, int) - virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const; - virtual PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const; + BIND2RC(uint32_t,mesh_surface_get_format,RID,int) + BIND2RC(PrimitiveType,mesh_surface_get_primitive_type,RID,int) - virtual void mesh_remove_surface(RID p_mesh,int p_index); - virtual int mesh_get_surface_count(RID p_mesh) const; + BIND2(mesh_remove_surface,RID,int) + BIND1RC(int,mesh_get_surface_count,RID) - virtual void mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb); - virtual AABB mesh_get_custom_aabb(RID p_mesh) const; + BIND2(mesh_set_custom_aabb,RID,const AABB&) + BIND1RC(AABB,mesh_get_custom_aabb,RID) - virtual void mesh_clear(RID p_mesh); + BIND1(mesh_clear,RID) /* MULTIMESH API */ - virtual RID multimesh_create(); + BIND0R(RID,multimesh_create) - virtual void multimesh_allocate(RID p_multimesh,int p_instances,MultimeshTransformFormat p_transform_format,MultimeshColorFormat p_color_format,bool p_gen_aabb=true); - virtual int multimesh_get_instance_count(RID p_multimesh) const; + BIND5(multimesh_allocate,RID,int,MultimeshTransformFormat,MultimeshColorFormat,bool) + BIND1RC(int,multimesh_get_instance_count,RID) - virtual void multimesh_set_mesh(RID p_multimesh,RID p_mesh); - virtual void multimesh_set_custom_aabb(RID p_multimesh,const AABB& p_aabb); - virtual void multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform); - virtual void multimesh_instance_set_transform_2d(RID p_multimesh,int p_index,const Matrix32& p_transform); - virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color); + BIND2(multimesh_set_mesh,RID,RID) + BIND2(multimesh_set_custom_aabb,RID,const AABB&) + BIND3(multimesh_instance_set_transform,RID,int,const Transform&) + BIND3(multimesh_instance_set_transform_2d,RID,int,const Matrix32& ) + BIND3(multimesh_instance_set_color,RID,int,const Color&) - virtual RID multimesh_get_mesh(RID p_multimesh) const; - virtual AABB multimesh_get_custom_aabb(RID p_multimesh,const AABB& p_aabb) const; + BIND1RC(RID,multimesh_get_mesh,RID) + BIND1RC(AABB,multimesh_get_custom_aabb,RID) - virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const; - virtual Matrix32 multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const; - virtual Color multimesh_instance_get_color(RID p_multimesh,int p_index) const; + BIND2RC(Transform,multimesh_instance_get_transform,RID,int ) + BIND2RC(Matrix32,multimesh_instance_get_transform_2d,RID,int) + BIND2RC(Color,multimesh_instance_get_color,RID,int) - virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible); - virtual int multimesh_get_visible_instances(RID p_multimesh) const; + BIND2(multimesh_set_visible_instances,RID,int) + BIND1RC(int,multimesh_get_visible_instances,RID) /* IMMEDIATE API */ - virtual RID immediate_create(); - virtual void immediate_begin(RID p_immediate,PrimitiveType p_rimitive,RID p_texture=RID()); - virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex); - virtual void immediate_vertex_2d(RID p_immediate,const Vector3& p_vertex); - virtual void immediate_normal(RID p_immediate,const Vector3& p_normal); - virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent); - virtual void immediate_color(RID p_immediate,const Color& p_color); - virtual void immediate_uv(RID p_immediate,const Vector2& tex_uv); - virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv); - virtual void immediate_end(RID p_immediate); - virtual void immediate_clear(RID p_immediate); - virtual void immediate_set_material(RID p_immediate,RID p_material); - virtual RID immediate_get_material(RID p_immediate) const; + BIND0R(RID,immediate_create) + BIND3(immediate_begin,RID,PrimitiveType,RID) + BIND2(immediate_vertex,RID,const Vector3&) + BIND2(immediate_vertex_2d,RID,const Vector3&) + BIND2(immediate_normal,RID,const Vector3&) + BIND2(immediate_tangent,RID,const Plane&) + BIND2(immediate_color,RID,const Color&) + BIND2(immediate_uv,RID,const Vector2& ) + BIND2(immediate_uv2,RID,const Vector2&) + BIND1(immediate_end,RID) + BIND1(immediate_clear,RID) + BIND2(immediate_set_material,RID ,RID ) + BIND1RC(RID,immediate_get_material,RID) /* SKELETON API */ - virtual RID skeleton_create(); - virtual void skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton=false); - virtual int skeleton_get_bone_count(RID p_skeleton) const; - virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform); - virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone); - virtual void skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Matrix32& p_transform); - virtual Matrix32 skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone); + BIND0R(RID,skeleton_create) + BIND3(skeleton_allocate,RID,int,bool) + BIND1RC(int,skeleton_get_bone_count,RID) + BIND3(skeleton_bone_set_transform,RID,int,const Transform&) + BIND2RC(Transform,skeleton_bone_get_transform,RID,int) + BIND3(skeleton_bone_set_transform_2d,RID,int, const Matrix32& ) + BIND2RC(Matrix32,skeleton_bone_get_transform_2d,RID,int) /* Light API */ - virtual RID light_create(LightType p_type); - - virtual void light_set_color(RID p_light,const Color& p_color); - virtual void light_set_param(RID p_light,LightParam p_param,float p_value); - virtual void light_set_shadow(RID p_light,bool p_enabled); - virtual void light_set_projector(RID p_light,RID p_texture); - virtual void light_set_attenuation_texure(RID p_light,RID p_texture); - virtual void light_set_negative(RID p_light,bool p_enable); - virtual void light_set_cull_mask(RID p_light,uint32_t p_mask); - virtual void light_set_shader(RID p_light,RID p_shader); + BIND1R(RID,light_create,LightType) + BIND2(light_set_color,RID,const Color&) + BIND3(light_set_param,RID ,LightParam ,float ) + BIND2(light_set_shadow,RID ,bool ) + BIND2(light_set_projector,RID,RID ) + BIND2(light_set_attenuation_texure,RID,RID ) + BIND2(light_set_negative,RID,bool ) + BIND2(light_set_cull_mask,RID ,uint32_t ) + BIND2(light_set_shader,RID ,RID ) - virtual void light_directional_set_shadow_mode(RID p_light,LightDirectionalShadowMode p_mode); + BIND2(light_directional_set_shadow_mode,RID,LightDirectionalShadowMode) /* PROBE API */ - virtual RID reflection_probe_create(); + BIND0R(RID,reflection_probe_create) - virtual void reflection_probe_set_intensity(RID p_probe, float p_intensity); - virtual void reflection_probe_set_clip(RID p_probe, float p_near, float p_far); - virtual void reflection_probe_set_min_blend_distance(RID p_probe, float p_distance); - virtual void reflection_probe_set_extents(RID p_probe, const Vector3& p_extents); - virtual void reflection_probe_set_origin_offset(RID p_probe, const Vector3& p_offset); - virtual void reflection_probe_set_enable_parallax_correction(RID p_probe, bool p_enable); - virtual void reflection_probe_set_resolution(RID p_probe, int p_resolution); - virtual void reflection_probe_set_hide_skybox(RID p_probe, bool p_hide); - virtual void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers); + BIND2(reflection_probe_set_intensity,RID, float ) + BIND3(reflection_probe_set_clip,RID, float , float ) + BIND2(reflection_probe_set_min_blend_distance,RID, float ) + BIND2(reflection_probe_set_extents,RID, const Vector3& ) + BIND2(reflection_probe_set_origin_offset,RID, const Vector3& ) + BIND2(reflection_probe_set_enable_parallax_correction,RID, bool ) + BIND2(reflection_probe_set_resolution,RID, int ) + BIND2(reflection_probe_set_hide_skybox,RID, bool ) + BIND2(reflection_probe_set_cull_mask,RID, uint32_t ) /* ROOM API */ - virtual RID room_create(); - virtual void room_add_bounds(RID p_room, const DVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform); - virtual void room_clear_bounds(); + BIND0R(RID,room_create) + BIND4(room_add_bounds,RID, const DVector<Vector2>& ,float ,const Transform& ) + BIND1(room_clear_bounds,RID) /* PORTAL API */ // portals are only (x/y) points, forming a convex shape, which its clockwise // order points outside. (z is 0); - virtual RID portal_create(); - virtual void portal_set_shape(RID p_portal, const Vector<Point2>& p_shape); - virtual void portal_set_enabled(RID p_portal, bool p_enabled); - virtual void portal_set_disable_distance(RID p_portal, float p_distance); - virtual void portal_set_disabled_color(RID p_portal, const Color& p_color); + BIND0R(RID,portal_create) + BIND2(portal_set_shape,RID , const Vector<Point2>& ) + BIND2(portal_set_enabled,RID , bool ) + BIND2(portal_set_disable_distance,RID , float ) + BIND2(portal_set_disabled_color,RID , const Color& ) /* CAMERA API */ @@ -773,40 +796,44 @@ public: virtual void camera_set_environment(RID p_camera,RID p_env); virtual void camera_set_use_vertical_aspect(RID p_camera,bool p_enable); +#undef BINDBASE +//from now on, calls forwarded to this singleton +#define BINDBASE VSG::viewport /* VIEWPORT TARGET API */ - virtual RID viewport_create(); + BIND0R(RID,viewport_create) - virtual void viewport_set_size(RID p_viewport,int p_width,int p_height); + BIND3(viewport_set_size,RID,int ,int ) - virtual void viewport_set_active(RID p_viewport,bool p_active); + BIND2(viewport_set_active,RID ,bool ) - virtual void viewport_set_clear_mode(RID p_viewport,ViewportClearMode p_clear_mode); + BIND2(viewport_set_clear_mode,RID,ViewportClearMode ) - virtual void viewport_attach_to_screen(RID p_viewport,const Rect2& p_rect=Rect2(),int p_screen=0); - virtual void viewport_detach(RID p_viewport); + BIND3(viewport_attach_to_screen,RID ,const Rect2& ,int ) + BIND1(viewport_detach,RID) - virtual void viewport_set_update_mode(RID p_viewport,ViewportUpdateMode p_mode); - virtual void viewport_set_vflip(RID p_viewport,bool p_enable); + BIND2(viewport_set_update_mode,RID,ViewportUpdateMode ) + BIND2(viewport_set_vflip,RID,bool) - virtual RID viewport_get_texture(RID p_viewport) const; - virtual Image viewport_capture(RID p_viewport) const; + BIND1RC(RID,viewport_get_texture,RID ) + BIND1RC(Image,viewport_capture,RID ) - virtual void viewport_set_hide_scenario(RID p_viewport,bool p_hide); - virtual void viewport_set_hide_canvas(RID p_viewport,bool p_hide); - virtual void viewport_set_disable_environment(RID p_viewport,bool p_disable); + BIND2(viewport_set_hide_scenario,RID,bool ) + BIND2(viewport_set_hide_canvas,RID,bool ) + BIND2(viewport_set_disable_environment,RID,bool ) - virtual void viewport_attach_camera(RID p_viewport,RID p_camera); - virtual void viewport_set_scenario(RID p_viewport,RID p_scenario); - virtual void viewport_attach_canvas(RID p_viewport,RID p_canvas); - virtual void viewport_remove_canvas(RID p_viewport,RID p_canvas); - virtual void viewport_set_canvas_transform(RID p_viewport,RID p_canvas,const Matrix32& p_offset); - virtual void viewport_set_transparent_background(RID p_viewport,bool p_enabled); + BIND2(viewport_attach_camera,RID,RID ) + BIND2(viewport_set_scenario,RID,RID ) + BIND2(viewport_attach_canvas,RID,RID ) - virtual void viewport_set_global_canvas_transform(RID p_viewport,const Matrix32& p_transform); - virtual void viewport_set_canvas_layer(RID p_viewport,RID p_canvas,int p_layer); + BIND2(viewport_remove_canvas,RID,RID ) + BIND3(viewport_set_canvas_transform,RID ,RID ,const Matrix32& ) + BIND2(viewport_set_transparent_background,RID ,bool ) + + BIND2(viewport_set_global_canvas_transform,RID,const Matrix32& ) + BIND3(viewport_set_canvas_layer,RID ,RID ,int ) /* ENVIRONMENT API */ @@ -872,93 +899,99 @@ public: virtual void instance_geometry_set_draw_range(RID p_instance,float p_min,float p_max,float p_min_margin,float p_max_margin); virtual void instance_geometry_set_as_instance_lod(RID p_instance,RID p_as_lod_of_instance); + +#undef BINDBASE +//from now on, calls forwarded to this singleton +#define BINDBASE VSG::canvas + /* CANVAS (2D) */ - virtual RID canvas_create(); - virtual void canvas_set_item_mirroring(RID p_canvas,RID p_item,const Point2& p_mirroring); - virtual void canvas_set_modulate(RID p_canvas,const Color& p_color); + BIND0R(RID,canvas_create) + BIND3(canvas_set_item_mirroring,RID ,RID ,const Point2& ) + BIND2(canvas_set_modulate,RID,const Color&) - virtual RID canvas_item_create(); - virtual void canvas_item_set_parent(RID p_item,RID p_parent); + BIND0R(RID,canvas_item_create) + BIND2(canvas_item_set_parent,RID ,RID) - virtual void canvas_item_set_visible(RID p_item,bool p_visible); - virtual void canvas_item_set_light_mask(RID p_item,int p_mask); + BIND2(canvas_item_set_visible,RID,bool ) + BIND2(canvas_item_set_light_mask,RID,int ) - virtual void canvas_item_set_transform(RID p_item, const Matrix32& p_transform); - virtual void canvas_item_set_clip(RID p_item, bool p_clip); - virtual void canvas_item_set_distance_field_mode(RID p_item, bool p_enable); - virtual void canvas_item_set_custom_rect(RID p_item, bool p_custom_rect,const Rect2& p_rect=Rect2()); - virtual void canvas_item_set_modulate(RID p_item, const Color& p_color); - virtual void canvas_item_set_self_modulate(RID p_item, const Color& p_color); + BIND2(canvas_item_set_transform,RID, const Matrix32& ) + BIND2(canvas_item_set_clip,RID, bool ) + BIND2(canvas_item_set_distance_field_mode,RID, bool ) + BIND3(canvas_item_set_custom_rect,RID, bool ,const Rect2& ) + BIND2(canvas_item_set_modulate,RID, const Color& ) + BIND2(canvas_item_set_self_modulate,RID, const Color& ) - virtual void canvas_item_set_draw_behind_parent(RID p_item, bool p_enable); + BIND2(canvas_item_set_draw_behind_parent,RID, bool ) - virtual void canvas_item_add_line(RID p_item, const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width=1.0,bool p_antialiased=false); - virtual void canvas_item_add_rect(RID p_item, const Rect2& p_rect, const Color& p_color); - virtual void canvas_item_add_circle(RID p_item, const Point2& p_pos, float p_radius,const Color& p_color); - virtual void canvas_item_add_texture_rect(RID p_item, const Rect2& p_rect, RID p_texture,bool p_tile=false,const Color& p_modulate=Color(1,1,1),bool p_transpose=false); - virtual void canvas_item_add_texture_rect_region(RID p_item, const Rect2& p_rect, RID p_texture,const Rect2& p_src_rect,const Color& p_modulate=Color(1,1,1),bool p_transpose=false); - virtual void canvas_item_add_nine_patch(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector2& p_topleft, const Vector2& p_bottomright,NinePatchAxisMode p_x_axis_mode=NINE_PATCH_STRETCH, NinePatchAxisMode p_y_axis_mode=NINE_PATCH_STRETCH,bool p_draw_center=true,const Color& p_modulate=Color(1,1,1)); - 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); - 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()); - 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); - virtual void canvas_item_add_mesh(RID p_item, const RID& p_mesh,RID p_skeleton=RID()); - virtual void canvas_item_add_multimesh(RID p_item, RID p_mesh,RID p_skeleton=RID()); - virtual void canvas_item_add_set_transform(RID p_item,const Matrix32& p_transform); - virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore); - virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable); - virtual void canvas_item_set_z(RID p_item, int p_z); - virtual void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable); - virtual void canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable,const Rect2& p_rect); + BIND6(canvas_item_add_line,RID, const Point2& , const Point2& ,const Color& ,float ,bool ) + BIND3(canvas_item_add_rect,RID, const Rect2& , const Color& ) + BIND4(canvas_item_add_circle,RID, const Point2& , float ,const Color& ) + BIND6(canvas_item_add_texture_rect,RID, const Rect2& , RID ,bool ,const Color& ,bool ) + BIND6(canvas_item_add_texture_rect_region,RID, const Rect2& , RID ,const Rect2& ,const Color& ,bool ) + BIND10(canvas_item_add_nine_patch,RID, const Rect2& , const Rect2& , RID ,const Vector2& , const Vector2& ,NinePatchAxisMode , NinePatchAxisMode,bool ,const Color& ) + BIND6(canvas_item_add_primitive,RID, const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID ,float ) + BIND5(canvas_item_add_polygon,RID, const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID ) + BIND7(canvas_item_add_triangle_array,RID, const Vector<int>& , const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID , int) + BIND3(canvas_item_add_mesh,RID, const RID& ,RID ) + BIND3(canvas_item_add_multimesh,RID, RID ,RID ) + BIND2(canvas_item_add_set_transform,RID,const Matrix32& ) + BIND2(canvas_item_add_clip_ignore,RID, bool ) + BIND2(canvas_item_set_sort_children_by_y,RID, bool ) + BIND2(canvas_item_set_z,RID, int ) + BIND2(canvas_item_set_z_as_relative_to_parent,RID, bool ) + BIND3(canvas_item_set_copy_to_backbuffer,RID, bool ,const Rect2& ) - virtual void canvas_item_clear(RID p_item); - virtual void canvas_item_set_draw_index(RID p_item,int p_index); + BIND1(canvas_item_clear,RID ) + BIND2(canvas_item_set_draw_index,RID,int) - virtual void canvas_item_set_material(RID p_item, RID p_material); + BIND2(canvas_item_set_material,RID, RID ) - virtual void canvas_item_set_use_parent_material(RID p_item, bool p_enable); + BIND2(canvas_item_set_use_parent_material,RID, bool ) - virtual RID canvas_light_create(); - virtual void canvas_light_attach_to_canvas(RID p_light,RID p_canvas); - virtual void canvas_light_set_enabled(RID p_light, bool p_enabled); - virtual void canvas_light_set_scale(RID p_light, float p_scale); - virtual void canvas_light_set_transform(RID p_light, const Matrix32& p_transform); - virtual void canvas_light_set_texture(RID p_light, RID p_texture); - virtual void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset); - virtual void canvas_light_set_color(RID p_light, const Color& p_color); - virtual void canvas_light_set_height(RID p_light, float p_height); - virtual void canvas_light_set_energy(RID p_light, float p_energy); - virtual void canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z); - virtual void canvas_light_set_layer_range(RID p_light, int p_min_layer,int p_max_layer); - virtual void canvas_light_set_item_cull_mask(RID p_light, int p_mask); - virtual void canvas_light_set_item_shadow_cull_mask(RID p_light, int p_mask); - virtual void canvas_light_set_mode(RID p_light, CanvasLightMode p_mode); + BIND0R(RID,canvas_light_create) + BIND2(canvas_light_attach_to_canvas,RID,RID ) + BIND2(canvas_light_set_enabled,RID, bool ) + BIND2(canvas_light_set_scale,RID, float ) + BIND2(canvas_light_set_transform,RID, const Matrix32& ) + BIND2(canvas_light_set_texture,RID, RID ) + BIND2(canvas_light_set_texture_offset,RID, const Vector2& ) + BIND2(canvas_light_set_color,RID, const Color& ) + BIND2(canvas_light_set_height,RID, float ) + BIND2(canvas_light_set_energy,RID, float ) + BIND3(canvas_light_set_z_range,RID, int ,int ) + BIND3(canvas_light_set_layer_range,RID, int ,int ) + BIND2(canvas_light_set_item_cull_mask,RID, int ) + BIND2(canvas_light_set_item_shadow_cull_mask,RID, int ) + BIND2(canvas_light_set_mode,RID, CanvasLightMode ) - virtual void canvas_light_set_shadow_enabled(RID p_light, bool p_enabled); - virtual void canvas_light_set_shadow_buffer_size(RID p_light, int p_size); - virtual void canvas_light_set_shadow_gradient_length(RID p_light, float p_length); - virtual void canvas_light_set_shadow_filter(RID p_light, CanvasLightShadowFilter p_filter); - virtual void canvas_light_set_shadow_color(RID p_light, const Color& p_color); + BIND2(canvas_light_set_shadow_enabled,RID, bool ) + BIND2(canvas_light_set_shadow_buffer_size,RID, int ) + BIND2(canvas_light_set_shadow_gradient_length,RID, float ) + BIND2(canvas_light_set_shadow_filter,RID, CanvasLightShadowFilter ) + BIND2(canvas_light_set_shadow_color,RID, const Color& ) - virtual RID canvas_light_occluder_create(); - virtual void canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas); - virtual void canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled); - virtual void canvas_light_occluder_set_polygon(RID p_occluder,RID p_polygon); - virtual void canvas_light_occluder_set_transform(RID p_occluder,const Matrix32& p_xform); - virtual void canvas_light_occluder_set_light_mask(RID p_occluder,int p_mask); + BIND0R(RID,canvas_light_occluder_create) + BIND2(canvas_light_occluder_attach_to_canvas,RID,RID ) + BIND2(canvas_light_occluder_set_enabled,RID,bool ) + BIND2(canvas_light_occluder_set_polygon,RID,RID ) + BIND2(canvas_light_occluder_set_transform,RID,const Matrix32& ) + BIND2(canvas_light_occluder_set_light_mask,RID,int ) - virtual RID canvas_occluder_polygon_create(); - virtual void canvas_occluder_polygon_set_shape(RID p_occluder_polygon,const DVector<Vector2>& p_shape,bool p_closed); - virtual void canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const DVector<Vector2>& p_shape); + BIND0R(RID,canvas_occluder_polygon_create) + BIND3(canvas_occluder_polygon_set_shape,RID,const DVector<Vector2>& ,bool) + BIND2(canvas_occluder_polygon_set_shape_as_lines,RID ,const DVector<Vector2>&) - virtual void canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon,CanvasOccluderPolygonCullMode p_mode); + + BIND2(canvas_occluder_polygon_set_cull_mode,RID,CanvasOccluderPolygonCullMode) /* CURSOR */ @@ -1005,6 +1038,24 @@ public: VisualServerRaster(); ~VisualServerRaster(); +#undef DISPLAY_CHANGED + +#undef BIND0R +#undef BIND1RC +#undef BIND2RC +#undef BIND3RC +#undef BIND4RC + +#undef BIND1 +#undef BIND2 +#undef BIND3 +#undef BIND4 +#undef BIND5 +#undef BIND6 +#undef BIND7 +#undef BIND8 +#undef BIND10 + }; #endif diff --git a/servers/visual_server.h b/servers/visual_server.h index 918b0b102e..4eb2b2a5fa 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -288,7 +288,7 @@ public: virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color)=0; virtual RID multimesh_get_mesh(RID p_multimesh) const=0; - virtual AABB multimesh_get_custom_aabb(RID p_multimesh,const AABB& p_aabb) const=0; + virtual AABB multimesh_get_custom_aabb(RID p_multimesh) const=0; virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const=0; virtual Matrix32 multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const=0; @@ -320,9 +320,9 @@ public: virtual void skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton=false)=0; virtual int skeleton_get_bone_count(RID p_skeleton) const=0; virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform)=0; - virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone)=0; + virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone) const=0; virtual void skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Matrix32& p_transform)=0; - virtual Matrix32 skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone)=0; + virtual Matrix32 skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone)const =0; /* Light API */ @@ -392,7 +392,7 @@ public: virtual RID room_create()=0; virtual void room_add_bounds(RID p_room, const DVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform)=0; - virtual void room_clear_bounds()=0; + virtual void room_clear_bounds(RID p_room)=0; /* PORTAL API */ |