diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2016-06-18 20:21:21 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2016-06-18 20:23:49 +0200 |
commit | c3bf11d4d48c0499460dc294c6836acedbfd46cb (patch) | |
tree | c92b1b74d310223be732377ed2ac6083c2aa4a99 /scene | |
parent | 80727b68961c0c884b7ce8e84b587e4f0350f385 (diff) |
Drop fully commented-out files
Part of #5272
Diffstat (limited to 'scene')
-rw-r--r-- | scene/register_scene_types.cpp | 24 | ||||
-rw-r--r-- | scene/resources/gibberish_stream.cpp | 3 | ||||
-rw-r--r-- | scene/resources/gibberish_stream.h | 3 | ||||
-rw-r--r-- | scene/resources/volume.cpp | 211 | ||||
-rw-r--r-- | scene/resources/volume.h | 86 |
5 files changed, 7 insertions, 320 deletions
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index b16b4aa56d..c83ab88c73 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -172,7 +172,6 @@ #include "scene/resources/world.h" #include "scene/resources/world_2d.h" -#include "scene/resources/volume.h" #include "scene/resources/sample_library.h" #include "scene/resources/audio_stream.h" @@ -476,31 +475,10 @@ void register_scene_types() { AcceptDialog::set_swap_ok_cancel( GLOBAL_DEF("display/swap_ok_cancel",bool(OS::get_singleton()->get_swap_ok_cancel())) ); ObjectTypeDB::register_type<SamplePlayer>(); - - -// ObjectTypeDB::register_type<StaticBody>(); -// ObjectTypeDB::register_type<RigidBody>(); -// ObjectTypeDB::register_type<CharacterBody>(); -// ObjectTypeDB::register_type<BodyVolumeSphere>(); - //ObjectTypeDB::register_type<BodyVolumeBox>(); - //ObjectTypeDB::register_type<BodyVolumeCylinder>(); - //ObjectTypeDB::register_type<BodyVolumeCapsule>(); - //ObjectTypeDB::register_type<PhysicsJointPin>(); - - - - ObjectTypeDB::register_type<StreamPlayer>(); ObjectTypeDB::register_type<EventPlayer>(); - /* disable types by default, only editors should enable them */ - //ObjectTypeDB::set_type_enabled("BodyVolumeSphere",false); - //ObjectTypeDB::set_type_enabled("BodyVolumeBox",false); - //ObjectTypeDB::set_type_enabled("BodyVolumeCapsule",false); - //ObjectTypeDB::set_type_enabled("BodyVolumeCylinder",false); - //ObjectTypeDB::set_type_enabled("BodyVolumeConvexPolygon",false); - ObjectTypeDB::register_type<CanvasItemMaterial>(); ObjectTypeDB::register_virtual_type<CanvasItem>(); ObjectTypeDB::register_type<Node2D>(); @@ -621,11 +599,11 @@ void register_scene_types() { OS::get_singleton()->yield(); //may take time to init - //ObjectTypeDB::register_type<Volume>(); ObjectTypeDB::register_type<Sample>(); ObjectTypeDB::register_type<SampleLibrary>(); ObjectTypeDB::register_virtual_type<AudioStream>(); ObjectTypeDB::register_virtual_type<AudioStreamPlayback>(); +//TODO: Adapt to the new AudioStream API or drop (GH-3307) // ObjectTypeDB::register_type<AudioStreamGibberish>(); ObjectTypeDB::register_virtual_type<VideoStream>(); diff --git a/scene/resources/gibberish_stream.cpp b/scene/resources/gibberish_stream.cpp index 9d67069a6c..73c135a913 100644 --- a/scene/resources/gibberish_stream.cpp +++ b/scene/resources/gibberish_stream.cpp @@ -29,6 +29,9 @@ #include "gibberish_stream.h" #include "servers/audio_server.h" +//TODO: This class needs to be adapted to the new AudioStream API, +// or dropped if nobody cares about fixing it :) (GH-3307) + #if 0 int AudioStreamGibberish::get_channel_count() const { diff --git a/scene/resources/gibberish_stream.h b/scene/resources/gibberish_stream.h index e06dc5eff2..7affb4bd4d 100644 --- a/scene/resources/gibberish_stream.h +++ b/scene/resources/gibberish_stream.h @@ -29,6 +29,9 @@ #ifndef GIBBERISH_STREAM_H #define GIBBERISH_STREAM_H +//TODO: This class needs to be adapted to the new AudioStream API, +// or dropped if nobody cares about fixing it :) (GH-3307) + #if 0 #include "scene/resources/audio_stream.h" #include "scene/resources/sample_library.h" diff --git a/scene/resources/volume.cpp b/scene/resources/volume.cpp deleted file mode 100644 index 8e056158cb..0000000000 --- a/scene/resources/volume.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/*************************************************************************/ -/* volume.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "volume.h" - -#if 0 -void Volume::_set(const String& p_name, const Variant& p_value) { - - - if (p_name.begins_with("shapes/")) { - - int idx=p_name.get_slice("/",1).to_int()-1; - ERR_FAIL_COND( idx != get_shape_count() ); - - Dictionary shape = p_value; - ERR_FAIL_COND( !shape.has("type") || !shape.has("data")); - String type = shape["type"]; - Variant data=shape["data"]; - Transform transform; - if (shape.has("transform")) - transform=shape["transform"]; - - if (type=="plane") - add_shape(SHAPE_PLANE,data,transform); - else if (type=="sphere") - add_shape(SHAPE_SPHERE,data,transform); - else if (type=="box") - add_shape(SHAPE_BOX,data,transform); - else if (type=="cylinder") - add_shape(SHAPE_CYLINDER,data,transform); - else if (type=="capsule") - add_shape(SHAPE_CAPSULE,data,transform); - else if (type=="convex_polygon") - add_shape(SHAPE_CONVEX_POLYGON,data,transform); - else if (type=="concave_polygon") - add_shape(SHAPE_CONCAVE_POLYGON,data,transform); - else { - ERR_FAIL(); - } - } -} - -Variant Volume::_get(const String& p_name) const { - - if (p_name.begins_with("shapes/")) { - - int idx=p_name.get_slice("/",1).to_int()-1; - ERR_FAIL_INDEX_V( idx, get_shape_count(), Variant() ); - - Dictionary shape; - - switch( get_shape_type(idx) ) { - - case SHAPE_PLANE: shape["type"]="plane"; break; - case SHAPE_SPHERE: shape["type"]="sphere"; break; - case SHAPE_BOX: shape["type"]="box"; break; - case SHAPE_CYLINDER: shape["type"]="cylinder"; break; - case SHAPE_CAPSULE: shape["type"]="capsule"; break; - case SHAPE_CONVEX_POLYGON: shape["type"]="convex_polygon"; break; - case SHAPE_CONCAVE_POLYGON: shape["type"]="concave_polygon"; break; - - } - - shape["transform"]=get_shape_transform(idx); - shape["data"]=get_shape(idx); - - return shape; - } - - return Variant(); -} - -void Volume::_get_property_list( List<PropertyInfo> *p_list) const { - - int count=get_shape_count(); - for(int i=0;i<count;i++) { - - p_list->push_back( PropertyInfo( Variant::DICTIONARY, "shapes/"+itos(i+1)) ); - } -} - - - - - -void Volume::add_shape(ShapeType p_shape_type, const Variant& p_data, const Transform& p_transform) { - - PhysicsServer::get_singleton()->volume_add_shape(volume,(PhysicsServer::ShapeType)p_shape_type,p_data,p_transform); - _change_notify(); -} - - -void Volume::add_plane_shape(const Plane& p_plane,const Transform& p_transform) { - - add_shape(SHAPE_PLANE, p_plane, p_transform ); -} - -void Volume::add_sphere_shape(float p_radius,const Transform& p_transform) { - - add_shape(SHAPE_SPHERE, p_radius, p_transform ); -} - -void Volume::add_box_shape(const Vector3& p_half_extents,const Transform& p_transform) { - - add_shape(SHAPE_BOX, p_half_extents, p_transform ); -} -void Volume::add_cylinder_shape(float p_radius, float p_height,const Transform& p_transform) { - - Dictionary d; - d["radius"]=p_radius; - d["height"]=p_height; - - add_shape(SHAPE_CYLINDER,d,p_transform); -} -void Volume::add_capsule_shape(float p_radius, float p_height,const Transform& p_transform) { - - Dictionary d; - d["radius"]=p_radius; - d["height"]=p_height; - - add_shape(SHAPE_CAPSULE,d,p_transform); -} - - -int Volume::get_shape_count() const { - - return PhysicsServer::get_singleton()->volume_get_shape_count(volume); -} - -Volume::ShapeType Volume::get_shape_type(int p_shape) const { - - return (ShapeType)PhysicsServer::get_singleton()->volume_get_shape_type(volume,p_shape); -} - -Transform Volume::get_shape_transform(int p_shape) const { - - return PhysicsServer::get_singleton()->volume_get_shape_transform(volume,p_shape); -} - -Variant Volume::get_shape(int p_shape) const { - - return PhysicsServer::get_singleton()->volume_get_shape(volume,p_shape); -} - -void Volume::_bind_methods() { - - ObjectTypeDB::bind_method(_MD("add_shape","type","data","transform"),&Volume::add_shape,DEFVAL( Transform() )); - ObjectTypeDB::bind_method(_MD("add_plane_shape","plane","transform"),&Volume::add_plane_shape,DEFVAL( Transform() )); - ObjectTypeDB::bind_method(_MD("add_sphere_shape"),&Volume::add_sphere_shape,DEFVAL( Transform() )); - ObjectTypeDB::bind_method(_MD("add_box_shape","radius","transform"),&Volume::add_box_shape,DEFVAL( Transform() )); - ObjectTypeDB::bind_method(_MD("add_cylinder_shape","radius","height","transform"),&Volume::add_cylinder_shape,DEFVAL( Transform() )); - ObjectTypeDB::bind_method(_MD("add_capsule_shape","radius","height","transform"),&Volume::add_capsule_shape,DEFVAL( Transform() )); - ObjectTypeDB::bind_method(_MD("get_shape_count"),&Volume::get_shape_count); - ObjectTypeDB::bind_method(_MD("get_shape_type","shape_idx"),&Volume::get_shape_type); - ObjectTypeDB::bind_method(_MD("get_shape_transform","shape_idx"),&Volume::get_shape_transform); - ObjectTypeDB::bind_method(_MD("get_shape","shape_idx"),&Volume::get_shape); - - BIND_CONSTANT( SHAPE_PLANE ); - BIND_CONSTANT( SHAPE_SPHERE ); - BIND_CONSTANT( SHAPE_BOX ); - BIND_CONSTANT( SHAPE_CYLINDER ); - BIND_CONSTANT( SHAPE_CAPSULE ); - BIND_CONSTANT( SHAPE_CONVEX_POLYGON ); - BIND_CONSTANT( SHAPE_CONCAVE_POLYGON ); - -} - -RID Volume::get_rid() { - - return volume; -} - -Volume::Volume() { - - volume= PhysicsServer::get_singleton()->volume_create(); - -} - - -Volume::~Volume() { - - PhysicsServer::get_singleton()->free(volume); -} - - -#endif diff --git a/scene/resources/volume.h b/scene/resources/volume.h deleted file mode 100644 index f03e48f1d9..0000000000 --- a/scene/resources/volume.h +++ /dev/null @@ -1,86 +0,0 @@ -/*************************************************************************/ -/* volume.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef VOLUME_H -#define VOLUME_H - -#include "resource.h" - -#if 0 -#include "servers/physics_server.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ -class Volume : public Resource { - - OBJ_TYPE( Volume, Resource ); - RID volume; - -protected: - - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name,Variant &r_ret) const; - void _get_property_list( List<PropertyInfo> *p_list) const; - - static void _bind_methods(); -public: - - enum ShapeType { - SHAPE_PLANE = PhysicsServer::SHAPE_PLANE, ///< plane:"plane" - SHAPE_SPHERE = PhysicsServer::SHAPE_SPHERE, ///< float:"radius" - SHAPE_BOX = PhysicsServer::SHAPE_BOX, ///< vec3:"extents" - SHAPE_CYLINDER = PhysicsServer::SHAPE_CYLINDER, ///< dict(float:"radius", float:"height"):cylinder - SHAPE_CAPSULE = PhysicsServer::SHAPE_CAPSULE, ///< dict(float:"radius", float:"height"):capsule - SHAPE_CONVEX_POLYGON = PhysicsServer::SHAPE_CONVEX_POLYGON, ///< array of planes:"planes" - SHAPE_CONCAVE_POLYGON = PhysicsServer::SHAPE_CONCAVE_POLYGON, ///< vector3 array:"triangles" - }; - - void add_shape(ShapeType p_shape_type, const Variant& p_data, const Transform& p_transform=Transform ()); - - void add_plane_shape(const Plane& p_plane,const Transform& p_transform); - void add_sphere_shape(float p_radius,const Transform& p_transform); - void add_box_shape(const Vector3& p_half_extents,const Transform& p_transform); - void add_cylinder_shape(float p_radius, float p_height,const Transform& p_transform); - void add_capsule_shape(float p_radius, float p_height,const Transform& p_transform); - - int get_shape_count() const; - ShapeType get_shape_type(int p_shape) const; - Transform get_shape_transform(int p_shape) const; - Variant get_shape(int p_shape) const; - - virtual RID get_rid(); - - Volume(); - ~Volume(); - -}; - -VARIANT_ENUM_CAST( Volume::ShapeType ); - -#endif -#endif |