summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/animation.cpp39
-rw-r--r--scene/resources/audio_stream_resampled.cpp388
-rw-r--r--scene/resources/audio_stream_resampled.h166
-rw-r--r--scene/resources/curve.cpp339
-rw-r--r--scene/resources/curve.h50
-rw-r--r--scene/resources/mesh_library.cpp63
-rw-r--r--scene/resources/mesh_library.h14
-rw-r--r--scene/resources/packed_scene.cpp77
-rw-r--r--scene/resources/room.cpp2
-rw-r--r--scene/resources/shader_graph.cpp75
-rw-r--r--scene/resources/shader_graph.h1
-rw-r--r--scene/resources/video_stream.h1
-rw-r--r--scene/resources/world.cpp2
13 files changed, 71 insertions, 1146 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 0328c8c9cd..1a2c8333ef 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -28,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "animation.h"
+
#include "geometry.h"
bool Animation::_set(const StringName &p_name, const Variant &p_value) {
@@ -83,44 +84,6 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) {
TransformTrack *tt = static_cast<TransformTrack *>(tracks[track]);
PoolVector<float> values = p_value;
int vcount = values.size();
-
-#if 0 // old compatibility hack
- if ((vcount%11) == 0) {
-
-
- PoolVector<float>::Read r = values.read();
-
- tt->transforms.resize(vcount/11);
-
-
- for(int i=0;i<(vcount/11);i++) {
-
-
- TKey<TransformKey> &tk=tt->transforms[i];
- const float *ofs=&r[i*11];
- tk.time=ofs[0];
-
- tk.value.loc.x=ofs[1];
- tk.value.loc.y=ofs[2];
- tk.value.loc.z=ofs[3];
-
- tk.value.rot.x=ofs[4];
- tk.value.rot.y=ofs[5];
- tk.value.rot.z=ofs[6];
- tk.value.rot.w=ofs[7];
-
- tk.value.scale.x=ofs[8];
- tk.value.scale.y=ofs[9];
- tk.value.scale.z=ofs[10];
-
-
- }
- return true;
-
-
-
- }
-#endif
ERR_FAIL_COND_V(vcount % 12, false); // shuld be multiple of 11
PoolVector<float>::Read r = values.read();
diff --git a/scene/resources/audio_stream_resampled.cpp b/scene/resources/audio_stream_resampled.cpp
deleted file mode 100644
index 4d0f869f15..0000000000
--- a/scene/resources/audio_stream_resampled.cpp
+++ /dev/null
@@ -1,388 +0,0 @@
-/*************************************************************************/
-/* audio_stream_resampled.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "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 "audio_stream_resampled.h"
-#include "project_settings.h"
-
-#if 0
-int AudioStreamResampled::get_channel_count() const {
-
- if (!rb)
- return 0;
-
- return channels;
-}
-
-
-template<int C>
-uint32_t AudioStreamResampled::_resample(int32_t *p_dest,int p_todo,int32_t p_increment) {
-
- uint32_t read=offset&MIX_FRAC_MASK;
-
- for (int i=0;i<p_todo;i++) {
-
- offset = (offset + p_increment)&(((1<<(rb_bits+MIX_FRAC_BITS))-1));
- read+=p_increment;
- uint32_t pos = offset >> MIX_FRAC_BITS;
- uint32_t frac = offset & MIX_FRAC_MASK;
-#ifndef FAST_AUDIO
- ERR_FAIL_COND_V(pos>=rb_len,0);
-#endif
- uint32_t pos_next = (pos+1)&rb_mask;
- //printf("rb pos %i\n",pos);
-
- // since this is a template with a known compile time value (C), conditionals go away when compiling.
- if (C==1) {
-
- int32_t v0 = rb[pos];
- int32_t v0n=rb[pos_next];
-#ifndef FAST_AUDIO
- v0+=(v0n-v0)*(int32_t)frac >> MIX_FRAC_BITS;
-#endif
- v0<<=16;
- p_dest[i]=v0;
-
- }
- if (C==2) {
-
- int32_t v0 = rb[(pos<<1)+0];
- int32_t v1 = rb[(pos<<1)+1];
- int32_t v0n=rb[(pos_next<<1)+0];
- int32_t v1n=rb[(pos_next<<1)+1];
-
-#ifndef FAST_AUDIO
- v0+=(v0n-v0)*(int32_t)frac >> MIX_FRAC_BITS;
- v1+=(v1n-v1)*(int32_t)frac >> MIX_FRAC_BITS;
-#endif
- v0<<=16;
- v1<<=16;
- p_dest[(i<<1)+0]=v0;
- p_dest[(i<<1)+1]=v1;
-
- }
-
- if (C==4) {
-
- int32_t v0 = rb[(pos<<2)+0];
- int32_t v1 = rb[(pos<<2)+1];
- int32_t v2 = rb[(pos<<2)+2];
- int32_t v3 = rb[(pos<<2)+3];
- int32_t v0n = rb[(pos_next<<2)+0];
- int32_t v1n=rb[(pos_next<<2)+1];
- int32_t v2n=rb[(pos_next<<2)+2];
- int32_t v3n=rb[(pos_next<<2)+3];
-
-#ifndef FAST_AUDIO
- v0+=(v0n-v0)*(int32_t)frac >> MIX_FRAC_BITS;
- v1+=(v1n-v1)*(int32_t)frac >> MIX_FRAC_BITS;
- v2+=(v2n-v2)*(int32_t)frac >> MIX_FRAC_BITS;
- v3+=(v3n-v3)*(int32_t)frac >> MIX_FRAC_BITS;
-#endif
- v0<<=16;
- v1<<=16;
- v2<<=16;
- v3<<=16;
- p_dest[(i<<2)+0]=v0;
- p_dest[(i<<2)+1]=v1;
- p_dest[(i<<2)+2]=v2;
- p_dest[(i<<2)+3]=v3;
-
- }
-
- if (C==6) {
-
- int32_t v0 = rb[(pos*6)+0];
- int32_t v1 = rb[(pos*6)+1];
- int32_t v2 = rb[(pos*6)+2];
- int32_t v3 = rb[(pos*6)+3];
- int32_t v4 = rb[(pos*6)+4];
- int32_t v5 = rb[(pos*6)+5];
- int32_t v0n = rb[(pos_next*6)+0];
- int32_t v1n=rb[(pos_next*6)+1];
- int32_t v2n=rb[(pos_next*6)+2];
- int32_t v3n=rb[(pos_next*6)+3];
- int32_t v4n=rb[(pos_next*6)+4];
- int32_t v5n=rb[(pos_next*6)+5];
-
-#ifndef FAST_AUDIO
- v0+=(v0n-v0)*(int32_t)frac >> MIX_FRAC_BITS;
- v1+=(v1n-v1)*(int32_t)frac >> MIX_FRAC_BITS;
- v2+=(v2n-v2)*(int32_t)frac >> MIX_FRAC_BITS;
- v3+=(v3n-v3)*(int32_t)frac >> MIX_FRAC_BITS;
- v4+=(v4n-v4)*(int32_t)frac >> MIX_FRAC_BITS;
- v5+=(v5n-v5)*(int32_t)frac >> MIX_FRAC_BITS;
-#endif
- v0<<=16;
- v1<<=16;
- v2<<=16;
- v3<<=16;
- v4<<=16;
- v5<<=16;
- p_dest[(i*6)+0]=v0;
- p_dest[(i*6)+1]=v1;
- p_dest[(i*6)+2]=v2;
- p_dest[(i*6)+3]=v3;
- p_dest[(i*6)+4]=v4;
- p_dest[(i*6)+5]=v5;
-
- }
-
-
- }
-
-
- return read>>MIX_FRAC_BITS;//rb_read_pos=offset>>MIX_FRAC_BITS;
-
-}
-
-
-bool AudioStreamResampled::mix(int32_t *p_dest, int p_frames) {
-
-
- if (!rb || !_can_mix())
- return false;
-
- int write_pos_cache=rb_write_pos;
-
- int32_t increment=(mix_rate*MIX_FRAC_LEN)/get_mix_rate();
-
- int rb_todo;
-
- if (write_pos_cache==rb_read_pos) {
- return false; //out of buffer
-
- } else if (rb_read_pos<write_pos_cache) {
-
- rb_todo=write_pos_cache-rb_read_pos; //-1?
- } else {
-
- rb_todo=(rb_len-rb_read_pos)+write_pos_cache; //-1?
- }
-
- int todo = MIN( ((int64_t(rb_todo)<<MIX_FRAC_BITS)/increment)+1, p_frames );
-#if 0
- if (int(mix_rate)==get_mix_rate()) {
-
-
- if (channels==6) {
-
- for(int i=0;i<p_frames;i++) {
-
- int from = ((rb_read_pos+i)&rb_mask)*6;
- int to = i*6;
-
- p_dest[from+0]=int32_t(rb[to+0])<<16;
- p_dest[from+1]=int32_t(rb[to+1])<<16;
- p_dest[from+2]=int32_t(rb[to+2])<<16;
- p_dest[from+3]=int32_t(rb[to+3])<<16;
- p_dest[from+4]=int32_t(rb[to+4])<<16;
- p_dest[from+5]=int32_t(rb[to+5])<<16;
- }
-
- } else {
- int len=p_frames*channels;
- int from=rb_read_pos*channels;
- int mask=0;
- switch(channels) {
- case 1: mask=rb_len-1; break;
- case 2: mask=(rb_len*2)-1; break;
- case 4: mask=(rb_len*4)-1; break;
- }
-
- for(int i=0;i<len;i++) {
-
- p_dest[i]=int32_t(rb[(from+i)&mask])<<16;
- }
- }
-
- rb_read_pos = (rb_read_pos+p_frames)&rb_mask;
- } else
-#endif
- {
-
- uint32_t read=0;
- switch(channels) {
- case 1: read=_resample<1>(p_dest,todo,increment); break;
- case 2: read=_resample<2>(p_dest,todo,increment); break;
- case 4: read=_resample<4>(p_dest,todo,increment); break;
- case 6: read=_resample<6>(p_dest,todo,increment); break;
- }
-#if 1
- //end of stream, fadeout
- int remaining = p_frames-todo;
- if (remaining && todo>0) {
-
- //print_line("fadeout");
- for(int c=0;c<channels;c++) {
-
- for(int i=0;i<todo;i++) {
-
- int32_t samp = p_dest[i*channels+c]>>8;
- uint32_t mul = (todo-i) * 256 /todo;
- //print_line("mul: "+itos(i)+" "+itos(mul));
- p_dest[i*channels+c]=samp*mul;
- }
-
- }
-
- }
-
-#else
- int remaining = p_frames-todo;
- if (remaining && todo>0) {
-
-
- for(int c=0;c<channels;c++) {
-
- int32_t from = p_dest[(todo-1)*channels+c]>>8;
-
- for(int i=0;i<remaining;i++) {
-
- uint32_t mul = (remaining-i) * 256 /remaining;
- p_dest[(todo+i)*channels+c]=from*mul;
- }
-
- }
-
- }
-#endif
-
- //zero out what remains there to avoid glitches
- for(int i=todo*channels;i<int(p_frames)*channels;i++) {
-
- p_dest[i]=0;
- }
-
- if (read>rb_todo)
- read=rb_todo;
-
- rb_read_pos = (rb_read_pos+read)&rb_mask;
-
-
-
-
- }
-
- return true;
-}
-
-
-Error AudioStreamResampled::_setup(int p_channels,int p_mix_rate,int p_minbuff_needed) {
-
- ERR_FAIL_COND_V(p_channels!=1 && p_channels!=2 && p_channels!=4 && p_channels!=6,ERR_INVALID_PARAMETER);
-
-
- float buffering_sec = int(GLOBAL_DEF("audio/stream_buffering_ms",500))/1000.0;
- int desired_rb_bits =nearest_shift(MAX(buffering_sec*p_mix_rate,p_minbuff_needed));
-
- bool recreate=!rb;
-
- if (rb && (uint32_t(desired_rb_bits)!=rb_bits || channels!=uint32_t(p_channels))) {
- //recreate
-
- memdelete_arr(rb);
- memdelete_arr(read_buf);
- recreate=true;
-
- }
-
- if (recreate) {
-
- channels=p_channels;
- rb_bits=desired_rb_bits;
- rb_len=(1<<rb_bits);
- rb_mask=rb_len-1;
- rb = memnew_arr( int16_t, rb_len * p_channels );
- read_buf = memnew_arr( int16_t, rb_len * p_channels );
-
- }
-
- mix_rate=p_mix_rate;
- offset=0;
- rb_read_pos=0;
- rb_write_pos=0;
-
- //avoid maybe strange noises upon load
- for (int i=0;i<(rb_len*channels);i++) {
-
- rb[i]=0;
- read_buf[i]=0;
- }
-
- return OK;
-
-}
-
-void AudioStreamResampled::_clear() {
-
- if (!rb)
- return;
-
- AudioServer::get_singleton()->lock();
- //should be stopped at this point but just in case
- if (rb) {
- memdelete_arr(rb);
- memdelete_arr(read_buf);
- }
- rb=NULL;
- offset=0;
- rb_read_pos=0;
- rb_write_pos=0;
- read_buf=NULL;
- AudioServer::get_singleton()->unlock();
-
-}
-
-AudioStreamResampled::AudioStreamResampled() {
-
- rb=NULL;
- offset=0;
- read_buf=NULL;
- rb_read_pos=0;
- rb_write_pos=0;
-
- rb_bits=0;
- rb_len=0;
- rb_mask=0;
- read_buff_len=0;
- channels=0;
- mix_rate=0;
-
-}
-
-AudioStreamResampled::~AudioStreamResampled() {
-
- if (rb) {
- memdelete_arr(rb);
- memdelete_arr(read_buf);
- }
-
-}
-
-#endif
diff --git a/scene/resources/audio_stream_resampled.h b/scene/resources/audio_stream_resampled.h
deleted file mode 100644
index e6dd44ea51..0000000000
--- a/scene/resources/audio_stream_resampled.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*************************************************************************/
-/* audio_stream_resampled.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "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 AUDIO_STREAM_RESAMPLED_H
-#define AUDIO_STREAM_RESAMPLED_H
-
-//#include "scene/resources/audio_stream.h"
-
-#if 0
-
-class AudioStreamResampled : public AudioStream {
- GDCLASS(AudioStreamResampled,AudioStream);
-
- uint32_t rb_bits;
- uint32_t rb_len;
- uint32_t rb_mask;
- uint32_t read_buff_len;
- uint32_t channels;
- uint32_t mix_rate;
-
- volatile int rb_read_pos;
- volatile int rb_write_pos;
-
- int32_t offset; //contains the fractional remainder of the resampler
- enum {
- MIX_FRAC_BITS=13,
- MIX_FRAC_LEN=(1<<MIX_FRAC_BITS),
- MIX_FRAC_MASK=MIX_FRAC_LEN-1,
- };
-
- int16_t *read_buf;
- int16_t *rb;
-
-
- template<int C>
- uint32_t _resample(int32_t *p_dest,int p_todo,int32_t p_increment);
-
-
-protected:
-
- _FORCE_INLINE_ int get_total() const {
-
- return rb_len;
- }
-
- _FORCE_INLINE_ int get_todo() const { //return amount of frames to mix
-
- int todo;
- int read_pos_cache=rb_read_pos;
-
- if (read_pos_cache==rb_write_pos) {
- todo=rb_len-1;
- } else if (read_pos_cache>rb_write_pos) {
-
- todo=read_pos_cache-rb_write_pos-1;
- } else {
-
- todo=(rb_len-rb_write_pos)+read_pos_cache-1;
- }
-
- return todo;
- }
-
- //Stream virtual funcs
- virtual int get_channel_count() const;
- virtual bool mix(int32_t *p_dest, int p_frames);
-
- _FORCE_INLINE_ void _flush() {
- rb_read_pos=0;
- rb_write_pos=0;
- }
-
- _FORCE_INLINE_ int16_t *get_write_buffer() { return read_buf; }
- _FORCE_INLINE_ void write(uint32_t p_frames) {
-
- ERR_FAIL_COND(p_frames >= rb_len);
-
- switch(channels) {
- case 1: {
-
- for(uint32_t i=0;i<p_frames;i++) {
-
- rb[ rb_write_pos ] = read_buf[i];
- rb_write_pos=(rb_write_pos+1)&rb_mask;
- }
- } break;
- case 2: {
-
- for(uint32_t i=0;i<p_frames;i++) {
-
- rb[ (rb_write_pos<<1)+0 ] = read_buf[(i<<1)+0];
- rb[ (rb_write_pos<<1)+1 ] = read_buf[(i<<1)+1];
- rb_write_pos=(rb_write_pos+1)&rb_mask;
- }
- } break;
- case 4: {
-
- for(uint32_t i=0;i<p_frames;i++) {
-
- rb[ (rb_write_pos<<2)+0 ] = read_buf[(i<<2)+0];
- rb[ (rb_write_pos<<2)+1 ] = read_buf[(i<<2)+1];
- rb[ (rb_write_pos<<2)+2 ] = read_buf[(i<<2)+2];
- rb[ (rb_write_pos<<2)+3 ] = read_buf[(i<<2)+3];
- rb_write_pos=(rb_write_pos+1)&rb_mask;
- }
- } break;
- case 6: {
-
- for(uint32_t i=0;i<p_frames;i++) {
-
- rb[ (rb_write_pos*6)+0 ] = read_buf[(i*6)+0];
- rb[ (rb_write_pos*6)+1 ] = read_buf[(i*6)+1];
- rb[ (rb_write_pos*6)+2 ] = read_buf[(i*6)+2];
- rb[ (rb_write_pos*6)+3 ] = read_buf[(i*6)+3];
- rb[ (rb_write_pos*6)+4 ] = read_buf[(i*6)+4];
- rb[ (rb_write_pos*6)+5 ] = read_buf[(i*6)+5];
- rb_write_pos=(rb_write_pos+1)&rb_mask;
- }
- } break;
-
-
- }
-
- }
-
- virtual bool _can_mix() const =0;
-
- _FORCE_INLINE_ bool _is_ready() const{
- return rb!=NULL;
- }
-
- Error _setup(int p_channels,int p_mix_rate,int p_minbuff_needed=-1);
- void _clear();
-
-public:
- AudioStreamResampled();
- ~AudioStreamResampled();
-};
-#endif
-#endif // AUDIO_STREAM_RESAMPLED_H
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index 877760c1bd..7fbaa1f73c 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -28,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "curve.h"
+
#include "core_string_names.h"
template <class T>
@@ -42,344 +43,6 @@ static _FORCE_INLINE_ T _bezier_interp(real_t t, T start, T control_1, T control
return start * omt3 + control_1 * omt2 * t * 3.0 + control_2 * omt * t2 * 3.0 + end * t3;
}
-#if 0
-
-int Curve2D::get_point_count() const {
-
- return points.size();
-}
-void Curve2D::add_point(const Vector2& p_pos, const Vector2& p_in, const Vector2& p_out) {
-
- Point n;
- n.pos=p_pos;
- n.in=p_in;
- n.out=p_out;
- points.push_back(n);
- emit_signal(CoreStringNames::get_singleton()->changed);
-}
-void Curve2D::set_point_pos(int p_index, const Vector2& p_pos) {
-
- ERR_FAIL_INDEX(p_index,points.size());
-
- points[p_index].pos=p_pos;
- emit_signal(CoreStringNames::get_singleton()->changed);
-
-}
-Vector2 Curve2D::get_point_pos(int p_index) const {
-
- ERR_FAIL_INDEX_V(p_index,points.size(),Vector2());
- return points[p_index].pos;
-
-}
-
-
-void Curve2D::set_point_in(int p_index, const Vector2& p_in) {
-
- ERR_FAIL_INDEX(p_index,points.size());
-
- points[p_index].in=p_in;
- emit_signal(CoreStringNames::get_singleton()->changed);
-
-}
-Vector2 Curve2D::get_point_in(int p_index) const {
-
- ERR_FAIL_INDEX_V(p_index,points.size(),Vector2());
- return points[p_index].in;
-
-}
-
-void Curve2D::set_point_out(int p_index, const Vector2& p_out) {
-
- ERR_FAIL_INDEX(p_index,points.size());
-
- points[p_index].out=p_out;
- emit_signal(CoreStringNames::get_singleton()->changed);
-}
-
-Vector2 Curve2D::get_point_out(int p_index) const {
-
- ERR_FAIL_INDEX_V(p_index,points.size(),Vector2());
- return points[p_index].out;
-
-}
-
-
-void Curve2D::remove_point(int p_index) {
-
- ERR_FAIL_INDEX(p_index,points.size());
- points.remove(p_index);
- emit_signal(CoreStringNames::get_singleton()->changed);
-}
-
-Vector2 Curve2D::interpolate(int p_index, float p_offset) const {
-
- int pc = points.size();
- ERR_FAIL_COND_V(pc==0,Vector2());
-
- if (p_index >= pc-1)
- return points[pc-1].pos;
- else if (p_index<0)
- return points[0].pos;
-
- Vector2 p0 = points[p_index].pos;
- Vector2 p1 = p0+points[p_index].out;
- Vector2 p3 = points[p_index+1].pos;
- Vector2 p2 = p3+points[p_index+1].in;
-
- return _bezier_interp(p_offset,p0,p1,p2,p3);
-}
-
-Vector2 Curve2D::interpolatef(real_t p_findex) const {
-
-
- if (p_findex<0)
- p_findex=0;
- else if (p_findex>=points.size())
- p_findex=points.size();
-
- return interpolate((int)p_findex,Math::fmod(p_findex,1.0));
-
-}
-
-PoolVector<Point2> Curve2D::bake(int p_subdivs) const {
-
- int pc = points.size();
-
- PoolVector<Point2> ret;
- if (pc<2)
- return ret;
-
- ret.resize((pc-1)*p_subdivs+1);
-
- PoolVector<Point2>::Write w = ret.write();
- const Point *r = points.ptr();
-
- for(int i=0;i<pc;i++) {
-
- int ofs = pc*p_subdivs;
-
- int limit=(i==pc-1)?p_subdivs+1:p_subdivs;
-
- for(int j=0;j<limit;j++) {
-
- Vector2 p0 = r[i].pos;
- Vector2 p1 = p0+r[i].out;
- Vector2 p3 = r[i].pos;
- Vector2 p2 = p3+r[i].in;
- real_t t = j/(real_t)p_subdivs;
-
- w[ofs+j]=_bezier_interp(t,p0,p1,p2,p3);
-
- }
- }
-
- w = PoolVector<Point2>::Write();
-
- return ret;
-}
-
-void Curve2D::advance(real_t p_distance,int &r_index, real_t &r_pos) const {
-
- int pc = points.size();
- ERR_FAIL_COND(pc<2);
- if (r_index<0 || r_index>=(pc-1))
- return;
-
- Vector2 pos = interpolate(r_index,r_pos);
-
- float sign=p_distance<0 ? -1 : 1;
- p_distance=Math::abs(p_distance);
-
- real_t base = r_index+r_pos;
- real_t top = 0.1; //a tenth is in theory representative
- int iterations=32;
-
-
-
- for(int i=0;i<iterations;i++) {
-
-
- real_t o=base+top*sign;
- if (sign>0 && o >=pc) {
- top=pc-base;
- break;
- } else if (sign<0 && o <0) {
- top=-base;
- break;
- }
-
- Vector2 new_d = interpolatef(o);
-
- if (new_d.distance_to(pos) > p_distance)
- break;
- top*=2.0;
- }
-
-
- real_t bottom = 0.0;
- iterations=8;
- real_t final_offset;
-
-
- for(int i=0;i<iterations;i++) {
-
- real_t middle = (bottom+top)*0.5;
- real_t o=base+middle*sign;
- Vector2 new_d = interpolatef(o);
-
- if (new_d.distance_to(pos) > p_distance) {
- bottom=middle;
- } else {
- top=middle;
- }
- final_offset=o;
- }
-
- r_index=(int)final_offset;
- r_pos=Math::fmod(final_offset,1.0);
-
-}
-
-void Curve2D::get_approx_position_from_offset(real_t p_offset,int &r_index, real_t &r_pos,int p_subdivs) const {
-
- ERR_FAIL_COND(points.size()<2);
-
- real_t accum=0;
-
-
-
- for(int i=0;i<points.size();i++) {
-
- Vector2 prev_p=interpolate(i,0);
-
-
- for(int j=1;j<=p_subdivs;j++) {
-
- real_t frac = j/(real_t)p_subdivs;
- Vector2 p = interpolate(i,frac);
- real_t d = p.distance_to(prev_p);
-
- accum+=d;
- if (accum>p_offset) {
-
-
- r_index=j-1;
- if (d>0) {
- real_t mf = (p_offset-(accum-d)) / d;
- r_pos=frac-(1.0-mf);
- } else {
- r_pos=frac;
- }
-
- return;
- }
-
- prev_p=p;
- }
- }
-
- r_index=points.size()-1;
- r_pos=1.0;
-
-
-}
-
-void Curve2D::set_points_in(const Vector2Array& p_points) {
-
- points.resize(p_points.size());
- for (int i=0; i<p_points.size(); i++) {
-
- Point p = points[i];
- p.in = p_points[i];
- points[i] = p;
- };
-};
-
-void Curve2D::set_points_out(const Vector2Array& p_points) {
-
- points.resize(p_points.size());
- for (int i=0; i<p_points.size(); i++) {
-
- Point p = points[i];
- p.out = p_points[i];
- points[i] = p;
- };
-};
-
-void Curve2D::set_points_pos(const Vector2Array& p_points) {
-
- points.resize(p_points.size());
- for (int i=0; i<p_points.size(); i++) {
-
- Point p = points[i];
- p.pos = p_points[i];
- points[i] = p;
- };
-};
-
-Vector2Array Curve2D::get_points_in() const {
- Vector2Array ret;
- ret.resize(points.size());
- for (int i=0; i<points.size(); i++) {
- ret.set(i, points[i].in);
- };
- return ret;
-};
-
-Vector2Array Curve2D::get_points_out() const {
- Vector2Array ret;
- ret.resize(points.size());
- for (int i=0; i<points.size(); i++) {
- ret.set(i, points[i].out);
- };
- return ret;
-};
-
-Vector2Array Curve2D::get_points_pos() const {
- Vector2Array ret;
- ret.resize(points.size());
- for (int i=0; i<points.size(); i++) {
- ret.set(i, points[i].pos);
- };
- return ret;
-};
-
-
-void Curve2D::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("get_point_count"),&Curve2D::get_point_count);
- ClassDB::bind_method(D_METHOD("add_point","pos","in","out"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2()));
- ClassDB::bind_method(D_METHOD("set_point_pos","idx","pos"),&Curve2D::set_point_pos);
- ClassDB::bind_method(D_METHOD("get_point_pos","idx"),&Curve2D::get_point_pos);
- ClassDB::bind_method(D_METHOD("set_point_in","idx","pos"),&Curve2D::set_point_in);
- ClassDB::bind_method(D_METHOD("get_point_in","idx"),&Curve2D::get_point_in);
- ClassDB::bind_method(D_METHOD("set_point_out","idx","pos"),&Curve2D::set_point_out);
- ClassDB::bind_method(D_METHOD("get_point_out","idx"),&Curve2D::get_point_out);
- ClassDB::bind_method(D_METHOD("remove_point","idx"),&Curve2D::remove_point);
- ClassDB::bind_method(D_METHOD("interpolate","idx","t"),&Curve2D::interpolate);
- ClassDB::bind_method(D_METHOD("bake","subdivs"),&Curve2D::bake,DEFVAL(10));
-
-
- ClassDB::bind_method(D_METHOD("set_points_in"),&Curve2D::set_points_in);
- ClassDB::bind_method(D_METHOD("set_points_out"),&Curve2D::set_points_out);
- ClassDB::bind_method(D_METHOD("set_points_pos"),&Curve2D::set_points_pos);
-
- ClassDB::bind_method(D_METHOD("get_points_in"),&Curve2D::get_points_in);
- ClassDB::bind_method(D_METHOD("get_points_out"),&Curve2D::get_points_out);
- ClassDB::bind_method(D_METHOD("get_points_pos"),&Curve2D::get_points_pos);
-
- ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_in"), "set_points_in","get_points_in");
- ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_out"), "set_points_out","get_points_out");
- ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_pos"), "set_points_pos","get_points_pos");
-}
-
-
-Curve2D::Curve2D()
-{
-}
-
-#endif
-
const char *Curve::SIGNAL_RANGE_CHANGED = "range_changed";
Curve::Curve() {
diff --git a/scene/resources/curve.h b/scene/resources/curve.h
index 0cdcc72d61..3071aee5de 100644
--- a/scene/resources/curve.h
+++ b/scene/resources/curve.h
@@ -31,56 +31,6 @@
#define CURVE_H
#include "resource.h"
-#if 0
-class Curve2D : public Resource {
-
- GDCLASS(Curve2D,Resource);
-
- struct Point {
-
- Vector2 in;
- Vector2 out;
- Vector2 pos;
- };
-
-
- Vector<Point> points;
-
-protected:
-
- static void _bind_methods();
-
- void set_points_in(const Vector2Array& p_points_in);
- void set_points_out(const Vector2Array& p_points_out);
- void set_points_pos(const Vector2Array& p_points_pos);
-
- Vector2Array get_points_in() const;
- Vector2Array get_points_out() const;
- Vector2Array get_points_pos() const;
-
-public:
-
-
- int get_point_count() const;
- void add_point(const Vector2& p_pos, const Vector2& p_in=Vector2(), const Vector2& p_out=Vector2());
- void set_point_pos(int p_index, const Vector2& p_pos);
- Vector2 get_point_pos(int p_index) const;
- void set_point_in(int p_index, const Vector2& p_in);
- Vector2 get_point_in(int p_index) const;
- void set_point_out(int p_index, const Vector2& p_out);
- Vector2 get_point_out(int p_index) const;
- void remove_point(int p_index);
-
- Vector2 interpolate(int p_index, float p_offset) const;
- Vector2 interpolatef(real_t p_findex) const;
- PoolVector<Point2> bake(int p_subdivs=10) const;
- void advance(real_t p_distance,int &r_index, real_t &r_pos) const;
- void get_approx_position_from_offset(real_t p_offset,int &r_index, real_t &r_pos,int p_subdivs=16) const;
-
- Curve2D();
-};
-
-#endif
// y(x) curve
class Curve : public Resource {
diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp
index cbdf42dc2b..4e1ffd2ab3 100644
--- a/scene/resources/mesh_library.cpp
+++ b/scene/resources/mesh_library.cpp
@@ -43,9 +43,15 @@ bool MeshLibrary::_set(const StringName &p_name, const Variant &p_value) {
set_item_name(idx, p_value);
else if (what == "mesh")
set_item_mesh(idx, p_value);
- else if (what == "shape")
- set_item_shape(idx, p_value);
- else if (what == "preview")
+ else if (what == "shape") {
+ Vector<ShapeData> shapes;
+ ShapeData sd;
+ sd.shape = p_value;
+ shapes.push_back(sd);
+ set_item_shapes(idx, shapes);
+ } else if (what == "shapes") {
+ _set_item_shapes(idx, p_value);
+ } else if (what == "preview")
set_item_preview(idx, p_value);
else if (what == "navmesh")
set_item_navmesh(idx, p_value);
@@ -69,8 +75,8 @@ bool MeshLibrary::_get(const StringName &p_name, Variant &r_ret) const {
r_ret = get_item_name(idx);
else if (what == "mesh")
r_ret = get_item_mesh(idx);
- else if (what == "shape")
- r_ret = get_item_shape(idx);
+ else if (what == "shapes")
+ r_ret = _get_item_shapes(idx);
else if (what == "navmesh")
r_ret = get_item_navmesh(idx);
else if (what == "preview")
@@ -88,7 +94,7 @@ void MeshLibrary::_get_property_list(List<PropertyInfo> *p_list) const {
String name = "item/" + itos(E->key()) + "/";
p_list->push_back(PropertyInfo(Variant::STRING, name + "name"));
p_list->push_back(PropertyInfo(Variant::OBJECT, name + "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh"));
- p_list->push_back(PropertyInfo(Variant::OBJECT, name + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"));
+ p_list->push_back(PropertyInfo(Variant::ARRAY, name + "shapes"));
p_list->push_back(PropertyInfo(Variant::OBJECT, name + "navmesh", PROPERTY_HINT_RESOURCE_TYPE, "NavigationMesh"));
p_list->push_back(PropertyInfo(Variant::OBJECT, name + "preview", PROPERTY_HINT_RESOURCE_TYPE, "Texture", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_EDITOR_HELPER));
}
@@ -118,10 +124,10 @@ void MeshLibrary::set_item_mesh(int p_item, const Ref<Mesh> &p_mesh) {
_change_notify();
}
-void MeshLibrary::set_item_shape(int p_item, const Ref<Shape> &p_shape) {
+void MeshLibrary::set_item_shapes(int p_item, const Vector<ShapeData> &p_shapes) {
ERR_FAIL_COND(!item_map.has(p_item));
- item_map[p_item].shape = p_shape;
+ item_map[p_item].shapes = p_shapes;
_change_notify();
notify_change_to_owners();
emit_changed();
@@ -156,10 +162,10 @@ Ref<Mesh> MeshLibrary::get_item_mesh(int p_item) const {
return item_map[p_item].mesh;
}
-Ref<Shape> MeshLibrary::get_item_shape(int p_item) const {
+Vector<MeshLibrary::ShapeData> MeshLibrary::get_item_shapes(int p_item) const {
- ERR_FAIL_COND_V(!item_map.has(p_item), Ref<Shape>());
- return item_map[p_item].shape;
+ ERR_FAIL_COND_V(!item_map.has(p_item), Vector<ShapeData>());
+ return item_map[p_item].shapes;
}
Ref<NavigationMesh> MeshLibrary::get_item_navmesh(int p_item) const {
@@ -226,17 +232,48 @@ int MeshLibrary::get_last_unused_item_id() const {
return item_map.back()->key() + 1;
}
+void MeshLibrary::_set_item_shapes(int p_item, const Array &p_shapes) {
+
+ ERR_FAIL_COND(p_shapes.size() & 1);
+ Vector<ShapeData> shapes;
+ for (int i = 0; i < p_shapes.size(); i += 2) {
+ ShapeData sd;
+ sd.shape = p_shapes[i + 0];
+ sd.local_transform = p_shapes[i + 1];
+
+ if (sd.shape.is_valid()) {
+ shapes.push_back(sd);
+ }
+ }
+
+ set_item_shapes(p_item, shapes);
+}
+
+Array MeshLibrary::_get_item_shapes(int p_item) const {
+
+ Vector<ShapeData> shapes = get_item_shapes(p_item);
+ Array ret;
+ for (int i = 0; i < shapes.size(); i++) {
+ ret.push_back(shapes[i].shape);
+ ret.push_back(shapes[i].local_transform);
+ }
+
+ return ret;
+}
+
void MeshLibrary::_bind_methods() {
ClassDB::bind_method(D_METHOD("create_item", "id"), &MeshLibrary::create_item);
ClassDB::bind_method(D_METHOD("set_item_name", "id", "name"), &MeshLibrary::set_item_name);
ClassDB::bind_method(D_METHOD("set_item_mesh", "id", "mesh"), &MeshLibrary::set_item_mesh);
ClassDB::bind_method(D_METHOD("set_item_navmesh", "id", "navmesh"), &MeshLibrary::set_item_navmesh);
- ClassDB::bind_method(D_METHOD("set_item_shape", "id", "shape"), &MeshLibrary::set_item_shape);
+ ClassDB::bind_method(D_METHOD("set_item_shapes", "id", "shapes"), &MeshLibrary::_set_item_shapes);
+ ClassDB::bind_method(D_METHOD("set_item_preview", "id", "texture"), &MeshLibrary::set_item_preview);
ClassDB::bind_method(D_METHOD("get_item_name", "id"), &MeshLibrary::get_item_name);
ClassDB::bind_method(D_METHOD("get_item_mesh", "id"), &MeshLibrary::get_item_mesh);
ClassDB::bind_method(D_METHOD("get_item_navmesh", "id"), &MeshLibrary::get_item_navmesh);
- ClassDB::bind_method(D_METHOD("get_item_shape", "id"), &MeshLibrary::get_item_shape);
+ ClassDB::bind_method(D_METHOD("get_item_shapes", "id"), &MeshLibrary::_get_item_shapes);
+ ClassDB::bind_method(D_METHOD("get_item_preview", "id"), &MeshLibrary::get_item_preview);
ClassDB::bind_method(D_METHOD("remove_item", "id"), &MeshLibrary::remove_item);
ClassDB::bind_method(D_METHOD("clear"), &MeshLibrary::clear);
ClassDB::bind_method(D_METHOD("get_item_list"), &MeshLibrary::get_item_list);
diff --git a/scene/resources/mesh_library.h b/scene/resources/mesh_library.h
index a9044881f7..99b6b48d61 100644
--- a/scene/resources/mesh_library.h
+++ b/scene/resources/mesh_library.h
@@ -41,16 +41,24 @@ class MeshLibrary : public Resource {
GDCLASS(MeshLibrary, Resource);
RES_BASE_EXTENSION("meshlib");
+public:
+ struct ShapeData {
+ Ref<Shape> shape;
+ Transform local_transform;
+ };
struct Item {
String name;
Ref<Mesh> mesh;
- Ref<Shape> shape;
+ Vector<ShapeData> shapes;
Ref<Texture> preview;
Ref<NavigationMesh> navmesh;
};
Map<int, Item> item_map;
+ void _set_item_shapes(int p_item, const Array &p_shapes);
+ Array _get_item_shapes(int p_item) const;
+
protected:
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;
@@ -63,12 +71,12 @@ public:
void set_item_name(int p_item, const String &p_name);
void set_item_mesh(int p_item, const Ref<Mesh> &p_mesh);
void set_item_navmesh(int p_item, const Ref<NavigationMesh> &p_navmesh);
- void set_item_shape(int p_item, const Ref<Shape> &p_shape);
+ void set_item_shapes(int p_item, const Vector<ShapeData> &p_shapes);
void set_item_preview(int p_item, const Ref<Texture> &p_preview);
String get_item_name(int p_item) const;
Ref<Mesh> get_item_mesh(int p_item) const;
Ref<NavigationMesh> get_item_navmesh(int p_item) const;
- Ref<Shape> get_item_shape(int p_item) const;
+ Vector<ShapeData> get_item_shapes(int p_item) const;
Ref<Texture> get_item_preview(int p_item) const;
void remove_item(int p_item);
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index d25ba11cf0..19fab5d587 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -28,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "packed_scene.h"
+
#include "core/core_string_names.h"
#include "io/resource_loader.h"
#include "project_settings.h"
@@ -35,6 +36,7 @@
#include "scene/3d/spatial.h"
#include "scene/gui/control.h"
#include "scene/main/instance_placeholder.h"
+
#define PACK_VERSION 2
bool SceneState::can_instance() const {
@@ -451,60 +453,6 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
}
}
-#if 0
-
- Ref<SceneState> base_scene = p_node->get_scene_inherited_state(); //for inheritance
- Ref<SceneState> instance_state;
- int instance_state_node=-1;
-
- if (base_scene.is_valid() && (p_node==p_owner || p_node->get_owner()==p_owner)) {
- //scene inheritance in use, see if this node is actually inherited
- NodePath path = p_owner->get_path_to(p_node);
- instance_state_node = base_scene->find_node_by_path(path);
- if (instance_state_node>=0) {
- instance_state=base_scene;
- }
- }
-
- // check that this is a directly instanced scene from the scene being packed, if so
- // this information must be saved. Of course, if using scene instancing and this node
- // does belong to base scene, ignore.
-
- if (instance_state.is_null() && p_node!=p_owner && p_node->get_owner()==p_owner && p_node->get_filename()!="") {
-
- //instanced, only direct sub-scnes are supported of course
- Ref<PackedScene> instance = ResourceLoader::load(p_node->get_filename());
- if (!instance.is_valid()) {
- return ERR_CANT_OPEN;
- }
-
- nd.instance=_vm_get_variant(instance,variant_map);
-
- } else {
-
- nd.instance=-1;
- }
-
- // finally, if this does not belong to scene inheritance, check
- // if it belongs to scene instancing
-
- if (instance_state.is_null() && p_node!=p_owner) {
- //if not affected by scene inheritance, this may be
- if (p_node->get_owner()==p_owner && p_node->get_filename()!=String()) {
- instance_state=p_node->get_scene_instance_state();
- if (instance_state.is_valid()) {
- instance_state_node=instance_state->find_node_by_path(p_node->get_path_to(p_node));
- }
-
- } else if (p_node->get_owner()!=p_owner && p_owner->is_editable_instance(p_node->get_owner())) {
- instance_state=p_node->get_owner()->get_scene_instance_state();
- if (instance_state.is_valid()) {
- instance_state_node=instance_state->find_node_by_path(p_node->get_owner()->get_path_to(p_node));
- }
- }
- }
-#endif
-
// all setup, we then proceed to check all properties for the node
// and save the ones that are worth saving
@@ -641,27 +589,6 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
} else {
nd.owner = -1;
-#if 0
- // this is pointless, if this was instanced by something else,
- // the owner will already be set.
-
- if (node_map.has(p_node->get_owner())) {
- //maybe an existing saved node
- nd.owner=node_map[p_node->get_owner()];
- } else {
- //not saved, use nodepath map
- int sidx;
- if (nodepath_map.has(p_node->get_owner())) {
- sidx=nodepath_map[p_node->get_owner()];
- } else {
- sidx=nodepath_map.size();
- nodepath_map[p_node->get_owner()]=sidx;
- }
-
- nd.owner=FLAG_ID_IS_PATH|sidx;
-
- }
-#endif
}
// Save the right type. If this node was created by an instance
diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp
index 2f75118bdf..487975dd4e 100644
--- a/scene/resources/room.cpp
+++ b/scene/resources/room.cpp
@@ -30,6 +30,8 @@
#include "room.h"
#include "servers/visual_server.h"
+
+// FIXME: Left for reference for reimplementation using Area
#if 0
RID RoomBounds::get_rid() const {
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp
index 1b00f71f4f..2ca9a14562 100644
--- a/scene/resources/shader_graph.cpp
+++ b/scene/resources/shader_graph.cpp
@@ -28,8 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "shader_graph.h"
+
#include "scene/scene_string_names.h"
+// FIXME: Needs to be ported to the new 3.0 shader API
#if 0
Array ShaderGraph::_get_node_list(ShaderType p_type) const {
@@ -397,79 +399,6 @@ void ShaderGraph::_bind_methods() {
BIND_ENUM_CONSTANT( VEC_MAX_FUNC );
ADD_SIGNAL(MethodInfo("updated"));
-
-#if 0
- ClassDB::bind_method(D_METHOD("node_add"),&ShaderGraph::node_add );
- ClassDB::bind_method(D_METHOD("node_remove"),&ShaderGraph::node_remove );
- ClassDB::bind_method(D_METHOD("node_set_param"),&ShaderGraph::node_set_param );
- ClassDB::bind_method(D_METHOD("node_set_pos"),&ShaderGraph::node_set_pos );
-
- ClassDB::bind_method(D_METHOD("node_get_pos"),&ShaderGraph::node_get_pos );
- ClassDB::bind_method(D_METHOD("node_get_param"),&ShaderGraph::node_get_param);
- ClassDB::bind_method(D_METHOD("node_get_type"),&ShaderGraph::node_get_type);
-
- ClassDB::bind_method(D_METHOD("connect"),&ShaderGraph::connect );
- ClassDB::bind_method(D_METHOD("disconnect"),&ShaderGraph::disconnect );
-
- ClassDB::bind_method(D_METHOD("get_connections"),&ShaderGraph::_get_connections_helper );
-
- ClassDB::bind_method(D_METHOD("clear"),&ShaderGraph::clear );
-
- BIND_ENUM_CONSTANT( NODE_IN ); ///< param 0: name
- BIND_ENUM_CONSTANT( NODE_OUT ); ///< param 0: name
- BIND_ENUM_CONSTANT( NODE_CONSTANT ); ///< param 0: value
- BIND_ENUM_CONSTANT( NODE_PARAMETER ); ///< param 0: name
- BIND_ENUM_CONSTANT( NODE_ADD );
- BIND_ENUM_CONSTANT( NODE_SUB );
- BIND_ENUM_CONSTANT( NODE_MUL );
- BIND_ENUM_CONSTANT( NODE_DIV );
- BIND_ENUM_CONSTANT( NODE_MOD );
- BIND_ENUM_CONSTANT( NODE_SIN );
- BIND_ENUM_CONSTANT( NODE_COS );
- BIND_ENUM_CONSTANT( NODE_TAN );
- BIND_ENUM_CONSTANT( NODE_ARCSIN );
- BIND_ENUM_CONSTANT( NODE_ARCCOS );
- BIND_ENUM_CONSTANT( NODE_ARCTAN );
- BIND_ENUM_CONSTANT( NODE_POW );
- BIND_ENUM_CONSTANT( NODE_LOG );
- BIND_ENUM_CONSTANT( NODE_MAX );
- BIND_ENUM_CONSTANT( NODE_MIN );
- BIND_ENUM_CONSTANT( NODE_COMPARE );
- BIND_ENUM_CONSTANT( NODE_TEXTURE ); ///< param 0: texture
- BIND_ENUM_CONSTANT( NODE_TIME ); ///< param 0: interval length
- BIND_ENUM_CONSTANT( NODE_NOISE );
- BIND_ENUM_CONSTANT( NODE_PASS );
- BIND_ENUM_CONSTANT( NODE_VEC_IN ); ///< param 0: name
- BIND_ENUM_CONSTANT( NODE_VEC_OUT ); ///< param 0: name
- BIND_ENUM_CONSTANT( NODE_VEC_CONSTANT ); ///< param 0: value
- BIND_ENUM_CONSTANT( NODE_VEC_PARAMETER ); ///< param 0: name
- BIND_ENUM_CONSTANT( NODE_VEC_ADD );
- BIND_ENUM_CONSTANT( NODE_VEC_SUB );
- BIND_ENUM_CONSTANT( NODE_VEC_MUL );
- BIND_ENUM_CONSTANT( NODE_VEC_DIV );
- BIND_ENUM_CONSTANT( NODE_VEC_MOD );
- BIND_ENUM_CONSTANT( NODE_VEC_CROSS );
- BIND_ENUM_CONSTANT( NODE_VEC_DOT );
- BIND_ENUM_CONSTANT( NODE_VEC_POW );
- BIND_ENUM_CONSTANT( NODE_VEC_NORMALIZE );
- BIND_ENUM_CONSTANT( NODE_VEC_TRANSFORM3 );
- BIND_ENUM_CONSTANT( NODE_VEC_TRANSFORM4 );
- BIND_ENUM_CONSTANT( NODE_VEC_COMPARE );
- BIND_ENUM_CONSTANT( NODE_VEC_TEXTURE_2D );
- BIND_ENUM_CONSTANT( NODE_VEC_TEXTURE_CUBE );
- BIND_ENUM_CONSTANT( NODE_VEC_NOISE );
- BIND_ENUM_CONSTANT( NODE_VEC_0 );
- BIND_ENUM_CONSTANT( NODE_VEC_1 );
- BIND_ENUM_CONSTANT( NODE_VEC_2 );
- BIND_ENUM_CONSTANT( NODE_VEC_BUILD );
- BIND_ENUM_CONSTANT( NODE_VEC_PASS );
- BIND_ENUM_CONSTANT( NODE_COLOR_CONSTANT );
- BIND_ENUM_CONSTANT( NODE_COLOR_PARAMETER );
- BIND_ENUM_CONSTANT( NODE_TEXTURE_PARAMETER );
- BIND_ENUM_CONSTANT( NODE_TEXTURE_2D_PARAMETER );
- BIND_ENUM_CONSTANT( NODE_TEXTURE_CUBE_PARAMETER );
- BIND_ENUM_CONSTANT( NODE_TYPE_MAX );
-#endif
}
diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h
index bb82ff167f..9a74b6c53a 100644
--- a/scene/resources/shader_graph.h
+++ b/scene/resources/shader_graph.h
@@ -30,6 +30,7 @@
#ifndef SHADER_GRAPH_H
#define SHADER_GRAPH_H
+// FIXME: Needs to be ported to the new 3.0 shader API
#if 0
#include "map.h"
#include "scene/resources/shader.h"
diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h
index f032685800..e08be02a07 100644
--- a/scene/resources/video_stream.h
+++ b/scene/resources/video_stream.h
@@ -30,7 +30,6 @@
#ifndef VIDEO_STREAM_H
#define VIDEO_STREAM_H
-#include "audio_stream_resampled.h"
#include "scene/resources/texture.h"
class VideoStreamPlayback : public Resource {
diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp
index 06026d1198..af159975ca 100644
--- a/scene/resources/world.cpp
+++ b/scene/resources/world.cpp
@@ -28,10 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "world.h"
+
#include "camera_matrix.h"
#include "octree.h"
#include "scene/3d/camera.h"
-#include "scene/3d/spatial_indexer.h"
#include "scene/3d/visibility_notifier.h"
#include "scene/scene_string_names.h"