summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/audio/audio_stream.cpp6
-rw-r--r--servers/audio/audio_stream.h6
-rw-r--r--servers/audio_server.cpp2
-rw-r--r--servers/physics/body_sw.cpp5
-rw-r--r--servers/physics/joints/generic_6dof_joint_sw.cpp4
-rw-r--r--servers/physics/physics_server_sw.cpp14
-rw-r--r--servers/physics_2d/physics_2d_server_sw.cpp14
-rw-r--r--servers/visual/visual_server_raster.cpp3
-rw-r--r--servers/visual/visual_server_raster.h2
9 files changed, 14 insertions, 42 deletions
diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp
index 0e3d5824d9..d7b2c2c5e0 100644
--- a/servers/audio/audio_stream.cpp
+++ b/servers/audio/audio_stream.cpp
@@ -191,12 +191,12 @@ void AudioStreamPlaybackRandomPitch::seek(float p_time) {
}
}
-void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) {
+void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
if (playing.is_valid()) {
- playing->mix(p_bufer, p_rate_scale * pitch_scale, p_frames);
+ playing->mix(p_buffer, p_rate_scale * pitch_scale, p_frames);
} else {
for (int i = 0; i < p_frames; i++) {
- p_bufer[i] = AudioFrame(0, 0);
+ p_buffer[i] = AudioFrame(0, 0);
}
}
}
diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h
index 3324597b41..dc931502b4 100644
--- a/servers/audio/audio_stream.h
+++ b/servers/audio/audio_stream.h
@@ -48,7 +48,7 @@ public:
virtual float get_playback_position() const = 0;
virtual void seek(float p_time) = 0;
- virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) = 0;
+ virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) = 0;
virtual float get_length() const = 0; //if supported, otherwise return 0
};
@@ -70,7 +70,7 @@ class AudioStreamPlaybackResampled : public AudioStreamPlayback {
protected:
void _begin_resample();
- virtual void _mix_internal(AudioFrame *p_bufer, int p_frames) = 0;
+ virtual void _mix_internal(AudioFrame *p_buffer, int p_frames) = 0;
virtual float get_stream_sampling_rate() = 0;
public:
@@ -136,7 +136,7 @@ public:
virtual float get_playback_position() const;
virtual void seek(float p_time);
- virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames);
+ virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames);
virtual float get_length() const; //if supported, otherwise return 0
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp
index 18b7014595..697abead68 100644
--- a/servers/audio_server.cpp
+++ b/servers/audio_server.cpp
@@ -226,7 +226,7 @@ void AudioServer::_driver_process(int p_frames, int32_t *p_buffer) {
static int total = 0;
ticks = OS::get_singleton()->get_ticks_msec();
- if ((ticks - first_ticks) > 10 * 1000) {
+ if ((ticks - first_ticks) > 10 * 1000 && count > 0) {
print_line("Audio Driver " + String(AudioDriver::get_singleton()->get_name()) + " average latency: " + itos(total / count) + "ms (frame=" + itos(p_frames) + ")");
first_ticks = ticks;
total = 0;
diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp
index 46a5192e52..6ced004118 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics/body_sw.cpp
@@ -45,8 +45,9 @@ void BodySW::_update_transform_dependant() {
// update inertia tensor
Basis tb = principal_inertia_axes;
Basis tbt = tb.transposed();
- tb.scale(_inv_inertia);
- _inv_inertia_tensor = tb * tbt;
+ Basis diag;
+ diag.scale(_inv_inertia);
+ _inv_inertia_tensor = tb * diag * tbt;
}
void BodySW::update_inertias() {
diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp
index 70cc549e2d..1e323be36c 100644
--- a/servers/physics/joints/generic_6dof_joint_sw.cpp
+++ b/servers/physics/joints/generic_6dof_joint_sw.cpp
@@ -219,9 +219,9 @@ Generic6DOFJointSW::Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform
}
void Generic6DOFJointSW::calculateAngleInfo() {
- Basis relative_frame = m_calculatedTransformA.basis.inverse() * m_calculatedTransformB.basis;
+ Basis relative_frame = m_calculatedTransformB.basis.inverse() * m_calculatedTransformA.basis;
- m_calculatedAxisAngleDiff = relative_frame.get_euler();
+ m_calculatedAxisAngleDiff = relative_frame.get_euler_xyz();
// in euler angle mode we do not actually constrain the angular velocity
// along the axes axis[0] and axis[2] (although we do use axis[1]) :
diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp
index a7c31cf16c..5ba935d47c 100644
--- a/servers/physics/physics_server_sw.cpp
+++ b/servers/physics/physics_server_sw.cpp
@@ -233,14 +233,7 @@ void PhysicsServerSW::area_set_space(RID p_area, RID p_space) {
if (area->get_space() == space)
return; //pointless
- for (Set<ConstraintSW *>::Element *E = area->get_constraints().front(); E; E = E->next()) {
- RID self = E->get()->get_self();
- if (!self.is_valid())
- continue;
- free(self);
- }
area->clear_constraints();
-
area->set_space(space);
};
@@ -494,14 +487,7 @@ void PhysicsServerSW::body_set_space(RID p_body, RID p_space) {
if (body->get_space() == space)
return; //pointless
- for (Map<ConstraintSW *, int>::Element *E = body->get_constraint_map().front(); E; E = E->next()) {
- RID self = E->key()->get_self();
- if (!self.is_valid())
- continue;
- free(self);
- }
body->clear_constraint_map();
-
body->set_space(space);
};
diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp
index df3bf72a31..5d3305c82d 100644
--- a/servers/physics_2d/physics_2d_server_sw.cpp
+++ b/servers/physics_2d/physics_2d_server_sw.cpp
@@ -299,14 +299,7 @@ void Physics2DServerSW::area_set_space(RID p_area, RID p_space) {
if (area->get_space() == space)
return; //pointless
- for (Set<Constraint2DSW *>::Element *E = area->get_constraints().front(); E; E = E->next()) {
- RID self = E->get()->get_self();
- if (!self.is_valid())
- continue;
- free(self);
- }
area->clear_constraints();
-
area->set_space(space);
};
@@ -551,14 +544,7 @@ void Physics2DServerSW::body_set_space(RID p_body, RID p_space) {
if (body->get_space() == space)
return; //pointless
- for (Map<Constraint2DSW *, int>::Element *E = body->get_constraint_map().front(); E; E = E->next()) {
- RID self = E->key()->get_self();
- if (!self.is_valid())
- continue;
- free(self);
- }
body->clear_constraint_map();
-
body->set_space(space);
};
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index c644fd2d55..69e2d1c162 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -102,6 +102,7 @@ void VisualServerRaster::draw() {
VSG::viewport->draw_viewports();
VSG::scene->render_probes();
+ _draw_margins();
VSG::rasterizer->end_frame();
while (frame_drawn_callbacks.front()) {
@@ -119,8 +120,6 @@ void VisualServerRaster::draw() {
frame_drawn_callbacks.pop_front();
}
-
- _draw_margins();
}
void VisualServerRaster::sync() {
}
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 302f13ee4f..425381550e 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -281,7 +281,7 @@ class VisualServerRaster : public VisualServer {
Set<Instance*> owned_instances;
BakedLightSampler *sampler;
int resolution;
- Vector<Color> light_bufer;
+ Vector<Color> light_buffer;
RID sampled_light;
uint64_t last_pass;
Transform xform; // viewspace normal to lightspace, might not use one.