summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/audio_server.cpp2
-rw-r--r--servers/physics/body_sw.cpp22
-rw-r--r--servers/physics/body_sw.h2
-rw-r--r--servers/physics_2d/body_2d_sw.cpp25
-rw-r--r--servers/physics_2d/body_2d_sw.h2
-rw-r--r--servers/visual/rasterizer.h2
-rw-r--r--servers/visual/shader_language.cpp5
7 files changed, 37 insertions, 23 deletions
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp
index c155f5204a..6c5a2de97b 100644
--- a/servers/audio_server.cpp
+++ b/servers/audio_server.cpp
@@ -132,7 +132,7 @@ void AudioServer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("voice_stop","voice"), &AudioServer::voice_stop );
- ObjectTypeDB::bind_method(_MD("free","rid"), &AudioServer::free );
+ ObjectTypeDB::bind_method(_MD("free_rid","rid"), &AudioServer::free );
ObjectTypeDB::bind_method(_MD("set_stream_global_volume_scale","scale"), &AudioServer::set_stream_global_volume_scale );
ObjectTypeDB::bind_method(_MD("get_stream_global_volume_scale"), &AudioServer::get_stream_global_volume_scale );
diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp
index 8edbaf0b89..c66e73b430 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics/body_sw.cpp
@@ -382,7 +382,7 @@ void BodySW::set_space(SpaceSW *p_space){
}
-void BodySW::_compute_area_gravity(const AreaSW *p_area) {
+void BodySW::_compute_area_gravity_and_dampenings(const AreaSW *p_area) {
if (p_area->is_gravity_point()) {
if(p_area->get_gravity_distance_scale() > 0) {
@@ -394,6 +394,9 @@ void BodySW::_compute_area_gravity(const AreaSW *p_area) {
} else {
gravity += p_area->get_gravity_vector() * p_area->get_gravity();
}
+
+ area_linear_damp += p_area->get_linear_damp();
+ area_angular_damp += p_area->get_angular_damp();
}
void BodySW::integrate_forces(real_t p_step) {
@@ -409,13 +412,15 @@ void BodySW::integrate_forces(real_t p_step) {
int ac = areas.size();
bool replace = false;
- gravity=Vector3(0,0,0);
+ gravity = Vector3(0,0,0);
+ area_linear_damp = 0;
+ area_angular_damp = 0;
if (ac) {
areas.sort();
const AreaCMP *aa = &areas[0];
damp_area = aa[ac-1].area;
for(int i=ac-1;i>=0;i--) {
- _compute_area_gravity(aa[i].area);
+ _compute_area_gravity_and_dampenings(aa[i].area);
if (aa[i].area->get_space_override_mode() == PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE) {
replace = true;
break;
@@ -424,20 +429,21 @@ void BodySW::integrate_forces(real_t p_step) {
}
if( !replace ) {
- _compute_area_gravity(def_area);
+ _compute_area_gravity_and_dampenings(def_area);
}
gravity*=gravity_scale;
+ // If less than 0, override dampenings with that of the Body
if (angular_damp>=0)
area_angular_damp=angular_damp;
- else
- area_angular_damp=damp_area->get_angular_damp();
+ //else
+ // area_angular_damp=damp_area->get_angular_damp();
if (linear_damp>=0)
area_linear_damp=linear_damp;
- else
- area_linear_damp=damp_area->get_linear_damp();
+ //else
+ // area_linear_damp=damp_area->get_linear_damp();
Vector3 motion;
diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h
index 66d814bfd1..4c4c7818c5 100644
--- a/servers/physics/body_sw.h
+++ b/servers/physics/body_sw.h
@@ -130,7 +130,7 @@ class BodySW : public CollisionObjectSW {
BodySW *island_next;
BodySW *island_list_next;
- _FORCE_INLINE_ void _compute_area_gravity(const AreaSW *p_area);
+ _FORCE_INLINE_ void _compute_area_gravity_and_dampenings(const AreaSW *p_area);
_FORCE_INLINE_ void _update_inertia_tensor();
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index 3afbbe5455..d0c5cbc77b 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -380,7 +380,7 @@ void Body2DSW::set_space(Space2DSW *p_space){
}
-void Body2DSW::_compute_area_gravity(const Area2DSW *p_area) {
+void Body2DSW::_compute_area_gravity_and_dampenings(const Area2DSW *p_area) {
if (p_area->is_gravity_point()) {
if(p_area->get_gravity_distance_scale() > 0) {
@@ -393,6 +393,8 @@ void Body2DSW::_compute_area_gravity(const Area2DSW *p_area) {
gravity += p_area->get_gravity_vector() * p_area->get_gravity();
}
+ area_linear_damp += p_area->get_linear_damp();
+ area_angular_damp += p_area->get_angular_damp();
}
void Body2DSW::integrate_forces(real_t p_step) {
@@ -406,13 +408,15 @@ void Body2DSW::integrate_forces(real_t p_step) {
int ac = areas.size();
bool replace = false;
- gravity=Vector2(0,0);
+ gravity = Vector2(0,0);
+ area_angular_damp = 0;
+ area_linear_damp = 0;
if (ac) {
areas.sort();
const AreaCMP *aa = &areas[0];
damp_area = aa[ac-1].area;
for(int i=ac-1;i>=0;i--) {
- _compute_area_gravity(aa[i].area);
+ _compute_area_gravity_and_dampenings(aa[i].area);
if (aa[i].area->get_space_override_mode() == Physics2DServer::AREA_SPACE_OVERRIDE_REPLACE) {
replace = true;
break;
@@ -420,19 +424,20 @@ void Body2DSW::integrate_forces(real_t p_step) {
}
}
if( !replace ) {
- _compute_area_gravity(def_area);
+ _compute_area_gravity_and_dampenings(def_area);
}
gravity*=gravity_scale;
+ // If less than 0, override dampenings with that of the Body2D
if (angular_damp>=0)
- area_angular_damp=angular_damp;
- else
- area_angular_damp=damp_area->get_angular_damp();
+ area_angular_damp = angular_damp;
+ //else
+ // area_angular_damp=damp_area->get_angular_damp();
if (linear_damp>=0)
- area_linear_damp=linear_damp;
- else
- area_linear_damp=damp_area->get_linear_damp();
+ area_linear_damp = linear_damp;
+ //else
+ // area_linear_damp=damp_area->get_linear_damp();
Vector2 motion;
bool do_motion=false;
diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h
index 2fbfcaca60..8418c5dcd7 100644
--- a/servers/physics_2d/body_2d_sw.h
+++ b/servers/physics_2d/body_2d_sw.h
@@ -132,7 +132,7 @@ class Body2DSW : public CollisionObject2DSW {
Body2DSW *island_next;
Body2DSW *island_list_next;
- _FORCE_INLINE_ void _compute_area_gravity(const Area2DSW *p_area);
+ _FORCE_INLINE_ void _compute_area_gravity_and_dampenings(const Area2DSW *p_area);
friend class Physics2DDirectBodyStateSW; // i give up, too many functions to expose
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index aca301e0a8..50407f1b0f 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -1029,6 +1029,8 @@ public:
virtual int get_render_info(VS::RenderInfo p_info)=0;
+ virtual void set_force_16_bits_fbo(bool p_force) {}
+
Rasterizer();
virtual ~Rasterizer() {}
};
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 6532c3f0ac..68a60e26f5 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -1113,7 +1113,8 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::light_builtins_defs[]={
{ "SPECULAR_EXP", TYPE_FLOAT},
{ "SHADE_PARAM", TYPE_FLOAT},
{ "LIGHT", TYPE_VEC3},
- { "POINT_COORD", TYPE_VEC2},
+ { "SHADOW", TYPE_VEC3 },
+ { "POINT_COORD", TYPE_VEC2 },
// { "SCREEN_POS", TYPE_VEC2},
// { "SCREEN_TEXEL_SIZE", TYPE_VEC2},
{ "TIME", TYPE_FLOAT},
@@ -1369,7 +1370,7 @@ ShaderLanguage::Node* ShaderLanguage::validate_function_call(Parser&parser, Oper
}
}
- if (!fail) {
+ if (!fail && name == program->functions[i].name) {
p_func->return_cache=pfunc->return_type;
return p_func;
}