summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-01-14 12:26:56 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-01-14 14:52:23 +0100
commit93ab45b6b5c4f8e0619e963156c983009d399a9d (patch)
tree80e55993f29ad7bf502ef7388eef78114b2dc4ab /main
parent78e90ac60b81f17fdf8c319357f16962e92e6106 (diff)
Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
Diffstat (limited to 'main')
-rw-r--r--main/input_default.cpp2
-rw-r--r--main/main.cpp31
-rw-r--r--main/tests/test_containers.cpp3
-rw-r--r--main/tests/test_gui.cpp2
-rw-r--r--main/tests/test_math.cpp2
-rw-r--r--main/tests/test_physics.cpp4
-rw-r--r--main/tests/test_physics_2d.cpp20
-rw-r--r--main/tests/test_render.cpp6
-rw-r--r--main/tests/test_string.cpp2
9 files changed, 38 insertions, 34 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp
index a4023b23d2..50b0006438 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -307,7 +307,7 @@ void InputDefault::parse_input_event(const InputEvent& p_event) {
if (p_event.key.scancode==0)
break;
- // print_line(p_event);
+ //print_line(p_event);
if (p_event.key.pressed)
keys_pressed.insert(p_event.key.scancode);
diff --git a/main/main.cpp b/main/main.cpp
index fa5fee782c..e535da3e28 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -239,7 +239,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
while (I) {
I->get()=unescape_cmdline(I->get().strip_escapes());
-// print_line("CMD: "+I->get());
+ //print_line("CMD: "+I->get());
I=I->next();
}
@@ -879,10 +879,12 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
// Note 1: *zip_packed_data live into *packed_data
// Note 2: PackedData::~PackedData destroy this.
-//#ifdef MINIZIP_ENABLED
-// if (zip_packed_data)
-// memdelete( zip_packed_data );
-//#endif
+/*
+#ifdef MINIZIP_ENABLED
+ if (zip_packed_data)
+ memdelete( zip_packed_data );
+#endif
+*/
unregister_core_driver_types();
unregister_core_types();
@@ -955,7 +957,7 @@ Error Main::setup2() {
VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg,boot_logo_scale);
#ifndef TOOLS_ENABLED
//no tools, so free the boot logo (no longer needed)
- // GlobalConfig::get_singleton()->set("application/boot_logo",Image());
+ //GlobalConfig::get_singleton()->set("application/boot_logo",Image());
#endif
} else {
@@ -1009,7 +1011,7 @@ Error Main::setup2() {
//print_line("use custom cursor");
Ref<Texture> cursor=ResourceLoader::load(GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image"));
if (cursor.is_valid()) {
- // print_line("loaded ok");
+ //print_line("loaded ok");
Vector2 hotspot = GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image_hotspot");
Input::get_singleton()->set_custom_mouse_cursor(cursor,hotspot);
}
@@ -1587,9 +1589,10 @@ bool Main::iteration() {
double step=(double)ticks_elapsed / 1000000.0;
float frame_slice=1.0/Engine::get_singleton()->get_iterations_per_second();
-// if (time_accum+step < frame_slice)
-// return false;
-
+ /*
+ if (time_accum+step < frame_slice)
+ return false;
+ */
uint64_t fixed_process_ticks=0;
uint64_t idle_process_ticks=0;
@@ -1635,8 +1638,10 @@ bool Main::iteration() {
time_accum-=frame_slice;
message_queue->flush();
- //if (AudioServer::get_singleton())
- // AudioServer::get_singleton()->update();
+ /*
+ if (AudioServer::get_singleton())
+ AudioServer::get_singleton()->update();
+ */
fixed_process_ticks=MAX(fixed_process_ticks,OS::get_singleton()->get_ticks_usec()-fixed_begin); // keep the largest one for reference
fixed_process_max=MAX(OS::get_singleton()->get_ticks_usec()-fixed_begin,fixed_process_max);
@@ -1692,7 +1697,7 @@ bool Main::iteration() {
}
- // x11_delay_usec(10000);
+ //x11_delay_usec(10000);
frames++;
Engine::get_singleton()->_idle_frames++;
diff --git a/main/tests/test_containers.cpp b/main/tests/test_containers.cpp
index 4bc297d0ba..2711d107e4 100644
--- a/main/tests/test_containers.cpp
+++ b/main/tests/test_containers.cpp
@@ -55,7 +55,6 @@ MainLoop * test() {
{
-// static const int size = 16;
Image img;
img.create(default_mouse_cursor_xpm);
@@ -78,7 +77,7 @@ MainLoop * test() {
for (int i=0;i<1100;i++) {
int num=i;//(int)Math::random(0,1024);
- // print_line("inserting "+itos(num));
+ //print_line("inserting "+itos(num));
set.insert( num );
}
diff --git a/main/tests/test_gui.cpp b/main/tests/test_gui.cpp
index da0ff5d1ca..b0ebc20180 100644
--- a/main/tests/test_gui.cpp
+++ b/main/tests/test_gui.cpp
@@ -97,7 +97,7 @@ public:
Sprite *sp = memnew( Sprite );
sp->set_texture( vp->get_render_target_texture() );
-// sp->set_texture( ResourceLoader::load("res://ball.png") );
+ //sp->set_texture( ResourceLoader::load("res://ball.png") );
sp->set_pos(Point2(300,300));
get_root()->add_child(sp);
diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp
index f3d9ddba87..89513b81d9 100644
--- a/main/tests/test_math.cpp
+++ b/main/tests/test_math.cpp
@@ -596,7 +596,7 @@ MainLoop* test() {
{
- // print_line("NUM: "+itos(237641278346127));
+ //print_line("NUM: "+itos(237641278346127));
print_line("NUM: "+itos(-128));
return NULL;
diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp
index ea5b1cae85..ea98da34ca 100644
--- a/main/tests/test_physics.cpp
+++ b/main/tests/test_physics.cpp
@@ -358,9 +358,9 @@ public:
gxf.basis.scale(Vector3(1.4,0.4,1.4));
gxf.origin=Vector3(-2,1,-2);
make_grid(5,5,2.5,1,gxf);
- // create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,gxf);
+ //create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,gxf);
//create_static_plane( Plane( Vector3(0,1,0), -2) );
-// test_joint();
+ //test_joint();
test_fall();
//test_joint();
diff --git a/main/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp
index 2074d532b1..8a6a8c78f9 100644
--- a/main/tests/test_physics_2d.cpp
+++ b/main/tests/test_physics_2d.cpp
@@ -218,8 +218,10 @@ class TestPhysics2DMainLoop : public MainLoop {
void _do_ray_query() {
-// Physics2DServer *ps = Physics2DServer::get_singleton();
- // ps->query_intersection_segment(ray_query,ray_from,ray_to);
+ /*
+ Physics2DServer *ps = Physics2DServer::get_singleton();
+ ps->query_intersection_segment(ray_query,ray_from,ray_to);
+ */
}
@@ -273,7 +275,7 @@ protected:
ps->body_set_continuous_collision_detection_mode(body,Physics2DServer::CCD_MODE_CAST_SHAPE);
ps->body_set_state(body,Physics2DServer::BODY_STATE_TRANSFORM,p_xform);
-// print_line("add body with xform: "+p_xform);
+ //print_line("add body with xform: "+p_xform);
RID sprite = vs->canvas_item_create();
vs->canvas_item_set_parent(sprite,canvas);
vs->canvas_item_set_transform(sprite,p_xform);
@@ -281,8 +283,8 @@ protected:
vs->canvas_item_add_texture_rect(sprite,Rect2(-imgsize/2.0,imgsize),body_shape_data[p_shape].image);
ps->body_set_force_integration_callback(body,this,"_body_moved",sprite);
-// RID q = ps->query_create(this,"_body_moved",sprite);
-// ps->query_body_state(q,body);
+ //RID q = ps->query_create(this,"_body_moved",sprite);
+ //ps->query_body_state(q,body);
return body;
}
@@ -409,10 +411,12 @@ public:
};
Physics2DServer::ShapeType type = types[i%4];
-// type=Physics2DServer::SHAPE_SEGMENT;
+ //type=Physics2DServer::SHAPE_SEGMENT;
_add_body(type,Transform2D(i*0.8,Point2(152+i*40,100-40*i)));
- //if (i==0)
- // ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC);
+ /*
+ if (i==0)
+ ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC);
+ */
}
//RID b= _add_body(Physics2DServer::SHAPE_CIRCLE,Transform2D(0,Point2(101,140)));
diff --git a/main/tests/test_render.cpp b/main/tests/test_render.cpp
index 3049ba7d45..7380c1ff6a 100644
--- a/main/tests/test_render.cpp
+++ b/main/tests/test_render.cpp
@@ -192,7 +192,6 @@ public:
*/
RID lightaux;
- //*
lightaux = vs->light_create( VisualServer::LIGHT_DIRECTIONAL );
//vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) );
vs->light_set_color( lightaux, Color(1.0,1.0,1.0) );
@@ -203,17 +202,14 @@ public:
lla.set_look_at(Vector3(),Vector3(-0.000000,-0.836026,-0.548690),Vector3(0,1,0));
vs->instance_set_transform( light, lla );
- // */
- //*
lightaux = vs->light_create( VisualServer::LIGHT_OMNI );
-// vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,1.0) );
+ //vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,1.0) );
vs->light_set_color( lightaux, Color(1.0,1.0,0.0) );
vs->light_set_param( lightaux, VisualServer::LIGHT_PARAM_RANGE, 4 );
vs->light_set_param( lightaux, VisualServer::LIGHT_PARAM_ENERGY, 8 );
//vs->light_set_shadow( lightaux, true );
//light = vs->instance_create( lightaux );
- // */
ofs=0;
quit=false;
diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp
index d99ad4476f..a4a8ceb072 100644
--- a/main/tests/test_string.cpp
+++ b/main/tests/test_string.cpp
@@ -252,7 +252,7 @@ bool test_13() {
/* how can i embed UTF in here? */
static const CharType ustr[] = { 0x304A , 0x360F, 0x3088, 0x3046, 0 };
-// static const wchar_t ustr[] = { 'P', 0xCE, 'p',0xD3, 0 };
+ //static const wchar_t ustr[] = { 'P', 0xCE, 'p',0xD3, 0 };
String s=ustr;
OS::get_singleton()->print("\tUnicode: %ls\n",ustr);