summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/tests/test_math.cpp3
-rw-r--r--drivers/chibi/cp_envelope.cpp1
-rw-r--r--drivers/chibi/cp_loader_xm.cpp4
-rw-r--r--drivers/chibi/cp_player_data_events.cpp8
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp34
-rw-r--r--drivers/jpegd/image_loader_jpegd.cpp2
-rw-r--r--drivers/openssl/stream_peer_openssl.cpp1
-rw-r--r--drivers/png/resource_saver_png.cpp1
-rw-r--r--drivers/speex/audio_stream_speex.cpp10
-rw-r--r--drivers/theora/video_stream_theora.cpp15
-rw-r--r--main/main.cpp7
-rw-r--r--modules/gdscript/gd_compiler.cpp6
-rw-r--r--modules/gdscript/gd_editor.cpp57
-rw-r--r--modules/gdscript/gd_functions.cpp1
-rw-r--r--modules/gdscript/gd_parser.cpp2
-rw-r--r--modules/gdscript/gd_tokenizer.cpp1
-rw-r--r--modules/gridmap/grid_map.cpp1
-rw-r--r--modules/ik/ik.cpp2
-rw-r--r--platform/bb10/export/export.cpp1
-rw-r--r--platform/x11/joystick_linux.cpp3
-rw-r--r--scene/gui/dialogs.cpp2
-rw-r--r--scene/gui/graph_edit.cpp1
-rw-r--r--scene/gui/label.cpp1
-rw-r--r--scene/gui/line_edit.cpp5
-rw-r--r--scene/gui/progress_bar.cpp2
-rw-r--r--scene/gui/rich_text_label.cpp66
-rw-r--r--scene/gui/scroll_container.cpp1
-rw-r--r--scene/gui/tab_container.cpp31
-rw-r--r--scene/gui/text_edit.cpp1
-rw-r--r--scene/gui/texture_button.cpp3
-rw-r--r--scene/gui/texture_frame.cpp20
-rw-r--r--scene/gui/tree.cpp15
-rw-r--r--scene/gui/video_player.cpp10
-rw-r--r--scene/main/node.cpp1
-rw-r--r--tools/collada/collada.cpp7
-rw-r--r--tools/editor/animation_editor.cpp5
-rw-r--r--tools/editor/dependency_editor.cpp3
-rw-r--r--tools/editor/editor_node.cpp13
-rw-r--r--tools/editor/editor_path.cpp1
-rw-r--r--tools/editor/import_settings.cpp81
-rw-r--r--tools/editor/io_plugins/editor_atlas.cpp6
-rw-r--r--tools/editor/io_plugins/editor_import_collada.cpp6
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp10
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.cpp4
-rw-r--r--tools/editor/io_plugins/editor_translation_import_plugin.cpp2
-rw-r--r--tools/editor/output_strings.cpp1
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp1
-rw-r--r--tools/editor/plugins/animation_tree_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/baked_light_baker.cpp11
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp11
-rw-r--r--tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/collision_polygon_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/editor_preview_plugins.cpp12
-rw-r--r--tools/editor/plugins/light_occluder_2d_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/navigation_polygon_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/particles_editor_plugin.cpp1
-rw-r--r--tools/editor/plugins/polygon_2d_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/sample_editor_plugin.cpp10
-rw-r--r--tools/editor/plugins/shader_editor_plugin.cpp5
-rw-r--r--tools/editor/plugins/shader_graph_editor_plugin.cpp3
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp75
-rw-r--r--tools/editor/project_export.cpp1
-rw-r--r--tools/editor/project_manager.cpp3
-rw-r--r--tools/editor/property_editor.cpp6
-rw-r--r--tools/editor/scene_tree_dock.cpp27
-rw-r--r--tools/editor/scenes_dock.cpp57
-rw-r--r--tools/editor/script_editor_debugger.cpp1
-rw-r--r--tools/editor/spatial_editor_gizmos.cpp78
68 files changed, 50 insertions, 722 deletions
diff --git a/bin/tests/test_math.cpp b/bin/tests/test_math.cpp
index 9110f72620..8e08969fa4 100644
--- a/bin/tests/test_math.cpp
+++ b/bin/tests/test_math.cpp
@@ -125,10 +125,7 @@ MainLoop* test() {
for (List<StringName>::Element *E=tl.front();E;E=E->next()) {
Vector<uint8_t> m5b = E->get().operator String().md5_buffer();
- uint32_t *ub = (uint32_t*)m5b.ptr();
- //hashes.push_back(ihash(ihash2(ihash3(*ub))));
hashes.push_back(hashes.size());
- //hashes.push_back(E->get().hash());
}
diff --git a/drivers/chibi/cp_envelope.cpp b/drivers/chibi/cp_envelope.cpp
index fab8a68ada..9892b6d4b0 100644
--- a/drivers/chibi/cp_envelope.cpp
+++ b/drivers/chibi/cp_envelope.cpp
@@ -359,7 +359,6 @@ uint8_t CPEnvelope::get_node_count() {
const CPEnvelope::Point& CPEnvelope::get_node(int p_idx) {
- static Point errpoint;
if (p_idx<0 || p_idx>=node_count)
return node[node_count-1];
diff --git a/drivers/chibi/cp_loader_xm.cpp b/drivers/chibi/cp_loader_xm.cpp
index 8ab6abc650..bff8615a32 100644
--- a/drivers/chibi/cp_loader_xm.cpp
+++ b/drivers/chibi/cp_loader_xm.cpp
@@ -560,8 +560,7 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
if (s_idx==-1) ABORT_LOAD;
//printf("free sample: %i\n",s_idx);
-
- char auxb;
+
CPSample& sample=*song->get_sample(s_idx);
int sample_size=file->get_dword();
@@ -611,6 +610,7 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
sm->set_c5_freq( sample_data, CPTables::get_linear_frequency(CPTables::get_linear_period(note_offset<<1,finetune)) );
//printf("NOTE %i,fine %i\n",note_offset,finetune);
+ char auxb;
auxb=file->get_byte(); //reserved?
file->get_byte_array((uint8_t*)instrname,22);
sample.set_name(instrname);
diff --git a/drivers/chibi/cp_player_data_events.cpp b/drivers/chibi/cp_player_data_events.cpp
index 8122988516..fb5090461b 100644
--- a/drivers/chibi/cp_player_data_events.cpp
+++ b/drivers/chibi/cp_player_data_events.cpp
@@ -325,8 +325,6 @@ void CPPlayer::update_mixer() {
printf("cgb %i\n",(int)v.master_channel->channel_global_volume);
*/
-
- int cv=v.master_channel->channel_global_volume;
tmpvol=(uint64_t)v.fadeout_volume; /* max 1024 - 10 bits */
tmpvol*=(uint64_t)v.channel_volume; /* * max 64 - 6 bits */
@@ -338,13 +336,9 @@ void CPPlayer::update_mixer() {
tmpvol*=(uint64_t)song->get_mixing_volume(); /* max 128 - 7 bits */
tmpvol*=(uint64_t)control.global_volume; /* max 128 - 7 bits*/
/* total 10+6+8+6+7+7=44 bits */
- uint64_t preshift=tmpvol;
+
tmpvol>>=43; /* Move back to 8 bits range , 44-19+8=43*/
- /*
- if (!tmpvol && preshift>>35)
- tmpvol=1; // even if the volume should be inaudible, some people WANTS to hear this.
- */
if (tmpvol>CP_VOL_MAX)
tmpvol=CP_VOL_MAX;
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 8bd2fe3862..4cd97a7f6a 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -2205,8 +2205,6 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui
AABB aabb;
float scale=1;
- float max=0;
-
if (p_surface->array[VS::ARRAY_VERTEX].datatype==_GL_HALF_FLOAT_OES) {
@@ -5913,8 +5911,7 @@ Error RasterizerGLES2::_setup_geometry(const Geometry *p_geometry, const Materia
base = skinned_buffer;
//copy stuff and get it ready for the skeleton
- int src_stride = surf->stride;
- int dst_stride = surf->stride - ( surf->array[VS::ARRAY_BONES].size + surf->array[VS::ARRAY_WEIGHTS].size );
+ int dst_stride = surf->stride - ( surf->array[VS::ARRAY_BONES].size + surf->array[VS::ARRAY_WEIGHTS].size );
const uint8_t *src_weights=&surf->array_local[surf->array[VS::ARRAY_WEIGHTS].ofs];
const uint8_t *src_bones=&surf->array_local[surf->array[VS::ARRAY_BONES].ofs];
const Skeleton::Bone *skeleton = &p_skeleton->bones[0];
@@ -6316,9 +6313,9 @@ void RasterizerGLES2::_render(const Geometry *p_geometry,const Material *p_mater
void RasterizerGLES2::_setup_shader_params(const Material *p_material) {
+#if 0
int idx=0;
int tex_idx=0;
-#if 0
for(Map<StringName,Variant>::Element *E=p_material->shader_cache->params.front();E;E=E->next(),idx++) {
Variant v; //
@@ -6384,7 +6381,6 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
uint16_t prev_light=0x777E;
const Geometry *prev_geometry_cmp=NULL;
uint8_t prev_light_type=0xEF;
- const ParamOverrideMap* prev_overrides=NULL; // make it diferent than NULL
const Skeleton *prev_skeleton =NULL;
uint8_t prev_sort_flags=0xFF;
const BakedLightData *prev_baked_light=NULL;
@@ -6392,8 +6388,6 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
const float *prev_morph_values=NULL;
int prev_receive_shadows_state=-1;
- Geometry::Type prev_geometry_type=Geometry::GEOMETRY_INVALID;
-
material_shader.set_conditional(MaterialShaderGLES2::USE_VERTEX_LIGHTING,!shadow && !p_fragment_light);
material_shader.set_conditional(MaterialShaderGLES2::USE_FRAGMENT_LIGHTING,!shadow && p_fragment_light);
material_shader.set_conditional(MaterialShaderGLES2::USE_SKELETON,false);
@@ -6450,12 +6444,10 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
prev_light=0x777E;
prev_geometry_cmp=NULL;
prev_light_type=0xEF;
- prev_overrides=NULL; // make it diferent than NULL
prev_skeleton =NULL;
prev_sort_flags=0xFF;
prev_morph_values=NULL;
prev_receive_shadows_state=-1;
- prev_geometry_type=Geometry::GEOMETRY_INVALID;
glEnable(GL_BLEND);
glDepthMask(GL_TRUE);
glEnable(GL_DEPTH_TEST);
@@ -6838,7 +6830,6 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
prev_sort_flags=sort_flags;
prev_baked_light=baked_light;
prev_morph_values=morph_values;
-// prev_geometry_type=geometry->type;
prev_receive_shadows_state=receive_shadows_state;
}
@@ -8877,8 +8868,6 @@ void RasterizerGLES2::canvas_light_shadow_buffer_update(RID p_buffer, const Matr
glEnableVertexAttribArray(VS::ARRAY_VERTEX);
canvas_shadow_shader.bind();
- const int vp_height = 10;
-
glViewport(0, 0, cls->size,cls->height);
_glClearDepth(1.0f);
glClearColor(1,1,1,1);
@@ -8920,12 +8909,6 @@ void RasterizerGLES2::canvas_light_shadow_buffer_update(RID p_buffer, const Matr
Vector3 cam_target=Matrix3(Vector3(0,0,Math_PI*2*(i/4.0))).xform(Vector3(0,1,0));
projection = projection * CameraMatrix(Transform().looking_at(cam_target,Vector3(0,0,-1)).affine_inverse());
- //print_line("near: "+rtos(p_near));
- //print_line("far: "+rtos(p_far));
- //projection.set_perspective(60,size/float(vp_height),p_near,p_far);
-
- // CameraMatrix light_mat = projection * CameraMatrix(camera);
-
canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES2::PROJECTION_MATRIX,projection);
canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES2::LIGHT_MATRIX,light);
@@ -9501,19 +9484,15 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const
if (ci->copy_back_buffer && framebuffer.active && framebuffer.scale==1) {
Rect2 rect;
- int x,y,w,h;
+ int x,y;
if (ci->copy_back_buffer->full) {
x = viewport.x;
y = window_size.height-(viewport.height+viewport.y);
- w = viewport.width;
- h = viewport.height;
} else {
x = viewport.x+ci->copy_back_buffer->screen_rect.pos.x;
y = window_size.height-(viewport.y+ci->copy_back_buffer->screen_rect.pos.y+ci->copy_back_buffer->screen_rect.size.y);
- w = ci->copy_back_buffer->screen_rect.size.x;
- h = ci->copy_back_buffer->screen_rect.size.y;
}
glActiveTexture(GL_TEXTURE0+max_texture_units-1);
glBindTexture(GL_TEXTURE_2D,framebuffer.sample_color);
@@ -9531,9 +9510,6 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const
} else {
glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height);
}
-// if (current_clip) {
-// // print_line(" a clip ");
-// }
canvas_texscreen_used=true;
glActiveTexture(GL_TEXTURE0);
@@ -10496,7 +10472,6 @@ void RasterizerGLES2::_update_framebuffer() {
// GLuint format_rgba = use_fp16_fb?_GL_RGBA16F_EXT:GL_RGBA;
GLuint format_rgba = GL_RGBA;
- GLuint format_rgb = use_fp16_fb?_GL_RGB16F_EXT:GL_RGB;
GLuint format_type = use_fp16_fb?_GL_HALF_FLOAT_OES:GL_UNSIGNED_BYTE;
GLuint format_internal=GL_RGBA;
@@ -10998,10 +10973,9 @@ void RasterizerGLES2::init() {
{
//shadowmaps
- OS::VideoMode vm=OS::get_singleton()->get_video_mode();
//don't use a shadowbuffer too big in GLES, this should be the maximum
- int max_shadow_size = GLOBAL_DEF("rasterizer/max_shadow_buffer_size",1024);//nearest_power_of_2(MIN(vm.width,vm.height))/2;
+ int max_shadow_size = GLOBAL_DEF("rasterizer/max_shadow_buffer_size",1024);
int smsize=max_shadow_size;
while(smsize>=16) {
diff --git a/drivers/jpegd/image_loader_jpegd.cpp b/drivers/jpegd/image_loader_jpegd.cpp
index 913a7bdf39..496334605d 100644
--- a/drivers/jpegd/image_loader_jpegd.cpp
+++ b/drivers/jpegd/image_loader_jpegd.cpp
@@ -129,6 +129,8 @@ static Image _jpegd_mem_loader_func(const uint8_t* p_png,int p_size) {
Image img;
Error err = jpeg_load_image_from_buffer(&img,p_png,p_size);
+ if (err)
+ ERR_PRINT("Couldn't initialize ImageLoaderJPG with the given resource.");
return img;
}
diff --git a/drivers/openssl/stream_peer_openssl.cpp b/drivers/openssl/stream_peer_openssl.cpp
index 9349df3793..aa3d8a8f7f 100644
--- a/drivers/openssl/stream_peer_openssl.cpp
+++ b/drivers/openssl/stream_peer_openssl.cpp
@@ -469,7 +469,6 @@ Error StreamPeerOpenSSL::put_partial_data(const uint8_t* p_data,int p_bytes, int
if (p_bytes==0)
return OK;
- int s=0;
Error err = put_data(p_data,p_bytes);
if (err!=OK)
return err;
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp
index b91329c8da..2578fe9eb6 100644
--- a/drivers/png/resource_saver_png.cpp
+++ b/drivers/png/resource_saver_png.cpp
@@ -133,7 +133,6 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) {
}
int pngf=0;
- int pngb=8;
int cs=0;
diff --git a/drivers/speex/audio_stream_speex.cpp b/drivers/speex/audio_stream_speex.cpp
index 79f3e58ac0..3aa80fd0b9 100644
--- a/drivers/speex/audio_stream_speex.cpp
+++ b/drivers/speex/audio_stream_speex.cpp
@@ -69,8 +69,7 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
return 0;
};
- int eos = 0;
- bool reloaded=false;
+ int eos = 0;
while (todo > page_size) {
@@ -100,7 +99,6 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
packets_available=true;
}
/*Extract all available packets*/
- //int packet_no=0;
while (todo > page_size && !eos) {
if (ogg_stream_packetout(&os, &op)!=1) {
@@ -157,7 +155,6 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
{
- int frame_offset = 0;
int new_frame_size = frame_size;
/*printf ("packet %d %d\n", packet_no, skip_samples);*/
@@ -165,7 +162,6 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
{
/*printf ("chopping first packet\n");*/
new_frame_size -= skip_samples;
- frame_offset = skip_samples;
}
if (packet_no == page_nb_packets && skip_samples < 0)
{
@@ -241,10 +237,8 @@ void AudioStreamPlaybackSpeex::unload() {
void *AudioStreamPlaybackSpeex::process_header(ogg_packet *op, int *frame_size, int *rate, int *nframes, int *channels, int *extra_headers) {
- void *st;
SpeexHeader *header;
int modeID;
- SpeexCallback callback;
header = speex_packet_to_header((char*)op->packet, op->bytes);
if (!header)
@@ -353,7 +347,6 @@ void AudioStreamPlaybackSpeex::reload() {
/*Loop for all complete pages we got (most likely only one)*/
while (ogg_sync_pageout(&oy, &og)==1) {
- int packet_no;
if (stream_init == 0) {
ogg_stream_init(&os, ogg_page_serialno(&og));
stream_init = 1;
@@ -377,7 +370,6 @@ void AudioStreamPlaybackSpeex::reload() {
last_granule = page_granule;
/*Extract all available packets*/
- packet_no=0;
while (!eos && ogg_stream_packetout(&os, &op)==1)
{
/*If first packet, process as Speex header*/
diff --git a/drivers/theora/video_stream_theora.cpp b/drivers/theora/video_stream_theora.cpp
index fa2a79dc7b..1f3832ec16 100644
--- a/drivers/theora/video_stream_theora.cpp
+++ b/drivers/theora/video_stream_theora.cpp
@@ -81,12 +81,12 @@ int VideoStreamPlaybackTheora::queue_page(ogg_page *page){
void VideoStreamPlaybackTheora::video_write(void){
th_ycbcr_buffer yuv;
- int y_offset, uv_offset;
th_decode_ycbcr_out(td,yuv);
+ /*
+ int y_offset, uv_offset;
y_offset=(ti.pic_x&~1)+yuv[0].stride*(ti.pic_y&~1);
- /*
{
int pixels = size.x * size.y;
frame_data.resize(pixels * 4);
@@ -117,7 +117,7 @@ void VideoStreamPlaybackTheora::video_write(void){
DVector<uint8_t>::Write w = frame_data.write();
char* dst = (char*)w.ptr();
- uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y/2);
+ //uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y/2);
if (px_fmt == TH_PF_444) {
@@ -543,16 +543,10 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
bool frame_done=false;
bool audio_done=!vorbis_p;
- bool theora_done=false;
-
while (!frame_done || (!audio_done && !vorbis_eos)) {
//a frame needs to be produced
ogg_packet op;
- bool audio_pending = false;
-
-
- bool no_vorbis=false;
bool no_theora=false;
@@ -604,8 +598,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
int tr = vorbis_synthesis_read(&vd, ret-to_read);
- audio_pending=true;
-
if (vd.granulepos>=0) {
// print_line("wrote: "+itos(audio_frames_wrote)+" gpos: "+itos(vd.granulepos));
@@ -627,7 +619,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
}
} else { /* we need more data; break out to suck in another page */
//printf("need moar data\n");
- no_vorbis=true;
break;
};
}
diff --git a/main/main.cpp b/main/main.cpp
index de212deefd..41a032842d 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -101,7 +101,6 @@ static bool init_fullscreen=false;
static bool init_use_custom_pos=false;
static bool debug_collisions=false;
static bool debug_navigation=false;
-static bool allow_hidpi=true;
static Vector2 init_custom_pos;
static int video_driver_idx=-1;
static int audio_driver_idx=-1;
@@ -262,7 +261,6 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
Vector<String> breakpoints;
bool use_custom_res=true;
bool force_res=false;
- bool profile=false;
I=args.front();
@@ -916,6 +914,8 @@ Error Main::setup2() {
if (boot_logo_path!=String() /*&& FileAccess::exists(boot_logo_path)*/) {
print_line("Boot splash path: "+boot_logo_path);
Error err = boot_logo.load(boot_logo_path);
+ if (err)
+ ERR_PRINTS("Non-existing or invalid boot splash at: " + boot_logo_path + ". Loading default splash.");
}
if (!boot_logo.empty()) {
@@ -1040,7 +1040,6 @@ bool Main::start() {
String _import_script;
String dumpstrings;
bool noquit=false;
- bool convert_old=false;
bool export_debug=false;
bool project_manager_request = false;
List<String> args = OS::get_singleton()->get_cmdline_args();
@@ -1050,8 +1049,6 @@ bool Main::start() {
doc_base=false;
} else if (args[i]=="-noquit") {
noquit=true;
- } else if (args[i]=="-convert_old") {
- convert_old=true;
} else if (args[i]=="-editor" || args[i]=="-e") {
editor=true;
} else if (args[i] == "-pm" || args[i] == "-project_manager") {
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index 1f76f025d4..304ed6b100 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -460,7 +460,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
const GDParser::Node *instance = on->arguments[0];
- bool in_static=false;
if (instance->type==GDParser::Node::TYPE_SELF) {
//room for optimization
@@ -771,8 +770,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
Vector<int> setchain;
- int prev_key_idx=-1;
-
for(List<GDParser::OperatorNode*>::Element *E=chain.back();E;E=E->prev()) {
@@ -822,7 +819,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
setchain.push_back(named ? GDFunction::OPCODE_SET_NAMED : GDFunction::OPCODE_SET);
prev_pos=dst_pos;
- prev_key_idx=key_idx;
}
@@ -1211,7 +1207,6 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *
if (p_func) {
for(int i=0;i<p_func->arguments.size();i++) {
- int idx = i;
codegen.add_stack_identifier(p_func->arguments[i],i);
#ifdef TOOLS_ENABLED
argnames.push_back(p_func->arguments[i]);
@@ -1449,7 +1444,6 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
p_script->name=p_class->name;
- int index_from=0;
Ref<GDNativeClass> native;
if (p_class->extends_used) {
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index 07a5a636d4..520a8b18d8 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -449,57 +449,21 @@ static Ref<Reference> _get_parent_class(GDCompletionContext& context) {
}
String base=context._class->extends_class[0];
- const GDParser::ClassNode *p = context._class->owner;
- Ref<GDScript> base_class;
-#if 0
- while(p) {
-
- if (p->subclasses.has(base)) {
-
- base_class=p->subclasses[base];
- break;
- }
- p=p->_owner;
- }
-#endif
- if (base_class.is_valid()) {
-#if 0
- for(int i=1;i<context._class->extends_class.size();i++) {
-
- String subclass=context._class->extends_class[i];
-
- if (base_class->subclasses.has(subclass)) {
-
- base_class=base_class->subclasses[subclass];
- } else {
-
- //print_line("Could not find subclass: "+subclass);
- return _get_type_from_class(context); //fail please
- }
- }
-
- script=base_class;
-#endif
-
- } else {
-
- if (context._class->extends_class.size()>1) {
- return REF();
+ if (context._class->extends_class.size()>1) {
+ return REF();
- }
- //if not found, try engine classes
- if (!GDScriptLanguage::get_singleton()->get_global_map().has(base)) {
-
- return REF();
- }
+ }
+ //if not found, try engine classes
+ if (!GDScriptLanguage::get_singleton()->get_global_map().has(base)) {
- int base_idx = GDScriptLanguage::get_singleton()->get_global_map()[base];
- native = GDScriptLanguage::get_singleton()->get_global_array()[base_idx];
- return native;
+ return REF();
}
+ int base_idx = GDScriptLanguage::get_singleton()->get_global_map()[base];
+ native = GDScriptLanguage::get_singleton()->get_global_array()[base_idx];
+ return native;
}
@@ -2100,10 +2064,8 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No
}
Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base_path, Object*p_owner, List<String>* r_options, String &r_call_hint) {
- //print_line( p_code.replace(String::chr(0xFFFF),"<cursor>"));
GDParser p;
- //Error parse(const String& p_code, const String& p_base_path="", bool p_just_validate=false,const String& p_self_path="",bool p_for_completion=false);
Error err = p.parse(p_code,p_base_path,false,"",true);
bool isfunction=false;
@@ -2204,7 +2166,6 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base
if (code!="") {
//if there is code, parse it. This way is slower but updates in real-time
GDParser p;
- //Error parse(const String& p_code, const String& p_base_path="", bool p_just_validate=false,const String& p_self_path="",bool p_for_completion=false);
Error err = p.parse(scr->get_source_code(),scr->get_path().get_base_dir(),true,"",false);
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp
index ec66841662..b9815a5efd 100644
--- a/modules/gdscript/gd_functions.cpp
+++ b/modules/gdscript/gd_functions.cpp
@@ -502,7 +502,6 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
Ref<FuncRef> fr = memnew( FuncRef);
- Object *obj = *p_args[0];
fr->set_instance(*p_args[0]);
fr->set_function(*p_args[1]);
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index c33bf00c7b..4a199eb6a8 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -514,8 +514,6 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
} else if (/*tokenizer->get_token()==GDTokenizer::TK_OP_ADD ||*/ tokenizer->get_token()==GDTokenizer::TK_OP_SUB || tokenizer->get_token()==GDTokenizer::TK_OP_NOT || tokenizer->get_token()==GDTokenizer::TK_OP_BIT_INVERT) {
//single prefix operators like !expr -expr ++expr --expr
- OperatorNode *op = alloc_node<OperatorNode>();
-
Expression e;
e.is_op=true;
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index 0a77b96569..93863c4eb2 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -1156,7 +1156,6 @@ Vector<uint8_t> GDTokenizerBuffer::parse_code_string(const String& p_code) {
GDTokenizerText tt;
tt.set_code(p_code);
int line=-1;
- int col=0;
while(true) {
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 5e30416641..37a3fb2b25 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -912,7 +912,6 @@ void GridMap::_octant_bake(const OctantKey &p_key, const Ref<TriangleMesh>& p_tm
int lc = p_lights.size();
const BakeLight* bl = p_lights.ptr();
float ofs = cell_size*0.02;
- float att = 0.2;
for(;V;V=V->next()) {
diff --git a/modules/ik/ik.cpp b/modules/ik/ik.cpp
index 172e16459e..35b3ba7e83 100644
--- a/modules/ik/ik.cpp
+++ b/modules/ik/ik.cpp
@@ -241,7 +241,7 @@ void InverseKinematics::_notification(int p_what)
}
} break;
case NOTIFICATION_PROCESS: {
- float delta = get_process_delta_time();
+
Spatial *sksp = skel->cast_to<Spatial>();
if (!bound)
break;
diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp
index 7cb0aa3607..14d87aef41 100644
--- a/platform/bb10/export/export.cpp
+++ b/platform/bb10/export/export.cpp
@@ -714,7 +714,6 @@ Error EditorExportPlatformBB10::run(int p_device, int p_flags) {
args.push_back("-installApp");
args.push_back("-launchApp");
args.push_back("-device");
- int idx = devices[p_device].index;
String host = EditorSettings::get_singleton()->get("blackberry/device_"+itos(p_device+1)+"/host");
String pass = EditorSettings::get_singleton()->get("blackberry/device_"+itos(p_device+1)+"/password");
args.push_back(host);
diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joystick_linux.cpp
index 82f79c2640..4a6a4f3a52 100644
--- a/platform/x11/joystick_linux.cpp
+++ b/platform/x11/joystick_linux.cpp
@@ -45,7 +45,9 @@
#define test_bit(nr, addr) (((1UL << ((nr) % LONG_BITS)) & ((addr)[(nr) / LONG_BITS])) != 0)
#define NBITS(x) ((((x)-1)/LONG_BITS)+1)
+#ifdef UDEV_ENABLED
static const char* ignore_str = "/dev/input/js";
+#endif
joystick_linux::Joystick::Joystick() {
fd = -1;
@@ -198,7 +200,6 @@ void joystick_linux::monitor_joysticks(udev *p_udev) {
}
usleep(50000);
}
- //printf("exit udev\n");
udev_monitor_unref(mon);
}
#endif
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 6342391383..4dbc106834 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -62,7 +62,6 @@ void WindowDialog::_input_event(const InputEvent& p_event) {
Point2 rel( p_event.mouse_motion.relative_x, p_event.mouse_motion.relative_y );
Point2 pos = get_pos();
- Size2 size = get_size();
pos+=rel;
@@ -409,7 +408,6 @@ AcceptDialog::AcceptDialog() {
ok->set_text(RTR("OK"));
hbc->add_child(ok);
hbc->add_spacer();
- //add_child(ok);
ok->connect("pressed", this,"_ok");
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index ee3b8913b4..06b1c42690 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -774,7 +774,6 @@ void GraphEdit::set_zoom(float p_zoom) {
Vector2 sbofs = (Vector2( h_scroll->get_val(), v_scroll->get_val() ) + get_size()/2)/zoom;
- float prev_zoom = zoom;
zoom = p_zoom;
top_layer->update();
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 2d4438c48c..778d24cc35 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -144,7 +144,6 @@ void Label::_notification(int p_what) {
if (!wc)
return;
- int c = 0;
int line=0;
int line_to=lines_skipped + (lines_visible>0?lines_visible:1);
while(wc) {
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index c025e4c706..d6c018ae8e 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -980,10 +980,6 @@ void LineEdit::set_cursor_pos(int p_pos) {
cursor_pos=p_pos;
-// if (cursor_pos>(window_pos+get_window_length())) {
-// set_window_pos(cursor_pos-get_window_lengt//h());
-// }
-
if (!is_inside_tree()) {
window_pos=cursor_pos;
@@ -1002,7 +998,6 @@ void LineEdit::set_cursor_pos(int p_pos) {
if (window_width<0)
return;
- int width_to_cursor=0;
int wp=window_pos;
if (font.is_valid()) {
diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp
index 02da8ff27e..8af94c3638 100644
--- a/scene/gui/progress_bar.cpp
+++ b/scene/gui/progress_bar.cpp
@@ -51,7 +51,6 @@ void ProgressBar::_notification(int p_what) {
Ref<StyleBox> fg = get_stylebox("fg");
Ref<Font> font = get_font("font");
Color font_color=get_color("font_color");
- Color font_color_shadow=get_color("font_color_shadow");
draw_style_box(bg,Rect2(Point2(),get_size()));
float r = get_unit_value();
@@ -63,7 +62,6 @@ void ProgressBar::_notification(int p_what) {
}
if (percent_visible) {
- int fh=font->get_height();
String txt=itos(int(get_unit_value()*100))+"%";
font->draw_halign(get_canvas_item(),Point2(0,font->get_ascent()+(get_size().height-font->get_height())/2),HALIGN_CENTER,get_size().width,txt,font_color);
}
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 786ce27a0c..31cef85aa0 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -270,7 +270,6 @@ if (m_height > line_height) {\
if (p_mode!=PROCESS_CACHE) {
lh=line<l.height_caches.size()?l.height_caches[line]:1;
}
- bool found_space=false;
while (c[end]!=0 && !(end && c[end-1]==' ' && c[end]!=' ')) {
@@ -284,30 +283,13 @@ if (m_height > line_height) {\
}
w+=cw;
-
- if (c[end]==' ') {
-
- fw+=cw;
- /*
- if (p_mode==PROCESS_CACHE) {
- fw+=cw;
- } else if (align==ALIGN_FILL && line<l.space_caches.size() && l.space_caches[line]>0) {
- //print_line(String(c,end)+": "+itos(l.offset_caches[line])+"/"+itos(l.space_caches[line]));
- //sub_space=cw;
- found_space=true;
- } else {
- fw+=cw;
- }*/
- } else {
- fw+=cw;
- }
+ fw+=cw;
end++;
}
ENSURE_WIDTH(w);
- //print_line("END: "+String::chr(c[end])+".");
if (end && c[end-1]==' ') {
if (p_mode==PROCESS_CACHE) {
spaces_size+=font->get_char_size(' ').width;
@@ -319,27 +301,17 @@ if (m_height > line_height) {\
}
spaces++;
- /*
- if (found_space) {
- int ln = MIN(l.offset_caches.size()-1,line);
-
- fw+=l.offset_caches[ln]/l.space_caches[ln];
- }*/
-
}
{
-
int ofs=0;
for(int i=0;i<end;i++) {
int pofs=wofs+ofs;
-
-
if (p_mode==PROCESS_POINTER && r_click_char && p_click_pos.y>=p_ofs.y+y && p_click_pos.y<=p_ofs.y+y+lh) {
//int o = (wofs+w)-p_click_pos.x;
@@ -354,15 +326,6 @@ if (m_height > line_height) {\
if (p_click_pos.x-cw/2>p_ofs.x+align_ofs+pofs) {
rchar=int((&c[i])-cf);
- //print_line("GOT: "+itos(rchar));
-
-
- //if (i==end-1 && p_click_pos.x+cw/2 > pofs)
- // rchar++;
- //int o = (wofs+w)-p_click_pos.x;
-
- // if (o>cw/2)
- // rchar++;
}
@@ -402,12 +365,9 @@ if (m_height > line_height) {\
}
- //print_line("draw char: "+String::chr(c[i]));
-
if (underline) {
Color uc=color;
uc.a*=0.5;
- //VS::get_singleton()->canvas_item_add_line(ci,Point2(pofs,y+ascent+2),Point2(pofs+cw,y+ascent+2),uc);
int uy = y+lh-fh+ascent+2;
VS::get_singleton()->canvas_item_add_line(ci,p_ofs+Point2(align_ofs+pofs,uy),p_ofs+Point2(align_ofs+pofs+cw,uy),uc);
}
@@ -462,28 +422,6 @@ if (m_height > line_height) {\
if (p_mode!=PROCESS_CACHE)
lh = line<l.height_caches.size()?l.height_caches[line]:1;
-
-#if 0
- if (p_mode==PROCESS_POINTER && r_click_item ) {
- //previous last "wrapped" line
- int pl = line-1;
- if (pl<0 || lines[pl].height_caches.size()==0)
- break;
- int py=lines[pl].offset_caches[ lines[pl].offset_caches.size() -1 ];
- int ph=lines[pl].height_caches[ lines[pl].height_caches.size() -1 ];
- print_line("py: "+itos(py));
- print_line("ph: "+itos(ph));
-
- rchar=0;
- if (p_click_pos.y>=py && p_click_pos.y<=py+ph) {
- if (r_outside) *r_outside=true;
- *r_click_item=it;
- *r_click_char=rchar;
- return;
- }
- }
-
-#endif
} break;
case ITEM_TABLE: {
@@ -493,7 +431,6 @@ if (m_height > line_height) {\
int vseparation=get_constant("table_vseparation");
Color ccolor = _find_color(table,p_base_color);
Vector2 draw_ofs = Point2(wofs,y);
- int max_y=get_size().height;
if (p_mode==PROCESS_CACHE) {
@@ -1825,7 +1762,6 @@ bool RichTextLabel::search(const String& p_string,bool p_from_selection) {
charidx=selection.to_char+1;
}
- int line=-1;
while(it) {
if (it->type==ITEM_TEXT) {
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index 9bf93aff77..190e8e141f 100644
--- a/scene/gui/scroll_container.cpp
+++ b/scene/gui/scroll_container.cpp
@@ -177,7 +177,6 @@ void ScrollContainer::_input_event(const InputEvent& p_input_event) {
void ScrollContainer::_update_scrollbar_pos() {
- Size2 size = get_size();
Size2 hmin = h_scroll->get_combined_minimum_size();
Size2 vmin = v_scroll->get_combined_minimum_size();
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 5eb579f1d2..0e0339c488 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -40,8 +40,6 @@ int TabContainer::_get_top_margin() const {
int h = MAX( tab_bg->get_minimum_size().height,tab_fg->get_minimum_size().height);
-// h+=MIN( get_constant("label_valign_fg"), get_constant("label_valign_bg") );
-
int ch = font->get_height();;
for(int i=0;i<get_child_count();i++) {
@@ -207,9 +205,7 @@ void TabContainer::_notification(int p_what) {
Ref<StyleBox> tab_bg = get_stylebox("tab_bg");
Ref<StyleBox> tab_fg = get_stylebox("tab_fg");
Ref<Texture> incr = get_icon("increment");
- Ref<Texture> incr_hl = get_icon("increment_hilite");
Ref<Texture> decr = get_icon("decrement");
- Ref<Texture> decr_hl = get_icon("decrement_hilite");
Ref<Texture> menu = get_icon("menu");
Ref<Texture> menu_hl = get_icon("menu_hl");
Ref<Font> font = get_font("font");
@@ -219,9 +215,6 @@ void TabContainer::_notification(int p_what) {
int side_margin = get_constant("side_margin");
int top_margin = _get_top_margin();
- int label_valign_fg = get_constant("label_valign_fg");
- int label_valign_bg = get_constant("label_valign_bg");
-
Size2 top_size = Size2( size.width, top_margin );
@@ -338,17 +331,14 @@ void TabContainer::_notification(int p_what) {
Ref<StyleBox> sb;
- int va;
Color col;
if (idx==current) {
sb=tab_fg;
- va=label_valign_fg;
col=color_fg;
} else {
sb=tab_bg;
- va=label_valign_bg;
col=color_bg;
}
@@ -371,23 +361,7 @@ void TabContainer::_notification(int p_what) {
}
font->draw(ci, Point2i( lpos.x, sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-font->get_height())/2+font->get_ascent() ), s, col );
- //ofs+=sb_ms.x+w;
-
- /*
- int sb_mw = sb->get_minimum_size().width;
- int font_ofs = sb_mw / 2;
-
- Rect2i rect =Rect2( ofs, 0, w+sb_mw, top_margin);
- rect.size
- sb->draw(ci,rect);
- rect.y+=va;
- rect.height+=va;
- int font_y = (rect.height - font->get_height())/2;
-
- font->draw(ci, Point2( ofs+font_ofs, va+font_y ), s, col );
-
-*/
idx++;
}
@@ -477,7 +451,6 @@ void TabContainer::set_current_tab(int p_current) {
ERR_FAIL_INDEX( p_current, get_tab_count() );
- //printf("DEBUG %p: set_current_tab to %i\n", this, p_current);
current=p_current;
int idx=0;
@@ -560,7 +533,6 @@ Control* TabContainer::get_current_tab_control() const {
void TabContainer::remove_child_notify(Node *p_child) {
int tc = get_tab_count();
-// bool set_curent=false;
if (current==tc-1) {
current--;
if (current<0)
@@ -705,9 +677,6 @@ Size2 TabContainer::get_minimum_size() const {
if (c->is_set_as_toplevel())
continue;
- //if (!c->has_meta("_tab_name"))
- // continue;
-
if (!c->is_visible())
continue;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 78fd699dd0..55e1a2cc52 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4137,7 +4137,6 @@ void TextEdit::_update_completion_candidates() {
completion_options.clear();
completion_index=0;
completion_base=s;
- int ci_match=0;
Vector<float> sim_cache;
for(int i=0;i<completion_strings.size();i++) {
if (s == completion_strings[i]) {
diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp
index c885b2d73e..df2f5edd48 100644
--- a/scene/gui/texture_button.cpp
+++ b/scene/gui/texture_button.cpp
@@ -76,10 +76,7 @@ void TextureButton::_notification(int p_what) {
switch( p_what ) {
case NOTIFICATION_DRAW: {
- RID canvas_item = get_canvas_item();
DrawMode draw_mode = get_draw_mode();
-// if (normal.is_null())
-// break;
Ref<Texture> texdraw;
diff --git a/scene/gui/texture_frame.cpp b/scene/gui/texture_frame.cpp
index 143f0e83b8..4aa45af863 100644
--- a/scene/gui/texture_frame.cpp
+++ b/scene/gui/texture_frame.cpp
@@ -37,9 +37,6 @@ void TextureFrame::_notification(int p_what) {
return;
-
- RID ci = get_canvas_item();
-
switch(stretch_mode) {
case STRETCH_SCALE_ON_EXPAND: {
Size2 s=expand?get_size():texture->get_size();
@@ -85,23 +82,6 @@ void TextureFrame::_notification(int p_what) {
}
-
-/*
- Vector<Point2> points;
- points.resize(4);
- points[0]=Point2(0,0);
- points[1]=Point2(s.x,0);
- points[2]=Point2(s.x,s.y);
- points[3]=Point2(0,s.y);
- Vector<Point2> uvs;
- uvs.resize(4);
- uvs[0]=Point2(0,0);
- uvs[1]=Point2(1,0);
- uvs[2]=Point2(1,1);
- uvs[3]=Point2(0,1);
-
- VisualServer::get_singleton()->canvas_item_add_primitive(ci,points,Vector<Color>(),uvs,texture->get_rid());
-*/
}
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 581103931e..f30b1979ef 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -973,22 +973,12 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
/* Draw label, if height fits */
- Point2i guide_from;
bool skip=(p_item==root && hide_root);
- // printf("skip (%p == %p && %i) %i\n",p_item,root,hide_root,skip);
if (!skip && (p_pos.y+label_h-cache.offset.y)>0) {
- // printf("entering\n");
-
- int height=label_h;
-
- Point2i guide_space=Point2i( cache.guide_width , height );
-
-
-
if (!hide_folding && p_item->childs) { //has childs, draw the guide box
Ref<Texture> arrow;
@@ -1660,7 +1650,6 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
/* editing */
bool bring_up_editor=force_select_on_already_selected ? (c.selected && already_selected) : c.selected;
- bool bring_up_value_editor=false;
String editor_text=c.text;
switch (c.mode) {
@@ -1711,9 +1700,6 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
bring_up_editor=false;
} else {
- Ref<Texture> updown = cache.updown;
-
-
if (x >= (col_width-item_h/2)) {
/* touching the combo */
@@ -1760,7 +1746,6 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
} else {
editor_text=String::num( p_item->cells[col].val, Math::decimals( p_item->cells[col].step ) );
- bring_up_value_editor=false;
if (select_mode==SELECT_MULTI && get_tree()->get_last_event_id() == focus_in_id)
bring_up_editor=false;
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index e9ff76bd91..1be847929d 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -116,7 +116,6 @@ void VideoPlayer::_notification(int p_notification) {
case NOTIFICATION_ENTER_TREE: {
- //set_idle_process(false); //don't annoy
if (stream.is_valid() && autoplay && !get_tree()->is_editor_hint()) {
play();
}
@@ -141,13 +140,6 @@ void VideoPlayer::_notification(int p_notification) {
playback->update(delta);
- /*int prev_width = texture->get_width();
- stream->pop_frame(texture);
- if (prev_width == 0) {
- update();
- minimum_size_changed();
- };*/
-
} break;
case NOTIFICATION_DRAW: {
@@ -158,8 +150,6 @@ void VideoPlayer::_notification(int p_notification) {
return;
Size2 s=expand?get_size():texture->get_size();
- RID ci = get_canvas_item();
- printf("drawing with size %f, %f\n", s.x, s.y);
draw_texture_rect(texture,Rect2(Point2(),s),false);
} break;
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 29851efaff..55106f5ee7 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -1206,7 +1206,6 @@ void Node::add_to_group(const StringName& p_identifier,bool p_persistent) {
GroupData gd;
- SceneTree::Group *gptr=NULL;
if (data.tree) {
gd.group=data.tree->add_to_group(p_identifier,this);
} else {
diff --git a/tools/collada/collada.cpp b/tools/collada/collada.cpp
index 11a0e1726b..268d42a613 100644
--- a/tools/collada/collada.cpp
+++ b/tools/collada/collada.cpp
@@ -681,9 +681,6 @@ void Collada::_parse_effect_material(XMLParser& parser,Effect &effect,String &id
} else {
String uri = effect.params[surface];
- int channel=0;
- //if (parser.has_attribute("texcoord"))
-
if (what=="diffuse") {
effect.diffuse.texture=uri;
@@ -759,9 +756,6 @@ void Collada::_parse_effect_material(XMLParser& parser,Effect &effect,String &id
} else {
String uri = effect.params[surface];
- int channel=0;
- //if (parser.has_attribute("texcoord"))
-
if (parser.has_attribute("bumptype") && parser.get_attribute_value("bumptype")!="NORMALMAP") {
WARN_PRINT("'bump' texture type is not NORMALMAP, only NORMALMAP is supported.")
}
@@ -2636,7 +2630,6 @@ void Collada::_find_morph_nodes(VisualScene *p_vscene,Node *p_node) {
base=sk.base;
} else if (state.morph_controller_data_map.has(base)) {
- MorphControllerData &sk = state.morph_controller_data_map[base];
state.morph_ownership_map[base]=nj->id;
break;
} else {
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp
index 7582162b72..c7b78b980f 100644
--- a/tools/editor/animation_editor.cpp
+++ b/tools/editor/animation_editor.cpp
@@ -85,7 +85,6 @@ private:
int points = 48;
if (mode==MODE_MULTIPLE) {
- int max_draw = 16;
Color mcolor=color;
mcolor.a*=0.3;
@@ -1356,7 +1355,6 @@ void AnimationKeyEditor::_track_editor_draw() {
}
}
- Color sep_color=color;
color.a*=0.5;
for(int i=0;i<fit;i++) {
@@ -1806,8 +1804,6 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
Ref<Font> font = te->get_font("font","Tree");
int sep = get_constant("vseparation","Tree");
int hsep = get_constant("hseparation","Tree");
- Color color = get_color("font_color","Tree");
- Color sepcolor = get_color("guide_color","Tree");
Ref<Texture> remove_icon = get_icon("Remove","EditorIcons");
Ref<Texture> move_up_icon = get_icon("MoveUp","EditorIcons");
Ref<Texture> move_down_icon = get_icon("MoveDown","EditorIcons");
@@ -3007,7 +3003,6 @@ void AnimationKeyEditor::_update_menu() {
updating=true;
- bool empty= !animation.is_valid();
if (animation.is_valid()) {
length->set_val(animation->get_length());
diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp
index ad2eb57f00..ef667b75e1 100644
--- a/tools/editor/dependency_editor.cpp
+++ b/tools/editor/dependency_editor.cpp
@@ -80,8 +80,6 @@ void DependencyEditor::_fix_and_find(EditorFileSystemDirectory *efsd, Map<String
continue;
String path = efsd->get_file_path(i);
- Map<String,String> &ss = candidates[file];
-
for(Map<String,String>::Element *E=candidates[file].front();E;E=E->next()) {
@@ -420,7 +418,6 @@ void DependencyRemoveDialog::show(const Vector<String> &to_erase) {
exist=false;
owners->clear();
files.clear();
- TreeItem *root=owners->create_item();
for(int i=0;i<to_erase.size();i++) {
files[to_erase[i]]=NULL;
}
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 56d745dee6..0233b6e9d6 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -597,7 +597,6 @@ void EditorNode::save_resource(const Ref<Resource>& p_resource) {
void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String& p_at_path) {
file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
- bool relpaths = (p_resource->has_meta("__editor_relpaths__") && p_resource->get_meta("__editor_relpaths__").operator bool());
current_option=RESOURCE_SAVE_AS;
List<String> extensions;
@@ -1551,9 +1550,10 @@ void EditorNode::_property_editor_back() {
void EditorNode::_imported(Node *p_node) {
- Node *scene = editor_data.get_edited_scene_root();
-// add_edited_scene(p_node);
/*
+ Node *scene = editor_data.get_edited_scene_root();
+ add_edited_scene(p_node);
+
if (scene) {
String path = scene->get_filename();
p_node->set_filename(path);
@@ -2129,7 +2129,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
}
file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
- bool relpaths = (scene->has_meta("__editor_relpaths__") && scene->get_meta("__editor_relpaths__").operator bool());
List<String> extensions;
@@ -2210,8 +2209,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
}
- bool relpaths = (scene->has_meta("__editor_relpaths__") && scene->get_meta("__editor_relpaths__").operator bool());
-
file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
file->set_current_path(cpath);
@@ -2220,8 +2217,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
} break;
case FILE_SAVE_OPTIMIZED: {
- Node *scene = editor_data.get_edited_scene_root();
#if 0
+ Node *scene = editor_data.get_edited_scene_root();
if (!scene) {
current_option=-1;
@@ -5644,8 +5641,6 @@ EditorNode::EditorNode() {
ED_SHORTCUT("editor/prev_tab", TTR("Previous tab"), KEY_MASK_CMD+KEY_MASK_SHIFT+KEY_TAB);
- Separator *vs=NULL;
-
file_menu->set_tooltip(TTR("Operations with scene files."));
p=file_menu->get_popup();
p->add_shortcut(ED_SHORTCUT("editor/new_scene",TTR("New Scene")),FILE_NEW_SCENE);
diff --git a/tools/editor/editor_path.cpp b/tools/editor/editor_path.cpp
index 4cf98e832c..6b804b6a24 100644
--- a/tools/editor/editor_path.cpp
+++ b/tools/editor/editor_path.cpp
@@ -38,7 +38,6 @@ void EditorPath::_notification(int p_what) {
RID ci=get_canvas_item();
Ref<Font> label_font = get_font("font","Label");
- Color label_color = get_color("font_color","Label");
Size2i size = get_size();
Ref<Texture> sn = get_icon("SmallNext","EditorIcons");
diff --git a/tools/editor/import_settings.cpp b/tools/editor/import_settings.cpp
index dfaeca03db..53bbd2a878 100644
--- a/tools/editor/import_settings.cpp
+++ b/tools/editor/import_settings.cpp
@@ -36,21 +36,6 @@ void ImportSettingsDialog::_item_pressed(int p_idx) {
return;
String p=edited->get_metadata(0);
-#if 0
- if (EditorImportDB::get_singleton()->is_image(p)) {
-
- uint32_t flags = EditorImportDB::get_singleton()->get_image_flags(p);
- bool pressed = !popup->is_item_checked(p_idx);
- if (pressed)
- flags|=(1<<p_idx);
- else
- flags&=~(1<<p_idx);
-
-
- EditorImportDB::get_singleton()->set_image_flags(p,flags);
- edited->set_text(2,_str_from_flags(flags));
- }
-#endif
}
void ImportSettingsDialog::_item_edited() {
@@ -58,38 +43,8 @@ void ImportSettingsDialog::_item_edited() {
if (updating)
return;
TreeItem *it=tree->get_selected();
- int ec=tree->get_edited_column();
String p=it->get_metadata(0);
-#if 0
- if (EditorImportDB::get_singleton()->is_image(p)) {
-
- if (ec==1) {
-
-
- EditorImportDB::get_singleton()->set_image_format(p,EditorImport::ImageFormat(int(it->get_range(1))));
-
- } else if (ec==2) {
-
-
- int flags = EditorImportDB::get_singleton()->get_image_flags(p);
- for(int i=0;i<popup->get_item_count();i++) {
-
- popup->set_item_checked(i,flags&(1<<i));
- }
-
- Rect2 r = tree->get_custom_popup_rect();
- popup->set_size(Size2(r.size.width,1));
- popup->set_pos(/*tree->get_global_pos()+*/r.pos+Point2(0,r.size.height));
- popup->popup();
- }
-
- edited=it;
-
- }
-#endif
-
-
}
@@ -167,42 +122,6 @@ bool ImportSettingsDialog::_generate_fs(TreeItem *p_parent,EditorFileSystemDirec
}
-#if 0
- if (!EditorImportDB::get_singleton()->is_image(path) && !EditorImportDB::get_singleton()->is_scene(path))
- continue;
-
- String f = p_dir->get_file(i);
- TreeItem *ti = tree->create_item(p_parent);
- ti->set_text(0,f);
- String type = p_dir->get_file_type(i);
- Ref<Texture> icon = get_icon( (has_icon(type,"EditorIcons")?type:String("Object")),"EditorIcons");
-
-
- if (EditorImportDB::get_singleton()->is_image(path)) {
-
-
- ti->set_tooltip(0,"Type: Image\nSource: "+EditorImportDB::get_singleton()->get_file_source(path)+"\nSource MD5: "+EditorImportDB::get_singleton()->get_file_md5(path));
- ti->set_cell_mode(1,TreeItem::CELL_MODE_RANGE);
- ti->set_editable(1,true);
- ti->set_range_config(1,0,3,1);
- ti->set_range(1,EditorImportDB::get_singleton()->get_image_format(path));
- ti->set_text(1,texformat);
- ti->set_cell_mode(2,TreeItem::CELL_MODE_CUSTOM);
- ti->set_editable(2,true);
- ti->set_metadata(0,path);
-
- String txt;
- uint32_t flags=EditorImportDB::get_singleton()->get_image_flags(path);
- txt=_str_from_flags(flags);
-
- ti->set_text(2,txt);
- }
-
- ti->set_icon(0, icon);
- valid=true;
-#endif
-
-
return valid;
}
diff --git a/tools/editor/io_plugins/editor_atlas.cpp b/tools/editor/io_plugins/editor_atlas.cpp
index f894e7e8b2..f69e383fb0 100644
--- a/tools/editor/io_plugins/editor_atlas.cpp
+++ b/tools/editor/io_plugins/editor_atlas.cpp
@@ -82,7 +82,6 @@ void EditorAtlas::fit(const Vector<Size2i>& p_rects,Vector<Point2i>& r_result, S
//place them
int ofs=0;
- int limit_h=0;
for(int j=0;j<wrects.size();j++) {
@@ -106,8 +105,6 @@ void EditorAtlas::fit(const Vector<Size2i>& p_rects,Vector<Point2i>& r_result, S
int end_h = from_y+wrects[j].s.height;
int end_w = ofs+wrects[j].s.width;
- if (ofs==0)
- limit_h=end_h;
for(int k=0;k<wrects[j].s.width;k++) {
@@ -120,8 +117,7 @@ void EditorAtlas::fit(const Vector<Size2i>& p_rects,Vector<Point2i>& r_result, S
if (end_w > max_w)
max_w=end_w;
- //if (ofs==0 || end_h>limit_h ) //while h limit not reched, keep stacking
- ofs+=wrects[j].s.width;
+ ofs+=wrects[j].s.width;
}
diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp
index 363cba3678..fc45b51a98 100644
--- a/tools/editor/io_plugins/editor_import_collada.cpp
+++ b/tools/editor/io_plugins/editor_import_collada.cpp
@@ -2278,12 +2278,6 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
NodeMap &nm = node_map[at.target];
String path = scene->get_path_to(nm.node);
- Collada::Node *cn = collada.state.scene_map[at.target];
- //if (cn->ignore_anim) {
- // print_line("warning, ignoring property animation on node: "+nm.path);
- //continue;
- //}
-
animation->add_track(Animation::TYPE_VALUE);
int track = animation->get_track_count() -1;
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index 8899d65aea..e24412d4ef 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -2680,12 +2680,6 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
progress.step(TTR("Importing Scene.."),2);
- bool reimport = bool(from->get_option("reimport"));
- int this_time_action = from->get_option("import_this_time");
- int next_time_action = from->get_option("import_next_time");
-
- int import_action = reimport?this_time_action:next_time_action;
-
from->set_source_md5(0,FileAccess::get_md5(src_path));
from->set_editor(get_name());
@@ -2694,8 +2688,6 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
Map<Ref<Mesh>,Ref<Shape> > collision_map;
- Ref<ResourceImportMetadata> imd = memnew(ResourceImportMetadata);
-
Map< Ref<ImageTexture>,TextureRole > imagemap;
scene=_fix_node(scene,scene,collision_map,scene_flags,imagemap);
@@ -2811,7 +2803,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
target_path=target_path.basename()+".tex";
Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
- print_line("flags: "+itos(image_flags));
+
uint32_t flags = image_flags;
if (E->get()==TEXTURE_ROLE_DIFFUSE && scene_flags&SCENE_FLAG_LINEARIZE_DIFFUSE_TEXTURES)
flags|=EditorTextureImportPlugin::IMAGE_FLAG_CONVERT_TO_LINEAR;
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
index 16ea803da4..1d8319d460 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -1192,8 +1192,6 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
}
ep.step(TTR("Converting Images"),sources.size());
- int base_index=0;
-
Map<uint64_t,int> source_md5;
Map<int,List<int> > source_map;
@@ -1760,7 +1758,6 @@ void EditorTextureImportPlugin::reimport_multiple_files(const Vector<String>& p_
Vector<String> valid;
- bool warning=false;
for(int i=0;i<p_list.size();i++) {
Ref<ResourceImportMetadata> rimd = ResourceLoader::load_import_metadata(p_list[i]);
@@ -1768,7 +1765,6 @@ void EditorTextureImportPlugin::reimport_multiple_files(const Vector<String>& p_
if (type=="texture" || type.begins_with("texture_")) {
if ((rimd->has_option("atlas") && rimd->get_option("atlas")) || (rimd->has_option("large") && rimd->get_option("large"))) {
- warning=true;
continue;
}
diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp
index aa36fefdb7..9ee3e98486 100644
--- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp
@@ -425,7 +425,6 @@ Error EditorTranslationImportPlugin::import(const String& p_path, const Ref<Reso
ERR_FAIL_COND_V( !f, ERR_INVALID_PARAMETER );
- bool first=false;
bool skip_first = from->get_option("skip_first");
int index = from->get_option("index");
index+=1;
@@ -439,7 +438,6 @@ Error EditorTranslationImportPlugin::import(const String& p_path, const Ref<Reso
while(line.size()>1) {
-
if (!skip_first) {
ERR_FAIL_INDEX_V(index,line.size(),ERR_INVALID_DATA );
translation->add_message(line[0].strip_edges(),line[index]);
diff --git a/tools/editor/output_strings.cpp b/tools/editor/output_strings.cpp
index f1b49d2326..a6126466c4 100644
--- a/tools/editor/output_strings.cpp
+++ b/tools/editor/output_strings.cpp
@@ -32,7 +32,6 @@
void OutputStrings::update_scrollbars() {
- Size2 size = get_size();
Size2 hmin = h_scroll->get_combined_minimum_size();
Size2 vmin = v_scroll->get_combined_minimum_size();
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index 203564e612..98ba25b482 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -407,7 +407,6 @@ void AnimationPlayerEditor::_animation_save(const Ref<Resource>& p_resource) {
void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource) {
file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
- bool relpaths = (p_resource->has_meta("__editor_relpaths__") && p_resource->get_meta("__editor_relpaths__").operator bool());
List<String> extensions;
ResourceSaver::get_recognized_extensions(p_resource, &extensions);
diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp
index a381ec4678..24914e4bc5 100644
--- a/tools/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp
@@ -90,7 +90,6 @@ Size2 AnimationTreeEditor::get_node_size(const StringName& p_node) const {
Ref<StyleBox> style = get_stylebox("panel","PopupMenu");
Ref<Font> font = get_font("font","PopupMenu");
- Color font_color = get_color("font_color","PopupMenu");
Size2 size = style->get_minimum_size();
@@ -633,7 +632,6 @@ AnimationTreeEditor::ClickType AnimationTreeEditor::_locate_click(const Point2&
Ref<StyleBox> style = get_stylebox("panel","PopupMenu");
Ref<Font> font = get_font("font","PopupMenu");
- Color font_color = get_color("font_color","PopupMenu");
float h = (font->get_height()+get_constant("vseparation","PopupMenu"));
diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp
index 1962f81e87..6a88ba4cbe 100644
--- a/tools/editor/plugins/baked_light_baker.cpp
+++ b/tools/editor/plugins/baked_light_baker.cpp
@@ -645,7 +645,6 @@ void BakedLightBaker::_octree_insert(int p_octant,Triangle* p_triangle, int p_de
leaf_list=child_idx;
cell_count++;
- int lz = lights.size();
for(int ci=0;ci<8;ci++) {
child->light_accum[ci][0]=0;
child->light_accum[ci][1]=0;
@@ -1016,8 +1015,6 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c
//ray_aabb.expand_to(p_end);
- const BVH *bvhptr = bvh;
-
bstack[0]=bvh;
stack[0]=TEST_AABB_BIT;
@@ -1693,7 +1690,7 @@ void BakedLightBaker::throw_rays(ThreadStack& thread_stack,int p_amount) {
Vector3 from = dl.pos;
double r1 = double(rand())/RAND_MAX;
- double r2 = double(rand())/RAND_MAX;
+ //double r2 = double(rand())/RAND_MAX;
double r3 = double(rand())/RAND_MAX;
float d=Math::tan(Math::deg2rad(dl.spot_angle));
@@ -1994,7 +1991,6 @@ void BakedLightBaker::update_octree_images(DVector<uint8_t> &p_octree,DVector<ui
const double *normptr=norm_arr.ptr();
*/
double norm = 1.0/double(total_rays);
- int lz=lights.size();
mult/=multiplier;
double saturation = baked_light->get_saturation();
@@ -2261,8 +2257,6 @@ void BakedLightBaker::_plot_pixel_to_lightmap(int x, int y, int width, int heigh
continue;
n/=len;
- const BVH *bvhptr = bvh;
-
bstack[0]=bvh;
stack[0]=TEST_RAY_BIT;
@@ -2404,8 +2398,6 @@ Error BakedLightBaker::transfer_to_lightmaps() {
float gamma = baked_light->get_gamma_adjust();
float mult = baked_light->get_energy_multiplier();
-
- const double *normptr=norm_arr.ptr();
for(int i=0;i<triangles.size();i++) {
if (i%200==0) {
@@ -2538,7 +2530,6 @@ Error BakedLightBaker::transfer_to_lightmaps() {
Vector<uint8_t> copy_data=bt.data;
uint8_t *data=bt.data.ptr();
- uint8_t *src_data=copy_data.ptr();
const int max_radius=8;
const int shadow_radius=2;
const int max_dist=0x7FFFFFFF;
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index caa09fba35..db500cdcdf 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1940,8 +1940,6 @@ void CanvasItemEditor::_viewport_draw() {
Map<Node*,Object*> &selection = editor_selection->get_selection();
- CanvasItem *single_item=NULL;
-
bool pivot_found=false;
for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
@@ -1961,15 +1959,6 @@ void CanvasItemEditor::_viewport_draw() {
Matrix32 xform=transform * canvas_item->get_global_transform_with_canvas();
VisualServer::get_singleton()->canvas_item_add_set_transform(ci,xform);
- Point2 ofs=Point2();//get_global_pos();
- Rect2 draw_rect=rect;
- Color light_edit_color=Color(1.0,0.8,0.8);
- Color dark_edit_color=Color(0.4,0.1,0.1);
- Size2 handle_size=Size2(handle_len,handle_len);
-
- //select_sb->draw(ci,draw_rect.grow(2));
- //DRAW_EMPTY_RECT( draw_rect.grow(2), light_edit_color );
- //DRAW_EMPTY_RECT( draw_rect.grow(1), dark_edit_color );
Vector2 endpoints[4]={
diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp
index 5ed9f8ab5f..95364e8921 100644
--- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp
@@ -349,8 +349,6 @@ void CollisionPolygon2DEditor::_canvas_draw() {
Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");
- int len = poly.size();
-
for(int i=0;i<poly.size();i++) {
diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
index b18afe7838..55e38cebcc 100644
--- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -381,8 +381,6 @@ void CollisionPolygonEditor::_polygon_draw() {
poly=node->get_polygon();
-
- int len = poly.size();
float depth = node->get_depth()*0.5;
imgeom->clear();
diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp
index a057e6c2a1..b1bce60484 100644
--- a/tools/editor/plugins/editor_preview_plugins.cpp
+++ b/tools/editor/plugins/editor_preview_plugins.cpp
@@ -36,6 +36,7 @@
#include "scene/resources/mesh.h"
#include "scene/resources/bit_mask.h"
#include "tools/editor/editor_scale.h"
+
bool EditorTexturePreviewPlugin::handles(const String& p_type) const {
return (ObjectTypeDB::is_type(p_type,"ImageTexture") || ObjectTypeDB::is_type(p_type, "AtlasTexture"));
@@ -442,7 +443,6 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) {
Color keyword_color = EditorSettings::get_singleton()->get("text_editor/keyword_color");
Color text_color = EditorSettings::get_singleton()->get("text_editor/text_color");
Color symbol_color = EditorSettings::get_singleton()->get("text_editor/symbol_color");
- Color comment_color = EditorSettings::get_singleton()->get("text_editor/comment_color");
for(int i=0;i<thumbnail_size;i++) {
@@ -607,7 +607,7 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
-1, -1, -1, -1, 2, 4, 6, 8
};
- int16_t nibble,signed_nibble,diff,step;
+ int16_t nibble,diff,step;
ima_adpcm.last_nibble++;
const uint8_t *src_ptr=sdata;
@@ -628,10 +628,6 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
if (ima_adpcm.step_index>88)
ima_adpcm.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 ;
@@ -748,15 +744,13 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
for(int j=0;j<h;j++) {
- int half,ofs;
+ int half;
float v;
if (j<(h/2)) {
half=0;
- ofs=0;
v = (j/(float)(h/2)) * 2.0 - 1.0;
} else {
half=1;
- ofs=h/2;
if( (float)(h/2) != 0 ) {
v = ((j-(h/2))/(float)(h/2)) * 2.0 - 1.0;
} else {
diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp
index 14e7b14fc3..56e58bc983 100644
--- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp
@@ -364,8 +364,6 @@ void LightOccluder2DEditor::_canvas_draw() {
Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");
- int len = poly.size();
-
for(int i=0;i<poly.size();i++) {
diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp
index 5a8cd8791e..22546c72f3 100644
--- a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp
+++ b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp
@@ -427,8 +427,6 @@ void NavigationPolygonEditor::_canvas_draw() {
poly = Variant(node->get_navigation_polygon()->get_outline(j));
}
- int len = poly.size();
-
for(int i=0;i<poly.size();i++) {
diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/tools/editor/plugins/particles_editor_plugin.cpp
index 93e2fb2f38..7e20cc3f54 100644
--- a/tools/editor/plugins/particles_editor_plugin.cpp
+++ b/tools/editor/plugins/particles_editor_plugin.cpp
@@ -283,7 +283,6 @@ void ParticlesEditor::_generate_emission_points() {
ofs=(Vector3(1,1,1)-dir)*Vector3(Math::randf(),Math::randf(),Math::randf())*aabb.size;
ofs+=aabb.pos;
- Vector3 dirv = -dir;
Vector3 ofsv = ofs + aabb.size * dir;
//space it a little
diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp
index d78508c429..19d1ccc06f 100644
--- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -466,8 +466,6 @@ void Polygon2DEditor::_canvas_draw() {
Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Ref<Texture> handle= get_icon("EditorHandle","EditorIcons");
- int len = poly.size();
-
for(int i=0;i<poly.size();i++) {
diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp
index 69602ac995..7965fa54ae 100644
--- a/tools/editor/plugins/sample_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_editor_plugin.cpp
@@ -151,7 +151,7 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag
-1, -1, -1, -1, 2, 4, 6, 8
};
- int16_t nibble,signed_nibble,diff,step;
+ int16_t nibble,diff,step;
ima_adpcm.last_nibble++;
const uint8_t *src_ptr=sdata;
@@ -172,10 +172,6 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag
if (ima_adpcm.step_index>88)
ima_adpcm.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 ;
@@ -285,15 +281,13 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag
for(int j=0;j<h;j++) {
- int half,ofs;
+ int half;
float v;
if (j<(h/2)) {
half=0;
- ofs=0;
v = (j/(float)(h/2)) * 2.0 - 1.0;
} else {
half=1;
- ofs=h/2;
v = ((j-(h/2))/(float)(h/2)) * 2.0 - 1.0;
}
diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp
index 0086f76b9c..864df42b6e 100644
--- a/tools/editor/plugins/shader_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_editor_plugin.cpp
@@ -118,9 +118,10 @@ void ShaderTextEditor::_load_theme_settings() {
get_text_edit()->add_color_region("/*","*/",comment_color,false);
get_text_edit()->add_color_region("//","",comment_color,false);
- //colorize strings
+
+ /*//colorize strings
Color string_color = EDITOR_DEF("text_editor/string_color",Color::hex(0x6b6f00ff));
- /*
+
List<String> strings;
shader->get_shader_mode()->get_string_delimiters(&strings);
diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp
index dea2fe4833..375220051c 100644
--- a/tools/editor/plugins/shader_graph_editor_plugin.cpp
+++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp
@@ -186,9 +186,8 @@ void GraphColorRampEdit::_notification(int p_what){
Point prev;
prev.offset=0;
prev.color=Color(0,0,0);
- int w = get_size().x;
- int h = get_size().y;
+ int h = get_size().y;
int total_w = get_size().width-get_size().height-3;
for(int i=-1;i<points.size();i++) {
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index 201ff30f40..91a347c69b 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -53,8 +53,6 @@
void SpatialEditorViewport::_update_camera() {
if (orthogonal) {
- Size2 size = get_size();
- Size2 vpsize = Point2(cursor.distance*size.get_aspect(), cursor.distance / size.get_aspect());
//camera->set_orthogonal(size.width*cursor.distance,get_znear(),get_zfar());
camera->set_orthogonal(2 * cursor.distance, 0.1, 8192);
}
@@ -276,10 +274,6 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b
r_includes_current=false;
List<_RayResult> results;
- Vector3 cn=_get_camera_normal();
- Plane cplane(pos,cn.normalized());
-
- float min_d=1e20;
for (int i=0;i<instances.size();i++) {
@@ -649,21 +643,8 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2& p_screenpos,bool p_hili
Vector3 ray_pos=_get_ray_pos( Vector2( p_screenpos.x, p_screenpos.y ) );
Vector3 ray=_get_ray( Vector2( p_screenpos.x, p_screenpos.y ) );
- Vector3 cn=_get_camera_normal();
- Plane cplane(ray_pos,cn.normalized());
-
Transform gt = spatial_editor->get_gizmo_transform();
float gs=gizmo_scale;
- /*
- if (orthogonal) {
- gs= cursor.distance/surface->get_size().get_aspect();
-
- } else {
- gs = cplane.distance_to(gt.origin);
- }
-
- gs*=GIZMO_SCALE_DEFAULT;
-*/
if (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) {
@@ -1268,16 +1249,6 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
if (_edit.gizmo.is_valid()) {
- Plane plane=Plane(_edit.gizmo_initial_pos,_get_camera_normal());
-
-
- Vector3 ray_pos=_get_ray_pos( Vector2( m.x, m.y ) );
- Vector3 ray=_get_ray( Vector2( m.x, m.y ) );
-
- //Vector3 intersection;
- //if (!plane.intersects_ray(ray_pos,ray,&intersection))
- // break;
-
_edit.gizmo->set_handle(_edit.gizmo_handle,camera,Vector2(m.x,m.y));
Variant v = _edit.gizmo->get_handle_value(_edit.gizmo_handle);
String n = _edit.gizmo->get_handle_name(_edit.gizmo_handle);
@@ -1808,16 +1779,6 @@ void SpatialEditorViewport::_notification(int p_what) {
continue;
- /*
- ??
- if (!se->poly_instance.is_valid())
- continue;
- if (!ObjectDB::get_instance( E->key() )) {
- VisualServer::get_singleton()->free( se->poly_instance );
- se->poly_instance=RID();
- continue;
- }
- */
VisualInstance *vi=sp->cast_to<VisualInstance>();
@@ -1855,35 +1816,6 @@ void SpatialEditorViewport::_notification(int p_what) {
surface->update();
}
- //grid
- Vector3 grid_cam_axis=_get_camera_normal();
- /*
- for(int i=0;i<3;i++) {
-
-
- Vector3 axis;
- axis[i]=1;
-
- bool should_be_visible= grid_enabled && (grid_enable[i] || (Math::abs(grid_cam_axis.dot(axis))>0.99 && orthogonal));
-
- if (should_be_visible!=grid_visible[i]) {
-
- VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,should_be_visible);
- grid_visible[i]=should_be_visible;
- }
- }
-
- if (last_grid_snap!=spatial_editor->get_translate_snap()) {
-
-
- last_grid_snap=spatial_editor->get_translate_snap()
- Transform gridt;
- gridt.basis.scale(Vector3(last_grid_snap,last_grid_snap,last_grid_snap));
- for(int i=0;i<3;i++)
- VisualServer::get_singleton()->instance_set_transform(grid_instance[i],gridt);
-
- }*/
-
}
if (p_what==NOTIFICATION_ENTER_TREE) {
@@ -2565,16 +2497,9 @@ Object *SpatialEditor::_get_editor_data(Object *p_what) {
si->sbox_instance=VisualServer::get_singleton()->instance_create2(selection_box->get_rid(),sp->get_world()->get_scenario());
VS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, VS::SHADOW_CASTING_SETTING_OFF);
- RID inst = sp->call("_get_visual_instance_rid");
-
-// if (inst.is_valid())
-// si->aabb = VisualServer::get_singleton()->instance_get_base_aabb(inst);
-
-
if (get_tree()->is_editor_hint())
editor->call("edit_node",sp);
-
return si;
}
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index 3f82199fc3..103962716b 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -431,7 +431,6 @@ void ProjectExportDialog::_validate_platform() {
void ProjectExportDialog::_export_mode_changed(int p_idx) {
- bool do_all = p_idx==0;
if (EditorImportExport::get_singleton()->get_export_filter()==p_idx)
return;
EditorImportExport::get_singleton()->set_export_filter(EditorImportExport::ExportFilter(p_idx));
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index 497ff43a4d..52f6d1dd9c 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -823,9 +823,6 @@ void ProjectManager::_bind_methods() {
ProjectManager::ProjectManager() {
- int margin = get_constant("margin","Dialogs");
- int button_margin = get_constant("button_margin","Dialogs");
-
// load settings
if (!EditorSettings::get_singleton())
EditorSettings::create();
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 4b3f245e44..7816dd9bc7 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -389,7 +389,6 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
List<String> names;
names.push_back("value:");
config_value_editors(1,1,50,names);
- Vector3 vec=v;
value_editor[0]->set_text( String::num(v) );
}
@@ -436,7 +435,6 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
List<String> names;
names.push_back("string:");
config_value_editors(1,1,50,names);
- Vector3 vec=v;
value_editor[0]->set_text( v );
}
@@ -3345,7 +3343,6 @@ void PropertyEditor::update_tree() {
String type;
if (p.hint==PROPERTY_HINT_RESOURCE_TYPE)
type=p.hint_string;
- bool notnil=false;
if (obj->get( p.name ).get_type() == Variant::NIL || obj->get( p.name ).operator RefPtr().is_null()) {
item->set_text(1,"<null>");
@@ -3368,8 +3365,7 @@ void PropertyEditor::update_tree() {
} else {
item->set_text(1,"<"+res->get_type()+">");
- };
- notnil=true;
+ }
if (has_icon(res->get_type(),"EditorIcons")) {
type=res->get_type();
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 0d0d9ff953..4526fa26aa 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -382,11 +382,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
ERR_FAIL_COND(!top_node->get_parent());
ERR_FAIL_COND(!bottom_node->get_parent());
- int top_node_pos = top_node->get_index();
int bottom_node_pos = bottom_node->get_index();
-
- int top_node_pos_next = top_node_pos + (MOVING_DOWN ? 1 : -1);
- int bottom_node_pos_next = bottom_node_pos + (MOVING_DOWN ? 1 : -1);
+ int top_node_pos_next = top_node->get_index() + (MOVING_DOWN ? 1 : -1);
editor_data->get_undo_redo().add_do_method(top_node->get_parent(), "move_child", top_node, top_node_pos_next);
editor_data->get_undo_redo().add_undo_method(bottom_node->get_parent(), "move_child", bottom_node, bottom_node_pos);
@@ -1108,17 +1105,8 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Node2D>()->get_global_transform());
if (node->cast_to<Spatial>())
editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Spatial>()->get_global_transform());
- if (node->cast_to<Control>()) {
- bool can_do_it=false;
- Control *c=node->cast_to<Control>();
- if (c->get_parent()->cast_to<Container>())
- can_do_it=false;
- for(int i=0;i<4;i++) {
- if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN)
- can_do_it=false;
- }
+ if (node->cast_to<Control>())
editor_data->get_undo_redo().add_do_method(node,"set_global_pos",node->cast_to<Control>()->get_global_pos());
- }
}
editor_data->get_undo_redo().add_do_method(this,"_set_owners",edited_scene,owners);
@@ -1161,17 +1149,8 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Node2D>()->get_transform());
if (node->cast_to<Spatial>())
editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Spatial>()->get_transform());
- if (node->cast_to<Control>()) {
- bool can_do_it=false;
- Control *c=node->cast_to<Control>();
- if (c->get_parent()->cast_to<Container>())
- can_do_it=false;
- for(int i=0;i<4;i++) {
- if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN)
- can_do_it=false;
- }
+ if (node->cast_to<Control>())
editor_data->get_undo_redo().add_undo_method(node,"set_pos",node->cast_to<Control>()->get_pos());
- }
}
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index fa7c898f91..c46178345c 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -37,6 +37,8 @@
#include "editor_settings.h"
#include "scene/main/viewport.h"
+
+
bool ScenesDock::_create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir) {
@@ -57,61 +59,6 @@ bool ScenesDock::_create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_di
item->select(0);
}
-
- //item->set_custom_bg_color(0,get_color("prop_subsection","Editor"));
-
- bool has_items=false;
-
- for(int i=0;i<p_dir->get_subdir_count();i++) {
-
- if (_create_tree(item,p_dir->get_subdir(i)))
- has_items=true;
- }
-#if 0
- for (int i=0;i<p_dir->get_file_count();i++) {
-
- String file_name = p_dir->get_file(i);
- String file_path = p_dir->get_file_path(i);
-
- // ScenesDockFilter::FILTER_PATH
- String search_from = file_path.right(6); // trim "res://"
- if (file_filter == ScenesDockFilter::FILTER_NAME)
- search_from = file_name;
- else if (file_filter == ScenesDockFilter::FILTER_FOLDER)
- search_from = file_path.right(6).get_base_dir();
-
- if (search_term!="" && search_from.findn(search_term)==-1)
- continue;
-
- bool isfave = favorites.has(file_path);
- if (button_favorite->is_pressed() && !isfave)
- continue;
-
- TreeItem *fitem = tree->create_item(item);
- fitem->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
- fitem->set_editable(0,true);
- fitem->set_checked(0,isfave);
- fitem->set_text(0,file_name);
-
- Ref<Texture> icon = get_icon( (has_icon(p_dir->get_file_type(i),"EditorIcons")?p_dir->get_file_type(i):String("Object")),"EditorIcons");
- fitem->set_icon(0, icon );
-
-
- fitem->set_metadata(0,file_path);
- //if (p_dir->files[i]->icon.is_valid()) {
-// fitem->set_icon(0,p_dir->files[i]->icon);
-// }
- has_items=true;
-
- }
-#endif
- /*if (!has_items) {
-
- memdelete(item);
- return false;
-
- }*/
-
return true;
}
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index 6d8f54d88f..fc746bc21d 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -819,7 +819,6 @@ void ScriptEditorDebugger::_performance_draw() {
if(which.empty())
return;
- Color graph_color=get_color("font_color","TextEdit");
Ref<StyleBox> graph_sb = get_stylebox("normal","TextEdit");
Ref<Font> graph_font = get_font("font","TextEdit");
diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp
index 1ca62d3a63..edc2fc513d 100644
--- a/tools/editor/spatial_editor_gizmos.cpp
+++ b/tools/editor/spatial_editor_gizmos.cpp
@@ -424,16 +424,11 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
}
Transform ti=t.affine_inverse();
- Vector3 ray_from=ti.xform(p_camera->project_ray_origin(p_point));
- Vector3 ray_dir=t.basis.xform_inv(p_camera->project_ray_normal(p_point)).normalized();
- Vector3 ray_to = ray_from+ray_dir*4096;
float min_d=1e20;
int idx=-1;
for(int i=0;i<secondary_handles.size();i++) {
-#if 1
-
Vector3 hpos = t.xform(secondary_handles[i]);
Vector2 p = p_camera->unproject_position(hpos);
@@ -449,31 +444,7 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
idx=i+handles.size();
}
-
- }
-
-#else
- AABB aabb;
- aabb.pos=Vector3(-1,-1,-1)*HANDLE_HALF_SIZE;
- aabb.size=aabb.pos*-2;
- aabb.pos+=secondary_handles[i];
-
-
- Vector3 rpos,rnorm;
-
- if (aabb.intersects_segment(ray_from,ray_to,&rpos,&rnorm)) {
-
- real_t dp = ray_dir.dot(rpos);
- if (dp<min_d) {
-
- r_pos=t.xform(rpos);
- r_normal=ti.basis.xform_inv(rnorm).normalized();
- min_d=dp;
- idx=i+handles.size();
-
- }
}
-#endif
}
if (p_sec_first && idx!=-1) {
@@ -486,9 +457,6 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
for(int i=0;i<handles.size();i++) {
-#if 1
-
-
Vector3 hpos = t.xform(handles[i]);
Vector2 p = p_camera->unproject_position(hpos);
if (p.distance_to(p_point)<SpatialEditorGizmos::singleton->handle_t->get_width()*0.6) {
@@ -503,32 +471,7 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
idx=i;
}
-
- }
-
-#else
-
- AABB aabb;
- aabb.pos=Vector3(-1,-1,-1)*HANDLE_HALF_SIZE;
- aabb.size=aabb.pos*-2;
- aabb.pos+=handles[i];
-
-
- Vector3 rpos,rnorm;
-
- if (aabb.intersects_segment(ray_from,ray_to,&rpos,&rnorm)) {
-
- real_t dp = ray_dir.dot(rpos);
- if (dp<min_d) {
-
- r_pos=t.xform(rpos);
- r_normal=ti.basis.xform_inv(rnorm).normalized();
- min_d=dp;
- idx=i;
-
- }
}
-#endif
}
if (idx>=0) {
@@ -612,9 +555,6 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
Vector3 ray_dir=ai.basis.xform(p_camera->project_ray_normal(p_point)).normalized();
Vector3 rpos,rnorm;
-#if 1
-
-
if (collision_mesh->intersect_ray(ray_from,ray_dir,rpos,rnorm)) {
@@ -622,16 +562,6 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
r_normal=gt.basis.xform(rnorm).normalized();
return true;
}
-#else
-
- if (collision_mesh->intersect_segment(ray_from,ray_from+ray_dir*4906.0,rpos,rnorm)) {
-
- r_pos=gt.xform(rpos);
- r_normal=gt.basis.xform(rnorm).normalized();
- return true;
- }
-
-#endif
}
return false;
@@ -2250,7 +2180,6 @@ void VisibilityNotifierGizmo::set_handle(int p_idx,Camera *p_camera, const Point
if (d<0.001)
d=0.001;
- Vector3 he = aabb.size;
aabb.pos[p_idx]=(aabb.pos[p_idx]+aabb.size[p_idx]*0.5)-d;
aabb.size[p_idx]=d*2;
notifier->set_aabb(aabb);
@@ -2456,8 +2385,6 @@ void HingeJointSpatialGizmo::redraw() {
if (p3d->get_flag(HingeJoint::FLAG_USE_LIMIT) && ll<ul) {
const int points = 32;
- float step = (ul-ll)/points;
-
for(int i=0;i<points;i++) {
@@ -2573,8 +2500,6 @@ void SliderJointSpatialGizmo::redraw() {
if (ll<ul) {
const int points = 32;
- float step = (ul-ll)/points;
-
for(int i=0;i<points;i++) {
@@ -2641,7 +2566,6 @@ SliderJointSpatialGizmo::SliderJointSpatialGizmo(SliderJoint* p_p3d) {
void ConeTwistJointSpatialGizmo::redraw() {
clear();
- float cs = 0.25;
Vector<Vector3> points;
float r = 1.0;
@@ -2837,8 +2761,6 @@ void Generic6DOFJointSpatialGizmo::redraw() {
if (enable_ang && ll<=ul) {
const int points = 32;
- float step = (ul-ll)/points;
-
for(int i=0;i<points;i++) {