summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/audio/audio_mixer_sw.cpp6
-rw-r--r--servers/physics/body_pair_sw.cpp4
-rw-r--r--servers/physics/collision_solver_sat.cpp1
-rw-r--r--servers/physics/shape_sw.cpp4
-rw-r--r--servers/physics/space_sw.cpp4
-rw-r--r--servers/physics_2d/shape_2d_sw.cpp3
-rw-r--r--servers/physics_2d/space_2d_sw.cpp4
-rw-r--r--servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp17
-rw-r--r--servers/visual/shader_language.cpp16
-rw-r--r--servers/visual/visual_server_raster.cpp8
-rw-r--r--servers/visual_server.cpp1
11 files changed, 1 insertions, 67 deletions
diff --git a/servers/audio/audio_mixer_sw.cpp b/servers/audio/audio_mixer_sw.cpp
index 64369182b1..17f8c36c9a 100644
--- a/servers/audio/audio_mixer_sw.cpp
+++ b/servers/audio/audio_mixer_sw.cpp
@@ -75,7 +75,7 @@ void AudioMixerSW::do_resample(const Depth* p_src, int32_t *p_dst, ResamplerStat
for(int i=0;i<(is_stereo?2:1);i++) {
- int16_t nibble,signed_nibble,diff,step;
+ int16_t nibble,diff,step;
p_state->ima_adpcm[i].last_nibble++;
const uint8_t *src_ptr=p_state->ima_adpcm[i].ptr;
@@ -92,10 +92,6 @@ void AudioMixerSW::do_resample(const Depth* p_src, int32_t *p_dst, ResamplerStat
if (p_state->ima_adpcm[i].step_index>88)
p_state->ima_adpcm[i].step_index=88;
- /*
- signed_nibble = (nibble&7) * ((nibble&8)?-1:1);
- diff = (2 * signed_nibble + 1) * step / 4; */
-
diff = step >> 3 ;
if (nibble & 1)
diff += step >> 2 ;
diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp
index 40e906c36c..3202e52abb 100644
--- a/servers/physics/body_pair_sw.cpp
+++ b/servers/physics/body_pair_sw.cpp
@@ -307,10 +307,6 @@ bool BodyPairSW::setup(float p_step) {
}
#endif
-
- int gather_A = A->can_report_contacts();
- int gather_B = B->can_report_contacts();
-
c.rA = global_A;
c.rB = global_B-offset_B;
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp
index 8789663f63..3e7719e5eb 100644
--- a/servers/physics/collision_solver_sat.cpp
+++ b/servers/physics/collision_solver_sat.cpp
@@ -1230,7 +1230,6 @@ static void _collision_capsule_convex_polygon(const ShapeSW *p_a,const Transform
const Geometry::MeshData::Edge *edges = mesh.edges.ptr();
int edge_count = mesh.edges.size();
const Vector3 *vertices = mesh.vertices.ptr();
- int vertex_count = mesh.vertices.size();
// faces of B
for (int i=0;i<face_count;i++) {
diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp
index 5923f89120..1d4914c945 100644
--- a/servers/physics/shape_sw.cpp
+++ b/servers/physics/shape_sw.cpp
@@ -766,7 +766,6 @@ bool ConvexPolygonShapeSW::intersect_segment(const Vector3& p_begin,const Vector
int fc = mesh.faces.size();
const Vector3 *vertices = mesh.vertices.ptr();
- int vc = mesh.vertices.size();
Vector3 n = p_end-p_begin;
float min = 1e20;
@@ -873,14 +872,11 @@ void FaceShapeSW::project_range(const Vector3& p_normal, const Transform& p_tran
Vector3 FaceShapeSW::get_support(const Vector3& p_normal) const {
- Vector3 n=p_normal;
-
int vert_support_idx=-1;
float support_max;
for (int i=0;i<3;i++) {
- //float d=n.dot(vertex[i]);
float d=p_normal.dot(vertex[i]);
if (i==0 || d > support_max) {
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp
index 1e6f42aa02..7077146420 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics/space_sw.cpp
@@ -150,7 +150,6 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transfo
int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results);
- bool collided=false;
int cc=0;
//Transform ai = p_xform.affine_inverse();
@@ -269,7 +268,6 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform&
for(int i=0;i<8;i++) { //steps should be customizable..
- Transform xfa = p_xform;
float ofs = (low+hi)*0.5;
Vector3 sep=mnormal; //important optimization for this to work fast enough
@@ -337,7 +335,6 @@ bool PhysicsDirectSpaceStateSW::collide_shape(RID p_shape, const Transform& p_sh
int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results);
bool collided=false;
- int cc=0;
r_result_count=0;
PhysicsServerSW::CollCbkData cbk;
@@ -457,7 +454,6 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform& p_shape_
if (rcd.best_object->get_type()==CollisionObjectSW::TYPE_BODY) {
const BodySW *body = static_cast<const BodySW*>(rcd.best_object);
- Vector3 rel_vec = r_info->point-body->get_transform().get_origin();
r_info->linear_velocity = body->get_linear_velocity() +
(body->get_angular_velocity()).cross(body->get_transform().origin-rcd.best_contact);// * mPos);
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp
index 8b583dd3c6..9291aa6c17 100644
--- a/servers/physics_2d/shape_2d_sw.cpp
+++ b/servers/physics_2d/shape_2d_sw.cpp
@@ -243,7 +243,6 @@ bool SegmentShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p
if (!Geometry::segment_intersects_segment_2d(p_begin,p_end,a,b,&r_point))
return false;
- Vector2 d = p_end-p_begin;
if (n.dot(p_begin) > n.dot(a)) {
r_normal=n;
} else {
@@ -825,7 +824,6 @@ bool ConcavePolygonShape2DSW::intersect_segment(const Vector2& p_begin,const Vec
const Segment *segmentptr=&segments[0];
const Vector2 *pointptr=&points[0];
const BVH *bvhptr = &bvh[0];
- int pos=bvh.size()-1;
stack[0]=0;
@@ -1088,7 +1086,6 @@ void ConcavePolygonShape2DSW::cull(const Rect2& p_local_aabb,Callback p_callback
const Segment *segmentptr=&segments[0];
const Vector2 *pointptr=&points[0];
const BVH *bvhptr = &bvh[0];
- int pos=bvh.size()-1;
stack[0]=0;
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index ddef5fc86b..5fde6f567b 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -200,7 +200,6 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Matri
int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,p_result_max,space->intersection_query_subindex_results);
- bool collided=false;
int cc=0;
for(int i=0;i<amount;i++) {
@@ -307,7 +306,6 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Matrix32
for(int i=0;i<8;i++) { //steps should be customizable..
- Matrix32 xfa = p_xform;
float ofs = (low+hi)*0.5;
Vector2 sep=mnormal; //important optimization for this to work fast enough
@@ -377,7 +375,6 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Matrix32& p_s
int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,Space2DSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results);
bool collided=false;
- int cc=0;
r_result_count=0;
Physics2DServerSW::CollCbkData cbk;
@@ -768,7 +765,6 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body,const Vector2&p_motion,float p
for(int i=0;i<8;i++) { //steps should be customizable..
- //Matrix32 xfa = p_xform;
float ofs = (low+hi)*0.5;
Vector2 sep=mnormal; //important optimization for this to work fast enough
diff --git a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp
index d27b322c21..6c42c2f527 100644
--- a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp
+++ b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp
@@ -851,23 +851,6 @@ void SpatialSound2DServerSW::update(float p_delta) {
//this could be optimized at some point... am not sure
Space *space=space_owner.get(source->space);
Room *room=room_owner.get(space->default_room);
- int max_level=-0x80000000;
- /*
- int rooms_culled = space->octree.cull_point(source->transform.origin,cull_rooms,MAX_CULL_ROOMS);
- for(int i=0;i<rooms_culled;i++) {
-
- Room *r=cull_rooms[i];
- ERR_CONTINUE( r->bounds.is_empty() ); // how did this happen??
- if (r->level<=max_level) //ignore optimization (level too low)
- continue;
- Vector2 local_point = r->inverse_transform.xform(source->transform.origin);
- if (!r->bounds.point_is_inside(local_point))
- continue;
- room=r;
- max_level=r->level;
-
- }
- */
//compute mixing weights (support for multiple listeners in the same output)
float total_distance=0;
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 0b2a282c04..09b3ada509 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -2539,8 +2539,6 @@ Error ShaderLanguage::parse_block(Parser& parser,BlockNode *p_block) {
Error ShaderLanguage::parse(const Vector<Token>& p_tokens,ShaderType p_type,CompileFunc p_compile_func,void *p_userdata,String *r_error,int *r_err_line,int *r_err_column) {
- uint64_t t = OS::get_singleton()->get_ticks_usec();
-
Parser parser(p_tokens);
parser.program = parser.create_node<ProgramNode>(NULL);
parser.program->body = parser.create_node<BlockNode>(parser.program);
@@ -2605,18 +2603,10 @@ Error ShaderLanguage::parse(const Vector<Token>& p_tokens,ShaderType p_type,Comp
return err;
}
- double tf = (OS::get_singleton()->get_ticks_usec()-t)/1000.0;
- //print_line("parse time: "+rtos(tf));
-
- t = OS::get_singleton()->get_ticks_usec();
-
if (p_compile_func) {
err = p_compile_func(p_userdata,parser.program);
}
- tf = (OS::get_singleton()->get_ticks_usec()-t)/1000.0;
- //print_line("compile time: "+rtos(tf));
-
//clean up nodes created
while(parser.nodegc.size()) {
@@ -2633,22 +2623,16 @@ Error ShaderLanguage::compile(const String& p_code,ShaderType p_type,CompileFunc
*r_err_column=0;
Vector<Token> tokens;
- uint64_t t = OS::get_singleton()->get_ticks_usec();
-
Error err = tokenize(p_code,&tokens,r_error,r_err_line,r_err_column);
if (err!=OK) {
print_line("tokenizer error!");
}
- double tf = (OS::get_singleton()->get_ticks_usec()-t)/1000.0;
- //print_line("tokenize time: "+rtos(tf));
-
if (err!=OK) {
return err;
}
err = parse(tokens,p_type,p_compile_func,p_userdata,r_error,r_err_line,r_err_column);
if (err!=OK) {
- //print_line("LDEBUG: "+lex_debug(p_code));
return err;
}
return OK;
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index 532247d94c..526179c41f 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -4843,11 +4843,6 @@ void VisualServerRaster::_instance_draw(Instance *p_instance) {
switch(p_instance->base_type) {
case INSTANCE_MESH: {
- const float *morphs = NULL;
- if (!p_instance->data.morph_values.empty()) {
- morphs=&p_instance->data.morph_values[0];
- }
-
rasterizer->add_mesh(p_instance->base_rid, &p_instance->data);
} break;
case INSTANCE_MULTIMESH: {
@@ -5227,8 +5222,6 @@ void VisualServerRaster::_light_instance_update_lispsm_shadow(Instance *p_light,
Vector3 light_vec = -p_light->data.transform.basis.get_axis(2);
Vector3 view_vec = -p_camera->transform.basis.get_axis(2);
- float viewdot = light_vec.normalized().dot(view_vec.normalized());
-
float near_dist=1;
@@ -6466,7 +6459,6 @@ void VisualServerRaster::_render_no_camera(Viewport *p_viewport,Camera *p_camera
void VisualServerRaster::_render_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario) {
- uint64_t t = OS::get_singleton()->get_ticks_usec();
render_pass++;
uint32_t camera_layer_mask=p_camera->visible_layers;
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index fafc09f554..9ec02f5071 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -757,7 +757,6 @@ void VisualServer::mesh_add_surface_from_mesh_data( RID p_mesh, const Geometry::
}
}
- int s = mesh_get_surface_count(p_mesh);
Array d;
d.resize(VS::ARRAY_MAX);
d[ARRAY_VERTEX]=vertices;