summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--SConstruct11
-rw-r--r--core/globals.cpp12
-rw-r--r--core/object.cpp5
-rw-r--r--core/variant_call.cpp4
-rw-r--r--core/variant_op.cpp6
-rw-r--r--core/variant_parser.cpp1495
-rw-r--r--core/variant_parser.h103
-rw-r--r--demos/gui/rich_text_bbcode/rich_text_bbcode.scnbin2373 -> 3288 bytes
-rw-r--r--doc/base/classes.xml103
-rw-r--r--doc/core_classes.xml4
-rw-r--r--drivers/SCsub6
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp3
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp10
-rw-r--r--drivers/gles2/shaders/material.glsl8
-rw-r--r--drivers/ogg/SCsub3
-rw-r--r--drivers/opus/SCsub7
-rw-r--r--drivers/opus/analysis.c20
-rw-r--r--drivers/opus/analysis.h4
-rw-r--r--drivers/opus/celt/_kiss_fft_guts.h4
-rw-r--r--drivers/opus/celt/arch.h8
-rw-r--r--drivers/opus/celt/arm/arm_celt_map.c6
-rw-r--r--drivers/opus/celt/arm/armcpu.c12
-rw-r--r--drivers/opus/celt/arm/fixed_armv5e.h2
-rw-r--r--drivers/opus/celt/arm/pitch_arm.h2
-rw-r--r--drivers/opus/celt/bands.c24
-rw-r--r--drivers/opus/celt/bands.h10
-rw-r--r--drivers/opus/celt/celt.c32
-rw-r--r--drivers/opus/celt/celt.h12
-rw-r--r--drivers/opus/celt/celt_decoder.c34
-rw-r--r--drivers/opus/celt/celt_encoder.c34
-rw-r--r--drivers/opus/celt/celt_lpc.c12
-rw-r--r--drivers/opus/celt/celt_lpc.h2
-rw-r--r--drivers/opus/celt/cpu_support.h4
-rw-r--r--drivers/opus/celt/cwrs.c12
-rw-r--r--drivers/opus/celt/cwrs.h8
-rw-r--r--drivers/opus/celt/ecintrin.h4
-rw-r--r--drivers/opus/celt/entcode.c8
-rw-r--r--drivers/opus/celt/entcode.h6
-rw-r--r--drivers/opus/celt/entdec.c12
-rw-r--r--drivers/opus/celt/entdec.h2
-rw-r--r--drivers/opus/celt/entenc.c12
-rw-r--r--drivers/opus/celt/entenc.h2
-rw-r--r--drivers/opus/celt/fixed_debug.h2
-rw-r--r--drivers/opus/celt/float_cast.h2
-rw-r--r--drivers/opus/celt/kiss_fft.c14
-rw-r--r--drivers/opus/celt/kiss_fft.h4
-rw-r--r--drivers/opus/celt/laplace.c8
-rw-r--r--drivers/opus/celt/laplace.h4
-rw-r--r--drivers/opus/celt/mathops.c6
-rw-r--r--drivers/opus/celt/mathops.h8
-rw-r--r--drivers/opus/celt/mdct.c16
-rw-r--r--drivers/opus/celt/mdct.h6
-rw-r--r--drivers/opus/celt/mfrngcod.h2
-rw-r--r--drivers/opus/celt/modes.c20
-rw-r--r--drivers/opus/celt/opus_custom_demo.c8
-rw-r--r--drivers/opus/celt/opus_modes.h12
-rw-r--r--drivers/opus/celt/os_support.h4
-rw-r--r--drivers/opus/celt/pitch.c16
-rw-r--r--drivers/opus/celt/pitch.h4
-rw-r--r--drivers/opus/celt/quant_bands.c18
-rw-r--r--drivers/opus/celt/quant_bands.h10
-rw-r--r--drivers/opus/celt/rate.c16
-rw-r--r--drivers/opus/celt/rate.h4
-rw-r--r--drivers/opus/celt/stack_alloc.h6
-rw-r--r--drivers/opus/celt/static_modes_fixed.h4
-rw-r--r--drivers/opus/celt/static_modes_float.h4
-rw-r--r--drivers/opus/celt/tests/test_unit_cwrs32.c18
-rw-r--r--drivers/opus/celt/tests/test_unit_dft.c14
-rw-r--r--drivers/opus/celt/tests/test_unit_entropy.c16
-rw-r--r--drivers/opus/celt/tests/test_unit_laplace.c16
-rw-r--r--drivers/opus/celt/tests/test_unit_mathops.c22
-rw-r--r--drivers/opus/celt/tests/test_unit_mdct.c16
-rw-r--r--drivers/opus/celt/tests/test_unit_rotation.c18
-rw-r--r--drivers/opus/celt/tests/test_unit_types.c6
-rw-r--r--drivers/opus/celt/vq.c18
-rw-r--r--drivers/opus/celt/vq.h6
-rw-r--r--drivers/opus/celt/x86/pitch_sse.h2
-rw-r--r--drivers/opus/http.c8
-rw-r--r--drivers/opus/info.c6
-rw-r--r--drivers/opus/internal.c6
-rw-r--r--drivers/opus/mlp.c14
-rw-r--r--drivers/opus/mlp.h2
-rw-r--r--drivers/opus/mlp_data.c2
-rw-r--r--drivers/opus/opus.c8
-rw-r--r--drivers/opus/opus.h4
-rw-r--r--drivers/opus/opus_custom.h2
-rw-r--r--drivers/opus/opus_decoder.c30
-rw-r--r--drivers/opus/opus_defines.h2
-rw-r--r--drivers/opus/opus_demo.c14
-rw-r--r--drivers/opus/opus_encoder.c36
-rw-r--r--drivers/opus/opus_multistream.c16
-rw-r--r--drivers/opus/opus_multistream.h2
-rw-r--r--drivers/opus/opus_multistream_decoder.c16
-rw-r--r--drivers/opus/opus_multistream_encoder.c26
-rw-r--r--drivers/opus/opus_private.h6
-rw-r--r--drivers/opus/opusfile.c8
-rw-r--r--drivers/opus/repacketizer.c10
-rw-r--r--drivers/opus/repacketizer_demo.c6
-rw-r--r--drivers/opus/silk/A2NLSF.c8
-rw-r--r--drivers/opus/silk/API.h10
-rw-r--r--drivers/opus/silk/CNG.c8
-rw-r--r--drivers/opus/silk/HP_variable_cutoff.c10
-rw-r--r--drivers/opus/silk/LPC_analysis_filter.c8
-rw-r--r--drivers/opus/silk/LPC_inv_pred_gain.c6
-rw-r--r--drivers/opus/silk/LP_variable_cutoff.c6
-rw-r--r--drivers/opus/silk/NLSF2A.c8
-rw-r--r--drivers/opus/silk/NLSF_VQ.c6
-rw-r--r--drivers/opus/silk/NLSF_VQ_weights_laroia.c8
-rw-r--r--drivers/opus/silk/NLSF_decode.c6
-rw-r--r--drivers/opus/silk/NLSF_del_dec_quant.c6
-rw-r--r--drivers/opus/silk/NLSF_encode.c8
-rw-r--r--drivers/opus/silk/NLSF_stabilize.c6
-rw-r--r--drivers/opus/silk/NLSF_unpack.c6
-rw-r--r--drivers/opus/silk/NSQ.c8
-rw-r--r--drivers/opus/silk/NSQ_del_dec.c8
-rw-r--r--drivers/opus/silk/PLC.c10
-rw-r--r--drivers/opus/silk/PLC.h2
-rw-r--r--drivers/opus/silk/SigProc_FIX.h12
-rw-r--r--drivers/opus/silk/VAD.c8
-rw-r--r--drivers/opus/silk/VQ_WMat_EC.c6
-rw-r--r--drivers/opus/silk/ana_filt_bank_1.c6
-rw-r--r--drivers/opus/silk/biquad_alt.c6
-rw-r--r--drivers/opus/silk/bwexpander.c6
-rw-r--r--drivers/opus/silk/bwexpander_32.c6
-rw-r--r--drivers/opus/silk/check_control_input.c10
-rw-r--r--drivers/opus/silk/code_signs.c6
-rw-r--r--drivers/opus/silk/control.h2
-rw-r--r--drivers/opus/silk/control_SNR.c8
-rw-r--r--drivers/opus/silk/control_audio_bandwidth.c8
-rw-r--r--drivers/opus/silk/control_codec.c14
-rw-r--r--drivers/opus/silk/debug.c8
-rw-r--r--drivers/opus/silk/debug.h2
-rw-r--r--drivers/opus/silk/dec_API.c10
-rw-r--r--drivers/opus/silk/decode_core.c8
-rw-r--r--drivers/opus/silk/decode_frame.c10
-rw-r--r--drivers/opus/silk/decode_indices.c6
-rw-r--r--drivers/opus/silk/decode_parameters.c6
-rw-r--r--drivers/opus/silk/decode_pitch.c8
-rw-r--r--drivers/opus/silk/decode_pulses.c6
-rw-r--r--drivers/opus/silk/decoder_set_fs.c6
-rw-r--r--drivers/opus/silk/define.h4
-rw-r--r--drivers/opus/silk/enc_API.c22
-rw-r--r--drivers/opus/silk/encode_indices.c6
-rw-r--r--drivers/opus/silk/encode_pulses.c8
-rw-r--r--drivers/opus/silk/fixed/LTP_analysis_filter_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/LTP_scale_ctrl_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/apply_sine_window_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/autocorr_FIX.c8
-rw-r--r--drivers/opus/silk/fixed/burg_modified_FIX.c12
-rw-r--r--drivers/opus/silk/fixed/corrMatrix_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/encode_frame_FIX.c10
-rw-r--r--drivers/opus/silk/fixed/find_LPC_FIX.c10
-rw-r--r--drivers/opus/silk/fixed/find_LTP_FIX.c8
-rw-r--r--drivers/opus/silk/fixed/find_pitch_lags_FIX.c10
-rw-r--r--drivers/opus/silk/fixed/find_pred_coefs_FIX.c8
-rw-r--r--drivers/opus/silk/fixed/k2a_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/k2a_Q16_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/main_FIX.h14
-rw-r--r--drivers/opus/silk/fixed/noise_shape_analysis_FIX.c10
-rw-r--r--drivers/opus/silk/fixed/pitch_analysis_core_FIX.c14
-rw-r--r--drivers/opus/silk/fixed/prefilter_FIX.c10
-rw-r--r--drivers/opus/silk/fixed/process_gains_FIX.c8
-rw-r--r--drivers/opus/silk/fixed/regularize_correlations_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/residual_energy16_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/residual_energy_FIX.c8
-rw-r--r--drivers/opus/silk/fixed/schur64_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/schur_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/solve_LS_FIX.c10
-rw-r--r--drivers/opus/silk/fixed/structs_FIX.h6
-rw-r--r--drivers/opus/silk/fixed/vector_ops_FIX.c6
-rw-r--r--drivers/opus/silk/fixed/warped_autocorrelation_FIX.c6
-rw-r--r--drivers/opus/silk/float/LPC_analysis_filter_FLP.c6
-rw-r--r--drivers/opus/silk/float/LPC_inv_pred_gain_FLP.c8
-rw-r--r--drivers/opus/silk/float/LTP_analysis_filter_FLP.c6
-rw-r--r--drivers/opus/silk/float/LTP_scale_ctrl_FLP.c6
-rw-r--r--drivers/opus/silk/float/SigProc_FLP.h4
-rw-r--r--drivers/opus/silk/float/apply_sine_window_FLP.c6
-rw-r--r--drivers/opus/silk/float/autocorrelation_FLP.c8
-rw-r--r--drivers/opus/silk/float/burg_modified_FLP.c10
-rw-r--r--drivers/opus/silk/float/bwexpander_FLP.c6
-rw-r--r--drivers/opus/silk/float/corrMatrix_FLP.c6
-rw-r--r--drivers/opus/silk/float/encode_frame_FLP.c8
-rw-r--r--drivers/opus/silk/float/energy_FLP.c6
-rw-r--r--drivers/opus/silk/float/find_LPC_FLP.c10
-rw-r--r--drivers/opus/silk/float/find_LTP_FLP.c8
-rw-r--r--drivers/opus/silk/float/find_pitch_lags_FLP.c8
-rw-r--r--drivers/opus/silk/float/find_pred_coefs_FLP.c6
-rw-r--r--drivers/opus/silk/float/inner_product_FLP.c6
-rw-r--r--drivers/opus/silk/float/k2a_FLP.c6
-rw-r--r--drivers/opus/silk/float/levinsondurbin_FLP.c6
-rw-r--r--drivers/opus/silk/float/main_FLP.h14
-rw-r--r--drivers/opus/silk/float/noise_shape_analysis_FLP.c8
-rw-r--r--drivers/opus/silk/float/pitch_analysis_core_FLP.c12
-rw-r--r--drivers/opus/silk/float/prefilter_FLP.c8
-rw-r--r--drivers/opus/silk/float/process_gains_FLP.c8
-rw-r--r--drivers/opus/silk/float/regularize_correlations_FLP.c6
-rw-r--r--drivers/opus/silk/float/residual_energy_FLP.c6
-rw-r--r--drivers/opus/silk/float/scale_copy_vector_FLP.c6
-rw-r--r--drivers/opus/silk/float/scale_vector_FLP.c6
-rw-r--r--drivers/opus/silk/float/schur_FLP.c6
-rw-r--r--drivers/opus/silk/float/solve_LS_FLP.c8
-rw-r--r--drivers/opus/silk/float/sort_FLP.c8
-rw-r--r--drivers/opus/silk/float/structs_FLP.h6
-rw-r--r--drivers/opus/silk/float/warped_autocorrelation_FLP.c6
-rw-r--r--drivers/opus/silk/float/wrappers_FLP.c6
-rw-r--r--drivers/opus/silk/gain_quant.c6
-rw-r--r--drivers/opus/silk/init_decoder.c6
-rw-r--r--drivers/opus/silk/init_encoder.c12
-rw-r--r--drivers/opus/silk/inner_prod_aligned.c6
-rw-r--r--drivers/opus/silk/interpolate.c6
-rw-r--r--drivers/opus/silk/lin2log.c6
-rw-r--r--drivers/opus/silk/log2lin.c6
-rw-r--r--drivers/opus/silk/macros.h8
-rw-r--r--drivers/opus/silk/pitch_est_defines.h2
-rw-r--r--drivers/opus/silk/pitch_est_tables.c8
-rw-r--r--drivers/opus/silk/process_NLSFs.c6
-rw-r--r--drivers/opus/silk/quant_LTP_gains.c8
-rw-r--r--drivers/opus/silk/resampler.c6
-rw-r--r--drivers/opus/silk/resampler_down2.c8
-rw-r--r--drivers/opus/silk/resampler_down2_3.c10
-rw-r--r--drivers/opus/silk/resampler_private.h6
-rw-r--r--drivers/opus/silk/resampler_private_AR2.c8
-rw-r--r--drivers/opus/silk/resampler_private_IIR_FIR.c10
-rw-r--r--drivers/opus/silk/resampler_private_down_FIR.c10
-rw-r--r--drivers/opus/silk/resampler_private_up2_HQ.c8
-rw-r--r--drivers/opus/silk/resampler_rom.c6
-rw-r--r--drivers/opus/silk/resampler_rom.h4
-rw-r--r--drivers/opus/silk/shell_coder.c6
-rw-r--r--drivers/opus/silk/sigm_Q15.c6
-rw-r--r--drivers/opus/silk/silk_main.h18
-rw-r--r--drivers/opus/silk/sort.c6
-rw-r--r--drivers/opus/silk/stereo_LR_to_MS.c8
-rw-r--r--drivers/opus/silk/stereo_MS_to_LR.c6
-rw-r--r--drivers/opus/silk/stereo_decode_pred.c6
-rw-r--r--drivers/opus/silk/stereo_encode_pred.c6
-rw-r--r--drivers/opus/silk/stereo_find_predictor.c6
-rw-r--r--drivers/opus/silk/stereo_quant_pred.c6
-rw-r--r--drivers/opus/silk/structs.h10
-rw-r--r--drivers/opus/silk/sum_sqr_shift.c6
-rw-r--r--drivers/opus/silk/table_LSF_cos.c6
-rw-r--r--drivers/opus/silk/tables.h4
-rw-r--r--drivers/opus/silk/tables_LTP.c6
-rw-r--r--drivers/opus/silk/tables_NLSF_CB_NB_MB.c6
-rw-r--r--drivers/opus/silk/tables_NLSF_CB_WB.c6
-rw-r--r--drivers/opus/silk/tables_gain.c6
-rw-r--r--drivers/opus/silk/tables_other.c10
-rw-r--r--drivers/opus/silk/tables_pitch_lag.c6
-rw-r--r--drivers/opus/silk/tables_pulses_per_block.c6
-rw-r--r--drivers/opus/silk/typedef.h4
-rw-r--r--drivers/opus/stream.c6
-rw-r--r--drivers/opus/wincerts.c6
-rw-r--r--drivers/png/resource_saver_png.cpp1
-rw-r--r--drivers/register_driver_types.cpp17
-rw-r--r--drivers/theora/SCsub36
-rw-r--r--drivers/theora/encint.h1
-rw-r--r--drivers/theora/video_stream_theora.cpp16
-rw-r--r--drivers/vorbis/SCsub4
-rw-r--r--main/main.cpp30
-rw-r--r--modules/gdscript/gd_editor.cpp9
-rw-r--r--modules/gdscript/gd_parser.cpp6
-rw-r--r--modules/gdscript/gd_script.cpp14
-rw-r--r--modules/gdscript/gd_script.h2
-rw-r--r--platform/android/detect.py4
-rw-r--r--platform/osx/detect.py2
-rw-r--r--platform/windows/SCsub10
-rw-r--r--platform/windows/detect.py2
-rw-r--r--platform/windows/export/export.cpp2
-rw-r--r--platform/windows/godot_res.rc2
-rw-r--r--platform/x11/detect.py4
-rw-r--r--scene/gui/container.cpp8
-rw-r--r--scene/gui/container.h1
-rw-r--r--scene/gui/dialogs.cpp4
-rw-r--r--scene/gui/popup_menu.cpp9
-rw-r--r--scene/gui/rich_text_label.cpp3
-rw-r--r--scene/gui/text_edit.cpp13
-rw-r--r--scene/gui/text_edit.h2
-rw-r--r--scene/gui/video_player.cpp4
-rw-r--r--scene/register_scene_types.cpp7
-rw-r--r--scene/resources/packed_scene.cpp83
-rw-r--r--scene/resources/packed_scene.h15
-rw-r--r--scene/resources/scene_format_text.cpp1040
-rw-r--r--scene/resources/scene_format_text.h94
-rw-r--r--scene/resources/shader_graph.cpp1
-rw-r--r--servers/visual/shader_language.cpp5
-rwxr-xr-xtools/Godot.app/Contents/Info.plist4
-rw-r--r--tools/editor/code_editor.cpp1
-rw-r--r--tools/editor/connections_dialog.cpp19
-rw-r--r--tools/editor/connections_dialog.h2
-rw-r--r--tools/editor/dependency_editor.cpp181
-rw-r--r--tools/editor/dependency_editor.h25
-rw-r--r--tools/editor/editor_help.cpp16
-rw-r--r--tools/editor/editor_help.h3
-rw-r--r--tools/editor/editor_node.cpp55
-rw-r--r--tools/editor/editor_node.h9
-rw-r--r--tools/editor/io_plugins/editor_mesh_import_plugin.cpp39
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp15
-rw-r--r--tools/editor/project_export.cpp12
-rw-r--r--tools/editor/project_manager.cpp5
-rw-r--r--tools/editor/property_editor.cpp9
-rw-r--r--tools/editor/scene_tree_dock.cpp5
-rw-r--r--tools/editor/scene_tree_editor.cpp1
-rw-r--r--tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj2
-rw-r--r--tools/ios_xcode_template/godot_ios/godot_ios-Info.plist2
-rw-r--r--tools/ios_xcode_template/godot_ios/main.m35
-rw-r--r--tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist2
-rw-r--r--tools/ios_xcode_template/godot_iosTests/godot_iosTests.m35
307 files changed, 4484 insertions, 1213 deletions
diff --git a/.gitignore b/.gitignore
index a7ac2d2fc7..f24d91a7ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -296,3 +296,4 @@ cscope.po.out
godot.creator.*
projects/
+platform/windows/godot_res.res
diff --git a/SConstruct b/SConstruct
index 05c53a15fc..46edf06a42 100644
--- a/SConstruct
+++ b/SConstruct
@@ -84,6 +84,9 @@ env_base.__class__.disable_module = methods.disable_module
env_base.__class__.add_source_files = methods.add_source_files
+env_base["x86_opt_gcc"]=False
+env_base["x86_opt_vc"]=False
+
customs = ['custom.py']
profile = ARGUMENTS.get("profile", False)
@@ -106,7 +109,7 @@ opts.Add('opus','Build Opus Audio Format Support: (yes/no)','yes')
opts.Add('minizip','Build Minizip Archive Support: (yes/no)','yes')
opts.Add('squish','Squish BC Texture Compression in editor (yes/no)','yes')
opts.Add('theora','Theora Video (yes/no)','yes')
-opts.Add('use_theoraplayer_binary', "Use precompiled binaries from libtheoraplayer for ogg/theora/vorbis (yes/no)", "no")
+opts.Add('theoralib','Theora Video (yes/no)','no')
opts.Add('freetype','Freetype support in editor','yes')
opts.Add('speex','Speex Audio (yes/no)','yes')
opts.Add('xml','XML Save/Load support (yes/no)','yes')
@@ -304,8 +307,12 @@ if selected_platform in platform_list:
if (env['opus']=='yes'):
env.Append(CPPFLAGS=['-DOPUS_ENABLED']);
+
if (env['theora']=='yes'):
- env.Append(CPPFLAGS=['-DTHEORA_ENABLED']);
+ env['theoralib']='yes'
+ env.Append(CPPFLAGS=['-DTHEORA_ENABLED']);
+ if (env['theoralib']=='yes'):
+ env.Append(CPPFLAGS=['-DTHEORALIB_ENABLED']);
if (env['png']=='yes'):
env.Append(CPPFLAGS=['-DPNG_ENABLED']);
diff --git a/core/globals.cpp b/core/globals.cpp
index ffd4cf5d5e..aee708d0cd 100644
--- a/core/globals.cpp
+++ b/core/globals.cpp
@@ -332,6 +332,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) {
String candidate = d->get_current_dir();
String current_dir = d->get_current_dir();
+ String exec_name = OS::get_singleton()->get_executable_path().get_file().basename();
bool found = false;
bool first_time=true;
@@ -339,7 +340,16 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) {
//try to load settings in ascending through dirs shape!
//tries to open pack, but only first time
- if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.pcz") )) {
+ if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".pcz") )) {
+ if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
+
+ _load_settings("res://override.cfg");
+ found=true;
+
+
+ }
+ break;
+ } else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.pcz") )) {
if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) {
_load_settings("res://override.cfg");
diff --git a/core/object.cpp b/core/object.cpp
index 07ac430d7a..3a4c06e7e7 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -970,7 +970,10 @@ void Object::set_script_instance(ScriptInstance *p_instance) {
script_instance=p_instance;
- script=p_instance->get_script().get_ref_ptr();
+ if (p_instance)
+ script=p_instance->get_script().get_ref_ptr();
+ else
+ script=RefPtr();
}
RefPtr Object::get_script() const {
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 51d683f1fe..48c38f05f9 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -1291,8 +1291,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC1(STRING,STRING,String,pad_decimals,INT,"digits",varray());
ADDFUNC1(STRING,STRING,String,pad_zeros,INT,"digits",varray());
- ADDFUNC0(STRING,STRING,String,to_ascii,varray());
- ADDFUNC0(STRING,STRING,String,to_utf8,varray());
+ ADDFUNC0(STRING,RAW_ARRAY,String,to_ascii,varray());
+ ADDFUNC0(STRING,RAW_ARRAY,String,to_utf8,varray());
ADDFUNC0(VECTOR2,VECTOR2,Vector2,normalized,varray());
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index eabd647837..1bcfa7d2ae 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -2818,9 +2818,9 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
} break;
case MATRIX32: {
- p_list->push_back( PropertyInfo(Variant::REAL,"x"));
- p_list->push_back( PropertyInfo(Variant::REAL,"y"));
- p_list->push_back( PropertyInfo(Variant::REAL,"o"));
+ p_list->push_back( PropertyInfo(Variant::VECTOR2,"x"));
+ p_list->push_back( PropertyInfo(Variant::VECTOR2,"y"));
+ p_list->push_back( PropertyInfo(Variant::VECTOR2,"o"));
} break;
case PLANE: {
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
new file mode 100644
index 0000000000..fed8c28740
--- /dev/null
+++ b/core/variant_parser.cpp
@@ -0,0 +1,1495 @@
+#include "variant_parser.h"
+#include "io/resource_loader.h"
+#include "os/keyboard.h"
+
+
+
+CharType VariantParser::StreamFile::get_char() {
+
+ return f->get_8();
+}
+
+bool VariantParser::StreamFile::is_utf8() const {
+
+ return true;
+}
+bool VariantParser::StreamFile::is_eof() const {
+
+ return f->eof_reached();
+}
+
+
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
+const char * VariantParser::tk_name[TK_MAX] = {
+ "'{'",
+ "'}'",
+ "'['",
+ "']'",
+ "'('",
+ "')'",
+ "identifier",
+ "string",
+ "number",
+ "':'",
+ "','",
+ "'='",
+ "EOF",
+ "ERROR"
+};
+
+
+
+Error VariantParser::get_token(Stream *p_stream, Token& r_token, int &line, String &r_err_str) {
+
+ while (true) {
+
+ CharType cchar;
+ if (p_stream->saved) {
+ cchar=p_stream->saved;
+ p_stream->saved=0;
+ } else {
+ cchar=p_stream->get_char();
+ if (p_stream->is_eof()) {
+ r_token.type=TK_EOF;
+ return OK;
+ }
+ }
+
+ switch(cchar) {
+
+ case '\n': {
+
+ line++;
+ break;
+ };
+ case 0: {
+ r_token.type=TK_EOF;
+ return OK;
+ } break;
+ case '{': {
+
+ r_token.type=TK_CURLY_BRACKET_OPEN;
+ return OK;
+ };
+ case '}': {
+
+ r_token.type=TK_CURLY_BRACKET_CLOSE;
+ return OK;
+ };
+ case '[': {
+
+ r_token.type=TK_BRACKET_OPEN;
+ return OK;
+ };
+ case ']': {
+
+ r_token.type=TK_BRACKET_CLOSE;
+ return OK;
+ };
+ case '(': {
+
+ r_token.type=TK_PARENTHESIS_OPEN;
+ return OK;
+ };
+ case ')': {
+
+ r_token.type=TK_PARENTHESIS_CLOSE;
+ return OK;
+ };
+ case ':': {
+
+ r_token.type=TK_COLON;
+ return OK;
+ };
+ case ',': {
+
+ r_token.type=TK_COMMA;
+ return OK;
+ };
+ case '=': {
+
+ r_token.type=TK_EQUAL;
+ return OK;
+ };
+ case '"': {
+
+
+ String str;
+ while(true) {
+
+ CharType ch=p_stream->get_char();
+
+ if (ch==0) {
+ r_err_str="Unterminated String";
+ r_token.type=TK_ERROR;
+ return ERR_PARSE_ERROR;
+ } else if (ch=='"') {
+ break;
+ } else if (ch=='\\') {
+ //escaped characters...
+ CharType next = p_stream->get_char();
+ if (next==0) {
+ r_err_str="Unterminated String";
+ r_token.type=TK_ERROR;
+ return ERR_PARSE_ERROR;
+ }
+ CharType res=0;
+
+ switch(next) {
+
+ case 'b': res=8; break;
+ case 't': res=9; break;
+ case 'n': res=10; break;
+ case 'f': res=12; break;
+ case 'r': res=13; break;
+ case 'u': {
+ //hexnumbarh - oct is deprecated
+
+
+ for(int j=0;j<4;j++) {
+ CharType c = p_stream->get_char();
+ if (c==0) {
+ r_err_str="Unterminated String";
+ r_token.type=TK_ERROR;
+ return ERR_PARSE_ERROR;
+ }
+ if (!((c>='0' && c<='9') || (c>='a' && c<='f') || (c>='A' && c<='F'))) {
+
+ r_err_str="Malformed hex constant in string";
+ r_token.type=TK_ERROR;
+ return ERR_PARSE_ERROR;
+ }
+ CharType v;
+ if (c>='0' && c<='9') {
+ v=c-'0';
+ } else if (c>='a' && c<='f') {
+ v=c-'a';
+ v+=10;
+ } else if (c>='A' && c<='F') {
+ v=c-'A';
+ v+=10;
+ } else {
+ ERR_PRINT("BUG");
+ v=0;
+ }
+
+ res<<=4;
+ res|=v;
+
+
+ }
+
+
+
+ } break;
+ //case '\"': res='\"'; break;
+ //case '\\': res='\\'; break;
+ //case '/': res='/'; break;
+ default: {
+ res = next;
+ //r_err_str="Invalid escape sequence";
+ //return ERR_PARSE_ERROR;
+ } break;
+ }
+
+ str+=res;
+
+ } else {
+ if (ch=='\n')
+ line++;
+ str+=ch;
+ }
+ }
+
+ if (p_stream->is_utf8()) {
+ str.parse_utf8( str.ascii(true).get_data() );
+ }
+ r_token.type=TK_STRING;
+ r_token.value=str;
+ return OK;
+
+ } break;
+ default: {
+
+ if (cchar<=32) {
+ break;
+ }
+
+ if (cchar=='-' || (cchar>='0' && cchar<='9')) {
+ //a number
+
+
+ String num;
+#define READING_SIGN 0
+#define READING_INT 1
+#define READING_DEC 2
+#define READING_EXP 3
+#define READING_DONE 4
+ int reading=READING_INT;
+
+ if (cchar=='-') {
+ num+='-';
+ cchar=p_stream->get_char();
+
+ }
+
+
+
+ CharType c = cchar;
+ bool exp_sign=false;
+ bool exp_beg=false;
+ bool is_float=false;
+
+ while(true) {
+
+ switch(reading) {
+ case READING_INT: {
+
+ if (c>='0' && c<='9') {
+ //pass
+ } else if (c=='.') {
+ reading=READING_DEC;
+ is_float=true;
+ } else if (c=='e') {
+ reading=READING_EXP;
+ } else {
+ reading=READING_DONE;
+ }
+
+ } break;
+ case READING_DEC: {
+
+ if (c>='0' && c<='9') {
+
+ } else if (c=='e') {
+ reading=READING_EXP;
+
+ } else {
+ reading=READING_DONE;
+ }
+
+ } break;
+ case READING_EXP: {
+
+ if (c>='0' && c<='9') {
+ exp_beg=true;
+
+ } else if ((c=='-' || c=='+') && !exp_sign && !exp_beg) {
+ exp_sign=true;
+
+ } else {
+ reading=READING_DONE;
+ }
+ } break;
+ }
+
+ if (reading==READING_DONE)
+ break;
+ num+=String::chr(c);
+ c = p_stream->get_char();
+
+
+ }
+
+ p_stream->saved=c;
+
+
+ r_token.type=TK_NUMBER;
+ if (is_float)
+ r_token.value=num.to_double();
+ else
+ r_token.value=num.to_int();
+ return OK;
+
+ } else if ((cchar>='A' && cchar<='Z') || (cchar>='a' && cchar<='z') || cchar=='_') {
+
+ String id;
+ bool first=true;
+
+ while((cchar>='A' && cchar<='Z') || (cchar>='a' && cchar<='z') || cchar=='_' || (!first && cchar>='0' && cchar<='9')) {
+
+ id+=String::chr(cchar);
+ cchar=p_stream->get_char();
+ first=false;
+ }
+
+ p_stream->saved=cchar;
+
+ r_token.type=TK_IDENTIFIER;
+ r_token.value=id;
+ return OK;
+ } else {
+ r_err_str="Unexpected character.";
+ r_token.type=TK_ERROR;
+ return ERR_PARSE_ERROR;
+ }
+ }
+ }
+ }
+
+ r_token.type=TK_ERROR;
+ return ERR_PARSE_ERROR;
+}
+
+template<class T>
+Error VariantParser::_parse_construct(Stream *p_stream,Vector<T>& r_construct,int &line,String &r_err_str) {
+
+
+ Token token;
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_OPEN) {
+ r_err_str="Expected '(' in constructor";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ bool first=true;
+ while(true) {
+
+ if (!first) {
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type==TK_COMMA) {
+ //do none
+ } else if (token.type==TK_PARENTHESIS_CLOSE) {
+ break;
+ } else {
+ r_err_str="Expected ',' or ')' in constructor";
+ return ERR_PARSE_ERROR;
+
+ }
+ }
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected float in constructor";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ r_construct.push_back(token.value);
+ first=false;
+ }
+
+ return OK;
+
+}
+
+Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,int &line,String &r_err_str,ResourceParser *p_res_parser) {
+
+
+
+/* {
+ Error err = get_token(p_stream,token,line,r_err_str);
+ if (err)
+ return err;
+ }*/
+
+
+ if (token.type==TK_CURLY_BRACKET_OPEN) {
+
+ Dictionary d;
+ Error err = _parse_dictionary(d,p_stream,line,r_err_str,p_res_parser);
+ if (err)
+ return err;
+ value=d;
+ return OK;
+ } else if (token.type==TK_BRACKET_OPEN) {
+
+ Array a;
+ Error err = _parse_array(a,p_stream,line,r_err_str,p_res_parser);
+ if (err)
+ return err;
+ value=a;
+ return OK;
+
+ } else if (token.type==TK_IDENTIFIER) {
+/*
+ VECTOR2, // 5
+ RECT2,
+ VECTOR3,
+ MATRIX32,
+ PLANE,
+ QUAT, // 10
+ _AABB, //sorry naming convention fail :( not like it's used often
+ MATRIX3,
+ TRANSFORM,
+
+ // misc types
+ COLOR,
+ IMAGE, // 15
+ NODE_PATH,
+ _RID,
+ OBJECT,
+ INPUT_EVENT,
+ DICTIONARY, // 20
+ ARRAY,
+
+ // arrays
+ RAW_ARRAY,
+ INT_ARRAY,
+ REAL_ARRAY,
+ STRING_ARRAY, // 25
+ VECTOR2_ARRAY,
+ VECTOR3_ARRAY,
+ COLOR_ARRAY,
+
+ VARIANT_MAX
+
+*/
+ String id = token.value;
+ if (id=="true")
+ value=true;
+ else if (id=="false")
+ value=false;
+ else if (id=="null")
+ value=Variant();
+ else if (id=="Vector2"){
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=2) {
+ r_err_str="Expected 2 arguments for constructor";
+ }
+
+ value=Vector2(args[0],args[1]);
+ return OK;
+ } else if (id=="Vector3"){
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=3) {
+ r_err_str="Expected 3 arguments for constructor";
+ }
+
+ value=Vector3(args[0],args[1],args[2]);
+ return OK;
+ } else if (id=="Matrix32"){
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=6) {
+ r_err_str="Expected 6 arguments for constructor";
+ }
+ Matrix32 m;
+ m[0]=Vector2(args[0],args[1]);
+ m[1]=Vector2(args[2],args[3]);
+ m[2]=Vector2(args[4],args[5]);
+ value=m;
+ return OK;
+ } else if (id=="Plane") {
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=4) {
+ r_err_str="Expected 4 arguments for constructor";
+ }
+
+ value=Plane(args[0],args[1],args[2],args[3]);
+ return OK;
+ } else if (id=="Quat") {
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=4) {
+ r_err_str="Expected 4 arguments for constructor";
+ }
+
+ value=Quat(args[0],args[1],args[2],args[3]);
+ return OK;
+
+ } else if (id=="AABB"){
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=6) {
+ r_err_str="Expected 6 arguments for constructor";
+ }
+
+ value=AABB(Vector3(args[0],args[1],args[2]),Vector3(args[3],args[4],args[5]));
+ return OK;
+
+ } else if (id=="Matrix3"){
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=9) {
+ r_err_str="Expected 9 arguments for constructor";
+ }
+
+ value=Matrix3(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]);
+ return OK;
+ } else if (id=="Transform"){
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=12) {
+ r_err_str="Expected 12 arguments for constructor";
+ }
+
+ value=Transform(Matrix3(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]),Vector3(args[9],args[10],args[11]));
+ return OK;
+
+ } else if (id=="Color") {
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ if (args.size()!=4) {
+ r_err_str="Expected 4 arguments for constructor";
+ }
+
+ value=Color(args[0],args[1],args[2],args[3]);
+ return OK;
+
+ } else if (id=="Image") {
+
+ //:|
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_OPEN) {
+ r_err_str="Expected '('";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type==TK_PARENTHESIS_CLOSE) {
+ value=Image(); // just an Image()
+ return OK;
+ } else if (token.type!=TK_NUMBER) {
+ r_err_str="Expected number (width)";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+
+ int width=token.value;
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected number (height)";
+ return ERR_PARSE_ERROR;
+ }
+
+ int height=token.value;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected number (mipmaps)";
+ return ERR_PARSE_ERROR;
+ }
+
+ int mipmaps=token.value;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_IDENTIFIER) {
+ r_err_str="Expected identifier (format)";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ String sformat=token.value;
+
+ Image::Format format;
+
+ if (sformat=="GRAYSCALE") format=Image::FORMAT_GRAYSCALE;
+ else if (sformat=="INTENSITY") format=Image::FORMAT_INTENSITY;
+ else if (sformat=="GRAYSCALE_ALPHA") format=Image::FORMAT_GRAYSCALE_ALPHA;
+ else if (sformat=="RGB") format=Image::FORMAT_RGB;
+ else if (sformat=="RGBA") format=Image::FORMAT_RGBA;
+ else if (sformat=="INDEXED") format=Image::FORMAT_INDEXED;
+ else if (sformat=="INDEXED_ALPHA") format=Image::FORMAT_INDEXED_ALPHA;
+ else if (sformat=="BC1") format=Image::FORMAT_BC1;
+ else if (sformat=="BC2") format=Image::FORMAT_BC2;
+ else if (sformat=="BC3") format=Image::FORMAT_BC3;
+ else if (sformat=="BC4") format=Image::FORMAT_BC4;
+ else if (sformat=="BC5") format=Image::FORMAT_BC5;
+ else if (sformat=="PVRTC2") format=Image::FORMAT_PVRTC2;
+ else if (sformat=="PVRTC2_ALPHA") format=Image::FORMAT_PVRTC2_ALPHA;
+ else if (sformat=="PVRTC4") format=Image::FORMAT_PVRTC4;
+ else if (sformat=="PVRTC4_ALPHA") format=Image::FORMAT_PVRTC4_ALPHA;
+ else if (sformat=="ATC") format=Image::FORMAT_ATC;
+ else if (sformat=="ATC_ALPHA_EXPLICIT") format=Image::FORMAT_ATC_ALPHA_EXPLICIT;
+ else if (sformat=="ATC_ALPHA_INTERPOLATED") format=Image::FORMAT_ATC_ALPHA_INTERPOLATED;
+ else if (sformat=="CUSTOM") format=Image::FORMAT_CUSTOM;
+ else {
+ r_err_str="Invalid image format: '"+sformat+"'";
+ return ERR_PARSE_ERROR;
+ };
+
+ int len = Image::get_image_data_size(width,height,format,mipmaps);
+
+ DVector<uint8_t> buffer;
+ buffer.resize(len);
+
+ if (buffer.size()!=len) {
+ r_err_str="Couldn't allocate image buffer of size: "+itos(len);
+ }
+
+ {
+ DVector<uint8_t>::Write w=buffer.write();
+
+ for(int i=0;i<len;i++) {
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected number";
+ return ERR_PARSE_ERROR;
+ }
+
+ w[i]=int(token.value);
+
+ }
+ }
+
+
+ Image img(width,height,mipmaps,format,buffer);
+
+ value=img;
+
+ return OK;
+
+
+ } else if (id=="NodePath") {
+
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_OPEN) {
+ r_err_str="Expected '('";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_STRING) {
+ r_err_str="Expected string as argument for NodePath()";
+ return ERR_PARSE_ERROR;
+ }
+
+ value=NodePath(String(token.value));
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+ } else if (id=="RID") {
+
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_OPEN) {
+ r_err_str="Expected '('";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected number as argument";
+ return ERR_PARSE_ERROR;
+ }
+
+ value=token.value;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ return OK;
+
+ } else if (id=="Resource" || id=="SubResource" || id=="ExtResource") {
+
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_OPEN) {
+ r_err_str="Expected '('";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ if (p_res_parser && id=="Resource" && p_res_parser->func){
+
+ RES res;
+ Error err = p_res_parser->func(p_res_parser->userdata,p_stream,res,line,r_err_str);
+ if (err)
+ return err;
+
+ value=res;
+
+ return OK;
+ } else if (p_res_parser && id=="ExtResource" && p_res_parser->ext_func){
+
+ RES res;
+ Error err = p_res_parser->ext_func(p_res_parser->userdata,p_stream,res,line,r_err_str);
+ if (err)
+ return err;
+
+ value=res;
+
+ return OK;
+ } else if (p_res_parser && id=="SubResource" && p_res_parser->sub_func){
+
+ RES res;
+ Error err = p_res_parser->sub_func(p_res_parser->userdata,p_stream,res,line,r_err_str);
+ if (err)
+ return err;
+
+ value=res;
+
+ return OK;
+ } else {
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type==TK_STRING) {
+ String path=token.value;
+ RES res = ResourceLoader::load(path);
+ if (res.is_null()) {
+ r_err_str="Can't load resource at path: '"+path+"'.";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+ value=res;
+ return OK;
+
+ } else {
+ r_err_str="Expected string as argument for Resource().";
+ return ERR_PARSE_ERROR;
+ }
+ }
+
+ return OK;
+
+
+ } else if (id=="InputEvent") {
+
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_OPEN) {
+ r_err_str="Expected '('";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+
+ if (token.type!=TK_IDENTIFIER) {
+ r_err_str="Expected identifier";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ String id = token.value;
+
+ InputEvent ie;
+
+ if (id=="KEY") {
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ }
+
+ ie.type=InputEvent::KEY;
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type==TK_IDENTIFIER) {
+ String name=token.value;
+ ie.key.scancode=find_keycode(name);
+ } else if (token.type==TK_NUMBER) {
+
+ ie.key.scancode=token.value;
+ } else {
+
+ r_err_str="Expected string or integer for keycode";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+
+ if (token.type==TK_COMMA) {
+
+ get_token(p_stream,token,line,r_err_str);
+
+ if (token.type!=TK_IDENTIFIER) {
+ r_err_str="Expected identifier with modifier flas";
+ return ERR_PARSE_ERROR;
+ }
+
+ String mods=token.value;
+
+ if (mods.findn("C")!=-1)
+ ie.key.mod.control=true;
+ if (mods.findn("A")!=-1)
+ ie.key.mod.alt=true;
+ if (mods.findn("S")!=-1)
+ ie.key.mod.shift=true;
+ if (mods.findn("M")!=-1)
+ ie.key.mod.meta=true;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+ } else if (token.type!=TK_PARENTHESIS_CLOSE) {
+
+ r_err_str="Expected ')' or modifier flags.";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ } else if (id=="MBUTTON") {
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ }
+
+ ie.type=InputEvent::MOUSE_BUTTON;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected button index";
+ return ERR_PARSE_ERROR;
+ }
+
+ ie.mouse_button.button_index = token.value;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+ } else if (id=="JBUTTON") {
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ }
+
+ ie.type=InputEvent::JOYSTICK_BUTTON;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected button index";
+ return ERR_PARSE_ERROR;
+ }
+
+ ie.joy_button.button_index = token.value;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+ } else if (id=="JAXIS") {
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_COMMA) {
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ }
+
+ ie.type=InputEvent::JOYSTICK_MOTION;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_NUMBER) {
+ r_err_str="Expected axis index";
+ return ERR_PARSE_ERROR;
+ }
+
+ ie.joy_motion.axis = token.value;
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+ } else {
+
+ r_err_str="Invalid input event type.";
+ return ERR_PARSE_ERROR;
+ }
+
+ value=ie;
+
+ return OK;
+
+ } else if (id=="ByteArray") {
+
+ Vector<uint8_t> args;
+ Error err = _parse_construct<uint8_t>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ DVector<uint8_t> arr;
+ {
+ int len=args.size();
+ arr.resize(len);
+ DVector<uint8_t>::Write w = arr.write();
+ for(int i=0;i<len;i++) {
+ w[i]=args[i];
+ }
+ }
+
+ value=arr;
+
+ return OK;
+
+ } else if (id=="IntArray") {
+
+ Vector<int32_t> args;
+ Error err = _parse_construct<int32_t>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ DVector<int32_t> arr;
+ {
+ int len=args.size();
+ arr.resize(len);
+ DVector<int32_t>::Write w = arr.write();
+ for(int i=0;i<len;i++) {
+ w[i]=int(args[i]);
+ }
+ }
+
+ value=arr;
+
+ return OK;
+
+ } else if (id=="FloatArray") {
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ DVector<float> arr;
+ {
+ int len=args.size();
+ arr.resize(len);
+ DVector<float>::Write w = arr.write();
+ for(int i=0;i<len;i++) {
+ w[i]=args[i];
+ }
+ }
+
+ value=arr;
+
+ return OK;
+ } else if (id=="StringArray") {
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_PARENTHESIS_OPEN) {
+ r_err_str="Expected '('";
+ return ERR_PARSE_ERROR;
+ }
+
+ Vector<String> cs;
+
+ bool first=true;
+ while(true) {
+
+ if (!first) {
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type==TK_COMMA) {
+ //do none
+ } else if (token.type!=TK_PARENTHESIS_CLOSE) {
+ break;
+ } else {
+ r_err_str="Expected ',' or ')'";
+ return ERR_PARSE_ERROR;
+
+ }
+ }
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_STRING) {
+ r_err_str="Expected string";
+ return ERR_PARSE_ERROR;
+ }
+
+ cs.push_back(token.value);
+ }
+
+
+ DVector<String> arr;
+ {
+ int len=cs.size();
+ arr.resize(len);
+ DVector<String>::Write w = arr.write();
+ for(int i=0;i<len;i++) {
+ w[i]=cs[i];
+ }
+ }
+
+ value=arr;
+
+ return OK;
+
+
+ } else if (id=="Vector2Array") {
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ DVector<Vector2> arr;
+ {
+ int len=args.size()/2;
+ arr.resize(len);
+ DVector<Vector2>::Write w = arr.write();
+ for(int i=0;i<len;i++) {
+ w[i]=Vector2(args[i*2+0],args[i*2+1]);
+ }
+ }
+
+ value=arr;
+
+ return OK;
+
+ } else if (id=="Vector3Array") {
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ DVector<Vector3> arr;
+ {
+ int len=args.size()/3;
+ arr.resize(len);
+ DVector<Vector3>::Write w = arr.write();
+ for(int i=0;i<len;i++) {
+ w[i]=Vector3(args[i*3+0],args[i*3+1],args[i*3+2]);
+ }
+ }
+
+ value=arr;
+
+ return OK;
+
+ } else if (id=="ColorArray") {
+
+ Vector<float> args;
+ Error err = _parse_construct<float>(p_stream,args,line,r_err_str);
+ if (err)
+ return err;
+
+ DVector<Color> arr;
+ {
+ int len=args.size()/4;
+ arr.resize(len);
+ DVector<Color>::Write w = arr.write();
+ for(int i=0;i<len;i++) {
+ w[i]=Color(args[i*3+0],args[i*3+1],args[i*3+2],args[i*3+3]);
+ }
+ }
+
+ value=arr;
+
+ return OK;
+
+ } else {
+ r_err_str="Unexpected identifier: '"+id+"'.";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ /*
+ VECTOR2, // 5
+ RECT2,
+ VECTOR3,
+ MATRIX32,
+ PLANE,
+ QUAT, // 10
+ _AABB, //sorry naming convention fail :( not like it's used often
+ MATRIX3,
+ TRANSFORM,
+
+ // misc types
+ COLOR,
+ IMAGE, // 15
+ NODE_PATH,
+ _RID,
+ OBJECT,
+ INPUT_EVENT,
+ DICTIONARY, // 20
+ ARRAY,
+
+ // arrays
+ RAW_ARRAY,
+ INT_ARRAY,
+ REAL_ARRAY,
+ STRING_ARRAY, // 25
+ VECTOR2_ARRAY,
+ VECTOR3_ARRAY,
+ COLOR_ARRAY,
+
+ VARIANT_MAX
+
+ */
+
+ return OK;
+
+ } else if (token.type==TK_NUMBER) {
+
+ value=token.value;
+ return OK;
+ } else if (token.type==TK_STRING) {
+
+ value=token.value;
+ return OK;
+ } else {
+ r_err_str="Expected value, got "+String(tk_name[token.type])+".";
+ return ERR_PARSE_ERROR;
+ }
+
+ return ERR_PARSE_ERROR;
+}
+
+
+Error VariantParser::_parse_array(Array &array, Stream *p_stream, int &line, String &r_err_str, ResourceParser *p_res_parser) {
+
+ Token token;
+ bool need_comma=false;
+
+
+ while(true) {
+
+ if (p_stream->is_eof()) {
+ r_err_str="Unexpected End of File while parsing array";
+ return ERR_FILE_CORRUPT;
+ }
+
+ Error err = get_token(p_stream,token,line,r_err_str);
+ if (err!=OK)
+ return err;
+
+ if (token.type==TK_BRACKET_CLOSE) {
+
+ return OK;
+ }
+
+ if (need_comma) {
+
+ if (token.type!=TK_COMMA) {
+
+ r_err_str="Expected ','";
+ return ERR_PARSE_ERROR;
+ } else {
+ need_comma=false;
+ continue;
+ }
+ }
+
+ Variant v;
+ err = parse_value(token,v,p_stream,line,r_err_str,p_res_parser);
+ if (err)
+ return err;
+
+ array.push_back(v);
+ need_comma=true;
+
+ }
+
+ return OK;
+
+}
+
+Error VariantParser::_parse_dictionary(Dictionary &object, Stream *p_stream, int &line, String &r_err_str, ResourceParser *p_res_parser) {
+
+ bool at_key=true;
+ Variant key;
+ Token token;
+ bool need_comma=false;
+
+
+ while(true) {
+
+
+ if (p_stream->is_eof()) {
+ r_err_str="Unexpected End of File while parsing dictionary";
+ return ERR_FILE_CORRUPT;
+ }
+
+ if (at_key) {
+
+ Error err = get_token(p_stream,token,line,r_err_str);
+ if (err!=OK)
+ return err;
+
+ if (token.type==TK_CURLY_BRACKET_CLOSE) {
+
+ return OK;
+ }
+
+ if (need_comma) {
+
+ if (token.type!=TK_COMMA) {
+
+ r_err_str="Expected '}' or ','";
+ return ERR_PARSE_ERROR;
+ } else {
+ need_comma=false;
+ continue;
+ }
+ }
+
+
+
+
+ err = parse_value(token,key,p_stream,line,r_err_str,p_res_parser);
+
+ if (err)
+ return err;
+
+ err = get_token(p_stream,token,line,r_err_str);
+
+ if (err!=OK)
+ return err;
+ if (token.type!=TK_COLON) {
+
+ r_err_str="Expected ':'";
+ return ERR_PARSE_ERROR;
+ }
+ at_key=false;
+ } else {
+
+
+ Error err = get_token(p_stream,token,line,r_err_str);
+ if (err!=OK)
+ return err;
+
+ Variant v;
+ err = parse_value(token,v,p_stream,line,r_err_str,p_res_parser);
+ if (err)
+ return err;
+ object[key]=v;
+ need_comma=true;
+ at_key=true;
+ }
+ }
+
+ return OK;
+}
+
+
+Error VariantParser::_parse_tag(Token& token, Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser) {
+
+ r_tag.fields.clear();
+
+ if (token.type!=TK_BRACKET_OPEN) {
+ r_err_str="Expected '['";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ get_token(p_stream,token,line,r_err_str);
+
+
+ if (token.type!=TK_IDENTIFIER) {
+ r_err_str="Expected identifier (tag name)";
+ return ERR_PARSE_ERROR;
+ }
+
+ r_tag.name=token.value;
+
+ while(true) {
+
+ if (p_stream->is_eof()) {
+ r_err_str="Unexpected End of File while parsing tag: "+r_tag.name;
+ return ERR_FILE_CORRUPT;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type==TK_BRACKET_CLOSE)
+ break;
+
+ if (token.type!=TK_IDENTIFIER) {
+ r_err_str="Expected Identifier";
+ return ERR_PARSE_ERROR;
+ }
+
+ String id=token.value;
+
+
+ get_token(p_stream,token,line,r_err_str);
+ if (token.type!=TK_EQUAL) {
+ r_err_str="Expected '='";
+ return ERR_PARSE_ERROR;
+ }
+
+ get_token(p_stream,token,line,r_err_str);
+ Variant value;
+ Error err = parse_value(token,value,p_stream,line,r_err_str,p_res_parser);
+ if (err)
+ return err;
+
+ r_tag.fields[id]=value;
+
+ }
+
+
+ return OK;
+
+}
+
+Error VariantParser::parse_tag(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, ResourceParser *p_res_parser) {
+
+ Token token;
+ get_token(p_stream,token,line,r_err_str);
+
+ if (token.type==TK_EOF) {
+ return ERR_FILE_EOF;
+ }
+
+ if (token.type!=TK_BRACKET_OPEN) {
+ r_err_str="Expected '['";
+ return ERR_PARSE_ERROR;
+ }
+
+ return _parse_tag(token,p_stream,line,r_err_str,r_tag,p_res_parser);
+
+}
+
+Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value, ResourceParser *p_res_parser) {
+
+
+ //assign..
+ String what;
+
+ while(true) {
+
+
+ CharType c;
+ if (p_stream->saved) {
+ c=p_stream->saved;
+ p_stream->saved=0;
+
+ } else {
+ c=p_stream->get_char();
+ }
+
+ if (p_stream->is_eof())
+ return ERR_FILE_EOF;
+
+ if (c=='[' && what.length()==0) {
+ //it's a tag!
+ p_stream->saved='['; //go back one
+
+ Error err = parse_tag(p_stream,line,r_err_str,r_tag,p_res_parser);
+
+ return err;
+ }
+
+ if (c>32) {
+ if (c!='=') {
+ what+=String::chr(c);
+ } else {
+ r_assign=what;
+ Token token;
+ get_token(p_stream,token,line,r_err_str);
+ Error err = parse_value(token,r_value,p_stream,line,r_err_str,p_res_parser);
+ if (err) {
+
+ }
+ return err;
+ }
+ } else if (c=='\n') {
+ line++;
+ }
+ }
+
+ return OK;
+}
+
+Error VariantParser::parse(Stream *p_stream, Variant& r_ret, String &r_err_str, int &r_err_line, ResourceParser *p_res_parser) {
+
+
+ Token token;
+ Error err = get_token(p_stream,token,r_err_line,r_err_str);
+ if (err)
+ return err;
+
+ if (token.type==TK_EOF) {
+ return ERR_FILE_EOF;
+ }
+
+ return parse_value(token,r_ret,p_stream,r_err_line,r_err_str,p_res_parser);
+
+}
+
+
diff --git a/core/variant_parser.h b/core/variant_parser.h
new file mode 100644
index 0000000000..e1d25f7512
--- /dev/null
+++ b/core/variant_parser.h
@@ -0,0 +1,103 @@
+#ifndef VARIANT_PARSER_H
+#define VARIANT_PARSER_H
+
+#include "variant.h"
+#include "os/file_access.h"
+#include "resource.h"
+
+class VariantParser {
+public:
+
+ struct Stream {
+
+ virtual CharType get_char()=0;
+ virtual bool is_utf8() const=0;
+ virtual bool is_eof() const=0;
+
+ CharType saved;
+
+ Stream() { saved=0; }
+ virtual ~Stream() {}
+ };
+
+ struct StreamFile : public Stream {
+
+ FileAccess *f;
+
+ virtual CharType get_char();
+ virtual bool is_utf8() const;
+ virtual bool is_eof() const;
+
+ StreamFile() { f=NULL; }
+
+ };
+
+ typedef Error (*ParseResourceFunc)(void* p_self, Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str);
+
+ struct ResourceParser {
+
+ void *userdata;
+ ParseResourceFunc func;
+ ParseResourceFunc ext_func;
+ ParseResourceFunc sub_func;
+
+ };
+
+ enum TokenType {
+ TK_CURLY_BRACKET_OPEN,
+ TK_CURLY_BRACKET_CLOSE,
+ TK_BRACKET_OPEN,
+ TK_BRACKET_CLOSE,
+ TK_PARENTHESIS_OPEN,
+ TK_PARENTHESIS_CLOSE,
+ TK_IDENTIFIER,
+ TK_STRING,
+ TK_NUMBER,
+ TK_COLON,
+ TK_COMMA,
+ TK_EQUAL,
+ TK_EOF,
+ TK_ERROR,
+ TK_MAX
+ };
+
+ enum Expecting {
+
+ EXPECT_OBJECT,
+ EXPECT_OBJECT_KEY,
+ EXPECT_COLON,
+ EXPECT_OBJECT_VALUE,
+ };
+
+ struct Token {
+
+ TokenType type;
+ Variant value;
+ };
+
+ struct Tag {
+
+ String name;
+ Map<String,Variant> fields;
+ };
+
+private:
+ static const char * tk_name[TK_MAX];
+
+ template<class T>
+ static Error _parse_construct(Stream *p_stream, Vector<T>& r_construct, int &line, String &r_err_str);
+ static Error _parse_dictionary(Dictionary &object, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL);
+ static Error _parse_array(Array &array, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL);
+ static Error _parse_tag(Token& token,Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL);
+
+public:
+
+ static Error parse_tag(Stream *p_stream, int &line, String &r_err_str,Tag& r_tag,ResourceParser *p_res_parser=NULL);
+ static Error parse_tag_assign_eof(Stream *p_stream, int &line, String &r_err_str, Tag& r_tag, String &r_assign, Variant &r_value,ResourceParser *p_res_parser=NULL);
+
+ static Error parse_value(Token& token,Variant &value, Stream *p_stream, int &line, String &r_err_str,ResourceParser *p_res_parser=NULL);
+ static Error get_token(Stream *p_stream,Token& r_token,int &line,String &r_err_str);
+ static Error parse(Stream *p_stream, Variant &r_ret, String &r_err_str, int &r_err_line,ResourceParser *p_res_parser=NULL);
+};
+
+#endif // VARIANT_PARSER_H
diff --git a/demos/gui/rich_text_bbcode/rich_text_bbcode.scn b/demos/gui/rich_text_bbcode/rich_text_bbcode.scn
index ca02044bb8..081338fd91 100644
--- a/demos/gui/rich_text_bbcode/rich_text_bbcode.scn
+++ b/demos/gui/rich_text_bbcode/rich_text_bbcode.scn
Binary files differ
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index 44a7cccfe5..fd5df945ba 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -1603,7 +1603,7 @@
Axis-Aligned Bounding Box.
</brief_description>
<description>
- AABB provides an 3D Axis-Aligned Bounding Box. It consists of a position and a size, and several utility functions. It is typically used for simple (fast) overlap tests.
+ AABB provides an 3D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for simple (fast) overlap tests.
</description>
<methods>
<method name="encloses">
@@ -1628,7 +1628,7 @@
<return type="float">
</return>
<description>
- Get the area inside the [AABB].
+ Get the area of the [AABB].
</description>
</method>
<method name="get_endpoint">
@@ -1697,7 +1697,7 @@
<argument index="0" name="by" type="float">
</argument>
<description>
- Return a copy of the AABB grown a given a mount of units towards all the sides.
+ Return a copy of the [AABB] grown a given amount of units towards all the sides.
</description>
</method>
<method name="has_no_area">
@@ -1747,7 +1747,7 @@
<argument index="0" name="plane" type="Plane">
</argument>
<description>
- Return true if the AABB is at both sides of a plane.
+ Return true if the [AABB] is at both sides of a plane.
</description>
</method>
<method name="intersects_segment">
@@ -1766,7 +1766,7 @@
<argument index="0" name="with" type="AABB">
</argument>
<description>
- Combine this [AABB] with another one, a larger one is returned that contains both.
+ Combine this [AABB] with another, a larger one is returned that contains both.
</description>
</method>
<method name="AABB">
@@ -4371,7 +4371,7 @@
Stop a given voice.
</description>
</method>
- <method name="free">
+ <method name="free_rid">
<argument index="0" name="rid" type="RID">
</argument>
<description>
@@ -12551,7 +12551,7 @@ This approximation makes straight segments between each point, then subdivides t
<description>
Connect to a host. This needs to be done before any requests are sent.
The host should not have http:// prepended but will strip the protocol identifier if provided.
-
+
verify_host will check the SSL identity of the host if set to true.
</description>
</method>
@@ -12576,9 +12576,9 @@ verify_host will check the SSL identity of the host if set to true.
Sends a request to the connected host. The url is the what is normally behind the hostname, i.e:
http://somehost.com/index.php
url would be "index.php"
-
+
Headers are HTTP request headers
-
+
To create a POST request with query strings to push to the server, do:
var fields = {"username" : "user",
"password" : "pass"}
@@ -12693,10 +12693,10 @@ var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, qu
</argument>
<description>
Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary.
-
+
var fields = {"username": "user", "password": "pass"}
String queryString = httpClient.query_string_from_dict(fields)
-
+
returns:= "username=user&amp;password=pass"
</description>
</method>
@@ -16735,11 +16735,11 @@ returns:= "username=user&amp;password=pass"
</method>
</methods>
<members>
- <member name="x" type="float">
+ <member name="x" type="Vector2">
</member>
- <member name="y" type="float">
+ <member name="y" type="Vector2">
</member>
- <member name="o" type="float">
+ <member name="o" type="Vector2">
</member>
</members>
<constants>
@@ -26372,12 +26372,14 @@ This method controls whether the position between two cached points is interpola
<return type="String">
</return>
<description>
+ Returns a copy of the array's contents formatted as String. Fast alternative to get_string_from_utf8(), assuming the content is ASCII-only (unlike the UTF-8 function, this function maps every byte to a character in the string, so any multibyte sequence will be torn apart).
</description>
</method>
<method name="get_string_from_utf8">
<return type="String">
</return>
<description>
+ Returns a copy of the array's contents formatted as String, assuming the array is formatted as UTF-8. Slower than get_string_from_ascii(), but works for UTF-8. Usually you should prefer this function over get_string_from_ascii() to support international input.
</description>
</method>
<method name="push_back">
@@ -26732,8 +26734,10 @@ This method controls whether the position between two cached points is interpola
</class>
<class name="Rect2" category="Built-In Types">
<brief_description>
+ 2D Axis-aligned bounding box.
</brief_description>
<description>
+ Rect2 provides an 2D Axis-Aligned Bounding Box. It consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
</description>
<methods>
<method name="clip">
@@ -26742,6 +26746,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="b" type="Rect2">
</argument>
<description>
+ Returns the intersection of this [Rect2] and b.
</description>
</method>
<method name="encloses">
@@ -26750,6 +26755,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="b" type="Rect2">
</argument>
<description>
+ Returns true if this [Rect2] completely encloses another one.
</description>
</method>
<method name="expand">
@@ -26758,12 +26764,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="to" type="Vector2">
</argument>
<description>
+ Return this [Rect2] expanded to include a given point.
</description>
</method>
<method name="get_area">
<return type="float">
</return>
<description>
+ Get the area of the [Rect2].
</description>
</method>
<method name="grow">
@@ -26772,12 +26780,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="by" type="float">
</argument>
<description>
+ Return a copy of the [Rect2] grown a given amount of units towards all the sides.
</description>
</method>
<method name="has_no_area">
<return type="bool">
</return>
<description>
+ Return true if the [Rect2] is flat or empty.
</description>
</method>
<method name="has_point">
@@ -26786,6 +26796,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="point" type="Vector2">
</argument>
<description>
+ Return true if the [Rect2] contains a point.
</description>
</method>
<method name="intersects">
@@ -26794,6 +26805,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="b" type="Rect2">
</argument>
<description>
+ Return true if the [Rect2] overlaps with another.
</description>
</method>
<method name="merge">
@@ -26802,6 +26814,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="b" type="Rect2">
</argument>
<description>
+ Combine this [Rect2] with another, a larger one is returned that contains both.
</description>
</method>
<method name="Rect2">
@@ -26812,6 +26825,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="size" type="Vector2">
</argument>
<description>
+ Construct a [Rect2] by position and size.
</description>
</method>
<method name="Rect2">
@@ -26826,6 +26840,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="height" type="float">
</argument>
<description>
+ Construct a [Rect2] by x, y, width and height.
</description>
</method>
</methods>
@@ -27523,6 +27538,12 @@ This method controls whether the position between two cached points is interpola
<description>
</description>
</method>
+ <method name="scroll_to_line">
+ <argument index="0" name="arg0" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_tab_size">
<argument index="0" name="spaces" type="int">
</argument>
@@ -33134,9 +33155,10 @@ This method controls whether the position between two cached points is interpola
</description>
</method>
<method name="to_ascii">
- <return type="String">
+ <return type="RawArray">
</return>
<description>
+ Convert the String (which is a character array) to RawArray (which is an array of bytes). The conversion is speeded up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
</description>
</method>
<method name="to_float">
@@ -33168,9 +33190,10 @@ This method controls whether the position between two cached points is interpola
</description>
</method>
<method name="to_utf8">
- <return type="String">
+ <return type="RawArray">
</return>
<description>
+ Convert the String (which is an array of characters) to RawArray (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
</description>
</method>
<method name="xml_escape">
@@ -37623,7 +37646,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="vec" type="Vector2">
</argument>
<description>
- Reflects/mirrors the vector around another vector.
+ Like "slide", but reflects the Vector instead of continuing along the wall.
</description>
</method>
<method name="rotated">
@@ -37687,10 +37710,10 @@ This method controls whether the position between two cached points is interpola
</class>
<class name="Vector2Array" category="Built-In Types">
<brief_description>
- An Array of Vector2's.
+ An Array of Vector2.
</brief_description>
<description>
- An Array specifically designed to hold Vector2's.
+ An Array specifically designed to hold Vector2.
</description>
<methods>
<method name="get">
@@ -37699,21 +37722,21 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="idx" type="int">
</argument>
<description>
- Get the Vector2 at the given index.
+ Returns the Vector2 at the given index.
</description>
</method>
<method name="push_back">
<argument index="0" name="vector2" type="Vector2">
</argument>
<description>
- Insert a new Vector2.
+ Inserts a Vector2 at the end.
</description>
</method>
<method name="resize">
<argument index="0" name="idx" type="int">
</argument>
<description>
- Set the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
+ Sets the size of the Vector2Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description>
</method>
<method name="set">
@@ -37722,7 +37745,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="vector2" type="Vector2">
</argument>
<description>
- Set the Vector2 at the given index.
+ Changes the Vector2 at the given index.
</description>
</method>
<method name="size">
@@ -37750,19 +37773,21 @@ This method controls whether the position between two cached points is interpola
Vector class, which performs basic 3D vector math operations.
</brief_description>
<description>
- Vector3 is one of the core classes of the engine, and includes several built-in helper functions to perform basic vecor math operations.
+ Vector3 is one of the core classes of the engine, and includes several built-in helper functions to perform basic vector math operations.
</description>
<methods>
<method name="abs">
<return type="Vector3">
</return>
<description>
+ Returns a new vector with all components in absolute values (e.g. positive).
</description>
</method>
<method name="ceil">
<return type="Vector3">
</return>
<description>
+ Returns a new vector with all components rounded up.
</description>
</method>
<method name="cross">
@@ -37786,7 +37811,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="t" type="float">
</argument>
<description>
- Perform a cubic interpolation between vectors a,b,c,d (b is current), by the given amount (i).
+ Perform a cubic interpolation between vectors pre_a, a, b, post_b (a is current), by the given amount (t).
</description>
</method>
<method name="distance_squared_to">
@@ -37795,7 +37820,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Return the squared distance (distance minus the last square root) to b.
+ Return the squared distance (distance minus the last square root) to b. Prefer this function over distance_to if you need to sort vectors or need the squared distance for some formula.
</description>
</method>
<method name="distance_to">
@@ -37820,13 +37845,14 @@ This method controls whether the position between two cached points is interpola
<return type="Vector3">
</return>
<description>
+ Returns a new vector with all components rounded down.
</description>
</method>
<method name="inverse">
<return type="Vector3">
</return>
<description>
- Returns the inverse of the vector. this is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
+ Returns the inverse of the vector. This is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
</description>
</method>
<method name="length">
@@ -37840,7 +37866,7 @@ This method controls whether the position between two cached points is interpola
<return type="float">
</return>
<description>
- Return the length of the vector, squared.
+ Return the length of the vector, squared. Prefer this function over "length" if you need to sort vectors or need the squared length for some formula.
</description>
</method>
<method name="linear_interpolate">
@@ -37851,26 +37877,28 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="t" type="float">
</argument>
<description>
- Linearly interpolates the vector to a given one (b), by the given amount (i).
+ Linearly interpolates the vector to a given one (b), by the given amount (t).
</description>
</method>
<method name="max_axis">
<return type="int">
</return>
<description>
+ Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the largest.
</description>
</method>
<method name="min_axis">
<return type="int">
</return>
<description>
+ Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the smallest.
</description>
</method>
<method name="normalized">
<return type="Vector3">
</return>
<description>
- Return a copy of the normalized vector to unit length. This is the same as v / v.length()
+ Return a copy of the normalized vector to unit length. This is the same as v / v.length().
</description>
</method>
<method name="reflect">
@@ -37879,6 +37907,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="by" type="Vector3">
</argument>
<description>
+ Like "slide", but reflects the Vector instead of continuing along the wall.
</description>
</method>
<method name="rotated">
@@ -37889,6 +37918,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="phi" type="float">
</argument>
<description>
+ Rotates the vector around some axis by phi radians.
</description>
</method>
<method name="slide">
@@ -37897,6 +37927,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="by" type="Vector3">
</argument>
<description>
+ Slides the vector along a wall.
</description>
</method>
<method name="snapped">
@@ -37918,6 +37949,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="z" type="float">
</argument>
<description>
+ Returns a Vector3 with the given components.
</description>
</method>
</methods>
@@ -37931,17 +37963,22 @@ This method controls whether the position between two cached points is interpola
</members>
<constants>
<constant name="AXIS_X" value="0">
+ Enumerated value for the X axis. Returned by functions like max_axis or min_axis.
</constant>
<constant name="AXIS_Y" value="1">
+ Enumerated value for the Y axis.
</constant>
<constant name="AXIS_Z" value="2">
+ Enumerated value for the Z axis.
</constant>
</constants>
</class>
<class name="Vector3Array" category="Built-In Types">
<brief_description>
+ An Array of Vector3.
</brief_description>
<description>
+ An Array specifically designed to hold Vector3.
</description>
<methods>
<method name="get">
@@ -37950,18 +37987,21 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Returns the Vector3 at the given index.
</description>
</method>
<method name="push_back">
<argument index="0" name="vector3" type="Vector3">
</argument>
<description>
+ Inserts a Vector3 at the end.
</description>
</method>
<method name="resize">
<argument index="0" name="idx" type="int">
</argument>
<description>
+ Sets the size of the Vector3Array. If larger than the current size it will reserve some space beforehand, and if it is smaller it will cut off the array.
</description>
</method>
<method name="set">
@@ -37970,12 +38010,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="vector3" type="Vector3">
</argument>
<description>
+ Changes the Vector3 at the given index.
</description>
</method>
<method name="size">
<return type="int">
</return>
<description>
+ Returns the size of the array.
</description>
</method>
<method name="Vector3Array">
@@ -37984,6 +38026,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="from" type="Array">
</argument>
<description>
+ Constructs a new Vector3Array. Optionally, you can pass in an Array that will be converted.
</description>
</method>
</methods>
diff --git a/doc/core_classes.xml b/doc/core_classes.xml
index 02b46ac4b9..c37b50f122 100644
--- a/doc/core_classes.xml
+++ b/doc/core_classes.xml
@@ -575,8 +575,8 @@
3x3 Matrix.
</brief_description>
<description>
- </description>
Matrix represent a 3x3 (3 rows by 3 columns) transformation matrix. it is used mainly to represent and accumulate transformations such as rotation or scale when used as an OCS (oriented coordinate system).
+ </description>
<methods>
<method name="invert">
<description>
@@ -937,8 +937,8 @@
Vector used for 2D Math.
</brief_description>
<description>
- </description>
Vector class, which performs basic 2D vector math operations.
+ </description>
<methods>
<method name="operator+">
<argument index="0" name="b" type="Vector2">
diff --git a/drivers/SCsub b/drivers/SCsub
index b94309013a..8e241830f8 100644
--- a/drivers/SCsub
+++ b/drivers/SCsub
@@ -31,7 +31,7 @@ SConscript("rtaudio/SCsub");
SConscript("nedmalloc/SCsub");
SConscript("nrex/SCsub");
SConscript("chibi/SCsub");
-if (env["vorbis"]=="yes" or env["speex"]=="yes" or env["theora"]=="yes" or env["opus"]=="yes"):
+if (env["vorbis"]=="yes" or env["speex"]=="yes" or env["theoralib"]=="yes" or env["opus"]=="yes"):
SConscript("ogg/SCsub");
if (env["vorbis"]=="yes"):
SConscript("vorbis/SCsub");
@@ -40,9 +40,7 @@ if (env["opus"]=="yes"):
if (env["tools"]=="yes"):
SConscript("convex_decomp/SCsub");
-#if env["theora"]=="yes":
-# SConscript("theoraplayer/SCsub")
-if (env["theora"]=="yes"):
+if (env["theoralib"]=="yes"):
SConscript("theora/SCsub");
if (env['speex']=='yes'):
SConscript("speex/SCsub");
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index b473e8493f..39b448d6e0 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -4641,6 +4641,9 @@ void RasterizerGLES2::_update_shader( Shader* p_shader) const {
if (light_flags.uses_light) {
enablers.push_back("#define USE_LIGHT_SHADER_CODE\n");
}
+ if (light_flags.uses_shadow_color) {
+ enablers.push_back("#define USE_LIGHT_SHADOW_COLOR\n");
+ }
if (light_flags.uses_time || fragment_flags.uses_time || vertex_flags.uses_time) {
enablers.push_back("#define USE_TIME\n");
uses_time=true;
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index c8f59ce22b..f981529ee3 100644
--- a/drivers/gles2/shader_compiler_gles2.cpp
+++ b/drivers/gles2/shader_compiler_gles2.cpp
@@ -221,6 +221,10 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node,int p_level,bool p_a
uses_light=true;
}
+ if (vnode->name==vname_shadow) {
+ uses_shadow_color=true;
+ }
+
}
if (type==ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX) {
@@ -783,13 +787,14 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
replace_table["texscreen"]= "texscreen";
replace_table["texpos"]= "texpos";
- mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["POSITION"] = "gl_Position";
+
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_VERTEX"] = "vertex_in.xyz";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_NORMAL"] = "normal_in";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_TANGENT"]="tangent_in";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_BINORMALF"]="binormalf";
-
+
+ mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["POSITION"] = "gl_Position";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["VERTEX"]="vertex_interp";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["NORMAL"]="normal_interp";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["TANGENT"]="tangent_interp";
@@ -858,6 +863,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["LIGHT"]="light";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["POINT_COORD"]="gl_PointCoord";
mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["TIME"]="time";
+ mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["SHADOW"]="shadow_color";
mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["SRC_VERTEX"]="src_vtx";
mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["VERTEX"]="outvec.xy";
diff --git a/drivers/gles2/shaders/material.glsl b/drivers/gles2/shaders/material.glsl
index 38fb03ab5c..ccd80bf2f0 100644
--- a/drivers/gles2/shaders/material.glsl
+++ b/drivers/gles2/shaders/material.glsl
@@ -1175,6 +1175,10 @@ FRAGMENT_SHADER_CODE
vec3 mdiffuse = diffuse.rgb;
vec3 light;
+#if defined(USE_LIGHT_SHADOW_COLOR)
+ vec3 shadow_color=vec3(0.0,0.0,0.0);
+#endif
+
#if defined(USE_LIGHT_SHADER_CODE)
//light is written by the light shader
{
@@ -1195,6 +1199,10 @@ LIGHT_SHADER_CODE
#endif
diffuse.rgb = const_light_mult * ambient_light *diffuse.rgb + light * attenuation * shadow_attenuation;
+#if defined(USE_LIGHT_SHADOW_COLOR)
+ diffuse.rgb += light * shadow_color * attenuation * (1.0 - shadow_attenuation);
+#endif
+
#ifdef USE_FOG
diffuse.rgb = mix(diffuse.rgb,fog_interp.rgb,fog_interp.a);
diff --git a/drivers/ogg/SCsub b/drivers/ogg/SCsub
index c85d4404f3..3ee1bb6408 100644
--- a/drivers/ogg/SCsub
+++ b/drivers/ogg/SCsub
@@ -6,5 +6,4 @@ ogg_sources = [
"ogg/framing.c",
]
-if env['theora'] != "yes" or env['use_theoraplayer_binary'] != "yes":
- env.drivers_sources+=ogg_sources
+env.drivers_sources+=ogg_sources
diff --git a/drivers/opus/SCsub b/drivers/opus/SCsub
index a2bebf62b3..59c746209b 100644
--- a/drivers/opus/SCsub
+++ b/drivers/opus/SCsub
@@ -124,7 +124,7 @@ opus_sources_lib = [
]
if("opus_fixed_point" in env and env.opus_fixed_point=="yes"):
- env.Append(CPPPATH=["#drivers/opus/silk/fixed"], CFLAGS=["-DOPUS_FIXED_POINT"])
+ env.Append(CFLAGS=["-DOPUS_FIXED_POINT"])
opus_sources_silk = [
"opus/silk/fixed/apply_sine_window_FIX.c",
"opus/silk/fixed/k2a_FIX.c",
@@ -153,7 +153,6 @@ if("opus_fixed_point" in env and env.opus_fixed_point=="yes"):
"opus/silk/fixed/regularize_correlations_FIX.c"
]
else:
- env.Append(CPPPATH=["#drivers/opus/silk/float"])
opus_sources_silk = [
"opus/silk/float/apply_sine_window_FLP.c",
"opus/silk/float/inner_product_FLP.c",
@@ -193,8 +192,4 @@ opus_sources_lib+=opus_sources_silk
env.drivers_sources+=opus_sources_lib
env.drivers_sources+=opus_sources
-env.Append(CPPPATH=["#drivers/opus"])
-env.Append(CPPPATH=["#drivers/opus/celt","#drivers/opus/silk","#drivers/opus/silk/float"])
-env.Append(CFLAGS=["-DOPUS_HAVE_CONFIG_H"])
-
Export('env')
diff --git a/drivers/opus/analysis.c b/drivers/opus/analysis.c
index 47e8668b8e..e27e948178 100644
--- a/drivers/opus/analysis.c
+++ b/drivers/opus/analysis.c
@@ -25,19 +25,19 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "kiss_fft.h"
-#include "celt.h"
-#include "opus_modes.h"
-#include "arch.h"
-#include "quant_bands.h"
+#include "opus/celt/kiss_fft.h"
+#include "opus/celt/celt.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/quant_bands.h"
#include <stdio.h>
-#include "analysis.h"
-#include "mlp.h"
-#include "stack_alloc.h"
+#include "opus/analysis.h"
+#include "opus/mlp.h"
+#include "opus/celt/stack_alloc.h"
extern const MLP net;
diff --git a/drivers/opus/analysis.h b/drivers/opus/analysis.h
index be0388faa3..548614d529 100644
--- a/drivers/opus/analysis.h
+++ b/drivers/opus/analysis.h
@@ -28,8 +28,8 @@
#ifndef ANALYSIS_H
#define ANALYSIS_H
-#include "celt.h"
-#include "opus_private.h"
+#include "opus/celt/celt.h"
+#include "opus/opus_private.h"
#define NB_FRAMES 8
#define NB_TBANDS 18
diff --git a/drivers/opus/celt/_kiss_fft_guts.h b/drivers/opus/celt/_kiss_fft_guts.h
index 21bea8a9b0..2a4ee744ef 100644
--- a/drivers/opus/celt/_kiss_fft_guts.h
+++ b/drivers/opus/celt/_kiss_fft_guts.h
@@ -33,7 +33,7 @@
defines kiss_fft_scalar as either short or a float type
and defines
typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; }kiss_fft_cpx; */
-#include "kiss_fft.h"
+#include "opus/celt/kiss_fft.h"
/*
Explanation of macros dealing with complex math:
@@ -45,7 +45,7 @@
C_ADDTO( res , a) : res += a
* */
#ifdef OPUS_FIXED_POINT
-#include "arch.h"
+#include "opus/celt/arch.h"
#define SAMP_MAX 2147483647
diff --git a/drivers/opus/celt/arch.h b/drivers/opus/celt/arch.h
index 83e3705000..d964f8d90c 100644
--- a/drivers/opus/celt/arch.h
+++ b/drivers/opus/celt/arch.h
@@ -34,8 +34,8 @@
#ifndef ARCH_H
#define ARCH_H
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
# if !defined(__GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
@@ -109,10 +109,10 @@ typedef opus_val32 celt_ener;
#define SCALEOUT(a) (a)
#ifdef FIXED_DEBUG
-#include "fixed_debug.h"
+#include "opus/celt/fixed_debug.h"
#else
-#include "fixed_generic.h"
+#include "opus/celt/fixed_generic.h"
#ifdef OPUS_ARM_INLINE_EDSP
#include "arm/fixed_armv5e.h"
diff --git a/drivers/opus/celt/arm/arm_celt_map.c b/drivers/opus/celt/arm/arm_celt_map.c
index b187345154..31e7d5b319 100644
--- a/drivers/opus/celt/arm/arm_celt_map.c
+++ b/drivers/opus/celt/arm/arm_celt_map.c
@@ -25,11 +25,11 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "pitch.h"
+#include "opus/celt/pitch.h"
#if defined(OPUS_HAVE_RTCD)
diff --git a/drivers/opus/celt/arm/armcpu.c b/drivers/opus/celt/arm/armcpu.c
index 7f0af631b9..fb7f2421fe 100644
--- a/drivers/opus/celt/arm/armcpu.c
+++ b/drivers/opus/celt/arm/armcpu.c
@@ -27,16 +27,16 @@
/* Original code from libtheora modified to suit to Opus */
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#ifdef OPUS_HAVE_RTCD
-#include "armcpu.h"
-#include "cpu_support.h"
-#include "os_support.h"
-#include "opus_types.h"
+#include "opus/celt/arm/armcpu.h"
+#include "opus/celt/cpu_support.h"
+#include "opus/celt/os_support.h"
+#include "opus/opus_types.h"
#define OPUS_CPU_ARM_V4 (1)
#define OPUS_CPU_ARM_EDSP (1<<1)
diff --git a/drivers/opus/celt/arm/fixed_armv5e.h b/drivers/opus/celt/arm/fixed_armv5e.h
index 1194a7d3ec..cb6e4c1da9 100644
--- a/drivers/opus/celt/arm/fixed_armv5e.h
+++ b/drivers/opus/celt/arm/fixed_armv5e.h
@@ -30,7 +30,7 @@
#ifndef FIXED_ARMv5E_H
#define FIXED_ARMv5E_H
-#include "fixed_armv4.h"
+#include "opus/celt/arm/fixed_armv4.h"
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q16
diff --git a/drivers/opus/celt/arm/pitch_arm.h b/drivers/opus/celt/arm/pitch_arm.h
index df5e82ef0b..18d1f2e75e 100644
--- a/drivers/opus/celt/arm/pitch_arm.h
+++ b/drivers/opus/celt/arm/pitch_arm.h
@@ -28,7 +28,7 @@
#if !defined(PITCH_ARM_H)
# define PITCH_ARM_H
-# include "armcpu.h"
+# include "opus/celt/arm/armcpu.h"
# if defined(OPUS_FIXED_POINT)
diff --git a/drivers/opus/celt/bands.c b/drivers/opus/celt/bands.c
index 87280c8333..5a6b23d87f 100644
--- a/drivers/opus/celt/bands.c
+++ b/drivers/opus/celt/bands.c
@@ -27,21 +27,21 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <math.h>
-#include "bands.h"
-#include "opus_modes.h"
-#include "vq.h"
-#include "cwrs.h"
-#include "stack_alloc.h"
-#include "os_support.h"
-#include "mathops.h"
-#include "rate.h"
-#include "quant_bands.h"
-#include "pitch.h"
+#include "opus/celt/bands.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/vq.h"
+#include "opus/celt/cwrs.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/rate.h"
+#include "opus/celt/quant_bands.h"
+#include "opus/celt/pitch.h"
int hysteresis_decision(opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev)
{
diff --git a/drivers/opus/celt/bands.h b/drivers/opus/celt/bands.h
index fe1e47097a..1ef7cbc8ee 100644
--- a/drivers/opus/celt/bands.h
+++ b/drivers/opus/celt/bands.h
@@ -30,11 +30,11 @@
#ifndef BANDS_H
#define BANDS_H
-#include "arch.h"
-#include "opus_modes.h"
-#include "entenc.h"
-#include "entdec.h"
-#include "rate.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
+#include "opus/celt/rate.h"
/** Compute the amplitude (sqrt energy) in each of the bands
* @param m Mode data
diff --git a/drivers/opus/celt/celt.c b/drivers/opus/celt/celt.c
index b894e1e13f..d99a91ba29 100644
--- a/drivers/opus/celt/celt.c
+++ b/drivers/opus/celt/celt.c
@@ -27,28 +27,28 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#define CELT_C
-#include "os_support.h"
-#include "mdct.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/mdct.h"
#include <math.h>
-#include "celt.h"
-#include "pitch.h"
-#include "bands.h"
-#include "opus_modes.h"
-#include "entcode.h"
-#include "quant_bands.h"
-#include "rate.h"
-#include "stack_alloc.h"
-#include "mathops.h"
-#include "float_cast.h"
+#include "opus/celt/celt.h"
+#include "opus/celt/pitch.h"
+#include "opus/celt/bands.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/entcode.h"
+#include "opus/celt/quant_bands.h"
+#include "opus/celt/rate.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/float_cast.h"
#include <stdarg.h>
-#include "celt_lpc.h"
-#include "vq.h"
+#include "opus/celt/celt_lpc.h"
+#include "opus/celt/vq.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "unknown"
diff --git a/drivers/opus/celt/celt.h b/drivers/opus/celt/celt.h
index 5deea1f0aa..2b7dc3fa72 100644
--- a/drivers/opus/celt/celt.h
+++ b/drivers/opus/celt/celt.h
@@ -35,12 +35,12 @@
#ifndef CELT_H
#define CELT_H
-#include "opus_types.h"
-#include "opus_defines.h"
-#include "opus_custom.h"
-#include "entenc.h"
-#include "entdec.h"
-#include "arch.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
+#include "opus/opus_custom.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
+#include "opus/celt/arch.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/celt/celt_decoder.c b/drivers/opus/celt/celt_decoder.c
index 93791feab4..67c3789439 100644
--- a/drivers/opus/celt/celt_decoder.c
+++ b/drivers/opus/celt/celt_decoder.c
@@ -27,29 +27,29 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#define CELT_DECODER_C
-#include "cpu_support.h"
-#include "os_support.h"
-#include "mdct.h"
+#include "opus/celt/cpu_support.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/mdct.h"
#include <math.h>
-#include "celt.h"
-#include "pitch.h"
-#include "bands.h"
-#include "opus_modes.h"
-#include "entcode.h"
-#include "quant_bands.h"
-#include "rate.h"
-#include "stack_alloc.h"
-#include "mathops.h"
-#include "float_cast.h"
+#include "opus/celt/celt.h"
+#include "opus/celt/pitch.h"
+#include "opus/celt/bands.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/entcode.h"
+#include "opus/celt/quant_bands.h"
+#include "opus/celt/rate.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/float_cast.h"
#include <stdarg.h>
-#include "celt_lpc.h"
-#include "vq.h"
+#include "opus/celt/celt_lpc.h"
+#include "opus/celt/vq.h"
/**********************************************************************/
/* */
diff --git a/drivers/opus/celt/celt_encoder.c b/drivers/opus/celt/celt_encoder.c
index a61e41f42d..810ee5d743 100644
--- a/drivers/opus/celt/celt_encoder.c
+++ b/drivers/opus/celt/celt_encoder.c
@@ -27,29 +27,29 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#define CELT_ENCODER_C
-#include "cpu_support.h"
-#include "os_support.h"
-#include "mdct.h"
+#include "opus/celt/cpu_support.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/mdct.h"
#include <math.h>
-#include "celt.h"
-#include "pitch.h"
-#include "bands.h"
-#include "opus_modes.h"
-#include "entcode.h"
-#include "quant_bands.h"
-#include "rate.h"
-#include "stack_alloc.h"
-#include "mathops.h"
-#include "float_cast.h"
+#include "opus/celt/celt.h"
+#include "opus/celt/pitch.h"
+#include "opus/celt/bands.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/entcode.h"
+#include "opus/celt/quant_bands.h"
+#include "opus/celt/rate.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/float_cast.h"
#include <stdarg.h>
-#include "celt_lpc.h"
-#include "vq.h"
+#include "opus/celt/celt_lpc.h"
+#include "opus/celt/vq.h"
/** Encoder state
diff --git a/drivers/opus/celt/celt_lpc.c b/drivers/opus/celt/celt_lpc.c
index 1fa4406bc9..ad0a6dfd43 100644
--- a/drivers/opus/celt/celt_lpc.c
+++ b/drivers/opus/celt/celt_lpc.c
@@ -25,14 +25,14 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "celt_lpc.h"
-#include "stack_alloc.h"
-#include "mathops.h"
-#include "pitch.h"
+#include "opus/celt/celt_lpc.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/pitch.h"
void _celt_lpc(
opus_val16 *_lpc, /* out: [0...p-1] LPC coefficients */
diff --git a/drivers/opus/celt/celt_lpc.h b/drivers/opus/celt/celt_lpc.h
index dc2a0a3d26..12bb78a6fd 100644
--- a/drivers/opus/celt/celt_lpc.h
+++ b/drivers/opus/celt/celt_lpc.h
@@ -28,7 +28,7 @@
#ifndef PLC_H
#define PLC_H
-#include "arch.h"
+#include "opus/celt/arch.h"
#define LPC_ORDER 24
diff --git a/drivers/opus/celt/cpu_support.h b/drivers/opus/celt/cpu_support.h
index d68dbe62c5..f682a1d19e 100644
--- a/drivers/opus/celt/cpu_support.h
+++ b/drivers/opus/celt/cpu_support.h
@@ -28,8 +28,8 @@
#ifndef CPU_SUPPORT_H
#define CPU_SUPPORT_H
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
#if defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_ASM)
#include "arm/armcpu.h"
diff --git a/drivers/opus/celt/cwrs.c b/drivers/opus/celt/cwrs.c
index b866aa9210..bae9d21b97 100644
--- a/drivers/opus/celt/cwrs.c
+++ b/drivers/opus/celt/cwrs.c
@@ -27,14 +27,14 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "os_support.h"
-#include "cwrs.h"
-#include "mathops.h"
-#include "arch.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/cwrs.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/arch.h"
#ifdef CUSTOM_MODES
diff --git a/drivers/opus/celt/cwrs.h b/drivers/opus/celt/cwrs.h
index 7dfbd076d1..5400afa6a4 100644
--- a/drivers/opus/celt/cwrs.h
+++ b/drivers/opus/celt/cwrs.h
@@ -30,10 +30,10 @@
#ifndef CWRS_H
#define CWRS_H
-#include "arch.h"
-#include "stack_alloc.h"
-#include "entenc.h"
-#include "entdec.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
#ifdef CUSTOM_MODES
int log2_frac(opus_uint32 val, int frac);
diff --git a/drivers/opus/celt/ecintrin.h b/drivers/opus/celt/ecintrin.h
index 2263cff6bd..6ed8fb280e 100644
--- a/drivers/opus/celt/ecintrin.h
+++ b/drivers/opus/celt/ecintrin.h
@@ -26,10 +26,10 @@
*/
/*Some common macros for potential platform-specific optimization.*/
-#include "opus_types.h"
+#include "opus/opus_types.h"
#include <math.h>
#include <limits.h>
-#include "arch.h"
+#include "opus/celt/arch.h"
#if !defined(_ecintrin_H)
# define _ecintrin_H (1)
diff --git a/drivers/opus/celt/entcode.c b/drivers/opus/celt/entcode.c
index fd817a9db5..5c9874908d 100644
--- a/drivers/opus/celt/entcode.c
+++ b/drivers/opus/celt/entcode.c
@@ -25,12 +25,12 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "entcode.h"
-#include "arch.h"
+#include "opus/celt/entcode.h"
+#include "opus/celt/arch.h"
#if !defined(EC_CLZ)
/*This is a fallback for systems where we don't know how to access
diff --git a/drivers/opus/celt/entcode.h b/drivers/opus/celt/entcode.h
index dd13e49e50..c129f9b7d9 100644
--- a/drivers/opus/celt/entcode.h
+++ b/drivers/opus/celt/entcode.h
@@ -25,14 +25,14 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
#if !defined(_entcode_H)
# define _entcode_H (1)
# include <limits.h>
# include <stddef.h>
-# include "ecintrin.h"
+# include "opus/celt/ecintrin.h"
/*OPT: ec_window must be at least 32 bits, but if you have fast arithmetic on a
larger type, you can speed up the decoder by using it here.*/
diff --git a/drivers/opus/celt/entdec.c b/drivers/opus/celt/entdec.c
index 383da571c9..0ec4d460d2 100644
--- a/drivers/opus/celt/entdec.c
+++ b/drivers/opus/celt/entdec.c
@@ -25,15 +25,15 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <stddef.h>
-#include "os_support.h"
-#include "arch.h"
-#include "entdec.h"
-#include "mfrngcod.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/entdec.h"
+#include "opus/celt/mfrngcod.h"
/*A range decoder.
This is an entropy decoder based upon \cite{Mar79}, which is itself a
diff --git a/drivers/opus/celt/entdec.h b/drivers/opus/celt/entdec.h
index d8ab318730..fda60ab326 100644
--- a/drivers/opus/celt/entdec.h
+++ b/drivers/opus/celt/entdec.h
@@ -28,7 +28,7 @@
#if !defined(_entdec_H)
# define _entdec_H (1)
# include <limits.h>
-# include "entcode.h"
+# include "opus/celt/entcode.h"
/*Initializes the decoder.
_buf: The input buffer to use.
diff --git a/drivers/opus/celt/entenc.c b/drivers/opus/celt/entenc.c
index 299329c63f..085b2b2816 100644
--- a/drivers/opus/celt/entenc.c
+++ b/drivers/opus/celt/entenc.c
@@ -25,13 +25,13 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if defined(OPUS_HAVE_CONFIG_H)
-# include "opus_config.h"
+#if defined(OPUS_ENABLED)
+# include "opus/opus_config.h"
#endif
-#include "os_support.h"
-#include "arch.h"
-#include "entenc.h"
-#include "mfrngcod.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/mfrngcod.h"
/*A range encoder.
See entdec.c and the references for implementation details \cite{Mar79,MNW98}.
diff --git a/drivers/opus/celt/entenc.h b/drivers/opus/celt/entenc.h
index 796bc4d572..3f4a3acc93 100644
--- a/drivers/opus/celt/entenc.h
+++ b/drivers/opus/celt/entenc.h
@@ -28,7 +28,7 @@
#if !defined(_entenc_H)
# define _entenc_H (1)
# include <stddef.h>
-# include "entcode.h"
+# include "opus/celt/entcode.h"
/*Initializes the encoder.
_buf: The buffer to store output bytes in.
diff --git a/drivers/opus/celt/fixed_debug.h b/drivers/opus/celt/fixed_debug.h
index 80bc94910f..0ed16baa17 100644
--- a/drivers/opus/celt/fixed_debug.h
+++ b/drivers/opus/celt/fixed_debug.h
@@ -33,7 +33,7 @@
#define FIXED_DEBUG_H
#include <stdio.h>
-#include "opus_defines.h"
+#include "opus/opus_defines.h"
#ifdef CELT_C
OPUS_EXPORT opus_int64 celt_mips=0;
diff --git a/drivers/opus/celt/float_cast.h b/drivers/opus/celt/float_cast.h
index ede6574860..86e80a93ff 100644
--- a/drivers/opus/celt/float_cast.h
+++ b/drivers/opus/celt/float_cast.h
@@ -30,7 +30,7 @@
#define FLOAT_CAST_H
-#include "arch.h"
+#include "opus/celt/arch.h"
/*============================================================================
** On Intel Pentium processors (especially PIII and probably P4), converting
diff --git a/drivers/opus/celt/kiss_fft.c b/drivers/opus/celt/kiss_fft.c
index 333be975d1..89a1790b24 100644
--- a/drivers/opus/celt/kiss_fft.c
+++ b/drivers/opus/celt/kiss_fft.c
@@ -30,16 +30,16 @@
heavily modified to better suit Opus */
#ifndef SKIP_CONFIG_H
-# ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+# ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
# endif
#endif
-#include "_kiss_fft_guts.h"
-#include "arch.h"
-#include "os_support.h"
-#include "mathops.h"
-#include "stack_alloc.h"
+#include "opus/celt/_kiss_fft_guts.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/stack_alloc.h"
/* The guts header contains all the multiplication and addition macros that are defined for
complex numbers. It also delares the kf_ internal functions.
diff --git a/drivers/opus/celt/kiss_fft.h b/drivers/opus/celt/kiss_fft.h
index aa22b3a419..db2532c692 100644
--- a/drivers/opus/celt/kiss_fft.h
+++ b/drivers/opus/celt/kiss_fft.h
@@ -31,7 +31,7 @@
#include <stdlib.h>
#include <math.h>
-#include "arch.h"
+#include "opus/celt/arch.h"
#ifdef __cplusplus
extern "C" {
@@ -46,7 +46,7 @@ extern "C" {
#endif
#ifdef OPUS_FIXED_POINT
-#include "arch.h"
+#include "opus/celt/arch.h"
# define kiss_fft_scalar opus_int32
# define kiss_twiddle_scalar opus_int16
diff --git a/drivers/opus/celt/laplace.c b/drivers/opus/celt/laplace.c
index c6d293f298..9dc4d94d24 100644
--- a/drivers/opus/celt/laplace.c
+++ b/drivers/opus/celt/laplace.c
@@ -26,12 +26,12 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "laplace.h"
-#include "mathops.h"
+#include "opus/celt/laplace.h"
+#include "opus/celt/mathops.h"
/* The minimum probability of an energy delta (out of 32768). */
#define LAPLACE_LOG_MINP (0)
diff --git a/drivers/opus/celt/laplace.h b/drivers/opus/celt/laplace.h
index 46c14b5da5..9efcc73aa2 100644
--- a/drivers/opus/celt/laplace.h
+++ b/drivers/opus/celt/laplace.h
@@ -26,8 +26,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "entenc.h"
-#include "entdec.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
/** Encode a value that is assumed to be the realisation of a
Laplace-distributed random process
diff --git a/drivers/opus/celt/mathops.c b/drivers/opus/celt/mathops.c
index 49be746d8c..88e5aea129 100644
--- a/drivers/opus/celt/mathops.c
+++ b/drivers/opus/celt/mathops.c
@@ -31,11 +31,11 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "mathops.h"
+#include "opus/celt/mathops.h"
/*Compute floor(sqrt(_val)) with exact arithmetic.
This has been tested on all possible 32-bit inputs.*/
diff --git a/drivers/opus/celt/mathops.h b/drivers/opus/celt/mathops.h
index 4a6bc539bc..759f58d1b7 100644
--- a/drivers/opus/celt/mathops.h
+++ b/drivers/opus/celt/mathops.h
@@ -34,9 +34,9 @@
#ifndef MATHOPS_H
#define MATHOPS_H
-#include "arch.h"
-#include "entcode.h"
-#include "os_support.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/entcode.h"
+#include "opus/celt/os_support.h"
/* Multiplies two 16-bit fractional values. Bit-exactness of this macro is important */
#define FRAC_MUL16(a,b) ((16384+((opus_int32)(opus_int16)(a)*(opus_int16)(b)))>>15)
@@ -141,7 +141,7 @@ static OPUS_INLINE float celt_exp2(float x)
#ifdef OPUS_FIXED_POINT
-#include "os_support.h"
+#include "opus/celt/os_support.h"
#ifndef OVERRIDE_CELT_ILOG2
/** Integer log in base2. Undefined for zero and negative numbers */
diff --git a/drivers/opus/celt/mdct.c b/drivers/opus/celt/mdct.c
index d08d026fac..ae34538d6c 100644
--- a/drivers/opus/celt/mdct.c
+++ b/drivers/opus/celt/mdct.c
@@ -40,18 +40,18 @@
*/
#ifndef SKIP_CONFIG_H
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#endif
-#include "mdct.h"
-#include "kiss_fft.h"
-#include "_kiss_fft_guts.h"
+#include "opus/celt/mdct.h"
+#include "opus/celt/kiss_fft.h"
+#include "opus/celt/_kiss_fft_guts.h"
#include <math.h>
-#include "os_support.h"
-#include "mathops.h"
-#include "stack_alloc.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/stack_alloc.h"
#ifdef CUSTOM_MODES
diff --git a/drivers/opus/celt/mdct.h b/drivers/opus/celt/mdct.h
index 4e7a199246..492afeae1e 100644
--- a/drivers/opus/celt/mdct.h
+++ b/drivers/opus/celt/mdct.h
@@ -42,9 +42,9 @@
#ifndef MDCT_H
#define MDCT_H
-#include "opus_defines.h"
-#include "kiss_fft.h"
-#include "arch.h"
+#include "opus/opus_defines.h"
+#include "opus/celt/kiss_fft.h"
+#include "opus/celt/arch.h"
typedef struct {
int n;
diff --git a/drivers/opus/celt/mfrngcod.h b/drivers/opus/celt/mfrngcod.h
index 809152a59a..c24d98cde2 100644
--- a/drivers/opus/celt/mfrngcod.h
+++ b/drivers/opus/celt/mfrngcod.h
@@ -27,7 +27,7 @@
#if !defined(_mfrngcode_H)
# define _mfrngcode_H (1)
-# include "entcode.h"
+# include "opus/celt/entcode.h"
/*Constants used by the entropy encoder/decoder.*/
diff --git a/drivers/opus/celt/modes.c b/drivers/opus/celt/modes.c
index 3794074aaa..aef2681443 100644
--- a/drivers/opus/celt/modes.c
+++ b/drivers/opus/celt/modes.c
@@ -27,16 +27,16 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "celt.h"
-#include "opus_modes.h"
-#include "rate.h"
-#include "os_support.h"
-#include "stack_alloc.h"
-#include "quant_bands.h"
+#include "opus/celt/celt.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/rate.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/quant_bands.h"
static const opus_int16 eband5ms[] = {
/*0 200 400 600 800 1k 1.2 1.4 1.6 2k 2.4 2.8 3.2 4k 4.8 5.6 6.8 8k 9.6 12k 15.6 */
@@ -63,9 +63,9 @@ static const unsigned char band_allocation[] = {
#ifndef CUSTOM_MODES_ONLY
#ifdef OPUS_FIXED_POINT
- #include "static_modes_fixed.h"
+ #include "opus/celt/static_modes_fixed.h"
#else
- #include "static_modes_float.h"
+ #include "opus/celt/static_modes_float.h"
#endif
#endif /* CUSTOM_MODES_ONLY */
diff --git a/drivers/opus/celt/opus_custom_demo.c b/drivers/opus/celt/opus_custom_demo.c
index 8c7f58b6e6..b3129de779 100644
--- a/drivers/opus/celt/opus_custom_demo.c
+++ b/drivers/opus/celt/opus_custom_demo.c
@@ -26,12 +26,12 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus_custom.h"
-#include "arch.h"
+#include "opus/opus_custom.h"
+#include "opus/celt/arch.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
diff --git a/drivers/opus/celt/opus_modes.h b/drivers/opus/celt/opus_modes.h
index a1df46265e..38e5844535 100644
--- a/drivers/opus/celt/opus_modes.h
+++ b/drivers/opus/celt/opus_modes.h
@@ -30,12 +30,12 @@
#ifndef OPUS_MODES_H
#define OPUS_MODES_H
-#include "opus_types.h"
-#include "celt.h"
-#include "arch.h"
-#include "mdct.h"
-#include "entenc.h"
-#include "entdec.h"
+#include "opus/opus_types.h"
+#include "opus/celt/celt.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/mdct.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
#define MAX_PERIOD 1024
diff --git a/drivers/opus/celt/os_support.h b/drivers/opus/celt/os_support.h
index 5e47e3cff9..e1cf884467 100644
--- a/drivers/opus/celt/os_support.h
+++ b/drivers/opus/celt/os_support.h
@@ -35,8 +35,8 @@
# include "custom_support.h"
#endif
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
#include <string.h>
#include <stdio.h>
diff --git a/drivers/opus/celt/pitch.c b/drivers/opus/celt/pitch.c
index 48cd02fb2b..c7c2b98c00 100644
--- a/drivers/opus/celt/pitch.c
+++ b/drivers/opus/celt/pitch.c
@@ -31,16 +31,16 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "pitch.h"
-#include "os_support.h"
-#include "opus_modes.h"
-#include "stack_alloc.h"
-#include "mathops.h"
-#include "celt_lpc.h"
+#include "opus/celt/pitch.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/celt_lpc.h"
static void find_best_pitch(opus_val32 *xcorr, opus_val16 *y, int len,
int max_pitch, int *best_pitch
diff --git a/drivers/opus/celt/pitch.h b/drivers/opus/celt/pitch.h
index 3a7d305425..f599f5fc76 100644
--- a/drivers/opus/celt/pitch.h
+++ b/drivers/opus/celt/pitch.h
@@ -34,8 +34,8 @@
#ifndef PITCH_H
#define PITCH_H
-#include "opus_modes.h"
-#include "cpu_support.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/cpu_support.h"
#if defined(__SSE__) && !defined(OPUS_FIXED_POINT)
#include "x86/pitch_sse.h"
diff --git a/drivers/opus/celt/quant_bands.c b/drivers/opus/celt/quant_bands.c
index 0a170e850d..e64ed28f22 100644
--- a/drivers/opus/celt/quant_bands.c
+++ b/drivers/opus/celt/quant_bands.c
@@ -26,18 +26,18 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "quant_bands.h"
-#include "laplace.h"
+#include "opus/celt/quant_bands.h"
+#include "opus/celt/laplace.h"
#include <math.h>
-#include "os_support.h"
-#include "arch.h"
-#include "mathops.h"
-#include "stack_alloc.h"
-#include "rate.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/rate.h"
#ifdef OPUS_FIXED_POINT
/* Mean energy in each band quantized in Q4 */
diff --git a/drivers/opus/celt/quant_bands.h b/drivers/opus/celt/quant_bands.h
index 840df8723f..85d011e6e0 100644
--- a/drivers/opus/celt/quant_bands.h
+++ b/drivers/opus/celt/quant_bands.h
@@ -29,11 +29,11 @@
#ifndef QUANT_BANDS
#define QUANT_BANDS
-#include "arch.h"
-#include "opus_modes.h"
-#include "entenc.h"
-#include "entdec.h"
-#include "mathops.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
+#include "opus/celt/mathops.h"
#ifdef OPUS_FIXED_POINT
extern const signed char eMeans[25];
diff --git a/drivers/opus/celt/rate.c b/drivers/opus/celt/rate.c
index cca585ad95..ecc0ab2a4f 100644
--- a/drivers/opus/celt/rate.c
+++ b/drivers/opus/celt/rate.c
@@ -26,18 +26,18 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <math.h>
-#include "opus_modes.h"
-#include "cwrs.h"
-#include "arch.h"
-#include "os_support.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/cwrs.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/os_support.h"
-#include "entcode.h"
-#include "rate.h"
+#include "opus/celt/entcode.h"
+#include "opus/celt/rate.h"
static const unsigned char LOG2_FRAC_TABLE[24]={
0,
diff --git a/drivers/opus/celt/rate.h b/drivers/opus/celt/rate.h
index 7ced23ea09..e12dd29db8 100644
--- a/drivers/opus/celt/rate.h
+++ b/drivers/opus/celt/rate.h
@@ -40,8 +40,8 @@
#define QTHETA_OFFSET 4
#define QTHETA_OFFSET_TWOPHASE 16
-#include "cwrs.h"
-#include "opus_modes.h"
+#include "opus/celt/cwrs.h"
+#include "opus/celt/opus_modes.h"
void compute_pulse_cache(CELTMode *m, int LM);
diff --git a/drivers/opus/celt/stack_alloc.h b/drivers/opus/celt/stack_alloc.h
index d500c4dab9..464a6d0b7f 100644
--- a/drivers/opus/celt/stack_alloc.h
+++ b/drivers/opus/celt/stack_alloc.h
@@ -32,8 +32,8 @@
#ifndef STACK_ALLOC_H
#define STACK_ALLOC_H
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
#if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK))
#define VAR_ARRAYS
@@ -149,7 +149,7 @@ extern char *global_stack_top;
#endif /* ENABLE_VALGRIND */
-#include "os_support.h"
+#include "opus/celt/os_support.h"
#define VARDECL(type, var) type *var
#define ALLOC(var, size, type) var = PUSH(global_stack, size, type)
#define SAVE_STACK char *_saved_stack = global_stack;
diff --git a/drivers/opus/celt/static_modes_fixed.h b/drivers/opus/celt/static_modes_fixed.h
index d23e2a66f5..1d92fc4b27 100644
--- a/drivers/opus/celt/static_modes_fixed.h
+++ b/drivers/opus/celt/static_modes_fixed.h
@@ -1,8 +1,8 @@
/* The contents of this file was automatically generated by dump_modes.c
with arguments: 48000 960
It contains static definitions for some pre-defined modes. */
-#include "opus_modes.h"
-#include "rate.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/rate.h"
#ifndef DEF_WINDOW120
#define DEF_WINDOW120
diff --git a/drivers/opus/celt/static_modes_float.h b/drivers/opus/celt/static_modes_float.h
index fe6bb4c8a3..362be6cca8 100644
--- a/drivers/opus/celt/static_modes_float.h
+++ b/drivers/opus/celt/static_modes_float.h
@@ -1,8 +1,8 @@
/* The contents of this file was automatically generated by dump_modes.c
with arguments: 48000 960
It contains static definitions for some pre-defined modes. */
-#include "opus_modes.h"
-#include "rate.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/rate.h"
#ifndef DEF_WINDOW120
#define DEF_WINDOW120
diff --git a/drivers/opus/celt/tests/test_unit_cwrs32.c b/drivers/opus/celt/tests/test_unit_cwrs32.c
index 9cf124336a..db43e3392b 100644
--- a/drivers/opus/celt/tests/test_unit_cwrs32.c
+++ b/drivers/opus/celt/tests/test_unit_cwrs32.c
@@ -26,8 +26,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <stdio.h>
@@ -40,13 +40,13 @@
#endif
#define CELT_C
-#include "stack_alloc.h"
-#include "entenc.c"
-#include "entdec.c"
-#include "entcode.c"
-#include "cwrs.c"
-#include "mathops.c"
-#include "rate.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/entenc.c"
+#include "opus/celt/entdec.c"
+#include "opus/celt/entcode.c"
+#include "opus/celt/cwrs.c"
+#include "opus/celt/mathops.c"
+#include "opus/celt/rate.h"
#define NMAX (240)
#define KMAX (128)
diff --git a/drivers/opus/celt/tests/test_unit_dft.c b/drivers/opus/celt/tests/test_unit_dft.c
index 4a00013b2a..9c0db3e9ac 100644
--- a/drivers/opus/celt/tests/test_unit_dft.c
+++ b/drivers/opus/celt/tests/test_unit_dft.c
@@ -25,8 +25,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#define SKIP_CONFIG_H
@@ -38,11 +38,11 @@
#include <stdio.h>
#define CELT_C
-#include "stack_alloc.h"
-#include "kiss_fft.h"
-#include "kiss_fft.c"
-#include "mathops.c"
-#include "entcode.c"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/kiss_fft.h"
+#include "opus/celt/kiss_fft.c"
+#include "opus/celt/mathops.c"
+#include "opus/celt/entcode.c"
#ifndef M_PI
diff --git a/drivers/opus/celt/tests/test_unit_entropy.c b/drivers/opus/celt/tests/test_unit_entropy.c
index 62268b1564..8c2defa8b3 100644
--- a/drivers/opus/celt/tests/test_unit_entropy.c
+++ b/drivers/opus/celt/tests/test_unit_entropy.c
@@ -26,22 +26,22 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
-#include "entcode.h"
-#include "entenc.h"
-#include "entdec.h"
+#include "opus/celt/entcode.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
#include <string.h>
-#include "entenc.c"
-#include "entdec.c"
-#include "entcode.c"
+#include "opus/celt/entenc.c"
+#include "opus/celt/entdec.c"
+#include "opus/celt/entcode.c"
#ifndef M_LOG2E
# define M_LOG2E 1.4426950408889634074
diff --git a/drivers/opus/celt/tests/test_unit_laplace.c b/drivers/opus/celt/tests/test_unit_laplace.c
index af7d471045..e4fe83c4d6 100644
--- a/drivers/opus/celt/tests/test_unit_laplace.c
+++ b/drivers/opus/celt/tests/test_unit_laplace.c
@@ -25,20 +25,20 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
-#include "laplace.h"
+#include "opus/celt/laplace.h"
#define CELT_C
-#include "stack_alloc.h"
+#include "opus/celt/stack_alloc.h"
-#include "entenc.c"
-#include "entdec.c"
-#include "entcode.c"
-#include "laplace.c"
+#include "opus/celt/entenc.c"
+#include "opus/celt/entdec.c"
+#include "opus/celt/entcode.c"
+#include "opus/celt/laplace.c"
#define DATA_SIZE 40000
diff --git a/drivers/opus/celt/tests/test_unit_mathops.c b/drivers/opus/celt/tests/test_unit_mathops.c
index 36d6a4bfb4..0e3f300d40 100644
--- a/drivers/opus/celt/tests/test_unit_mathops.c
+++ b/drivers/opus/celt/tests/test_unit_mathops.c
@@ -26,8 +26,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#ifndef CUSTOM_MODES
@@ -36,15 +36,15 @@
#define CELT_C
-#include "mathops.c"
-#include "entenc.c"
-#include "entdec.c"
-#include "entcode.c"
-#include "bands.c"
-#include "quant_bands.c"
-#include "laplace.c"
-#include "vq.c"
-#include "cwrs.c"
+#include "opus/celt/mathops.c"
+#include "opus/celt/entenc.c"
+#include "opus/celt/entdec.c"
+#include "opus/celt/entcode.c"
+#include "opus/celt/bands.c"
+#include "opus/celt/quant_bands.c"
+#include "opus/celt/laplace.c"
+#include "opus/celt/vq.c"
+#include "opus/celt/cwrs.c"
#include <stdio.h>
#include <math.h>
diff --git a/drivers/opus/celt/tests/test_unit_mdct.c b/drivers/opus/celt/tests/test_unit_mdct.c
index e3b5eec11c..0be03db2e8 100644
--- a/drivers/opus/celt/tests/test_unit_mdct.c
+++ b/drivers/opus/celt/tests/test_unit_mdct.c
@@ -25,8 +25,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#define SKIP_CONFIG_H
@@ -38,13 +38,13 @@
#include <stdio.h>
#define CELT_C
-#include "mdct.h"
-#include "stack_alloc.h"
+#include "opus/celt/mdct.h"
+#include "opus/celt/stack_alloc.h"
-#include "kiss_fft.c"
-#include "mdct.c"
-#include "mathops.c"
-#include "entcode.c"
+#include "opus/celt/kiss_fft.c"
+#include "opus/celt/mdct.c"
+#include "opus/celt/mathops.c"
+#include "opus/celt/entcode.c"
#ifndef M_PI
#define M_PI 3.141592653
diff --git a/drivers/opus/celt/tests/test_unit_rotation.c b/drivers/opus/celt/tests/test_unit_rotation.c
index c12cc3f02f..a57bf11e79 100644
--- a/drivers/opus/celt/tests/test_unit_rotation.c
+++ b/drivers/opus/celt/tests/test_unit_rotation.c
@@ -25,8 +25,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#ifndef CUSTOM_MODES
@@ -37,13 +37,13 @@
#include <stdio.h>
#include <stdlib.h>
-#include "vq.c"
-#include "cwrs.c"
-#include "entcode.c"
-#include "entenc.c"
-#include "entdec.c"
-#include "mathops.c"
-#include "bands.h"
+#include "opus/celt/vq.c"
+#include "opus/celt/cwrs.c"
+#include "opus/celt/entcode.c"
+#include "opus/celt/entenc.c"
+#include "opus/celt/entdec.c"
+#include "opus/celt/mathops.c"
+#include "opus/celt/bands.h"
#include <math.h>
#define MAX_SIZE 100
diff --git a/drivers/opus/celt/tests/test_unit_types.c b/drivers/opus/celt/tests/test_unit_types.c
index 29e671067f..12d5ca72f8 100644
--- a/drivers/opus/celt/tests/test_unit_types.c
+++ b/drivers/opus/celt/tests/test_unit_types.c
@@ -25,11 +25,11 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus_types.h"
+#include "opus/opus_types.h"
#include <stdio.h>
int main(void)
diff --git a/drivers/opus/celt/vq.c b/drivers/opus/celt/vq.c
index 20b0b82728..29a98a3a63 100644
--- a/drivers/opus/celt/vq.c
+++ b/drivers/opus/celt/vq.c
@@ -26,17 +26,17 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "mathops.h"
-#include "cwrs.h"
-#include "vq.h"
-#include "arch.h"
-#include "os_support.h"
-#include "bands.h"
-#include "rate.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/cwrs.h"
+#include "opus/celt/vq.h"
+#include "opus/celt/arch.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/bands.h"
+#include "opus/celt/rate.h"
static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_val16 s)
{
diff --git a/drivers/opus/celt/vq.h b/drivers/opus/celt/vq.h
index 8bab59c5e0..b52b1a0982 100644
--- a/drivers/opus/celt/vq.h
+++ b/drivers/opus/celt/vq.h
@@ -33,9 +33,9 @@
#ifndef VQ_H
#define VQ_H
-#include "entenc.h"
-#include "entdec.h"
-#include "opus_modes.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
+#include "opus/celt/opus_modes.h"
/** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of
* the pitch and a combination of pulses such that its norm is still equal
diff --git a/drivers/opus/celt/x86/pitch_sse.h b/drivers/opus/celt/x86/pitch_sse.h
index 695122a5ad..1542b87232 100644
--- a/drivers/opus/celt/x86/pitch_sse.h
+++ b/drivers/opus/celt/x86/pitch_sse.h
@@ -33,7 +33,7 @@
#define PITCH_SSE_H
#include <xmmintrin.h>
-#include "arch.h"
+#include "opus/celt/arch.h"
#define OVERRIDE_XCORR_KERNEL
static OPUS_INLINE void xcorr_kernel(const opus_val16 *x, const opus_val16 *y, opus_val32 sum[4], int len)
diff --git a/drivers/opus/http.c b/drivers/opus/http.c
index 803db044af..24991b0401 100644
--- a/drivers/opus/http.c
+++ b/drivers/opus/http.c
@@ -9,11 +9,11 @@
* by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
* *
********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "internal.h"
+#include "opus/internal.h"
#include <ctype.h>
#include <errno.h>
#include <limits.h>
@@ -214,7 +214,7 @@ static const char *op_parse_file_url(const char *_src){
# include <winsock2.h>
# include <ws2tcpip.h>
# include <openssl/ssl.h>
-# include "winerrno.h"
+# include "opus/winerrno.h"
typedef SOCKET op_sock;
diff --git a/drivers/opus/info.c b/drivers/opus/info.c
index f5ad2110be..8175a013ac 100644
--- a/drivers/opus/info.c
+++ b/drivers/opus/info.c
@@ -9,11 +9,11 @@
* by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
* *
********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "internal.h"
+#include "opus/internal.h"
#include <limits.h>
#include <string.h>
diff --git a/drivers/opus/internal.c b/drivers/opus/internal.c
index a9c3671179..d73628ec53 100644
--- a/drivers/opus/internal.c
+++ b/drivers/opus/internal.c
@@ -9,11 +9,11 @@
* by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
* *
********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "internal.h"
+#include "opus/internal.h"
#if defined(OP_ENABLE_ASSERTIONS)
void op_fatal_impl(const char *_str,const char *_file,int _line){
diff --git a/drivers/opus/mlp.c b/drivers/opus/mlp.c
index 7220a23d42..d4d4971796 100644
--- a/drivers/opus/mlp.c
+++ b/drivers/opus/mlp.c
@@ -25,17 +25,17 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
#include <math.h>
-#include "mlp.h"
-#include "arch.h"
-#include "tansig_table.h"
+#include "opus/mlp.h"
+#include "opus/celt/arch.h"
+#include "opus/tansig_table.h"
#define MAX_NEURONS 100
#if 0
diff --git a/drivers/opus/mlp.h b/drivers/opus/mlp.h
index 86c8e0617d..3f9ca73bb0 100644
--- a/drivers/opus/mlp.h
+++ b/drivers/opus/mlp.h
@@ -28,7 +28,7 @@
#ifndef _MLP_H_
#define _MLP_H_
-#include "arch.h"
+#include "opus/celt/arch.h"
typedef struct {
int layers;
diff --git a/drivers/opus/mlp_data.c b/drivers/opus/mlp_data.c
index 401c4c0250..127c62ce8c 100644
--- a/drivers/opus/mlp_data.c
+++ b/drivers/opus/mlp_data.c
@@ -1,7 +1,7 @@
/* The contents of this file was automatically generated by mlp_train.c
It contains multi-layer perceptron (MLP) weights. */
-#include "mlp.h"
+#include "opus/mlp.h"
/* RMS error was 0.138320, seed was 1361535663 */
diff --git a/drivers/opus/opus.c b/drivers/opus/opus.c
index 8978e3b06b..5af71b478d 100644
--- a/drivers/opus/opus.c
+++ b/drivers/opus/opus.c
@@ -25,12 +25,12 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus.h"
-#include "opus_private.h"
+#include "opus/opus.h"
+#include "opus/opus_private.h"
#ifndef DISABLE_FLOAT_API
OPUS_EXPORT void opus_pcm_soft_clip(float *_x, int N, int C, float *declip_mem)
diff --git a/drivers/opus/opus.h b/drivers/opus/opus.h
index 93a53a2ffc..b99f553016 100644
--- a/drivers/opus/opus.h
+++ b/drivers/opus/opus.h
@@ -33,8 +33,8 @@
#ifndef OPUS_H
#define OPUS_H
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/opus_custom.h b/drivers/opus/opus_custom.h
index 41f36bf2fb..32fcb81ac7 100644
--- a/drivers/opus/opus_custom.h
+++ b/drivers/opus/opus_custom.h
@@ -35,7 +35,7 @@
#ifndef OPUS_CUSTOM_H
#define OPUS_CUSTOM_H
-#include "opus_defines.h"
+#include "opus/opus_defines.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/opus_decoder.c b/drivers/opus/opus_decoder.c
index c5d4cc6aaa..dea56015ce 100644
--- a/drivers/opus/opus_decoder.c
+++ b/drivers/opus/opus_decoder.c
@@ -25,8 +25,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-# include "opus_config.h"
+#ifdef OPUS_ENABLED
+# include "opus/opus_config.h"
#endif
#ifndef OPUS_BUILD
@@ -38,19 +38,19 @@
#endif
#include <stdarg.h>
-#include "celt.h"
-#include "opus.h"
-#include "entdec.h"
-#include "opus_modes.h"
-#include "API.h"
-#include "stack_alloc.h"
-#include "float_cast.h"
-#include "opus_private.h"
-#include "os_support.h"
-#include "structs.h"
-#include "define.h"
-#include "mathops.h"
-#include "cpu_support.h"
+#include "opus/celt/celt.h"
+#include "opus/opus.h"
+#include "opus/celt/entdec.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/silk/API.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/float_cast.h"
+#include "opus/opus_private.h"
+#include "opus/celt/os_support.h"
+#include "opus/silk/structs.h"
+#include "opus/silk/define.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/cpu_support.h"
struct OpusDecoder {
int celt_dec_offset;
diff --git a/drivers/opus/opus_defines.h b/drivers/opus/opus_defines.h
index 265089f65e..9d089d8391 100644
--- a/drivers/opus/opus_defines.h
+++ b/drivers/opus/opus_defines.h
@@ -33,7 +33,7 @@
#ifndef OPUS_DEFINES_H
#define OPUS_DEFINES_H
-#include "opus_types.h"
+#include "opus/opus_types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/opus_demo.c b/drivers/opus/opus_demo.c
index 7fcf65fd8b..a0c5a5f862 100644
--- a/drivers/opus/opus_demo.c
+++ b/drivers/opus/opus_demo.c
@@ -26,19 +26,19 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#include "opus.h"
-#include "debug.h"
-#include "opus_types.h"
-#include "opus_private.h"
-#include "opus_multistream.h"
+#include "opus/opus.h"
+#include "opus/silk/debug.h"
+#include "opus/opus_types.h"
+#include "opus/opus_private.h"
+#include "opus/opus_multistream.h"
#define MAX_PACKET 1500
diff --git a/drivers/opus/opus_encoder.c b/drivers/opus/opus_encoder.c
index f739daa258..890a2514de 100644
--- a/drivers/opus/opus_encoder.c
+++ b/drivers/opus/opus_encoder.c
@@ -25,29 +25,29 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <stdarg.h>
-#include "celt.h"
-#include "entenc.h"
-#include "opus_modes.h"
-#include "API.h"
-#include "stack_alloc.h"
-#include "float_cast.h"
-#include "opus.h"
-#include "arch.h"
-#include "opus_private.h"
-#include "os_support.h"
-#include "cpu_support.h"
-#include "analysis.h"
-#include "mathops.h"
-#include "tuning_parameters.h"
+#include "opus/celt/celt.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/silk/API.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/celt/float_cast.h"
+#include "opus/opus.h"
+#include "opus/celt/arch.h"
+#include "opus/opus_private.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/cpu_support.h"
+#include "opus/analysis.h"
+#include "opus/celt/mathops.h"
+#include "opus/silk/tuning_parameters.h"
#ifdef OPUS_FIXED_POINT
-#include "fixed/structs_FIX.h"
+#include "opus/silk/fixed/structs_FIX.h"
#else
-#include "float/structs_FLP.h"
+#include "opus/silk/float/structs_FLP.h"
#endif
#define MAX_ENCODER_BUFFER 480
diff --git a/drivers/opus/opus_multistream.c b/drivers/opus/opus_multistream.c
index 8211c0b470..10c42dd56d 100644
--- a/drivers/opus/opus_multistream.c
+++ b/drivers/opus/opus_multistream.c
@@ -25,17 +25,17 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus_multistream.h"
-#include "opus.h"
-#include "opus_private.h"
-#include "stack_alloc.h"
+#include "opus/opus_multistream.h"
+#include "opus/opus.h"
+#include "opus/opus_private.h"
+#include "opus/celt/stack_alloc.h"
#include <stdarg.h>
-#include "float_cast.h"
-#include "os_support.h"
+#include "opus/celt/float_cast.h"
+#include "opus/celt/os_support.h"
int validate_layout(const ChannelLayout *layout)
diff --git a/drivers/opus/opus_multistream.h b/drivers/opus/opus_multistream.h
index ae5997934a..f736c99c88 100644
--- a/drivers/opus/opus_multistream.h
+++ b/drivers/opus/opus_multistream.h
@@ -33,7 +33,7 @@
#ifndef OPUS_MULTISTREAM_H
#define OPUS_MULTISTREAM_H
-#include "opus.h"
+#include "opus/opus.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/opus/opus_multistream_decoder.c b/drivers/opus/opus_multistream_decoder.c
index 64a0c24067..43c695d815 100644
--- a/drivers/opus/opus_multistream_decoder.c
+++ b/drivers/opus/opus_multistream_decoder.c
@@ -25,17 +25,17 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus_multistream.h"
-#include "opus.h"
-#include "opus_private.h"
-#include "stack_alloc.h"
+#include "opus/opus_multistream.h"
+#include "opus/opus.h"
+#include "opus/opus_private.h"
+#include "opus/celt/stack_alloc.h"
#include <stdarg.h>
-#include "float_cast.h"
-#include "os_support.h"
+#include "opus/celt/float_cast.h"
+#include "opus/celt/os_support.h"
struct OpusMSDecoder {
ChannelLayout layout;
diff --git a/drivers/opus/opus_multistream_encoder.c b/drivers/opus/opus_multistream_encoder.c
index 8d559743ea..685d2de277 100644
--- a/drivers/opus/opus_multistream_encoder.c
+++ b/drivers/opus/opus_multistream_encoder.c
@@ -25,22 +25,22 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus_multistream.h"
-#include "opus.h"
-#include "opus_private.h"
-#include "stack_alloc.h"
+#include "opus/opus_multistream.h"
+#include "opus/opus.h"
+#include "opus/opus_private.h"
+#include "opus/celt/stack_alloc.h"
#include <stdarg.h>
-#include "float_cast.h"
-#include "os_support.h"
-#include "mathops.h"
-#include "mdct.h"
-#include "opus_modes.h"
-#include "bands.h"
-#include "quant_bands.h"
+#include "opus/celt/float_cast.h"
+#include "opus/celt/os_support.h"
+#include "opus/celt/mathops.h"
+#include "opus/celt/mdct.h"
+#include "opus/celt/opus_modes.h"
+#include "opus/celt/bands.h"
+#include "opus/celt/quant_bands.h"
typedef struct {
int nb_streams;
diff --git a/drivers/opus/opus_private.h b/drivers/opus/opus_private.h
index 83225f2b6c..d63ed4f051 100644
--- a/drivers/opus/opus_private.h
+++ b/drivers/opus/opus_private.h
@@ -29,9 +29,9 @@
#ifndef OPUS_PRIVATE_H
#define OPUS_PRIVATE_H
-#include "arch.h"
-#include "opus.h"
-#include "celt.h"
+#include "opus/celt/arch.h"
+#include "opus/opus.h"
+#include "opus/celt/celt.h"
struct OpusRepacketizer {
unsigned char toc;
diff --git a/drivers/opus/opusfile.c b/drivers/opus/opusfile.c
index 1e7497f6cd..a38e8cd5ad 100644
--- a/drivers/opus/opusfile.c
+++ b/drivers/opus/opusfile.c
@@ -14,11 +14,11 @@
last mod: $Id: vorbisfile.c 17573 2010-10-27 14:53:59Z xiphmont $
********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "internal.h"
+#include "opus/internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@ -26,7 +26,7 @@
#include <string.h>
#include <math.h>
-#include "opusfile.h"
+#include "opus/opusfile.h"
/*This implementation is largely based off of libvorbisfile.
All of the Ogg bits work roughly the same, though I have made some
diff --git a/drivers/opus/repacketizer.c b/drivers/opus/repacketizer.c
index 01406bb39b..eb0c0c7376 100644
--- a/drivers/opus/repacketizer.c
+++ b/drivers/opus/repacketizer.c
@@ -25,13 +25,13 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus.h"
-#include "opus_private.h"
-#include "os_support.h"
+#include "opus/opus.h"
+#include "opus/opus_private.h"
+#include "opus/celt/os_support.h"
int opus_repacketizer_get_size(void)
diff --git a/drivers/opus/repacketizer_demo.c b/drivers/opus/repacketizer_demo.c
index 1ca9cc3c96..5df4f26958 100644
--- a/drivers/opus/repacketizer_demo.c
+++ b/drivers/opus/repacketizer_demo.c
@@ -25,11 +25,11 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "opus.h"
+#include "opus/opus.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/drivers/opus/silk/A2NLSF.c b/drivers/opus/silk/A2NLSF.c
index cec53a5cd8..18b0e3092d 100644
--- a/drivers/opus/silk/A2NLSF.c
+++ b/drivers/opus/silk/A2NLSF.c
@@ -31,12 +31,12 @@ POSSIBILITY OF SUCH DAMAGE.
/* Therefore the result is not accurate NLSFs, but the two */
/* functions are accurate inverses of each other */
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "tables.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/tables.h"
/* Number of binary divisions, when not in low complexity mode */
#define BIN_DIV_STEPS_A2NLSF_FIX 3 /* must be no higher than 16 - log2( LSF_COS_TAB_SZ_FIX ) */
diff --git a/drivers/opus/silk/API.h b/drivers/opus/silk/API.h
index f0601bcf6b..70f81a0c44 100644
--- a/drivers/opus/silk/API.h
+++ b/drivers/opus/silk/API.h
@@ -28,11 +28,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_API_H
#define SILK_API_H
-#include "control.h"
-#include "typedef.h"
-#include "errors.h"
-#include "entenc.h"
-#include "entdec.h"
+#include "opus/silk/control.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/errors.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/CNG.c b/drivers/opus/silk/CNG.c
index 8b8dbf882c..253ae7db4c 100644
--- a/drivers/opus/silk/CNG.c
+++ b/drivers/opus/silk/CNG.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
/* Generates excitation for CNG LPC synthesis */
static OPUS_INLINE void silk_CNG_exc(
diff --git a/drivers/opus/silk/HP_variable_cutoff.c b/drivers/opus/silk/HP_variable_cutoff.c
index 379752bb19..9da2032869 100644
--- a/drivers/opus/silk/HP_variable_cutoff.c
+++ b/drivers/opus/silk/HP_variable_cutoff.c
@@ -25,15 +25,15 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#ifdef OPUS_FIXED_POINT
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
#else
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
#endif
-#include "tuning_parameters.h"
+#include "opus/silk/tuning_parameters.h"
/* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */
void silk_HP_variable_cutoff(
diff --git a/drivers/opus/silk/LPC_analysis_filter.c b/drivers/opus/silk/LPC_analysis_filter.c
index 98ef509e4e..4976d9d3c5 100644
--- a/drivers/opus/silk/LPC_analysis_filter.c
+++ b/drivers/opus/silk/LPC_analysis_filter.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "celt_lpc.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/celt/celt_lpc.h"
/*******************************************/
/* LPC analysis filter */
diff --git a/drivers/opus/silk/LPC_inv_pred_gain.c b/drivers/opus/silk/LPC_inv_pred_gain.c
index 6dc9a49861..aa67875759 100644
--- a/drivers/opus/silk/LPC_inv_pred_gain.c
+++ b/drivers/opus/silk/LPC_inv_pred_gain.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
#define QA 24
#define A_LIMIT SILK_FIX_CONST( 0.99975, QA )
diff --git a/drivers/opus/silk/LP_variable_cutoff.c b/drivers/opus/silk/LP_variable_cutoff.c
index 098c19d34f..65c4a6b06a 100644
--- a/drivers/opus/silk/LP_variable_cutoff.c
+++ b/drivers/opus/silk/LP_variable_cutoff.c
@@ -25,8 +25,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/*
@@ -35,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
[0.95 : 0.15 : 0.35] normalized cut off frequencies.
*/
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Helper function, interpolates the filter taps */
static OPUS_INLINE void silk_LP_interpolate_filter_taps(
diff --git a/drivers/opus/silk/NLSF2A.c b/drivers/opus/silk/NLSF2A.c
index 2b6f685f49..c3b8568a0c 100644
--- a/drivers/opus/silk/NLSF2A.c
+++ b/drivers/opus/silk/NLSF2A.c
@@ -25,8 +25,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/* conversion between prediction filter coefficients and LSFs */
@@ -35,8 +35,8 @@ POSSIBILITY OF SUCH DAMAGE.
/* therefore the result is not accurate LSFs, but the two */
/* functions are accurate inverses of each other */
-#include "SigProc_FIX.h"
-#include "tables.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/tables.h"
#define QA 16
diff --git a/drivers/opus/silk/NLSF_VQ.c b/drivers/opus/silk/NLSF_VQ.c
index e4ca79fbfe..9420f5bfb9 100644
--- a/drivers/opus/silk/NLSF_VQ.c
+++ b/drivers/opus/silk/NLSF_VQ.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Compute quantization errors for an LPC_order element input vector for a VQ codebook */
void silk_NLSF_VQ(
diff --git a/drivers/opus/silk/NLSF_VQ_weights_laroia.c b/drivers/opus/silk/NLSF_VQ_weights_laroia.c
index f461ba01c0..d3b4fd6401 100644
--- a/drivers/opus/silk/NLSF_VQ_weights_laroia.c
+++ b/drivers/opus/silk/NLSF_VQ_weights_laroia.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "define.h"
-#include "SigProc_FIX.h"
+#include "opus/silk/define.h"
+#include "opus/silk/SigProc_FIX.h"
/*
R. Laroia, N. Phamdo and N. Farvardin, "Robust and Efficient Quantization of Speech LSP
diff --git a/drivers/opus/silk/NLSF_decode.c b/drivers/opus/silk/NLSF_decode.c
index 786a62d278..6868a93858 100644
--- a/drivers/opus/silk/NLSF_decode.c
+++ b/drivers/opus/silk/NLSF_decode.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Predictive dequantizer for NLSF residuals */
static OPUS_INLINE void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */
diff --git a/drivers/opus/silk/NLSF_del_dec_quant.c b/drivers/opus/silk/NLSF_del_dec_quant.c
index b74585370c..9caeb0a23b 100644
--- a/drivers/opus/silk/NLSF_del_dec_quant.c
+++ b/drivers/opus/silk/NLSF_del_dec_quant.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Delayed-decision quantizer for NLSF residuals */
opus_int32 silk_NLSF_del_dec_quant( /* O Returns RD value in Q25 */
diff --git a/drivers/opus/silk/NLSF_encode.c b/drivers/opus/silk/NLSF_encode.c
index bf67bd5cf1..157c0c8ff6 100644
--- a/drivers/opus/silk/NLSF_encode.c
+++ b/drivers/opus/silk/NLSF_encode.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
/***********************/
/* NLSF vector encoder */
diff --git a/drivers/opus/silk/NLSF_stabilize.c b/drivers/opus/silk/NLSF_stabilize.c
index a1bf20b8d4..caeeed9754 100644
--- a/drivers/opus/silk/NLSF_stabilize.c
+++ b/drivers/opus/silk/NLSF_stabilize.c
@@ -25,8 +25,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/* NLSF stabilizer: */
@@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
/* - Output are sorted NLSF coefficients */
/* */
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Constant Definitions */
#define MAX_LOOPS 20
diff --git a/drivers/opus/silk/NLSF_unpack.c b/drivers/opus/silk/NLSF_unpack.c
index 60242a3b52..20d3020f9b 100644
--- a/drivers/opus/silk/NLSF_unpack.c
+++ b/drivers/opus/silk/NLSF_unpack.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Unpack predictor values and indices for entropy coding tables */
void silk_NLSF_unpack(
diff --git a/drivers/opus/silk/NSQ.c b/drivers/opus/silk/NSQ.c
index a08e34e893..6092498a1b 100644
--- a/drivers/opus/silk/NSQ.c
+++ b/drivers/opus/silk/NSQ.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
static OPUS_INLINE void silk_nsq_scale_states(
const silk_encoder_state *psEncC, /* I Encoder State */
diff --git a/drivers/opus/silk/NSQ_del_dec.c b/drivers/opus/silk/NSQ_del_dec.c
index 8ac6311b11..4aa730ed6a 100644
--- a/drivers/opus/silk/NSQ_del_dec.c
+++ b/drivers/opus/silk/NSQ_del_dec.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
typedef struct {
opus_int32 sLPC_Q14[ MAX_SUB_FRAME_LENGTH + NSQ_LPC_BUF_LENGTH ];
diff --git a/drivers/opus/silk/PLC.c b/drivers/opus/silk/PLC.c
index 9fc11adda9..1f5ce09927 100644
--- a/drivers/opus/silk/PLC.c
+++ b/drivers/opus/silk/PLC.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
-#include "PLC.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/PLC.h"
#define NB_ATT 2
static const opus_int16 HARM_ATT_Q15[NB_ATT] = { 32440, 31130 }; /* 0.99, 0.95 */
diff --git a/drivers/opus/silk/PLC.h b/drivers/opus/silk/PLC.h
index f531cda950..ae573fc00c 100644
--- a/drivers/opus/silk/PLC.h
+++ b/drivers/opus/silk/PLC.h
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_PLC_H
#define SILK_PLC_H
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
#define BWE_COEF 0.99
#define V_PITCH_GAIN_START_MIN_Q14 11469 /* 0.7 in Q14 */
diff --git a/drivers/opus/silk/SigProc_FIX.h b/drivers/opus/silk/SigProc_FIX.h
index 1b58057910..f4db0fa9a4 100644
--- a/drivers/opus/silk/SigProc_FIX.h
+++ b/drivers/opus/silk/SigProc_FIX.h
@@ -38,9 +38,9 @@ extern "C"
#define SILK_MAX_ORDER_LPC 16 /* max order of the LPC analysis in schur() and k2a() */
#include <string.h> /* for memset(), memcpy(), memmove() */
-#include "typedef.h"
-#include "resampler_structs.h"
-#include "macros.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/resampler_structs.h"
+#include "opus/silk/macros.h"
/********************************************************************/
@@ -575,9 +575,9 @@ static OPUS_INLINE opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
/* the following seems faster on x86 */
#define silk_SMMUL(a32, b32) (opus_int32)silk_RSHIFT64(silk_SMULL((a32), (b32)), 32)
-#include "Inlines.h"
-#include "MacroCount.h"
-#include "MacroDebug.h"
+#include "opus/silk/Inlines.h"
+#include "opus/silk/MacroCount.h"
+#include "opus/silk/MacroDebug.h"
#ifdef OPUS_ARM_INLINE_ASM
#include "arm/SigProc_FIX_armv4.h"
diff --git a/drivers/opus/silk/VAD.c b/drivers/opus/silk/VAD.c
index 3a5c566627..a789a13d32 100644
--- a/drivers/opus/silk/VAD.c
+++ b/drivers/opus/silk/VAD.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
/* Silk VAD noise level estimation */
static OPUS_INLINE void silk_VAD_GetNoiseLevels(
diff --git a/drivers/opus/silk/VQ_WMat_EC.c b/drivers/opus/silk/VQ_WMat_EC.c
index 28c5fc7e6f..a35b84ef14 100644
--- a/drivers/opus/silk/VQ_WMat_EC.c
+++ b/drivers/opus/silk/VQ_WMat_EC.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Entropy constrained matrix-weighted VQ, hard-coded to 5-element vectors, for a single input data vector */
void silk_VQ_WMat_EC(
diff --git a/drivers/opus/silk/ana_filt_bank_1.c b/drivers/opus/silk/ana_filt_bank_1.c
index 387dcd87e7..a2fa720bd0 100644
--- a/drivers/opus/silk/ana_filt_bank_1.c
+++ b/drivers/opus/silk/ana_filt_bank_1.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Coefficients for 2-band filter bank based on first-order allpass filters */
static opus_int16 A_fb1_20 = 5394 << 1;
diff --git a/drivers/opus/silk/biquad_alt.c b/drivers/opus/silk/biquad_alt.c
index 5f1d6d25c3..85708167de 100644
--- a/drivers/opus/silk/biquad_alt.c
+++ b/drivers/opus/silk/biquad_alt.c
@@ -32,11 +32,11 @@ POSSIBILITY OF SUCH DAMAGE.
* Can handle slowly varying filter coefficients *
* */
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Second order ARMA filter, alternative implementation */
void silk_biquad_alt(
diff --git a/drivers/opus/silk/bwexpander.c b/drivers/opus/silk/bwexpander.c
index d757483872..7f81a2af99 100644
--- a/drivers/opus/silk/bwexpander.c
+++ b/drivers/opus/silk/bwexpander.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Chirp (bandwidth expand) LP AR filter */
void silk_bwexpander(
diff --git a/drivers/opus/silk/bwexpander_32.c b/drivers/opus/silk/bwexpander_32.c
index 8a60767c0d..58dfe1f8d6 100644
--- a/drivers/opus/silk/bwexpander_32.c
+++ b/drivers/opus/silk/bwexpander_32.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Chirp (bandwidth expand) LP AR filter */
void silk_bwexpander_32(
diff --git a/drivers/opus/silk/check_control_input.c b/drivers/opus/silk/check_control_input.c
index 0e02fff22d..9c882334c3 100644
--- a/drivers/opus/silk/check_control_input.c
+++ b/drivers/opus/silk/check_control_input.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "control.h"
-#include "errors.h"
+#include "opus/silk/silk_main.h"
+#include "opus/silk/control.h"
+#include "opus/silk/errors.h"
/* Check encoder control struct */
opus_int check_control_input(
diff --git a/drivers/opus/silk/code_signs.c b/drivers/opus/silk/code_signs.c
index 8bcc6ecde1..e2f671d7ca 100644
--- a/drivers/opus/silk/code_signs.c
+++ b/drivers/opus/silk/code_signs.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/*#define silk_enc_map(a) ((a) > 0 ? 1 : 0)*/
/*#define silk_dec_map(a) ((a) > 0 ? 1 : -1)*/
diff --git a/drivers/opus/silk/control.h b/drivers/opus/silk/control.h
index 747e5426a0..4b20c4a8b8 100644
--- a/drivers/opus/silk/control.h
+++ b/drivers/opus/silk/control.h
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_CONTROL_H
#define SILK_CONTROL_H
-#include "typedef.h"
+#include "opus/silk/typedef.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/control_SNR.c b/drivers/opus/silk/control_SNR.c
index ae6351798b..e3983d5039 100644
--- a/drivers/opus/silk/control_SNR.c
+++ b/drivers/opus/silk/control_SNR.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "tuning_parameters.h"
+#include "opus/silk/silk_main.h"
+#include "opus/silk/tuning_parameters.h"
/* Control SNR of redidual quantizer */
opus_int silk_control_SNR(
diff --git a/drivers/opus/silk/control_audio_bandwidth.c b/drivers/opus/silk/control_audio_bandwidth.c
index 6f060bbd29..846a7baa59 100644
--- a/drivers/opus/silk/control_audio_bandwidth.c
+++ b/drivers/opus/silk/control_audio_bandwidth.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "tuning_parameters.h"
+#include "opus/silk/silk_main.h"
+#include "opus/silk/tuning_parameters.h"
/* Control internal sampling rate */
opus_int silk_control_audio_bandwidth(
diff --git a/drivers/opus/silk/control_codec.c b/drivers/opus/silk/control_codec.c
index 2d7b10e9b7..beb6dfe6cd 100644
--- a/drivers/opus/silk/control_codec.c
+++ b/drivers/opus/silk/control_codec.c
@@ -25,19 +25,19 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#ifdef OPUS_FIXED_POINT
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
#define silk_encoder_state_Fxx silk_encoder_state_FIX
#else
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
#define silk_encoder_state_Fxx silk_encoder_state_FLP
#endif
-#include "stack_alloc.h"
-#include "tuning_parameters.h"
-#include "pitch_est_defines.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/tuning_parameters.h"
+#include "opus/silk/pitch_est_defines.h"
static opus_int silk_setup_resamplers(
silk_encoder_state_Fxx *psEnc, /* I/O */
diff --git a/drivers/opus/silk/debug.c b/drivers/opus/silk/debug.c
index 2230813fae..9f31b68f76 100644
--- a/drivers/opus/silk/debug.c
+++ b/drivers/opus/silk/debug.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "debug.h"
-#include "SigProc_FIX.h"
+#include "opus/silk/debug.h"
+#include "opus/silk/SigProc_FIX.h"
#if SILK_TIC_TOC
diff --git a/drivers/opus/silk/debug.h b/drivers/opus/silk/debug.h
index efb6d3e99e..d2eccfa1e4 100644
--- a/drivers/opus/silk/debug.h
+++ b/drivers/opus/silk/debug.h
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_DEBUG_H
#define SILK_DEBUG_H
-#include "typedef.h"
+#include "opus/silk/typedef.h"
#include <stdio.h> /* file writing */
#include <string.h> /* strcpy, strcmp */
diff --git a/drivers/opus/silk/dec_API.c b/drivers/opus/silk/dec_API.c
index cd72115a20..43aeb4faff 100644
--- a/drivers/opus/silk/dec_API.c
+++ b/drivers/opus/silk/dec_API.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "API.h"
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/API.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
/************************/
/* Decoder Super Struct */
diff --git a/drivers/opus/silk/decode_core.c b/drivers/opus/silk/decode_core.c
index 8f801ea7ad..f7cd8db7c9 100644
--- a/drivers/opus/silk/decode_core.c
+++ b/drivers/opus/silk/decode_core.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
/**********************************************************/
/* Core decoder. Performs inverse NSQ operation LTP + LPC */
diff --git a/drivers/opus/silk/decode_frame.c b/drivers/opus/silk/decode_frame.c
index 38500227c2..f166019455 100644
--- a/drivers/opus/silk/decode_frame.c
+++ b/drivers/opus/silk/decode_frame.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
-#include "PLC.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/PLC.h"
/****************/
/* Decode frame */
diff --git a/drivers/opus/silk/decode_indices.c b/drivers/opus/silk/decode_indices.c
index c2aaad2606..3e09fb416b 100644
--- a/drivers/opus/silk/decode_indices.c
+++ b/drivers/opus/silk/decode_indices.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Decode side-information parameters from payload */
void silk_decode_indices(
diff --git a/drivers/opus/silk/decode_parameters.c b/drivers/opus/silk/decode_parameters.c
index 72df4fcdb2..7f4cbeec29 100644
--- a/drivers/opus/silk/decode_parameters.c
+++ b/drivers/opus/silk/decode_parameters.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Decode parameters from payload */
void silk_decode_parameters(
diff --git a/drivers/opus/silk/decode_pitch.c b/drivers/opus/silk/decode_pitch.c
index 3e1dd2d35b..73e94b4ee2 100644
--- a/drivers/opus/silk/decode_pitch.c
+++ b/drivers/opus/silk/decode_pitch.c
@@ -25,15 +25,15 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/***********************************************************
* Pitch analyser function
********************************************************** */
-#include "SigProc_FIX.h"
-#include "pitch_est_defines.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/pitch_est_defines.h"
void silk_decode_pitch(
opus_int16 lagIndex, /* I */
diff --git a/drivers/opus/silk/decode_pulses.c b/drivers/opus/silk/decode_pulses.c
index 13772f8a57..24f841881d 100644
--- a/drivers/opus/silk/decode_pulses.c
+++ b/drivers/opus/silk/decode_pulses.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/*********************************************/
/* Decode quantization indices of excitation */
diff --git a/drivers/opus/silk/decoder_set_fs.c b/drivers/opus/silk/decoder_set_fs.c
index 6d2de56647..97ecd8afd1 100644
--- a/drivers/opus/silk/decoder_set_fs.c
+++ b/drivers/opus/silk/decoder_set_fs.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Set decoder sampling rate */
opus_int silk_decoder_set_fs(
diff --git a/drivers/opus/silk/define.h b/drivers/opus/silk/define.h
index c47aca9f58..a38564c835 100644
--- a/drivers/opus/silk/define.h
+++ b/drivers/opus/silk/define.h
@@ -28,8 +28,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_DEFINE_H
#define SILK_DEFINE_H
-#include "errors.h"
-#include "typedef.h"
+#include "opus/silk/errors.h"
+#include "opus/silk/typedef.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/enc_API.c b/drivers/opus/silk/enc_API.c
index 66a9bb67de..ac1a7854f0 100644
--- a/drivers/opus/silk/enc_API.c
+++ b/drivers/opus/silk/enc_API.c
@@ -25,20 +25,20 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "define.h"
-#include "API.h"
-#include "control.h"
-#include "typedef.h"
-#include "stack_alloc.h"
-#include "structs.h"
-#include "tuning_parameters.h"
+#include "opus/silk/define.h"
+#include "opus/silk/API.h"
+#include "opus/silk/control.h"
+#include "opus/silk/typedef.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/structs.h"
+#include "opus/silk/tuning_parameters.h"
#ifdef OPUS_FIXED_POINT
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
#else
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
#endif
/***************************************/
diff --git a/drivers/opus/silk/encode_indices.c b/drivers/opus/silk/encode_indices.c
index c6679b34f6..7150325d49 100644
--- a/drivers/opus/silk/encode_indices.c
+++ b/drivers/opus/silk/encode_indices.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Encode side-information parameters to payload */
void silk_encode_indices(
diff --git a/drivers/opus/silk/encode_pulses.c b/drivers/opus/silk/encode_pulses.c
index d148b9d1e6..f9fe39eeb8 100644
--- a/drivers/opus/silk/encode_pulses.c
+++ b/drivers/opus/silk/encode_pulses.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
/*********************************************/
/* Encode quantization indices of excitation */
diff --git a/drivers/opus/silk/fixed/LTP_analysis_filter_FIX.c b/drivers/opus/silk/fixed/LTP_analysis_filter_FIX.c
index 1df4b01d20..19d5defc7a 100644
--- a/drivers/opus/silk/fixed/LTP_analysis_filter_FIX.c
+++ b/drivers/opus/silk/fixed/LTP_analysis_filter_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
void silk_LTP_analysis_filter_FIX(
opus_int16 *LTP_res, /* O LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length ) */
diff --git a/drivers/opus/silk/fixed/LTP_scale_ctrl_FIX.c b/drivers/opus/silk/fixed/LTP_scale_ctrl_FIX.c
index ab6923c5c9..0887fd03f7 100644
--- a/drivers/opus/silk/fixed/LTP_scale_ctrl_FIX.c
+++ b/drivers/opus/silk/fixed/LTP_scale_ctrl_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
/* Calculation of LTP state scaling */
void silk_LTP_scale_ctrl_FIX(
diff --git a/drivers/opus/silk/fixed/apply_sine_window_FIX.c b/drivers/opus/silk/fixed/apply_sine_window_FIX.c
index 0998b49eca..5b4d8ebfdc 100644
--- a/drivers/opus/silk/fixed/apply_sine_window_FIX.c
+++ b/drivers/opus/silk/fixed/apply_sine_window_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Apply sine window to signal vector. */
/* Window types: */
diff --git a/drivers/opus/silk/fixed/autocorr_FIX.c b/drivers/opus/silk/fixed/autocorr_FIX.c
index 438b42f85b..88a849e12c 100644
--- a/drivers/opus/silk/fixed/autocorr_FIX.c
+++ b/drivers/opus/silk/fixed/autocorr_FIX.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "celt_lpc.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/celt/celt_lpc.h"
/* Compute autocorrelation */
void silk_autocorr(
diff --git a/drivers/opus/silk/fixed/burg_modified_FIX.c b/drivers/opus/silk/fixed/burg_modified_FIX.c
index ce2a560e6d..5ef3ad2c38 100644
--- a/drivers/opus/silk/fixed/burg_modified_FIX.c
+++ b/drivers/opus/silk/fixed/burg_modified_FIX.c
@@ -25,14 +25,14 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "define.h"
-#include "tuning_parameters.h"
-#include "pitch.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/define.h"
+#include "opus/silk/tuning_parameters.h"
+#include "opus/celt/pitch.h"
#define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384 */
diff --git a/drivers/opus/silk/fixed/corrMatrix_FIX.c b/drivers/opus/silk/fixed/corrMatrix_FIX.c
index 28543fc204..9f50153dcc 100644
--- a/drivers/opus/silk/fixed/corrMatrix_FIX.c
+++ b/drivers/opus/silk/fixed/corrMatrix_FIX.c
@@ -25,15 +25,15 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/**********************************************************************
* Correlation Matrix Computations for LS estimate.
**********************************************************************/
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
/* Calculates correlation vector X'*t */
void silk_corrVector_FIX(
diff --git a/drivers/opus/silk/fixed/encode_frame_FIX.c b/drivers/opus/silk/fixed/encode_frame_FIX.c
index 2d80ca3583..27944729f8 100644
--- a/drivers/opus/silk/fixed/encode_frame_FIX.c
+++ b/drivers/opus/silk/fixed/encode_frame_FIX.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "stack_alloc.h"
-#include "tuning_parameters.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/tuning_parameters.h"
/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */
static OPUS_INLINE void silk_LBRR_encode_FIX(
diff --git a/drivers/opus/silk/fixed/find_LPC_FIX.c b/drivers/opus/silk/fixed/find_LPC_FIX.c
index a46cdb7515..df76e17ca2 100644
--- a/drivers/opus/silk/fixed/find_LPC_FIX.c
+++ b/drivers/opus/silk/fixed/find_LPC_FIX.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "stack_alloc.h"
-#include "tuning_parameters.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/tuning_parameters.h"
/* Finds LPC vector from correlations, and converts to NLSF */
void silk_find_LPC_FIX(
diff --git a/drivers/opus/silk/fixed/find_LTP_FIX.c b/drivers/opus/silk/fixed/find_LTP_FIX.c
index a1d152eee4..d556371ffa 100644
--- a/drivers/opus/silk/fixed/find_LTP_FIX.c
+++ b/drivers/opus/silk/fixed/find_LTP_FIX.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "tuning_parameters.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/silk/tuning_parameters.h"
/* Head room for correlations */
#define LTP_CORRS_HEAD_ROOM 2
diff --git a/drivers/opus/silk/fixed/find_pitch_lags_FIX.c b/drivers/opus/silk/fixed/find_pitch_lags_FIX.c
index 0598477cd1..0d00b3edf6 100644
--- a/drivers/opus/silk/fixed/find_pitch_lags_FIX.c
+++ b/drivers/opus/silk/fixed/find_pitch_lags_FIX.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "stack_alloc.h"
-#include "tuning_parameters.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/tuning_parameters.h"
/* Find pitch lags */
void silk_find_pitch_lags_FIX(
diff --git a/drivers/opus/silk/fixed/find_pred_coefs_FIX.c b/drivers/opus/silk/fixed/find_pred_coefs_FIX.c
index 0ab70df09d..93b506b523 100644
--- a/drivers/opus/silk/fixed/find_pred_coefs_FIX.c
+++ b/drivers/opus/silk/fixed/find_pred_coefs_FIX.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "stack_alloc.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/celt/stack_alloc.h"
void silk_find_pred_coefs_FIX(
silk_encoder_state_FIX *psEnc, /* I/O encoder state */
diff --git a/drivers/opus/silk/fixed/k2a_FIX.c b/drivers/opus/silk/fixed/k2a_FIX.c
index 848666ee3b..7d5808f190 100644
--- a/drivers/opus/silk/fixed/k2a_FIX.c
+++ b/drivers/opus/silk/fixed/k2a_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Step up function, converts reflection coefficients to prediction coefficients */
void silk_k2a(
diff --git a/drivers/opus/silk/fixed/k2a_Q16_FIX.c b/drivers/opus/silk/fixed/k2a_Q16_FIX.c
index f7e62e95fe..8df61dc3f6 100644
--- a/drivers/opus/silk/fixed/k2a_Q16_FIX.c
+++ b/drivers/opus/silk/fixed/k2a_Q16_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Step up function, converts reflection coefficients to prediction coefficients */
void silk_k2a_Q16(
diff --git a/drivers/opus/silk/fixed/main_FIX.h b/drivers/opus/silk/fixed/main_FIX.h
index fb47ffe700..71a560ef0e 100644
--- a/drivers/opus/silk/fixed/main_FIX.h
+++ b/drivers/opus/silk/fixed/main_FIX.h
@@ -28,13 +28,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_MAIN_FIX_H
#define SILK_MAIN_FIX_H
-#include "SigProc_FIX.h"
-#include "structs_FIX.h"
-#include "control.h"
-#include "silk_main.h"
-#include "PLC.h"
-#include "debug.h"
-#include "entenc.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/fixed/structs_FIX.h"
+#include "opus/silk/control.h"
+#include "opus/silk/silk_main.h"
+#include "opus/silk/PLC.h"
+#include "opus/silk/debug.h"
+#include "opus/celt/entenc.h"
#ifndef FORCE_CPP_BUILD
#ifdef __cplusplus
diff --git a/drivers/opus/silk/fixed/noise_shape_analysis_FIX.c b/drivers/opus/silk/fixed/noise_shape_analysis_FIX.c
index 420cbeedfc..862640d2c8 100644
--- a/drivers/opus/silk/fixed/noise_shape_analysis_FIX.c
+++ b/drivers/opus/silk/fixed/noise_shape_analysis_FIX.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "stack_alloc.h"
-#include "tuning_parameters.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/tuning_parameters.h"
/* Compute gain to make warped filter coefficients have a zero mean log frequency response on a */
/* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.) */
diff --git a/drivers/opus/silk/fixed/pitch_analysis_core_FIX.c b/drivers/opus/silk/fixed/pitch_analysis_core_FIX.c
index 4d65c09d1d..2acd51db6a 100644
--- a/drivers/opus/silk/fixed/pitch_analysis_core_FIX.c
+++ b/drivers/opus/silk/fixed/pitch_analysis_core_FIX.c
@@ -25,18 +25,18 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/***********************************************************
* Pitch analyser function
********************************************************** */
-#include "SigProc_FIX.h"
-#include "pitch_est_defines.h"
-#include "stack_alloc.h"
-#include "debug.h"
-#include "pitch.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/pitch_est_defines.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/debug.h"
+#include "opus/celt/pitch.h"
#define SCRATCH_SIZE 22
#define SF_LENGTH_4KHZ ( PE_SUBFR_LENGTH_MS * 4 )
diff --git a/drivers/opus/silk/fixed/prefilter_FIX.c b/drivers/opus/silk/fixed/prefilter_FIX.c
index 0b027eb836..195df3da75 100644
--- a/drivers/opus/silk/fixed/prefilter_FIX.c
+++ b/drivers/opus/silk/fixed/prefilter_FIX.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "stack_alloc.h"
-#include "tuning_parameters.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/tuning_parameters.h"
/* Prefilter for finding Quantizer input signal */
static OPUS_INLINE void silk_prefilt_FIX(
diff --git a/drivers/opus/silk/fixed/process_gains_FIX.c b/drivers/opus/silk/fixed/process_gains_FIX.c
index 3a78c475bb..2c501a2010 100644
--- a/drivers/opus/silk/fixed/process_gains_FIX.c
+++ b/drivers/opus/silk/fixed/process_gains_FIX.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "tuning_parameters.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/silk/tuning_parameters.h"
/* Processing of gains */
void silk_process_gains_FIX(
diff --git a/drivers/opus/silk/fixed/regularize_correlations_FIX.c b/drivers/opus/silk/fixed/regularize_correlations_FIX.c
index a3378fdd17..af34da68fa 100644
--- a/drivers/opus/silk/fixed/regularize_correlations_FIX.c
+++ b/drivers/opus/silk/fixed/regularize_correlations_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
/* Add noise to matrix diagonal */
void silk_regularize_correlations_FIX(
diff --git a/drivers/opus/silk/fixed/residual_energy16_FIX.c b/drivers/opus/silk/fixed/residual_energy16_FIX.c
index 39bdff2a72..9b6e103a52 100644
--- a/drivers/opus/silk/fixed/residual_energy16_FIX.c
+++ b/drivers/opus/silk/fixed/residual_energy16_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
/* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */
opus_int32 silk_residual_energy16_covar_FIX(
diff --git a/drivers/opus/silk/fixed/residual_energy_FIX.c b/drivers/opus/silk/fixed/residual_energy_FIX.c
index 13dbc51e39..468bfbab48 100644
--- a/drivers/opus/silk/fixed/residual_energy_FIX.c
+++ b/drivers/opus/silk/fixed/residual_energy_FIX.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "stack_alloc.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/celt/stack_alloc.h"
/* Calculates residual energies of input subframes where all subframes have LPC_order */
/* of preceding samples */
diff --git a/drivers/opus/silk/fixed/schur64_FIX.c b/drivers/opus/silk/fixed/schur64_FIX.c
index 22c0952ffd..fe1278e062 100644
--- a/drivers/opus/silk/fixed/schur64_FIX.c
+++ b/drivers/opus/silk/fixed/schur64_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Slower than schur(), but more accurate. */
/* Uses SMULL(), available on armv4 */
diff --git a/drivers/opus/silk/fixed/schur_FIX.c b/drivers/opus/silk/fixed/schur_FIX.c
index e8b24cf068..b0a36e5ad2 100644
--- a/drivers/opus/silk/fixed/schur_FIX.c
+++ b/drivers/opus/silk/fixed/schur_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Faster than schur64(), but much less accurate. */
/* uses SMLAWB(), requiring armv5E and higher. */
diff --git a/drivers/opus/silk/fixed/solve_LS_FIX.c b/drivers/opus/silk/fixed/solve_LS_FIX.c
index 5d09284935..6e8afaaa88 100644
--- a/drivers/opus/silk/fixed/solve_LS_FIX.c
+++ b/drivers/opus/silk/fixed/solve_LS_FIX.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
-#include "stack_alloc.h"
-#include "tuning_parameters.h"
+#include "opus/silk/fixed/main_FIX.h"
+#include "opus/celt/stack_alloc.h"
+#include "opus/silk/tuning_parameters.h"
/*****************************/
/* Internal function headers */
diff --git a/drivers/opus/silk/fixed/structs_FIX.h b/drivers/opus/silk/fixed/structs_FIX.h
index 0284dfa27a..21eab05f0f 100644
--- a/drivers/opus/silk/fixed/structs_FIX.h
+++ b/drivers/opus/silk/fixed/structs_FIX.h
@@ -28,9 +28,9 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_STRUCTS_FIX_H
#define SILK_STRUCTS_FIX_H
-#include "typedef.h"
-#include "silk_main.h"
-#include "structs.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/silk_main.h"
+#include "opus/silk/structs.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/fixed/vector_ops_FIX.c b/drivers/opus/silk/fixed/vector_ops_FIX.c
index b1e422eb91..c2725194ec 100644
--- a/drivers/opus/silk/fixed/vector_ops_FIX.c
+++ b/drivers/opus/silk/fixed/vector_ops_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Copy and multiply a vector by a constant */
void silk_scale_copy_vector16(
diff --git a/drivers/opus/silk/fixed/warped_autocorrelation_FIX.c b/drivers/opus/silk/fixed/warped_autocorrelation_FIX.c
index 3f04df775c..4e5a7fee58 100644
--- a/drivers/opus/silk/fixed/warped_autocorrelation_FIX.c
+++ b/drivers/opus/silk/fixed/warped_autocorrelation_FIX.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
#define QC 10
#define QS 14
diff --git a/drivers/opus/silk/float/LPC_analysis_filter_FLP.c b/drivers/opus/silk/float/LPC_analysis_filter_FLP.c
index 8d26c093bf..438b704fe9 100644
--- a/drivers/opus/silk/float/LPC_analysis_filter_FLP.c
+++ b/drivers/opus/silk/float/LPC_analysis_filter_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <stdlib.h>
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
/************************************************/
/* LPC analysis filter */
diff --git a/drivers/opus/silk/float/LPC_inv_pred_gain_FLP.c b/drivers/opus/silk/float/LPC_inv_pred_gain_FLP.c
index 968edfb189..2e86e269eb 100644
--- a/drivers/opus/silk/float/LPC_inv_pred_gain_FLP.c
+++ b/drivers/opus/silk/float/LPC_inv_pred_gain_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "SigProc_FLP.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/float/SigProc_FLP.h"
#define RC_THRESHOLD 0.9999f
diff --git a/drivers/opus/silk/float/LTP_analysis_filter_FLP.c b/drivers/opus/silk/float/LTP_analysis_filter_FLP.c
index fc729e99b1..5919ceb928 100644
--- a/drivers/opus/silk/float/LTP_analysis_filter_FLP.c
+++ b/drivers/opus/silk/float/LTP_analysis_filter_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
void silk_LTP_analysis_filter_FLP(
silk_float *LTP_res, /* O LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */
diff --git a/drivers/opus/silk/float/LTP_scale_ctrl_FLP.c b/drivers/opus/silk/float/LTP_scale_ctrl_FLP.c
index 60e1119d5a..c952d810af 100644
--- a/drivers/opus/silk/float/LTP_scale_ctrl_FLP.c
+++ b/drivers/opus/silk/float/LTP_scale_ctrl_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
void silk_LTP_scale_ctrl_FLP(
silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
diff --git a/drivers/opus/silk/float/SigProc_FLP.h b/drivers/opus/silk/float/SigProc_FLP.h
index f0cb3733be..9b14f24f21 100644
--- a/drivers/opus/silk/float/SigProc_FLP.h
+++ b/drivers/opus/silk/float/SigProc_FLP.h
@@ -28,8 +28,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_SIGPROC_FLP_H
#define SILK_SIGPROC_FLP_H
-#include "SigProc_FIX.h"
-#include "float_cast.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/celt/float_cast.h"
#include <math.h>
#ifdef __cplusplus
diff --git a/drivers/opus/silk/float/apply_sine_window_FLP.c b/drivers/opus/silk/float/apply_sine_window_FLP.c
index d904585d17..e8aa197bb0 100644
--- a/drivers/opus/silk/float/apply_sine_window_FLP.c
+++ b/drivers/opus/silk/float/apply_sine_window_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
/* Apply sine window to signal vector */
/* Window types: */
diff --git a/drivers/opus/silk/float/autocorrelation_FLP.c b/drivers/opus/silk/float/autocorrelation_FLP.c
index 192a001b16..f4b90ff32d 100644
--- a/drivers/opus/silk/float/autocorrelation_FLP.c
+++ b/drivers/opus/silk/float/autocorrelation_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "typedef.h"
-#include "SigProc_FLP.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/float/SigProc_FLP.h"
/* compute autocorrelation */
void silk_autocorrelation_FLP(
diff --git a/drivers/opus/silk/float/burg_modified_FLP.c b/drivers/opus/silk/float/burg_modified_FLP.c
index 0f30ca2280..5a16334240 100644
--- a/drivers/opus/silk/float/burg_modified_FLP.c
+++ b/drivers/opus/silk/float/burg_modified_FLP.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
-#include "tuning_parameters.h"
-#include "define.h"
+#include "opus/silk/float/SigProc_FLP.h"
+#include "opus/silk/tuning_parameters.h"
+#include "opus/silk/define.h"
#define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384*/
diff --git a/drivers/opus/silk/float/bwexpander_FLP.c b/drivers/opus/silk/float/bwexpander_FLP.c
index 86154dc3f1..b3de4f6453 100644
--- a/drivers/opus/silk/float/bwexpander_FLP.c
+++ b/drivers/opus/silk/float/bwexpander_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
+#include "opus/silk/float/SigProc_FLP.h"
/* Chirp (bw expand) LP AR filter */
void silk_bwexpander_FLP(
diff --git a/drivers/opus/silk/float/corrMatrix_FLP.c b/drivers/opus/silk/float/corrMatrix_FLP.c
index e193c98f11..551f8578d7 100644
--- a/drivers/opus/silk/float/corrMatrix_FLP.c
+++ b/drivers/opus/silk/float/corrMatrix_FLP.c
@@ -25,15 +25,15 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/**********************************************************************
* Correlation matrix computations for LS estimate.
**********************************************************************/
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
/* Calculates correlation vector X'*t */
void silk_corrVector_FLP(
diff --git a/drivers/opus/silk/float/encode_frame_FLP.c b/drivers/opus/silk/float/encode_frame_FLP.c
index 90e5357ced..c5973b8922 100644
--- a/drivers/opus/silk/float/encode_frame_FLP.c
+++ b/drivers/opus/silk/float/encode_frame_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
-#include "tuning_parameters.h"
+#include "opus/silk/float/main_FLP.h"
+#include "opus/silk/tuning_parameters.h"
/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */
static OPUS_INLINE void silk_LBRR_encode_FLP(
diff --git a/drivers/opus/silk/float/energy_FLP.c b/drivers/opus/silk/float/energy_FLP.c
index d441526df3..9c6fad48d7 100644
--- a/drivers/opus/silk/float/energy_FLP.c
+++ b/drivers/opus/silk/float/energy_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
+#include "opus/silk/float/SigProc_FLP.h"
/* sum of squares of a silk_float array, with result as double */
double silk_energy_FLP(
diff --git a/drivers/opus/silk/float/find_LPC_FLP.c b/drivers/opus/silk/float/find_LPC_FLP.c
index 212f2de3cd..2b8c54388f 100644
--- a/drivers/opus/silk/float/find_LPC_FLP.c
+++ b/drivers/opus/silk/float/find_LPC_FLP.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "define.h"
-#include "main_FLP.h"
-#include "tuning_parameters.h"
+#include "opus/silk/define.h"
+#include "opus/silk/float/main_FLP.h"
+#include "opus/silk/tuning_parameters.h"
/* LPC analysis */
void silk_find_LPC_FLP(
diff --git a/drivers/opus/silk/float/find_LTP_FLP.c b/drivers/opus/silk/float/find_LTP_FLP.c
index 5c62851f20..2f66de4684 100644
--- a/drivers/opus/silk/float/find_LTP_FLP.c
+++ b/drivers/opus/silk/float/find_LTP_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
-#include "tuning_parameters.h"
+#include "opus/silk/float/main_FLP.h"
+#include "opus/silk/tuning_parameters.h"
void silk_find_LTP_FLP(
silk_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */
diff --git a/drivers/opus/silk/float/find_pitch_lags_FLP.c b/drivers/opus/silk/float/find_pitch_lags_FLP.c
index d74d5941b5..a2d582c734 100644
--- a/drivers/opus/silk/float/find_pitch_lags_FLP.c
+++ b/drivers/opus/silk/float/find_pitch_lags_FLP.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#include <stdlib.h>
-#include "main_FLP.h"
-#include "tuning_parameters.h"
+#include "opus/silk/float/main_FLP.h"
+#include "opus/silk/tuning_parameters.h"
void silk_find_pitch_lags_FLP(
silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
diff --git a/drivers/opus/silk/float/find_pred_coefs_FLP.c b/drivers/opus/silk/float/find_pred_coefs_FLP.c
index e0d8804cc9..61eead7573 100644
--- a/drivers/opus/silk/float/find_pred_coefs_FLP.c
+++ b/drivers/opus/silk/float/find_pred_coefs_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
/* Find LPC and LTP coefficients */
void silk_find_pred_coefs_FLP(
diff --git a/drivers/opus/silk/float/inner_product_FLP.c b/drivers/opus/silk/float/inner_product_FLP.c
index 57acf5ffba..e5f0308448 100644
--- a/drivers/opus/silk/float/inner_product_FLP.c
+++ b/drivers/opus/silk/float/inner_product_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
+#include "opus/silk/float/SigProc_FLP.h"
/* inner product of two silk_float arrays, with result as double */
double silk_inner_product_FLP(
diff --git a/drivers/opus/silk/float/k2a_FLP.c b/drivers/opus/silk/float/k2a_FLP.c
index a668a32127..71dc4c3c44 100644
--- a/drivers/opus/silk/float/k2a_FLP.c
+++ b/drivers/opus/silk/float/k2a_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
+#include "opus/silk/float/SigProc_FLP.h"
/* step up function, converts reflection coefficients to prediction coefficients */
void silk_k2a_FLP(
diff --git a/drivers/opus/silk/float/levinsondurbin_FLP.c b/drivers/opus/silk/float/levinsondurbin_FLP.c
index 64aaf0fb29..8fbca230a5 100644
--- a/drivers/opus/silk/float/levinsondurbin_FLP.c
+++ b/drivers/opus/silk/float/levinsondurbin_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
+#include "opus/silk/float/SigProc_FLP.h"
/* Solve the normal equations using the Levinson-Durbin recursion */
silk_float silk_levinsondurbin_FLP( /* O prediction error energy */
diff --git a/drivers/opus/silk/float/main_FLP.h b/drivers/opus/silk/float/main_FLP.h
index 92d6ec3df1..4ec8ddeefc 100644
--- a/drivers/opus/silk/float/main_FLP.h
+++ b/drivers/opus/silk/float/main_FLP.h
@@ -28,13 +28,13 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_MAIN_FLP_H
#define SILK_MAIN_FLP_H
-#include "SigProc_FLP.h"
-#include "SigProc_FIX.h"
-#include "structs_FLP.h"
-#include "silk_main.h"
-#include "define.h"
-#include "debug.h"
-#include "entenc.h"
+#include "opus/silk/float/SigProc_FLP.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/float/structs_FLP.h"
+#include "opus/silk/silk_main.h"
+#include "opus/silk/define.h"
+#include "opus/silk/debug.h"
+#include "opus/celt/entenc.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/float/noise_shape_analysis_FLP.c b/drivers/opus/silk/float/noise_shape_analysis_FLP.c
index f80e0b3d0e..5d8bc6332a 100644
--- a/drivers/opus/silk/float/noise_shape_analysis_FLP.c
+++ b/drivers/opus/silk/float/noise_shape_analysis_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
-#include "tuning_parameters.h"
+#include "opus/silk/float/main_FLP.h"
+#include "opus/silk/tuning_parameters.h"
/* Compute gain to make warped filter coefficients have a zero mean log frequency response on a */
/* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.) */
diff --git a/drivers/opus/silk/float/pitch_analysis_core_FLP.c b/drivers/opus/silk/float/pitch_analysis_core_FLP.c
index 2588094c49..2689c5008b 100644
--- a/drivers/opus/silk/float/pitch_analysis_core_FLP.c
+++ b/drivers/opus/silk/float/pitch_analysis_core_FLP.c
@@ -25,17 +25,17 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/*****************************************************************************
* Pitch analyser function
******************************************************************************/
-#include "SigProc_FLP.h"
-#include "SigProc_FIX.h"
-#include "pitch_est_defines.h"
-#include "pitch.h"
+#include "opus/silk/float/SigProc_FLP.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/pitch_est_defines.h"
+#include "opus/celt/pitch.h"
#define SCRATCH_SIZE 22
diff --git a/drivers/opus/silk/float/prefilter_FLP.c b/drivers/opus/silk/float/prefilter_FLP.c
index aa43852ff1..0298ef2f8e 100644
--- a/drivers/opus/silk/float/prefilter_FLP.c
+++ b/drivers/opus/silk/float/prefilter_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
-#include "tuning_parameters.h"
+#include "opus/silk/float/main_FLP.h"
+#include "opus/silk/tuning_parameters.h"
/*
* Prefilter for finding Quantizer input signal
diff --git a/drivers/opus/silk/float/process_gains_FLP.c b/drivers/opus/silk/float/process_gains_FLP.c
index e83d05552a..bd5e7ee7a2 100644
--- a/drivers/opus/silk/float/process_gains_FLP.c
+++ b/drivers/opus/silk/float/process_gains_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
-#include "tuning_parameters.h"
+#include "opus/silk/float/main_FLP.h"
+#include "opus/silk/tuning_parameters.h"
/* Processing of gains */
void silk_process_gains_FLP(
diff --git a/drivers/opus/silk/float/regularize_correlations_FLP.c b/drivers/opus/silk/float/regularize_correlations_FLP.c
index f056eadc57..397e45b10b 100644
--- a/drivers/opus/silk/float/regularize_correlations_FLP.c
+++ b/drivers/opus/silk/float/regularize_correlations_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
/* Add noise to matrix diagonal */
void silk_regularize_correlations_FLP(
diff --git a/drivers/opus/silk/float/residual_energy_FLP.c b/drivers/opus/silk/float/residual_energy_FLP.c
index 011efcef04..50bc728b71 100644
--- a/drivers/opus/silk/float/residual_energy_FLP.c
+++ b/drivers/opus/silk/float/residual_energy_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
#define MAX_ITERATIONS_RESIDUAL_NRG 10
#define REGULARIZATION_FACTOR 1e-8f
diff --git a/drivers/opus/silk/float/scale_copy_vector_FLP.c b/drivers/opus/silk/float/scale_copy_vector_FLP.c
index 7578d44894..8c5bfadb3a 100644
--- a/drivers/opus/silk/float/scale_copy_vector_FLP.c
+++ b/drivers/opus/silk/float/scale_copy_vector_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
+#include "opus/silk/float/SigProc_FLP.h"
/* copy and multiply a vector by a constant */
void silk_scale_copy_vector_FLP(
diff --git a/drivers/opus/silk/float/scale_vector_FLP.c b/drivers/opus/silk/float/scale_vector_FLP.c
index 03345d519d..191b3d6041 100644
--- a/drivers/opus/silk/float/scale_vector_FLP.c
+++ b/drivers/opus/silk/float/scale_vector_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
+#include "opus/silk/float/SigProc_FLP.h"
/* multiply a vector by a constant */
void silk_scale_vector_FLP(
diff --git a/drivers/opus/silk/float/schur_FLP.c b/drivers/opus/silk/float/schur_FLP.c
index 76b87f1304..631dbe093a 100644
--- a/drivers/opus/silk/float/schur_FLP.c
+++ b/drivers/opus/silk/float/schur_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FLP.h"
+#include "opus/silk/float/SigProc_FLP.h"
silk_float silk_schur_FLP( /* O returns residual energy */
silk_float refl_coef[], /* O reflection coefficients (length order) */
diff --git a/drivers/opus/silk/float/solve_LS_FLP.c b/drivers/opus/silk/float/solve_LS_FLP.c
index 9fd962b33d..b3757ce03f 100644
--- a/drivers/opus/silk/float/solve_LS_FLP.c
+++ b/drivers/opus/silk/float/solve_LS_FLP.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
-#include "tuning_parameters.h"
+#include "opus/silk/float/main_FLP.h"
+#include "opus/silk/tuning_parameters.h"
/**********************************************************************
* LDL Factorisation. Finds the upper triangular matrix L and the diagonal
diff --git a/drivers/opus/silk/float/sort_FLP.c b/drivers/opus/silk/float/sort_FLP.c
index 58ea485116..f2570503a5 100644
--- a/drivers/opus/silk/float/sort_FLP.c
+++ b/drivers/opus/silk/float/sort_FLP.c
@@ -25,16 +25,16 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/* Insertion sort (fast for already almost sorted arrays): */
/* Best case: O(n) for an already sorted array */
/* Worst case: O(n^2) for an inversely sorted array */
-#include "typedef.h"
-#include "SigProc_FLP.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/float/SigProc_FLP.h"
void silk_insertion_sort_decreasing_FLP(
silk_float *a, /* I/O Unsorted / Sorted vector */
diff --git a/drivers/opus/silk/float/structs_FLP.h b/drivers/opus/silk/float/structs_FLP.h
index 4082914d93..798aec2f43 100644
--- a/drivers/opus/silk/float/structs_FLP.h
+++ b/drivers/opus/silk/float/structs_FLP.h
@@ -28,9 +28,9 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_STRUCTS_FLP_H
#define SILK_STRUCTS_FLP_H
-#include "typedef.h"
-#include "silk_main.h"
-#include "structs.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/silk_main.h"
+#include "opus/silk/structs.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/float/warped_autocorrelation_FLP.c b/drivers/opus/silk/float/warped_autocorrelation_FLP.c
index 6075dfe8d3..092b998d93 100644
--- a/drivers/opus/silk/float/warped_autocorrelation_FLP.c
+++ b/drivers/opus/silk/float/warped_autocorrelation_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
/* Autocorrelations for a warped frequency axis */
void silk_warped_autocorrelation_FLP(
diff --git a/drivers/opus/silk/float/wrappers_FLP.c b/drivers/opus/silk/float/wrappers_FLP.c
index c4e34e5578..31586cf2a9 100644
--- a/drivers/opus/silk/float/wrappers_FLP.c
+++ b/drivers/opus/silk/float/wrappers_FLP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
/* Wrappers. Calls flp / fix code */
diff --git a/drivers/opus/silk/gain_quant.c b/drivers/opus/silk/gain_quant.c
index e9467198eb..e1d9b91126 100644
--- a/drivers/opus/silk/gain_quant.c
+++ b/drivers/opus/silk/gain_quant.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
#define OFFSET ( ( MIN_QGAIN_DB * 128 ) / 6 + 16 * 128 )
#define SCALE_Q16 ( ( 65536 * ( N_LEVELS_QGAIN - 1 ) ) / ( ( ( MAX_QGAIN_DB - MIN_QGAIN_DB ) * 128 ) / 6 ) )
diff --git a/drivers/opus/silk/init_decoder.c b/drivers/opus/silk/init_decoder.c
index 88c1ff7b43..43fa1f1c38 100644
--- a/drivers/opus/silk/init_decoder.c
+++ b/drivers/opus/silk/init_decoder.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/************************/
/* Init Decoder State */
diff --git a/drivers/opus/silk/init_encoder.c b/drivers/opus/silk/init_encoder.c
index baf97d49e7..9ba4524b73 100644
--- a/drivers/opus/silk/init_encoder.c
+++ b/drivers/opus/silk/init_encoder.c
@@ -25,16 +25,16 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
#ifdef OPUS_FIXED_POINT
-#include "main_FIX.h"
+#include "opus/silk/fixed/main_FIX.h"
#else
-#include "main_FLP.h"
+#include "opus/silk/float/main_FLP.h"
#endif
-#include "tuning_parameters.h"
-#include "cpu_support.h"
+#include "opus/silk/tuning_parameters.h"
+#include "opus/celt/cpu_support.h"
/*********************************/
/* Initialize Silk Encoder state */
diff --git a/drivers/opus/silk/inner_prod_aligned.c b/drivers/opus/silk/inner_prod_aligned.c
index d625001db7..86ecf463ad 100644
--- a/drivers/opus/silk/inner_prod_aligned.c
+++ b/drivers/opus/silk/inner_prod_aligned.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
opus_int32 silk_inner_prod_aligned_scale(
const opus_int16 *const inVec1, /* I input vector 1 */
diff --git a/drivers/opus/silk/interpolate.c b/drivers/opus/silk/interpolate.c
index d5df0feddb..26c44de493 100644
--- a/drivers/opus/silk/interpolate.c
+++ b/drivers/opus/silk/interpolate.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Interpolate two vectors */
void silk_interpolate(
diff --git a/drivers/opus/silk/lin2log.c b/drivers/opus/silk/lin2log.c
index 77bfc8c8ab..ea11f33dd0 100644
--- a/drivers/opus/silk/lin2log.c
+++ b/drivers/opus/silk/lin2log.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Approximation of 128 * log2() (very close inverse of silk_log2lin()) */
/* Convert input to a log scale */
opus_int32 silk_lin2log(
diff --git a/drivers/opus/silk/log2lin.c b/drivers/opus/silk/log2lin.c
index 0ed2a12efd..0a33ca48fb 100644
--- a/drivers/opus/silk/log2lin.c
+++ b/drivers/opus/silk/log2lin.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Approximation of 2^() (very close inverse of silk_lin2log()) */
/* Convert input to a linear scale */
diff --git a/drivers/opus/silk/macros.h b/drivers/opus/silk/macros.h
index 6cf2e93dbc..8986dc8f82 100644
--- a/drivers/opus/silk/macros.h
+++ b/drivers/opus/silk/macros.h
@@ -28,10 +28,10 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_MACROS_H
#define SILK_MACROS_H
-#include "opus_config.h"
+#include "opus/opus_config.h"
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
/* This is an OPUS_INLINE header file for general platform. */
@@ -77,7 +77,7 @@ POSSIBILITY OF SUCH DAMAGE.
(( (a) & ((b)^0x80000000) & 0x80000000) ? silk_int32_MIN : (a)-(b)) : \
((((a)^0x80000000) & (b) & 0x80000000) ? silk_int32_MAX : (a)-(b)) )
-#include "ecintrin.h"
+#include "opus/celt/ecintrin.h"
static OPUS_INLINE opus_int32 silk_CLZ16(opus_int16 in16)
{
diff --git a/drivers/opus/silk/pitch_est_defines.h b/drivers/opus/silk/pitch_est_defines.h
index e1e4b5d768..e2d9e517c4 100644
--- a/drivers/opus/silk/pitch_est_defines.h
+++ b/drivers/opus/silk/pitch_est_defines.h
@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_PE_DEFINES_H
#define SILK_PE_DEFINES_H
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/********************************************************/
/* Definitions for pitch estimator */
diff --git a/drivers/opus/silk/pitch_est_tables.c b/drivers/opus/silk/pitch_est_tables.c
index 97ddbab010..7555f5b04b 100644
--- a/drivers/opus/silk/pitch_est_tables.c
+++ b/drivers/opus/silk/pitch_est_tables.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "typedef.h"
-#include "pitch_est_defines.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/pitch_est_defines.h"
const opus_int8 silk_CB_lags_stage2_10_ms[ PE_MAX_NB_SUBFR >> 1][ PE_NB_CBKS_STAGE2_10MS ] =
{
diff --git a/drivers/opus/silk/process_NLSFs.c b/drivers/opus/silk/process_NLSFs.c
index 0193fda1f1..9e6ebf827c 100644
--- a/drivers/opus/silk/process_NLSFs.c
+++ b/drivers/opus/silk/process_NLSFs.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Limit, stabilize, convert and quantize NLSFs */
void silk_process_NLSFs(
diff --git a/drivers/opus/silk/quant_LTP_gains.c b/drivers/opus/silk/quant_LTP_gains.c
index 34bcd3acdb..f6fff470f4 100644
--- a/drivers/opus/silk/quant_LTP_gains.c
+++ b/drivers/opus/silk/quant_LTP_gains.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "tuning_parameters.h"
+#include "opus/silk/silk_main.h"
+#include "opus/silk/tuning_parameters.h"
void silk_quant_LTP_gains(
opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (un)quantized LTP gains */
diff --git a/drivers/opus/silk/resampler.c b/drivers/opus/silk/resampler.c
index 14b185c45e..dde8fcddb1 100644
--- a/drivers/opus/silk/resampler.c
+++ b/drivers/opus/silk/resampler.c
@@ -25,8 +25,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/*
@@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE.
* AF -> AR2 filter followed by FIR interpolation
*/
-#include "resampler_private.h"
+#include "opus/silk/resampler_private.h"
/* Tables with delay compensation values to equalize total delay for different modes */
static const opus_int8 delay_matrix_enc[ 5 ][ 3 ] = {
diff --git a/drivers/opus/silk/resampler_down2.c b/drivers/opus/silk/resampler_down2.c
index 5c4b27759a..dbc962c5ef 100644
--- a/drivers/opus/silk/resampler_down2.c
+++ b/drivers/opus/silk/resampler_down2.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "resampler_rom.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/resampler_rom.h"
/* Downsample by a factor 2 */
void silk_resampler_down2(
diff --git a/drivers/opus/silk/resampler_down2_3.c b/drivers/opus/silk/resampler_down2_3.c
index 2733072fe6..6ff32ff336 100644
--- a/drivers/opus/silk/resampler_down2_3.c
+++ b/drivers/opus/silk/resampler_down2_3.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "resampler_private.h"
-#include "stack_alloc.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/resampler_private.h"
+#include "opus/celt/stack_alloc.h"
#define ORDER_FIR 4
diff --git a/drivers/opus/silk/resampler_private.h b/drivers/opus/silk/resampler_private.h
index 422a7d9d95..5c0ee110fc 100644
--- a/drivers/opus/silk/resampler_private.h
+++ b/drivers/opus/silk/resampler_private.h
@@ -32,9 +32,9 @@ POSSIBILITY OF SUCH DAMAGE.
extern "C" {
#endif
-#include "SigProc_FIX.h"
-#include "resampler_structs.h"
-#include "resampler_rom.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/resampler_structs.h"
+#include "opus/silk/resampler_rom.h"
/* Number of input samples to process in the inner loop */
#define RESAMPLER_MAX_BATCH_SIZE_MS 10
diff --git a/drivers/opus/silk/resampler_private_AR2.c b/drivers/opus/silk/resampler_private_AR2.c
index 84157d17ba..e04319da4d 100644
--- a/drivers/opus/silk/resampler_private_AR2.c
+++ b/drivers/opus/silk/resampler_private_AR2.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "resampler_private.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/resampler_private.h"
/* Second order AR filter with single delay elements */
void silk_resampler_private_AR2(
diff --git a/drivers/opus/silk/resampler_private_IIR_FIR.c b/drivers/opus/silk/resampler_private_IIR_FIR.c
index f45c3e7413..1d71ebd891 100644
--- a/drivers/opus/silk/resampler_private_IIR_FIR.c
+++ b/drivers/opus/silk/resampler_private_IIR_FIR.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "resampler_private.h"
-#include "stack_alloc.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/resampler_private.h"
+#include "opus/celt/stack_alloc.h"
static OPUS_INLINE opus_int16 *silk_resampler_private_IIR_FIR_INTERPOL(
opus_int16 *out,
diff --git a/drivers/opus/silk/resampler_private_down_FIR.c b/drivers/opus/silk/resampler_private_down_FIR.c
index f4de303546..739c91db29 100644
--- a/drivers/opus/silk/resampler_private_down_FIR.c
+++ b/drivers/opus/silk/resampler_private_down_FIR.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "resampler_private.h"
-#include "stack_alloc.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/resampler_private.h"
+#include "opus/celt/stack_alloc.h"
static OPUS_INLINE opus_int16 *silk_resampler_private_down_FIR_INTERPOL(
opus_int16 *out,
diff --git a/drivers/opus/silk/resampler_private_up2_HQ.c b/drivers/opus/silk/resampler_private_up2_HQ.c
index 39f4818454..a2b6ad432e 100644
--- a/drivers/opus/silk/resampler_private_up2_HQ.c
+++ b/drivers/opus/silk/resampler_private_up2_HQ.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
-#include "resampler_private.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/resampler_private.h"
/* Upsample by a factor 2, high quality */
/* Uses 2nd order allpass filters for the 2x upsampling, followed by a */
diff --git a/drivers/opus/silk/resampler_rom.c b/drivers/opus/silk/resampler_rom.c
index 0098e18ba8..d564087051 100644
--- a/drivers/opus/silk/resampler_rom.c
+++ b/drivers/opus/silk/resampler_rom.c
@@ -25,14 +25,14 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/* Filter coefficients for IIR/FIR polyphase resampling *
* Total size: 179 Words (358 Bytes) */
-#include "resampler_private.h"
+#include "opus/silk/resampler_private.h"
/* Matlab code for the notch filter coefficients: */
/* B = [1, 0.147, 1]; A = [1, 0.107, 0.89]; G = 0.93; freqz(G * B, A, 2^14, 16e3); axis([0, 8000, -10, 1]) */
diff --git a/drivers/opus/silk/resampler_rom.h b/drivers/opus/silk/resampler_rom.h
index 490b3388dc..2fa586ebf2 100644
--- a/drivers/opus/silk/resampler_rom.h
+++ b/drivers/opus/silk/resampler_rom.h
@@ -33,8 +33,8 @@ extern "C"
{
#endif
-#include "typedef.h"
-#include "resampler_structs.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/resampler_structs.h"
#define RESAMPLER_DOWN_ORDER_FIR0 18
#define RESAMPLER_DOWN_ORDER_FIR1 24
diff --git a/drivers/opus/silk/shell_coder.c b/drivers/opus/silk/shell_coder.c
index 79e392bd98..cd18ed638b 100644
--- a/drivers/opus/silk/shell_coder.c
+++ b/drivers/opus/silk/shell_coder.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* shell coder; pulse-subframe length is hardcoded */
diff --git a/drivers/opus/silk/sigm_Q15.c b/drivers/opus/silk/sigm_Q15.c
index 2df5b9695c..4c78250472 100644
--- a/drivers/opus/silk/sigm_Q15.c
+++ b/drivers/opus/silk/sigm_Q15.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/* Approximate sigmoid function */
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* fprintf(1, '%d, ', round(1024 * ([1 ./ (1 + exp(-(1:5))), 1] - 1 ./ (1 + exp(-(0:5)))))); */
static const opus_int32 sigm_LUT_slope_Q10[ 6 ] = {
diff --git a/drivers/opus/silk/silk_main.h b/drivers/opus/silk/silk_main.h
index 2bdf89784d..14671dcf72 100644
--- a/drivers/opus/silk/silk_main.h
+++ b/drivers/opus/silk/silk_main.h
@@ -28,15 +28,15 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_MAIN_H
#define SILK_MAIN_H
-#include "SigProc_FIX.h"
-#include "define.h"
-#include "structs.h"
-#include "tables.h"
-#include "PLC.h"
-#include "control.h"
-#include "debug.h"
-#include "entenc.h"
-#include "entdec.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/define.h"
+#include "opus/silk/structs.h"
+#include "opus/silk/tables.h"
+#include "opus/silk/PLC.h"
+#include "opus/silk/control.h"
+#include "opus/silk/debug.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
/* Convert Left/Right stereo signal to adaptive Mid/Side representation */
void silk_stereo_LR_to_MS(
diff --git a/drivers/opus/silk/sort.c b/drivers/opus/silk/sort.c
index 5e9ba08616..495292ad51 100644
--- a/drivers/opus/silk/sort.c
+++ b/drivers/opus/silk/sort.c
@@ -25,8 +25,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
/* Insertion sort (fast for already almost sorted arrays): */
@@ -35,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
/* */
/* Shell short: http://en.wikipedia.org/wiki/Shell_sort */
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
void silk_insertion_sort_increasing(
opus_int32 *a, /* I/O Unsorted / Sorted vector */
diff --git a/drivers/opus/silk/stereo_LR_to_MS.c b/drivers/opus/silk/stereo_LR_to_MS.c
index 678f46984b..e17a36046e 100644
--- a/drivers/opus/silk/stereo_LR_to_MS.c
+++ b/drivers/opus/silk/stereo_LR_to_MS.c
@@ -25,12 +25,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
-#include "stack_alloc.h"
+#include "opus/silk/silk_main.h"
+#include "opus/celt/stack_alloc.h"
/* Convert Left/Right stereo signal to adaptive Mid/Side representation */
void silk_stereo_LR_to_MS(
diff --git a/drivers/opus/silk/stereo_MS_to_LR.c b/drivers/opus/silk/stereo_MS_to_LR.c
index 34f43cf795..dddb62c788 100644
--- a/drivers/opus/silk/stereo_MS_to_LR.c
+++ b/drivers/opus/silk/stereo_MS_to_LR.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Convert adaptive Mid/Side representation to Left/Right stereo signal */
void silk_stereo_MS_to_LR(
diff --git a/drivers/opus/silk/stereo_decode_pred.c b/drivers/opus/silk/stereo_decode_pred.c
index 56d94e56fe..d54faf137e 100644
--- a/drivers/opus/silk/stereo_decode_pred.c
+++ b/drivers/opus/silk/stereo_decode_pred.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Decode mid/side predictors */
void silk_stereo_decode_pred(
diff --git a/drivers/opus/silk/stereo_encode_pred.c b/drivers/opus/silk/stereo_encode_pred.c
index bfe75b08e4..d68922cf01 100644
--- a/drivers/opus/silk/stereo_encode_pred.c
+++ b/drivers/opus/silk/stereo_encode_pred.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Entropy code the mid/side quantization indices */
void silk_stereo_encode_pred(
diff --git a/drivers/opus/silk/stereo_find_predictor.c b/drivers/opus/silk/stereo_find_predictor.c
index 266293dff3..1f529b28d0 100644
--- a/drivers/opus/silk/stereo_find_predictor.c
+++ b/drivers/opus/silk/stereo_find_predictor.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Find least-squares prediction gain for one signal based on another and quantize it */
opus_int32 silk_stereo_find_predictor( /* O Returns predictor in Q13 */
diff --git a/drivers/opus/silk/stereo_quant_pred.c b/drivers/opus/silk/stereo_quant_pred.c
index 834020d715..3a4d9b31da 100644
--- a/drivers/opus/silk/stereo_quant_pred.c
+++ b/drivers/opus/silk/stereo_quant_pred.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "silk_main.h"
+#include "opus/silk/silk_main.h"
/* Quantize mid/side predictors */
void silk_stereo_quant_pred(
diff --git a/drivers/opus/silk/structs.h b/drivers/opus/silk/structs.h
index 1826b36a80..c8c5dae844 100644
--- a/drivers/opus/silk/structs.h
+++ b/drivers/opus/silk/structs.h
@@ -28,11 +28,11 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_STRUCTS_H
#define SILK_STRUCTS_H
-#include "typedef.h"
-#include "SigProc_FIX.h"
-#include "define.h"
-#include "entenc.h"
-#include "entdec.h"
+#include "opus/silk/typedef.h"
+#include "opus/silk/SigProc_FIX.h"
+#include "opus/silk/define.h"
+#include "opus/celt/entenc.h"
+#include "opus/celt/entdec.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/sum_sqr_shift.c b/drivers/opus/silk/sum_sqr_shift.c
index 8ec27f8a03..7e2a97b530 100644
--- a/drivers/opus/silk/sum_sqr_shift.c
+++ b/drivers/opus/silk/sum_sqr_shift.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "SigProc_FIX.h"
+#include "opus/silk/SigProc_FIX.h"
/* Compute number of bits to right shift the sum of squares of a vector */
/* of int16s to make it fit in an int32 */
diff --git a/drivers/opus/silk/table_LSF_cos.c b/drivers/opus/silk/table_LSF_cos.c
index 674b6a03e6..818a532c28 100644
--- a/drivers/opus/silk/table_LSF_cos.c
+++ b/drivers/opus/silk/table_LSF_cos.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "tables.h"
+#include "opus/silk/tables.h"
/* Cosine approximation table for LSF conversion */
/* Q12 values (even) */
diff --git a/drivers/opus/silk/tables.h b/drivers/opus/silk/tables.h
index a91431e854..0dc7c37545 100644
--- a/drivers/opus/silk/tables.h
+++ b/drivers/opus/silk/tables.h
@@ -28,8 +28,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_TABLES_H
#define SILK_TABLES_H
-#include "define.h"
-#include "structs.h"
+#include "opus/silk/define.h"
+#include "opus/silk/structs.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/tables_LTP.c b/drivers/opus/silk/tables_LTP.c
index 56b672db8b..6a05698252 100644
--- a/drivers/opus/silk/tables_LTP.c
+++ b/drivers/opus/silk/tables_LTP.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "tables.h"
+#include "opus/silk/tables.h"
const opus_uint8 silk_LTP_per_index_iCDF[3] = {
179, 99, 0
diff --git a/drivers/opus/silk/tables_NLSF_CB_NB_MB.c b/drivers/opus/silk/tables_NLSF_CB_NB_MB.c
index ded35eee74..66c2fd4036 100644
--- a/drivers/opus/silk/tables_NLSF_CB_NB_MB.c
+++ b/drivers/opus/silk/tables_NLSF_CB_NB_MB.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "tables.h"
+#include "opus/silk/tables.h"
static const opus_uint8 silk_NLSF_CB1_NB_MB_Q8[ 320 ] = {
12, 35, 60, 83, 108, 132, 157, 180,
diff --git a/drivers/opus/silk/tables_NLSF_CB_WB.c b/drivers/opus/silk/tables_NLSF_CB_WB.c
index d83567ea6f..366f1bc887 100644
--- a/drivers/opus/silk/tables_NLSF_CB_WB.c
+++ b/drivers/opus/silk/tables_NLSF_CB_WB.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "tables.h"
+#include "opus/silk/tables.h"
static const opus_uint8 silk_NLSF_CB1_WB_Q8[ 512 ] = {
7, 23, 38, 54, 69, 85, 100, 116,
diff --git a/drivers/opus/silk/tables_gain.c b/drivers/opus/silk/tables_gain.c
index 6df980616b..efb5b899b8 100644
--- a/drivers/opus/silk/tables_gain.c
+++ b/drivers/opus/silk/tables_gain.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "tables.h"
+#include "opus/silk/tables.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/tables_other.c b/drivers/opus/silk/tables_other.c
index 246e960fa4..5e588fbf0c 100644
--- a/drivers/opus/silk/tables_other.c
+++ b/drivers/opus/silk/tables_other.c
@@ -25,13 +25,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "structs.h"
-#include "define.h"
-#include "tables.h"
+#include "opus/silk/structs.h"
+#include "opus/silk/define.h"
+#include "opus/silk/tables.h"
#ifdef __cplusplus
extern "C"
diff --git a/drivers/opus/silk/tables_pitch_lag.c b/drivers/opus/silk/tables_pitch_lag.c
index 0af5c5ace7..e1c4617d0a 100644
--- a/drivers/opus/silk/tables_pitch_lag.c
+++ b/drivers/opus/silk/tables_pitch_lag.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "tables.h"
+#include "opus/silk/tables.h"
const opus_uint8 silk_pitch_lag_iCDF[ 2 * ( PITCH_EST_MAX_LAG_MS - PITCH_EST_MIN_LAG_MS ) ] = {
253, 250, 244, 233, 212, 182, 150, 131,
diff --git a/drivers/opus/silk/tables_pulses_per_block.c b/drivers/opus/silk/tables_pulses_per_block.c
index 05ba2318f8..a1e2fb03d8 100644
--- a/drivers/opus/silk/tables_pulses_per_block.c
+++ b/drivers/opus/silk/tables_pulses_per_block.c
@@ -25,11 +25,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "tables.h"
+#include "opus/silk/tables.h"
const opus_uint8 silk_max_pulses_table[ 4 ] = {
8, 10, 12, 16
diff --git a/drivers/opus/silk/typedef.h b/drivers/opus/silk/typedef.h
index ca2361bc82..3e193b4a45 100644
--- a/drivers/opus/silk/typedef.h
+++ b/drivers/opus/silk/typedef.h
@@ -28,8 +28,8 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef SILK_TYPEDEF_H
#define SILK_TYPEDEF_H
-#include "opus_types.h"
-#include "opus_defines.h"
+#include "opus/opus_types.h"
+#include "opus/opus_defines.h"
#ifndef OPUS_FIXED_POINT
# include <float.h>
diff --git a/drivers/opus/stream.c b/drivers/opus/stream.c
index 17293f2bca..8dd23e88e7 100644
--- a/drivers/opus/stream.c
+++ b/drivers/opus/stream.c
@@ -14,11 +14,11 @@
last mod: $Id: vorbisfile.c 17573 2010-10-27 14:53:59Z xiphmont $
********************************************************************/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "internal.h"
+#include "opus/internal.h"
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/drivers/opus/wincerts.c b/drivers/opus/wincerts.c
index 568a085e43..2a04eab6d1 100644
--- a/drivers/opus/wincerts.c
+++ b/drivers/opus/wincerts.c
@@ -16,11 +16,11 @@
[1] <http://rt.openssl.org/Ticket/Display.html?id=2158>*/
-#ifdef OPUS_HAVE_CONFIG_H
-#include "opus_config.h"
+#ifdef OPUS_ENABLED
+#include "opus/opus_config.h"
#endif
-#include "internal.h"
+#include "opus/internal.h"
#if defined(OP_ENABLE_HTTP)&&defined(_WIN32)
/*You must include windows.h before wincrypt.h and x509.h.*/
# define WIN32_LEAN_AND_MEAN
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp
index 76e0c03c46..581efb5adc 100644
--- a/drivers/png/resource_saver_png.cpp
+++ b/drivers/png/resource_saver_png.cpp
@@ -214,6 +214,7 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) {
memdelete(f);
/* cleanup heap allocation */
+ png_destroy_write_struct(&png_ptr, &info_ptr);
return OK;
}
diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp
index c4ab54d102..11c4e7dd29 100644
--- a/drivers/register_driver_types.cpp
+++ b/drivers/register_driver_types.cpp
@@ -54,10 +54,6 @@
#include "theora/video_stream_theora.h"
#endif
-#ifdef THEORAPLAYER_ENABLED
-#include "theoraplayer/video_stream_theoraplayer.h"
-#endif
-
#include "drivers/nrex/regex.h"
@@ -108,10 +104,6 @@ static ResourceFormatLoaderAudioStreamSpeex *speex_stream_loader=NULL;
static ResourceFormatLoaderVideoStreamTheora* theora_stream_loader = NULL;
#endif
-#ifdef THEORAPLAYER_ENABLED
-static ResourceFormatLoaderVideoStreamTheoraplayer* theoraplayer_stream_loader = NULL;
-#endif
-
#ifdef MUSEPACK_ENABLED
static ResourceFormatLoaderAudioStreamMPC * mpc_stream_loader=NULL;
#endif
@@ -233,12 +225,6 @@ void register_driver_types() {
ObjectTypeDB::register_type<VideoStreamTheora>();
#endif
-#ifdef THEORAPLAYER_ENABLED
- theoraplayer_stream_loader = memnew( ResourceFormatLoaderVideoStreamTheoraplayer );
- ResourceLoader::add_resource_format_loader(theoraplayer_stream_loader);
- ObjectTypeDB::register_type<VideoStreamTheoraplayer>();
-#endif
-
#ifdef TOOLS_ENABLED
#ifdef SQUISH_ENABLED
@@ -277,9 +263,6 @@ void unregister_driver_types() {
memdelete (theora_stream_loader);
#endif
-#ifdef THEORAPLAYER_ENABLED
- memdelete (theoraplayer_stream_loader);
-#endif
#ifdef MUSEPACK_ENABLED
diff --git a/drivers/theora/SCsub b/drivers/theora/SCsub
index faa1ede6a7..fa85b49804 100644
--- a/drivers/theora/SCsub
+++ b/drivers/theora/SCsub
@@ -31,5 +31,37 @@ sources = [
"theora/video_stream_theora.cpp",
]
-if env['use_theoraplayer_binary'] != "yes":
- env.drivers_sources += sources
+sources_x86 = [
+ "theora/x86/mmxencfrag.c",
+ "theora/x86/mmxfdct.c",
+ "theora/x86/mmxfrag.c",
+ "theora/x86/mmxidct.c",
+ "theora/x86/mmxstate.c",
+ "theora/x86/sse2fdct.c",
+ "theora/x86/x86enc.c",
+ "theora/x86/x86state.c",
+]
+
+sources_x86_vc = [
+ "theora/x86_vc/mmxencfrag.c",
+ "theora/x86_vc/mmxfdct.c",
+ "theora/x86_vc/mmxfrag.c",
+ "theora/x86_vc/mmxidct.c",
+ "theora/x86_vc/mmxstate.c",
+ "theora/x86_vc/x86enc.c",
+ "theora/x86_vc/x86state.c",
+]
+
+env.drivers_sources += sources
+
+if (env["x86_opt_gcc"]):
+ env.Append(CCFLAGS=["-DOC_X86_ASM"])
+ env.drivers_sources += sources_x86
+
+if (env["x86_opt_vc"]):
+ env.Append(CCFLAGS=["-DOC_X86_ASM"])
+ env.drivers_sources += sources_x86_vc
+
+
+
+
diff --git a/drivers/theora/encint.h b/drivers/theora/encint.h
index 97897d5a04..82338256dc 100644
--- a/drivers/theora/encint.h
+++ b/drivers/theora/encint.h
@@ -14,6 +14,7 @@
last mod: $Id: encint.h 16503 2009-08-22 18:14:02Z giles $
********************************************************************/
+
#if !defined(_encint_H)
# define _encint_H (1)
# if defined(HAVE_CONFIG_H)
diff --git a/drivers/theora/video_stream_theora.cpp b/drivers/theora/video_stream_theora.cpp
index ed2565177a..f301bd7515 100644
--- a/drivers/theora/video_stream_theora.cpp
+++ b/drivers/theora/video_stream_theora.cpp
@@ -441,8 +441,10 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
//print_line("play "+rtos(p_delta));
time+=p_delta;
- if (videobuf_time>get_time())
+ if (videobuf_time>get_time()) {
+
return; //no new frames need to be produced
+ }
bool frame_done=false;
bool audio_done=false;
@@ -541,7 +543,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
if(ogg_stream_packetout(&to,&op)>0){
- if(pp_inc){
+ if(false && pp_inc){
pp_level+=pp_inc;
th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,
sizeof(pp_level));
@@ -569,16 +571,20 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
keyframing. Soon enough libtheora will be able to deal
with non-keyframe seeks. */
- if(videobuf_time>=get_time())
+ if(videobuf_time>=get_time()) {
frame_done=true;
- else{
+ print_line("frame!");
+ } else{
/*If we are too slow, reduce the pp level.*/
pp_inc=pp_level>0?-1:0;
+ print_line("skip!");
}
}
- } else
+ } else {
+ print_line("no packet..");
break;
+ }
}
if (file && /*!videobuf_ready && */ file->eof_reached()) {
diff --git a/drivers/vorbis/SCsub b/drivers/vorbis/SCsub
index 4a16e80dfc..87805cc2d8 100644
--- a/drivers/vorbis/SCsub
+++ b/drivers/vorbis/SCsub
@@ -33,6 +33,4 @@ sources_lib = [
]
env.drivers_sources += sources
-
-if env['theora'] != "yes" or env['use_theoraplayer_binary'] != "yes":
- env.drivers_sources += sources_lib
+env.drivers_sources += sources_lib
diff --git a/main/main.cpp b/main/main.cpp
index b6bc10cee7..a060dbd232 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -432,7 +432,6 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
} else if (I->get()=="-e" || I->get()=="-editor") { // fonud editor
editor=true;
- init_maximized=true;
} else if (I->get()=="-nowindow") { // fullscreen
OS::get_singleton()->set_no_window_mode(true);
@@ -649,6 +648,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
if (editor) {
main_args.push_back("-editor");
+ init_maximized=true;
use_custom_res=false;
}
@@ -870,21 +870,14 @@ Error Main::setup2() {
String boot_logo_path=GLOBAL_DEF("application/boot_splash",String());
bool boot_logo_scale=GLOBAL_DEF("application/boot_splash_fullsize",true);
Globals::get_singleton()->set_custom_property_info("application/boot_splash",PropertyInfo(Variant::STRING,"application/boot_splash",PROPERTY_HINT_FILE,"*.png"));
- print_line("BOOT SPLASH: "+boot_logo_path);
Image boot_logo;
boot_logo_path = boot_logo_path.strip_edges();
- print_line("BOOT SPLASH IS : "+boot_logo_path);
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!=OK) {
- print_line("ËRROR LOADING BOOT LOGO SPLASH :"+boot_logo_path);
- } else {
- print_line("BOOT SPLASH OK!");
-
- }
}
if (!boot_logo.empty()) {
@@ -901,7 +894,7 @@ Error Main::setup2() {
} else {
#ifndef NO_DEFAULT_BOOT_LOGO
- MAIN_PRINT("Main: Create botsplash");
+ MAIN_PRINT("Main: Create bootsplash");
Image splash(boot_splash_png);
MAIN_PRINT("Main: ClearColor");
@@ -944,10 +937,10 @@ Error Main::setup2() {
if (String(Globals::get_singleton()->get("display/custom_mouse_cursor"))!=String()) {
- print_line("use custom cursor");
+ //print_line("use custom cursor");
Ref<Texture> cursor=ResourceLoader::load(Globals::get_singleton()->get("display/custom_mouse_cursor"));
if (cursor.is_valid()) {
- print_line("loaded ok");
+ // print_line("loaded ok");
Vector2 hotspot = Globals::get_singleton()->get("display/custom_mouse_cursor_hotspot");
Input::get_singleton()->set_custom_mouse_cursor(cursor,hotspot);
}
@@ -1093,7 +1086,18 @@ bool Main::start() {
#endif
- if(script=="" && game_path=="" && !editor && String(GLOBAL_DEF("application/main_scene",""))!="") {
+ if (_export_platform!="") {
+ if (game_path=="") {
+ String err="Command line param ";
+ err+=export_debug?"-export_debug":"-export";
+ err+=" passed but no destination path given.\n";
+ err+="Please specify the binary's file path to export to. Aborting export.";
+ ERR_PRINT(err.utf8().get_data());
+ return false;
+ }
+ }
+
+ if(script=="" && game_path=="" && String(GLOBAL_DEF("application/main_scene",""))!="") {
game_path=GLOBAL_DEF("application/main_scene","");
}
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index 0d986e92a2..381edcba50 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -1291,6 +1291,15 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl
const GDParser::BlockNode *block=context.block;
+ if (context.function) {
+
+ const GDParser::FunctionNode* f = context.function;
+
+ for (int i=0;i<f->arguments.size();i++) {
+ result.insert(f->arguments[i].operator String());
+ }
+ }
+
while(block) {
GDCompletionContext c = context;
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 202ab76da0..c55bfee591 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -65,8 +65,10 @@ bool GDParser::_enter_indent_block(BlockNode* p_block) {
if (tokenizer->get_token()!=GDTokenizer::TK_COLON) {
-
- _set_error("':' expected at end of line.");
+ // report location at the previous token (on the previous line)
+ int error_line = tokenizer->get_token_line(-1);
+ int error_column = tokenizer->get_token_column(-1);
+ _set_error("':' expected at end of line.",error_line,error_column);
return false;
}
tokenizer->advance();
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index 99ddc74bb4..8746f92c9e 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -1449,7 +1449,7 @@ Object *GDNativeClass::instance() {
-GDInstance* GDScript::_create_instance(const Variant** p_args,int p_argcount,Object *p_owner,bool p_isref) {
+GDInstance* GDScript::_create_instance(const Variant** p_args,int p_argcount,Object *p_owner,bool p_isref,Variant::CallError& r_error) {
/* STEP 1, CREATE */
@@ -1465,14 +1465,13 @@ GDInstance* GDScript::_create_instance(const Variant** p_args,int p_argcount,Obj
instances.insert(instance->owner);
- Variant::CallError err;
- initializer->call(instance,p_args,p_argcount,err);
+ initializer->call(instance,p_args,p_argcount,r_error);
- if (err.error!=Variant::CallError::CALL_OK) {
+ if (r_error.error!=Variant::CallError::CALL_OK) {
instance->script=Ref<GDScript>();
instance->owner->set_script_instance(NULL);
instances.erase(p_owner);
- ERR_FAIL_COND_V(err.error!=Variant::CallError::CALL_OK, NULL); //error consrtucting
+ ERR_FAIL_COND_V(r_error.error!=Variant::CallError::CALL_OK, NULL); //error constructing
}
//@TODO make thread safe
@@ -1505,7 +1504,7 @@ Variant GDScript::_new(const Variant** p_args,int p_argcount,Variant::CallError&
}
- GDInstance* instance = _create_instance(p_args,p_argcount,owner,r!=NULL);
+ GDInstance* instance = _create_instance(p_args,p_argcount,owner,r!=NULL,r_error);
if (!instance) {
if (ref.is_null()) {
memdelete(owner); //no owner, sorry
@@ -1637,7 +1636,8 @@ ScriptInstance* GDScript::instance_create(Object *p_this) {
}
}
- return _create_instance(NULL,0,p_this,p_this->cast_to<Reference>());
+ Variant::CallError unchecked_error;
+ return _create_instance(NULL,0,p_this,p_this->cast_to<Reference>(),unchecked_error);
}
bool GDScript::instance_has(const Object *p_this) const {
diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h
index 37ef47af6c..850ffec05f 100644
--- a/modules/gdscript/gd_script.h
+++ b/modules/gdscript/gd_script.h
@@ -286,7 +286,7 @@ friend class GDScriptLanguage;
String name;
- GDInstance* _create_instance(const Variant** p_args,int p_argcount,Object *p_owner,bool p_isref);
+ GDInstance* _create_instance(const Variant** p_args,int p_argcount,Object *p_owner,bool p_isref,Variant::CallError &r_error);
void _set_subclass_path(Ref<GDScript>& p_sc,const String& p_path);
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 9db5d02b48..66097a5149 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -98,6 +98,7 @@ def configure(env):
if env['android_arch']=='x86':
env['NDK_TARGET']=env['NDK_TARGET_X86']
+ env["x86_opt_gcc"]=True
if env['PLATFORM'] == 'win32':
import methods
@@ -210,7 +211,8 @@ def configure(env):
# env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT'])
if(env["opus"]=="yes"):
- env.Append(CFLAGS=["-DOPUS_ARM_OPT"])
+ if (env["android_arch"]=="armv6" or env["android_arch"]=="armv7"):
+ env.Append(CFLAGS=["-DOPUS_ARM_OPT"])
env.opus_fixed_point="yes"
if (env['android_stl']=='yes'):
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index 22cee0527e..f7cf5111f5 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -116,4 +116,4 @@ def configure(env):
env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
#env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } )
-
+ env["x86_opt_gcc"]=True
diff --git a/platform/windows/SCsub b/platform/windows/SCsub
index 1fa793e2de..f98c1b01ff 100644
--- a/platform/windows/SCsub
+++ b/platform/windows/SCsub
@@ -11,11 +11,11 @@ common_win=[
"stream_peer_winsock.cpp",
]
-env.RES('godot_res.rc')
-if env["is_mingw"]:
- common_win.append("godot_res.o")
-else:
- common_win.append("godot_res.res")
+restarget="godot_res"+env["OBJSUFFIX"]
+
+obj = env.RES(restarget,'godot_res.rc')
+
+common_win.append(obj)
env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX"])
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index fcde14030f..4ec4b054db 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -263,6 +263,7 @@ def configure(env):
env.Append(CCFLAGS=["/I"+DIRECTX_PATH+"/Include"])
env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x86"])
env['ENV'] = os.environ;
+ env["x86_opt_vc"]=True
else:
# Workaround for MinGW. See:
@@ -361,6 +362,7 @@ def configure(env):
env['AR'] = mingw_prefix+"ar"
env['RANLIB'] = mingw_prefix+"ranlib"
env['LD'] = mingw_prefix+"g++"
+ env["x86_opt_gcc"]=True
#env['CC'] = "winegcc"
#env['CXX'] = "wineg++"
diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp
index 29f21bf227..9cfd475091 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -327,7 +327,7 @@ EditorExportPlatformWindows::EditorExportPlatformWindows() {
icon128=true;
icon256=true;
product_name="$genname";
- company_name="Okam Studio";
+ company_name="Godot Engine";
file_description="Created With Godot Engine";
version_text="1.0";
OS::Date date = OS::get_singleton()->get_date();
diff --git a/platform/windows/godot_res.rc b/platform/windows/godot_res.rc
index 73f36e5e59..f77182f909 100644
--- a/platform/windows/godot_res.rc
+++ b/platform/windows/godot_res.rc
@@ -16,7 +16,7 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "CompanyName", "Okam Studio"
+ VALUE "CompanyName", "Godot Engine"
VALUE "FileDescription", _MKSTR(VERSION_NAME) " Editor (" _MKSTR(VERSION_STATUS) ")"
VALUE "FileVersion", _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) "."_MKSTR(VERSION_REVISION)
VALUE "ProductName", _MKSTR(VERSION_NAME)
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 9a52a7c92b..d996587864 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -118,6 +118,8 @@ def configure(env):
elif (env["target"]=="release_debug"):
env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED'])
+ if (env["debug_release"]=="yes"):
+ env.Append(CCFLAGS=['-g2'])
elif (env["target"]=="debug"):
@@ -180,3 +182,5 @@ def configure(env):
env.Append(CPPFLAGS=['-DNEW_WM_API'])
env.ParseConfig('pkg-config xinerama --cflags --libs')
+ env["x86_opt_gcc"]=True
+
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp
index 6c74bc3977..8cdf4dd039 100644
--- a/scene/gui/container.cpp
+++ b/scene/gui/container.cpp
@@ -52,6 +52,14 @@ void Container::add_child_notify(Node *p_child) {
}
+void Container::move_child_notify(Node *p_child) {
+
+ if (!p_child->cast_to<Control>())
+ return;
+
+ queue_sort();
+}
+
void Container::remove_child_notify(Node *p_child) {
diff --git a/scene/gui/container.h b/scene/gui/container.h
index ba9bf2d60f..04d5d6ab36 100644
--- a/scene/gui/container.h
+++ b/scene/gui/container.h
@@ -42,6 +42,7 @@ protected:
void queue_sort();
virtual void add_child_notify(Node *p_child);
+ virtual void move_child_notify(Node *p_child);
virtual void remove_child_notify(Node *p_child);
void _notification(int p_what);
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 0c0f924f52..efda8a66e1 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -308,7 +308,9 @@ void AcceptDialog::_bind_methods() {
ADD_SIGNAL( MethodInfo("confirmed") );
ADD_SIGNAL( MethodInfo("custom_action",PropertyInfo(Variant::STRING,"action")) );
-
+ ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"dialog/text",PROPERTY_HINT_MULTILINE_TEXT,"",PROPERTY_USAGE_DEFAULT_INTL),_SCS("set_text"),_SCS("get_text"));
+ ADD_PROPERTY( PropertyInfo(Variant::BOOL, "dialog/hide_on_ok"),_SCS("set_hide_on_ok"),_SCS("get_hide_on_ok") );
+
}
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 99663fb2e2..20f28ecf10 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -170,7 +170,14 @@ void PopupMenu::_activate_submenu(int over) {
Point2 p = get_global_pos();
Rect2 pr(p,get_size());
Ref<StyleBox> style = get_stylebox("panel");
- pm->set_pos(p+Point2(get_size().width,items[over]._ofs_cache-style->get_offset().y));
+
+ Point2 pos = p+Point2(get_size().width,items[over]._ofs_cache-style->get_offset().y);
+ Size2 size = pm->get_size();
+ // fix pos
+ if (pos.x+size.width > get_viewport_rect().size.width)
+ pos.x=p.x-size.width;
+
+ pm->set_pos(pos);
pm->popup();
PopupMenu *pum = pm->cast_to<PopupMenu>();
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index b98fec1bde..3b0425b223 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -1689,10 +1689,11 @@ void RichTextLabel::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_v_scroll"),&RichTextLabel::get_v_scroll);
+ ObjectTypeDB::bind_method(_MD("scroll_to_line"),&RichTextLabel::scroll_to_line);
+
ObjectTypeDB::bind_method(_MD("set_tab_size","spaces"),&RichTextLabel::set_tab_size);
ObjectTypeDB::bind_method(_MD("get_tab_size"),&RichTextLabel::get_tab_size);
-
ObjectTypeDB::bind_method(_MD("set_selection_enabled","enabled"),&RichTextLabel::set_selection_enabled);
ObjectTypeDB::bind_method(_MD("is_selection_enabled"),&RichTextLabel::is_selection_enabled);
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 5415484009..78792dc785 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1610,6 +1610,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
else
break;
}
+ if(auto_indent){
+ // indent once again if previous line will end with ':'
+ // (i.e. colon precedes current cursor position)
+ if(cursor.column>0 && text[cursor.line][cursor.column-1]==':') {
+ ins+="\t";
+ }
+ }
_insert_text_at_cursor(ins);
_push_current_op();
@@ -2869,6 +2876,10 @@ bool TextEdit::is_syntax_coloring_enabled() const {
return syntax_coloring;
}
+void TextEdit::set_auto_indent(bool p_auto_indent) {
+ auto_indent = p_auto_indent;
+}
+
void TextEdit::cut() {
if (!selection.active)
@@ -3836,7 +3847,7 @@ TextEdit::TextEdit() {
next_operation_is_complex=false;
auto_brace_completion_enabled=false;
brace_matching_enabled=false;
-
+ auto_indent=false;
}
TextEdit::~TextEdit()
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 059e15dcff..91369309cf 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -213,6 +213,7 @@ class TextEdit : public Control {
bool auto_brace_completion_enabled;
bool brace_matching_enabled;
+ bool auto_indent;
bool cut_copy_line;
uint64_t last_dblclk;
@@ -323,6 +324,7 @@ public:
brace_matching_enabled=p_enabled;
update();
}
+ void set_auto_indent(bool p_auto_indent);
void cursor_set_column(int p_col, bool p_adjust_viewport=true);
void cursor_set_line(int p_row, bool p_adjust_viewport=true);
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index 9b9c797ed9..d99da5e906 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -27,7 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "video_player.h"
-
+#include "os/os.h"
int VideoPlayer::InternalStream::get_channel_count() const {
@@ -130,7 +130,7 @@ void VideoPlayer::_notification(int p_notification) {
if (!playback->is_playing())
return;
- double audio_time = AudioServer::get_singleton()->get_mix_time();
+ double audio_time = OS::get_singleton()->get_ticks_usec()/1000000.0; //AudioServer::get_singleton()->get_mix_time();
double delta = last_audio_time==0?0:audio_time-last_audio_time;
last_audio_time=audio_time;
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index fe6b192d78..b3a9ab922e 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -231,6 +231,7 @@ static ResourceFormatLoaderTheme *resource_loader_theme=NULL;
static ResourceFormatLoaderShader *resource_loader_shader=NULL;
static ResourceFormatSaverText *resource_saver_text=NULL;
+static ResourceFormatLoaderText *resource_loader_text=NULL;
//static SceneStringNames *string_names;
@@ -619,6 +620,9 @@ void register_scene_types() {
resource_saver_text = memnew( ResourceFormatSaverText );
ResourceSaver::add_resource_format_saver(resource_saver_text);
+ resource_loader_text = memnew( ResourceFormatLoaderText );
+ ResourceLoader::add_resource_format_loader(resource_loader_text);
+
}
void unregister_scene_types() {
@@ -640,5 +644,8 @@ void unregister_scene_types() {
if (resource_saver_text) {
memdelete(resource_saver_text);
}
+ if (resource_loader_text) {
+ memdelete(resource_loader_text);
+ }
SceneStringNames::free();
}
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 896b4fb2fa..863f2be699 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -1280,15 +1280,18 @@ StringName SceneState::get_node_name(int p_idx) const {
Ref<PackedScene> SceneState::get_node_instance(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,nodes.size(),Ref<PackedScene>());
+
if (nodes[p_idx].instance>=0) {
return variants[nodes[p_idx].instance];
- } else if (nodes[p_idx].parent<=0 || nodes[p_idx].parent==NO_PARENT_SAVED) {
+ } else if (nodes[p_idx].parent<0 || nodes[p_idx].parent==NO_PARENT_SAVED) {
if (base_scene_idx>=0) {
return variants[base_scene_idx];
}
}
+
+
return Ref<PackedScene>();
@@ -1438,6 +1441,84 @@ Array SceneState::get_connection_binds(int p_idx) const {
Vector<NodePath> SceneState::get_editable_instances() const {
return editable_instances;
}
+//add
+
+int SceneState::add_name(const StringName& p_name) {
+
+ names.push_back(p_name);
+ return names.size()-1;
+}
+
+int SceneState::add_value(const Variant& p_value) {
+
+ variants.push_back(p_value);
+ return variants.size()-1;
+}
+
+int SceneState::add_node_path(const NodePath& p_path){
+
+ node_paths.push_back(p_path);
+ return (node_paths.size()-1)|FLAG_ID_IS_PATH;
+}
+int SceneState::add_node(int p_parent,int p_owner,int p_type,int p_name, int p_instance){
+
+ NodeData nd;
+ nd.parent=p_parent;
+ nd.owner=p_owner;
+ nd.type=p_type;
+ nd.name=p_name;
+ nd.instance=p_instance;
+
+ nodes.push_back(nd);
+
+ return nodes.size()-1;
+}
+void SceneState::add_node_property(int p_node,int p_name,int p_value){
+
+ ERR_FAIL_INDEX(p_node,nodes.size());
+ ERR_FAIL_INDEX(p_name,names.size());
+ ERR_FAIL_INDEX(p_value,variants.size());
+
+ NodeData::Property prop;
+ prop.name=p_name;
+ prop.value=p_value;
+ nodes[p_node].properties.push_back(prop);
+}
+void SceneState::add_node_group(int p_node,int p_group){
+
+ ERR_FAIL_INDEX(p_node,nodes.size());
+ ERR_FAIL_INDEX(p_group,names.size());
+ nodes[p_node].groups.push_back(p_group);
+
+}
+void SceneState::set_base_scene(int p_idx){
+
+ ERR_FAIL_INDEX(p_idx,variants.size());
+ base_scene_idx=p_idx;
+}
+void SceneState::add_connection(int p_from,int p_to, int p_signal, int p_method, int p_flags,const Vector<int>& p_binds){
+
+ ERR_FAIL_INDEX(p_signal,names.size());
+ ERR_FAIL_INDEX(p_method,names.size());
+
+ for(int i=0;i<p_binds.size();i++) {
+ ERR_FAIL_INDEX(p_binds[i],variants.size());
+ }
+ ConnectionData c;
+ c.from=p_from;
+ c.to=p_to;
+ c.signal=p_signal;
+ c.method=p_method;
+ c.flags=p_flags;
+ c.binds=p_binds;
+ connections.push_back(c);
+
+}
+void SceneState::add_editable_instance(const NodePath& p_path){
+
+ editable_instances.push_back(p_path);
+}
+
SceneState::SceneState() {
diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h
index 3956d2abe4..f3ec0afb6d 100644
--- a/scene/resources/packed_scene.h
+++ b/scene/resources/packed_scene.h
@@ -126,7 +126,7 @@ public:
Node *instance(bool p_gen_edit_state=false) const;
- //build-unbuild API
+ //unbuild API
int get_node_count() const;
StringName get_node_type(int p_idx) const;
@@ -150,6 +150,19 @@ public:
Vector<NodePath> get_editable_instances() const;
+ //build API
+
+ int add_name(const StringName& p_name);
+ int add_value(const Variant& p_value);
+ int add_node_path(const NodePath& p_path);
+ int add_node(int p_parent,int p_owner,int p_type,int p_name, int p_instance);
+ void add_node_property(int p_node,int p_name,int p_value);
+ void add_node_group(int p_node,int p_group);
+ void set_base_scene(int p_idx);
+ void add_connection(int p_from,int p_to, int p_signal, int p_method, int p_flags,const Vector<int>& p_binds);
+ void add_editable_instance(const NodePath& p_path);
+
+
SceneState();
};
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index 8403c06ad1..5f41dc2ce8 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -6,6 +6,1022 @@
#define FORMAT_VERSION 1
+#include "version.h"
+#include "os/dir_access.h"
+
+#define _printerr() ERR_PRINT(String(res_path+":"+itos(lines)+" - Parse Error: "+error_text).utf8().get_data());
+
+
+Error ResourceInteractiveLoaderText::parse_property(Variant& r_v, String &r_name) {
+
+ return OK;
+}
+
+
+
+
+///
+
+void ResourceInteractiveLoaderText::set_local_path(const String& p_local_path) {
+
+ res_path=p_local_path;
+}
+
+Ref<Resource> ResourceInteractiveLoaderText::get_resource() {
+
+ return resource;
+}
+
+Error ResourceInteractiveLoaderText::_parse_sub_resource(VariantParser::Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str) {
+
+ VariantParser::Token token;
+ VariantParser::get_token(p_stream,token,line,r_err_str);
+ if (token.type!=VariantParser::TK_NUMBER) {
+ r_err_str="Expected number (sub-resource index)";
+ return ERR_PARSE_ERROR;
+ }
+
+ int index = token.value;
+
+ String path = local_path+"::"+itos(index);
+
+ if (!ResourceCache::has(path)) {
+ r_err_str="Can't load cached sub-resource: "+path;
+ return ERR_PARSE_ERROR;
+ }
+
+ r_res=RES(ResourceCache::get(path));
+
+ VariantParser::get_token(p_stream,token,line,r_err_str);
+ if (token.type!=VariantParser::TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ return OK;
+}
+
+Error ResourceInteractiveLoaderText::_parse_ext_resource(VariantParser::Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str){
+
+ VariantParser::Token token;
+ VariantParser::get_token(p_stream,token,line,r_err_str);
+ if (token.type!=VariantParser::TK_NUMBER) {
+ r_err_str="Expected number (sub-resource index)";
+ return ERR_PARSE_ERROR;
+ }
+
+ int id = token.value;
+
+
+ if (!ext_resources.has(id)) {
+ r_err_str="Can't load cached ext-resource #"+itos(id);
+ return ERR_PARSE_ERROR;
+ }
+
+ String path = ext_resources[id].path;
+ String type = ext_resources[id].type;
+
+ if (path.find("://")==-1 && path.is_rel_path()) {
+ // path is relative to file being loaded, so convert to a resource path
+ path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
+
+ }
+
+ r_res=ResourceLoader::load(path,type);
+
+ if (r_res.is_null()) {
+ r_err_str="Couldn't load external resource: "+path;
+ return ERR_PARSE_ERROR;
+ }
+
+ VariantParser::get_token(p_stream,token,line,r_err_str);
+ if (token.type!=VariantParser::TK_PARENTHESIS_CLOSE) {
+ r_err_str="Expected ')'";
+ return ERR_PARSE_ERROR;
+ }
+
+
+ return OK;
+}
+
+
+Error ResourceInteractiveLoaderText::poll() {
+
+ if (error!=OK)
+ return error;
+
+ if (next_tag.name=="ext_resource") {
+
+
+ if (!next_tag.fields.has("path")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="Missing 'path' in external resource tag";
+ _printerr();
+ return error;
+ }
+
+ if (!next_tag.fields.has("type")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="Missing 'type' in external resource tag";
+ _printerr();
+ return error;
+ }
+
+ if (!next_tag.fields.has("id")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="Missing 'id' in external resource tag";
+ _printerr();
+ return error;
+ }
+
+ String path=next_tag.fields["path"];
+ String type=next_tag.fields["type"];
+ int index=next_tag.fields["id"];
+
+
+ if (path.find("://")==-1 && path.is_rel_path()) {
+ // path is relative to file being loaded, so convert to a resource path
+ path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
+ }
+
+ if (remaps.has(path)) {
+ path=remaps[path];
+ }
+
+ RES res = ResourceLoader::load(path,type);
+
+ if (res.is_null()) {
+
+ if (ResourceLoader::get_abort_on_missing_resources()) {
+ error=ERR_FILE_CORRUPT;
+ error_text="[ext_resource] referenced nonexistent resource at: "+path;
+ _printerr();
+ return error;
+ } else {
+ ResourceLoader::notify_dependency_error(local_path,path,type);
+ }
+ } else {
+
+ resource_cache.push_back(res);
+ }
+
+ ExtResource er;
+ er.path=path;
+ er.type=type;
+ ext_resources[index]=er;
+
+ error = VariantParser::parse_tag(&stream,lines,error_text,next_tag,&rp);
+
+ if (error) {
+ _printerr();
+ }
+
+ return error;
+
+
+ } else if (next_tag.name=="sub_resource") {
+
+
+ if (!next_tag.fields.has("type")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="Missing 'type' in external resource tag";
+ _printerr();
+ return error;
+ }
+
+ if (!next_tag.fields.has("id")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="Missing 'index' in external resource tag";
+ _printerr();
+ return error;
+ }
+
+ String type=next_tag.fields["type"];
+ int id=next_tag.fields["id"];
+
+ String path = local_path+"::"+itos(id);
+
+
+ //bool exists=ResourceCache::has(path);
+
+ Ref<Resource> res;
+
+ if ( !ResourceCache::has(path)) { //only if it doesn't exist
+
+ Object *obj = ObjectTypeDB::instance(type);
+ if (!obj) {
+
+ error_text+="Can't create sub resource of type: "+type;
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+
+ Resource *r = obj->cast_to<Resource>();
+ if (!r) {
+
+ error_text+="Can't create sub resource of type, because not a resource: "+type;
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+ res=Ref<Resource>(r);
+ resource_cache.push_back(res);
+ res->set_path(path);
+
+ }
+
+ while(true) {
+
+ String assign;
+ Variant value;
+
+ error = VariantParser::parse_tag_assign_eof(&stream,lines,error_text,next_tag,assign,value,&rp);
+
+ if (error) {
+ _printerr();
+ return error;
+ }
+
+ if (assign!=String()) {
+ if (res.is_valid()) {
+ res->set(assign,value);
+ }
+ //it's assignment
+ } else if (next_tag.name!=String()) {
+
+ error=OK;
+ break;
+ } else {
+ error=ERR_FILE_CORRUPT;
+ error_text="Premature end of file while parsing [sub_resource]";
+ _printerr();
+ return error;
+ }
+
+
+ }
+
+ return OK;
+
+ } else if (next_tag.name=="resource") {
+
+ if (is_scene) {
+
+ error_text+="found the 'resource' tag on a scene file!";
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+ Object *obj = ObjectTypeDB::instance(res_type);
+ if (!obj) {
+
+ error_text+="Can't create sub resource of type: "+res_type;
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+
+ Resource *r = obj->cast_to<Resource>();
+ if (!r) {
+
+ error_text+="Can't create sub resource of type, because not a resource: "+res_type;
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+ resource=Ref<Resource>(r);
+
+ while(true) {
+
+ String assign;
+ Variant value;
+
+ error = VariantParser::parse_tag_assign_eof(&stream,lines,error_text,next_tag,assign,value,&rp);
+
+ if (error) {
+ if (error!=ERR_FILE_EOF) {
+ _printerr();
+ }
+ return error;
+ }
+
+ if (assign!=String()) {
+ resource->set(assign,value);
+ //it's assignment
+ } else if (next_tag.name!=String()) {
+
+ error=ERR_FILE_CORRUPT;
+ error_text="Extra tag found when parsing main resource file";
+ _printerr();
+ return error;
+ } else {
+ error=ERR_FILE_EOF;
+ return error;
+ }
+
+ }
+
+ return OK;
+
+ } else if (next_tag.name=="node") {
+
+ if (!is_scene) {
+
+ error_text+="found the 'node' tag on a resource file!";
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+ /*
+ int add_name(const StringName& p_name);
+ int add_value(const Variant& p_value);
+ int add_node_path(const NodePath& p_path);
+ int add_node(int p_parent,int p_owner,int p_type,int p_name, int p_instance);
+ void add_node_property(int p_node,int p_name,int p_value);
+ void add_node_group(int p_node,int p_group);
+ void set_base_scene(int p_idx);
+ void add_connection(int p_from,int p_to, int p_signal, int p_method, int p_flags,const Vector<int>& p_binds);
+ void add_editable_instance(const NodePath& p_path);
+
+ */
+
+ int parent=-1;
+ int owner=-1;
+ int type=-1;
+ int name=-1;
+ int instance=-1;
+ int base_scene=-1;
+
+ if (next_tag.fields.has("name")) {
+ name=packed_scene->get_state()->add_name(next_tag.fields["name"]);
+ }
+
+ if (next_tag.fields.has("parent")) {
+ parent=packed_scene->get_state()->add_node_path(next_tag.fields["parent"]);
+ }
+
+ if (next_tag.fields.has("owner")) {
+ owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]);
+ } else {
+ if (parent!=-1)
+ owner=0; //if no owner, owner is root
+ }
+
+
+ if (next_tag.fields.has("type")) {
+ type=packed_scene->get_state()->add_name(next_tag.fields["type"]);
+ }
+
+ if (next_tag.fields.has("instance")) {
+
+ instance=packed_scene->get_state()->add_value(next_tag.fields["instance"]);
+
+ if (packed_scene->get_state()->get_node_count()==0 && parent==-1) {
+ packed_scene->get_state()->set_base_scene(instance);
+ instance=-1;
+ }
+ }
+
+ int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance);
+
+
+ while(true) {
+
+ String assign;
+ Variant value;
+
+ error = VariantParser::parse_tag_assign_eof(&stream,lines,error_text,next_tag,assign,value,&rp);
+
+ if (error) {
+ if (error!=ERR_FILE_EOF) {
+ _printerr();
+ } else {
+ resource=packed_scene;
+ }
+ return error;
+ }
+
+ if (assign!=String()) {
+ int nameidx = packed_scene->get_state()->add_name(assign);
+ int valueidx = packed_scene->get_state()->add_value(value);
+ packed_scene->get_state()->add_node_property(node_id,nameidx,valueidx);
+ //it's assignment
+ } else if (next_tag.name!=String()) {
+
+ error=OK;
+ return error;
+ } else {
+
+ resource=packed_scene;
+ error=ERR_FILE_EOF;
+ return error;
+ }
+
+ }
+
+ return OK;
+
+ } else if (next_tag.name=="connection") {
+
+ if (!is_scene) {
+
+ error_text+="found the 'connection' tag on a resource file!";
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+ if (!next_tag.fields.has("from")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="missing 'from' field fron connection tag";
+ return error;
+ }
+
+ if (!next_tag.fields.has("to")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="missing 'to' field fron connection tag";
+ return error;
+ }
+
+ if (!next_tag.fields.has("signal")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="missing 'signal' field fron connection tag";
+ return error;
+ }
+
+ if (!next_tag.fields.has("method")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="missing 'method' field fron connection tag";
+ return error;
+ }
+
+ NodePath from = next_tag.fields["from"];
+ NodePath to = next_tag.fields["to"];
+ StringName method = next_tag.fields["method"];
+ StringName signal = next_tag.fields["signal"];
+ int flags=CONNECT_PERSIST;
+ Array binds;
+
+ if (next_tag.fields.has("flags")) {
+ flags=next_tag.fields["flags"];
+ }
+
+ if (next_tag.fields.has("binds")) {
+ binds=next_tag.fields["binds"];
+ }
+
+ Vector<int> bind_ints;
+ for(int i=9;i<binds.size();i++) {
+ bind_ints.push_back( packed_scene->get_state()->add_value( bind_ints[i] ) );
+ }
+
+ packed_scene->get_state()->add_connection(
+ packed_scene->get_state()->add_node_path(from.simplified()),
+ packed_scene->get_state()->add_node_path(to.simplified()),
+ packed_scene->get_state()->add_name(signal),
+ packed_scene->get_state()->add_name(method),
+ flags,
+ bind_ints
+ );
+
+ error = VariantParser::parse_tag(&stream,lines,error_text,next_tag,&rp);
+
+ if (error) {
+ if (error!=ERR_FILE_EOF) {
+ _printerr();
+ } else {
+ resource=packed_scene;
+ }
+ }
+
+ return error;
+ } else if (next_tag.name=="editable") {
+
+ if (!is_scene) {
+
+ error_text+="found the 'editable' tag on a resource file!";
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+ if (!next_tag.fields.has("path")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="missing 'path' field fron connection tag";
+ _printerr();
+ return error;
+ }
+
+ NodePath path = next_tag.fields["path"];
+
+ packed_scene->get_state()->add_editable_instance(path.simplified());
+
+ error = VariantParser::parse_tag(&stream,lines,error_text,next_tag,&rp);
+
+ if (error) {
+ if (error!=ERR_FILE_EOF) {
+ _printerr();
+ } else {
+ resource=packed_scene;
+ }
+ }
+
+ return error;
+
+ } else {
+
+ error_text+="Unknown tag in file: "+next_tag.name;
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ return error;
+ }
+
+ return OK;
+}
+
+int ResourceInteractiveLoaderText::get_stage() const {
+
+ return resource_current;
+}
+int ResourceInteractiveLoaderText::get_stage_count() const {
+
+ return resources_total;//+ext_resources;
+}
+
+ResourceInteractiveLoaderText::~ResourceInteractiveLoaderText() {
+
+ memdelete(f);
+}
+
+void ResourceInteractiveLoaderText::get_dependencies(FileAccess *f,List<String> *p_dependencies,bool p_add_types) {
+
+
+ open(f);
+ ERR_FAIL_COND(error!=OK);
+
+ while(next_tag.name=="ext_resource") {
+
+ if (!next_tag.fields.has("type")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="Missing 'type' in external resource tag";
+ _printerr();
+ return;
+ }
+
+ if (!next_tag.fields.has("id")) {
+ error=ERR_FILE_CORRUPT;
+ error_text="Missing 'index' in external resource tag";
+ _printerr();
+ return;
+ }
+
+ String path=next_tag.fields["path"];
+ String type=next_tag.fields["type"];
+
+
+ if (path.find("://")==-1 && path.is_rel_path()) {
+ // path is relative to file being loaded, so convert to a resource path
+ path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
+ }
+
+
+ if (p_add_types) {
+ path+="::"+type;
+ }
+
+ p_dependencies->push_back(path);
+
+ Error err = VariantParser::parse_tag(&stream,lines,error_text,next_tag,&rp);
+
+ if (err) {
+ error_text="Unexpected end of file";
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ }
+
+
+ }
+}
+
+Error ResourceInteractiveLoaderText::rename_dependencies(FileAccess *p_f, const String &p_path,const Map<String,String>& p_map) {
+
+
+
+
+#if 0
+ open(p_f);
+ ERR_FAIL_COND_V(error!=OK,error);
+
+ //FileAccess
+
+ bool old_format=false;
+
+ FileAccess *fw = NULL;
+
+ String base_path=local_path.get_base_dir();
+
+ while(true) {
+ bool exit;
+ List<String> order;
+
+ Tag *tag = parse_tag(&exit,true,&order);
+
+ bool done=false;
+
+ if (!tag) {
+ if (fw) {
+ memdelete(fw);
+ }
+ error=ERR_FILE_CORRUPT;
+ ERR_FAIL_COND_V(!exit,error);
+ error=ERR_FILE_EOF;
+
+ return error;
+ }
+
+ if (tag->name=="ext_resource") {
+
+ if (!tag->args.has("index") || !tag->args.has("path") || !tag->args.has("type")) {
+ old_format=true;
+ break;
+ }
+
+ if (!fw) {
+
+ fw=FileAccess::open(p_path+".depren",FileAccess::WRITE);
+ fw->store_line("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); //no escape
+ fw->store_line("<resource_file type=\""+resource_type+"\" subresource_count=\""+itos(resources_total)+"\" version=\""+itos(VERSION_MAJOR)+"."+itos(VERSION_MINOR)+"\" version_name=\""+VERSION_FULL_NAME+"\">");
+
+ }
+
+ String path = tag->args["path"];
+ String index = tag->args["index"];
+ String type = tag->args["type"];
+
+
+ bool relative=false;
+ if (!path.begins_with("res://")) {
+ path=base_path.plus_file(path).simplify_path();
+ relative=true;
+ }
+
+
+ if (p_map.has(path)) {
+ String np=p_map[path];
+ path=np;
+ }
+
+ if (relative) {
+ //restore relative
+ path=base_path.path_to_file(path);
+ }
+
+ tag->args["path"]=path;
+ tag->args["index"]=index;
+ tag->args["type"]=type;
+
+ } else {
+
+ done=true;
+ }
+
+ String tagt="\t<";
+ if (exit)
+ tagt+="/";
+ tagt+=tag->name;
+
+ for(List<String>::Element *E=order.front();E;E=E->next()) {
+ tagt+=" "+E->get()+"=\""+tag->args[E->get()]+"\"";
+ }
+ tagt+=">";
+ fw->store_line(tagt);
+ if (done)
+ break;
+ close_tag("ext_resource");
+ fw->store_line("\t</ext_resource>");
+
+ }
+
+
+ if (old_format) {
+ if (fw)
+ memdelete(fw);
+
+ DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ da->remove(p_path+".depren");
+ memdelete(da);
+ //fuck it, use the old approach;
+
+ WARN_PRINT(("This file is old, so it can't refactor dependencies, opening and resaving: "+p_path).utf8().get_data());
+
+ Error err;
+ FileAccess *f2 = FileAccess::open(p_path,FileAccess::READ,&err);
+ if (err!=OK) {
+ ERR_FAIL_COND_V(err!=OK,ERR_FILE_CANT_OPEN);
+ }
+
+ Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
+ ria->local_path=Globals::get_singleton()->localize_path(p_path);
+ ria->res_path=ria->local_path;
+ ria->remaps=p_map;
+ // ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
+ ria->open(f2);
+
+ err = ria->poll();
+
+ while(err==OK) {
+ err=ria->poll();
+ }
+
+ ERR_FAIL_COND_V(err!=ERR_FILE_EOF,ERR_FILE_CORRUPT);
+ RES res = ria->get_resource();
+ ERR_FAIL_COND_V(!res.is_valid(),ERR_FILE_CORRUPT);
+
+ return ResourceFormatSaverText::singleton->save(p_path,res);
+ }
+
+ if (!fw) {
+
+ return OK; //nothing to rename, do nothing
+ }
+
+ uint8_t c=f->get_8();
+ while(!f->eof_reached()) {
+ fw->store_8(c);
+ c=f->get_8();
+ }
+
+ bool all_ok = fw->get_error()==OK;
+
+ memdelete(fw);
+
+ if (!all_ok) {
+ return ERR_CANT_CREATE;
+ }
+
+ DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ da->remove(p_path);
+ da->rename(p_path+".depren",p_path);
+ memdelete(da);
+#endif
+ return OK;
+
+}
+
+
+void ResourceInteractiveLoaderText::open(FileAccess *p_f) {
+
+ error=OK;
+
+ lines=1;
+ f=p_f;
+
+
+ stream.f=f;
+ is_scene=false;
+
+
+ VariantParser::Tag tag;
+ Error err = VariantParser::parse_tag(&stream,lines,error_text,tag);
+
+ if (err) {
+
+ error=err;
+ _printerr();
+ return;
+ }
+
+ if (tag.fields.has("format")) {
+ int fmt = tag.fields["format"];
+ if (fmt>FORMAT_VERSION) {
+ error_text="Saved with newer format version";
+ _printerr();
+ error=ERR_PARSE_ERROR;
+ return;
+ }
+ }
+
+
+ if (tag.name=="gd_scene") {
+ is_scene=true;
+ packed_scene.instance();
+
+ } else if (tag.name=="gd_resource") {
+ if (!tag.fields.has("type")) {
+ error_text="Missing 'type' field in 'gd_resource' tag";
+ _printerr();
+ error=ERR_PARSE_ERROR;
+ return;
+ }
+
+ res_type=tag.fields["type"];
+
+ } else {
+ error_text="Unrecognized file type: "+tag.name;
+ _printerr();
+ error=ERR_PARSE_ERROR;
+ return;
+
+ }
+
+
+
+ if (tag.fields.has("load_steps")) {
+ resources_total=tag.fields["load_steps"];
+ } else {
+ resources_total=0;
+ }
+
+
+ err = VariantParser::parse_tag(&stream,lines,error_text,next_tag,&rp);
+
+ if (err) {
+ error_text="Unexpected end of file";
+ _printerr();
+ error=ERR_FILE_CORRUPT;
+ }
+
+ rp.ext_func=_parse_ext_resources;
+ rp.sub_func=_parse_sub_resources;
+ rp.func=NULL;
+ rp.userdata=this;
+
+}
+
+
+
+
+String ResourceInteractiveLoaderText::recognize(FileAccess *p_f) {
+
+ error=OK;
+
+ lines=1;
+ f=p_f;
+
+ stream.f=f;
+
+
+ VariantParser::Tag tag;
+ Error err = VariantParser::parse_tag(&stream,lines,error_text,tag);
+
+ if (err) {
+ _printerr();
+ return "";
+ }
+
+ if (tag.fields.has("format")) {
+ int fmt = tag.fields["format"];
+ if (fmt>FORMAT_VERSION) {
+ error_text="Saved with newer format version";
+ _printerr();
+ return "";
+ }
+ }
+
+ if (tag.name=="gd_scene")
+ return "PackedScene";
+
+ if (tag.name!="gd_resource")
+ return "";
+
+
+
+ if (!tag.fields.has("type")) {
+ error_text="Missing 'type' field in 'gd_resource' tag";
+ _printerr();
+ return "";
+ }
+
+ return tag.fields["type"];
+
+
+}
+
+/////////////////////
+
+Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const String &p_path, Error *r_error) {
+
+ if (r_error)
+ *r_error=ERR_CANT_OPEN;
+
+ Error err;
+ FileAccess *f = FileAccess::open(p_path,FileAccess::READ,&err);
+
+
+ if (err!=OK) {
+
+ ERR_FAIL_COND_V(err!=OK,Ref<ResourceInteractiveLoader>());
+ }
+
+ Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
+ ria->local_path=Globals::get_singleton()->localize_path(p_path);
+ ria->res_path=ria->local_path;
+// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
+ ria->open(f);
+
+ return ria;
+}
+
+void ResourceFormatLoaderText::get_recognized_extensions_for_type(const String& p_type,List<String> *p_extensions) const {
+
+
+ if (p_type=="PackedScene")
+ p_extensions->push_back("tscn");
+ else
+ p_extensions->push_back("tres");
+
+}
+
+void ResourceFormatLoaderText::get_recognized_extensions(List<String> *p_extensions) const{
+
+ p_extensions->push_back("tscn");
+ p_extensions->push_back("tres");
+}
+
+bool ResourceFormatLoaderText::handles_type(const String& p_type) const{
+
+ return true;
+}
+String ResourceFormatLoaderText::get_resource_type(const String &p_path) const{
+
+
+
+ String ext=p_path.extension().to_lower();
+ if (ext=="tscn")
+ return "PackedScene";
+ else if (ext!="tres")
+ return String();
+
+ //for anyhting else must test..
+
+ FileAccess *f = FileAccess::open(p_path,FileAccess::READ);
+ if (!f) {
+
+ return ""; //could not rwead
+ }
+
+ Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
+ ria->local_path=Globals::get_singleton()->localize_path(p_path);
+ ria->res_path=ria->local_path;
+// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
+ String r = ria->recognize(f);
+ return r;
+}
+
+
+void ResourceFormatLoaderText::get_dependencies(const String& p_path,List<String> *p_dependencies,bool p_add_types) {
+
+ FileAccess *f = FileAccess::open(p_path,FileAccess::READ);
+ if (!f) {
+
+ ERR_FAIL();
+ }
+
+ Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
+ ria->local_path=Globals::get_singleton()->localize_path(p_path);
+ ria->res_path=ria->local_path;
+// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
+ ria->get_dependencies(f,p_dependencies,p_add_types);
+
+
+}
+
+Error ResourceFormatLoaderText::rename_dependencies(const String &p_path,const Map<String,String>& p_map) {
+
+ FileAccess *f = FileAccess::open(p_path,FileAccess::READ);
+ if (!f) {
+
+ ERR_FAIL_V(ERR_CANT_OPEN);
+ }
+
+ Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
+ ria->local_path=Globals::get_singleton()->localize_path(p_path);
+ ria->res_path=ria->local_path;
+// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) );
+ return ria->rename_dependencies(f,p_path,p_map);
+}
+
+
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+/*****************************************************************************************************/
+
+
void ResourceFormatSaverTextInstance::write_property(const String& p_name,const Variant& p_property,bool *r_ok) {
if (r_ok)
@@ -137,11 +1153,11 @@ void ResourceFormatSaverTextInstance::write_property(const String& p_name,const
Image img=p_property;
if (img.empty()) {
- f->store_string("RawImage()");
+ f->store_string("Image()");
break;
}
- String imgstr="RawImage( ";
+ String imgstr="Image( ";
imgstr+=itos(img.get_width());
imgstr+=", "+itos(img.get_height());
imgstr+=", "+itos(img.get_mipmaps());
@@ -182,10 +1198,9 @@ void ResourceFormatSaverTextInstance::write_property(const String& p_name,const
const uint8_t *ptr=r.ptr();;
for (int i=0;i<len;i++) {
- uint8_t byte = ptr[i];
- const char hex[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
- char str[3]={ hex[byte>>4], hex[byte&0xF], 0};
- s+=str;
+ if (i>0)
+ s+=", ";
+ s+=itos(ptr[i]);
}
imgstr+=", ";
@@ -287,7 +1302,7 @@ void ResourceFormatSaverTextInstance::write_property(const String& p_name,const
case Variant::RAW_ARRAY: {
- f->store_string("RawArray( ");
+ f->store_string("ByteArray( ");
String s;
DVector<uint8_t> data = p_property;
int len = data.size();
@@ -297,10 +1312,8 @@ void ResourceFormatSaverTextInstance::write_property(const String& p_name,const
if (i>0)
f->store_string(", ");
- uint8_t byte = ptr[i];
- const char hex[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
- char str[3]={ hex[byte>>4], hex[byte&0xF], 0};
- f->store_string(str);
+
+ f->store_string(itos(ptr[i]));
}
@@ -673,6 +1686,9 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re
Ref<PackedScene> instance = state->get_node_instance(i);
Vector<StringName> groups = state->get_node_groups(i);
+ if (instance.is_valid())
+ print_line("for path "+String(path)+" instance "+instance->get_path());
+
String header="[node";
header+=" name=\""+String(name)+"\"";
if (type!=StringName()) {
@@ -690,7 +1706,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re
for(int j=0;j<groups.size();j++) {
if (j>0)
sgroups+=", ";
- sgroups+="\""+groups[i].operator String().c_escape()+"\"";
+ sgroups+="\""+groups[j].operator String().c_escape()+"\"";
}
sgroups+=" ]";
header+=sgroups;
diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h
index 576a78d183..4f18af2b62 100644
--- a/scene/resources/scene_format_text.h
+++ b/scene/resources/scene_format_text.h
@@ -5,6 +5,100 @@
#include "io/resource_saver.h"
#include "os/file_access.h"
#include "scene/resources/packed_scene.h"
+#include "variant_parser.h"
+
+
+
+class ResourceInteractiveLoaderText : public ResourceInteractiveLoader {
+
+ String local_path;
+ String res_path;
+ String error_text;
+
+ FileAccess *f;
+
+ VariantParser::StreamFile stream;
+
+ struct ExtResource {
+ String path;
+ String type;
+ };
+
+
+ bool is_scene;
+ String res_type;
+
+
+
+// Map<String,String> remaps;
+
+ Map<int,ExtResource> ext_resources;
+
+ int resources_total;
+ int resource_current;
+ String resource_type;
+
+ VariantParser::Tag next_tag;
+
+ mutable int lines;
+
+ Map<String,String> remaps;
+ //void _printerr();
+
+ static Error _parse_sub_resources(void* p_self, VariantParser::Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str) { return reinterpret_cast<ResourceInteractiveLoaderText*>(p_self)->_parse_sub_resource(p_stream,r_res,line,r_err_str); }
+ static Error _parse_ext_resources(void* p_self, VariantParser::Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str) { return reinterpret_cast<ResourceInteractiveLoaderText*>(p_self)->_parse_ext_resource(p_stream,r_res,line,r_err_str); }
+
+ Error _parse_sub_resource(VariantParser::Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str);
+ Error _parse_ext_resource(VariantParser::Stream* p_stream,Ref<Resource>& r_res,int &line,String &r_err_str);
+
+ VariantParser::ResourceParser rp;
+
+
+ Ref<PackedScene> packed_scene;
+
+
+friend class ResourceFormatLoaderText;
+
+ List<RES> resource_cache;
+ Error parse_property(Variant& r_v, String &r_name);
+ Error error;
+
+ RES resource;
+
+public:
+
+ virtual void set_local_path(const String& p_local_path);
+ virtual Ref<Resource> get_resource();
+ virtual Error poll();
+ virtual int get_stage() const;
+ virtual int get_stage_count() const;
+
+ void open(FileAccess *p_f);
+ String recognize(FileAccess *p_f);
+ void get_dependencies(FileAccess *p_f, List<String> *p_dependencies, bool p_add_types);
+ Error rename_dependencies(FileAccess *p_f, const String &p_path,const Map<String,String>& p_map);
+
+
+ ~ResourceInteractiveLoaderText();
+
+};
+
+
+
+class ResourceFormatLoaderText : public ResourceFormatLoader {
+public:
+
+ virtual Ref<ResourceInteractiveLoader> load_interactive(const String &p_path,Error *r_error=NULL);
+ virtual void get_recognized_extensions_for_type(const String& p_type,List<String> *p_extensions) const;
+ virtual void get_recognized_extensions(List<String> *p_extensions) const;
+ virtual bool handles_type(const String& p_type) const;
+ virtual String get_resource_type(const String &p_path) const;
+ virtual void get_dependencies(const String& p_path, List<String> *p_dependencies, bool p_add_types=false);
+ virtual Error rename_dependencies(const String &p_path,const Map<String,String>& p_map);
+
+
+};
+
class ResourceFormatSaverTextInstance {
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp
index d5204f45d5..7b67eaeda8 100644
--- a/scene/resources/shader_graph.cpp
+++ b/scene/resources/shader_graph.cpp
@@ -1435,6 +1435,7 @@ const ShaderGraph::InOutParamInfo ShaderGraph::inout_param_info[]={
{MODE_MATERIAL,SHADER_TYPE_LIGHT,"ShadeParam","SHADE_PARAM","",SLOT_TYPE_SCALAR,SLOT_IN},
//light out
{MODE_MATERIAL,SHADER_TYPE_LIGHT,"Light","LIGHT","",SLOT_TYPE_VEC,SLOT_OUT},
+ {MODE_MATERIAL,SHADER_TYPE_LIGHT,"Shadow", "SHADOW", "",SLOT_TYPE_VEC, SLOT_OUT },
//canvas item vertex in
{MODE_CANVAS_ITEM,SHADER_TYPE_VERTEX,"Vertex","vec3(SRC_VERTEX,0)","",SLOT_TYPE_VEC,SLOT_IN},
{MODE_CANVAS_ITEM,SHADER_TYPE_VERTEX,"UV","SRC_UV","",SLOT_TYPE_VEC,SLOT_IN},
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 6532c3f0ac..68a60e26f5 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -1113,7 +1113,8 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::light_builtins_defs[]={
{ "SPECULAR_EXP", TYPE_FLOAT},
{ "SHADE_PARAM", TYPE_FLOAT},
{ "LIGHT", TYPE_VEC3},
- { "POINT_COORD", TYPE_VEC2},
+ { "SHADOW", TYPE_VEC3 },
+ { "POINT_COORD", TYPE_VEC2 },
// { "SCREEN_POS", TYPE_VEC2},
// { "SCREEN_TEXEL_SIZE", TYPE_VEC2},
{ "TIME", TYPE_FLOAT},
@@ -1369,7 +1370,7 @@ ShaderLanguage::Node* ShaderLanguage::validate_function_call(Parser&parser, Oper
}
}
- if (!fail) {
+ if (!fail && name == program->functions[i].name) {
p_func->return_cache=pfunc->return_type;
return p_func;
}
diff --git a/tools/Godot.app/Contents/Info.plist b/tools/Godot.app/Contents/Info.plist
index 3a4b51e2fe..8a89993fb9 100755
--- a/tools/Godot.app/Contents/Info.plist
+++ b/tools/Godot.app/Contents/Info.plist
@@ -13,7 +13,7 @@
<key>CFBundleIconFile</key>
<string>Godot.icns</string>
<key>CFBundleIdentifier</key>
- <string>com.okamstudio.godot</string>
+ <string>org.godotengine.godot</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
@@ -61,7 +61,7 @@
<true/>
<key>LSItemContentTypes</key>
<array>
- <string>com.okamstudio.scn</string>
+ <string>org.godotengine.scn</string>
</array>
</dict>
</array>
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp
index 685763cadb..0728b3b7c1 100644
--- a/tools/editor/code_editor.cpp
+++ b/tools/editor/code_editor.cpp
@@ -614,6 +614,7 @@ CodeTextEditor::CodeTextEditor() {
text_editor->add_font_override("font",get_font("source","Fonts"));
text_editor->set_show_line_numbers(true);
text_editor->set_brace_matching(true);
+ text_editor->set_auto_indent(true);
line_col = memnew( Label );
add_child(line_col);
diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp
index b0bacdae61..d4937d7114 100644
--- a/tools/editor/connections_dialog.cpp
+++ b/tools/editor/connections_dialog.cpp
@@ -163,6 +163,7 @@ void ConnectDialog::edit(Node *p_node) {
dst_path->set_text("");
dst_method->set_text("");
deferred->set_pressed(false);
+ oneshot->set_pressed(false);
cdbinds->params.clear();
cdbinds->notify_changed();
}
@@ -196,6 +197,11 @@ bool ConnectDialog::get_deferred() const {
return deferred->is_pressed();
}
+bool ConnectDialog::get_oneshot() const {
+
+ return oneshot->is_pressed();
+}
+
StringName ConnectDialog::get_dst_method() const {
String txt=dst_method->get_text();
@@ -423,12 +429,13 @@ ConnectDialog::ConnectDialog() {
dstm_hb->add_child(make_callback);
deferred = memnew( CheckButton );
- deferred->set_toggle_mode(true);
- deferred->set_pressed(true);
deferred->set_text("Deferred");
dstm_hb->add_child(deferred);
-
+ oneshot = memnew( CheckButton );
+ oneshot->set_text("Oneshot");
+ dstm_hb->add_child(oneshot);
+
/*
realtime = memnew( CheckButton );
realtime->set_anchor( MARGIN_TOP, ANCHOR_END );
@@ -496,11 +503,13 @@ void ConnectionsDialog::_connect() {
StringName dst_method=connect_dialog->get_dst_method();
bool defer=connect_dialog->get_deferred();
+ bool oshot=connect_dialog->get_oneshot();
Vector<Variant> binds = connect_dialog->get_binds();
StringArray args = it->get_metadata(0).operator Dictionary()["args"];
+ int flags = CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0) | (oshot?CONNECT_ONESHOT:0);
undo_redo->create_action("Connect '"+signal+"' to '"+String(dst_method)+"'");
- undo_redo->add_do_method(node,"connect",signal,target,dst_method,binds,CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0));
+ undo_redo->add_do_method(node,"connect",signal,target,dst_method,binds,flags);
undo_redo->add_undo_method(node,"disconnect",signal,target,dst_method);
undo_redo->add_do_method(this,"update_tree");
undo_redo->add_undo_method(this,"update_tree");
@@ -731,6 +740,8 @@ void ConnectionsDialog::update_tree() {
String path = String(node->get_path_to(target))+" :: "+c.method+"()";
if (c.flags&CONNECT_DEFERRED)
path+=" (deferred)";
+ if (c.flags&CONNECT_ONESHOT)
+ path+=" (oneshot)";
if (c.binds.size()) {
path+=" binds( ";
diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h
index 68b13bf07a..4a1c3f189c 100644
--- a/tools/editor/connections_dialog.h
+++ b/tools/editor/connections_dialog.h
@@ -58,6 +58,7 @@ class ConnectDialog : public ConfirmationDialog {
//MenuButton *dst_method_list;
OptionButton *type_list;
CheckButton *deferred;
+ CheckButton *oneshot;
CheckButton *make_callback;
PropertyEditor *bind_editor;
Node *node;
@@ -80,6 +81,7 @@ public:
NodePath get_dst_path() const;
StringName get_dst_method() const;
bool get_deferred() const;
+ bool get_oneshot() const;
Vector<Variant> get_binds() const;
void set_dst_method(const StringName& p_method);
void set_dst_node(Node* p_node);
diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp
index c04e82a08a..7e63cfb1b4 100644
--- a/tools/editor/dependency_editor.cpp
+++ b/tools/editor/dependency_editor.cpp
@@ -510,3 +510,184 @@ DependencyErrorDialog::DependencyErrorDialog() {
set_title("Errors loading!");
}
+
+//////////////////////////////////////////////////////////////////////
+
+
+
+void OrphanResourcesDialog::ok_pressed() {
+
+ paths.clear();
+
+ _find_to_delete(files->get_root(),paths);
+ if (paths.empty())
+ return;
+
+ delete_confirm->set_text("Permanently Delete "+itos(paths.size())+" Item(s) ? (No Undo!!)");
+ delete_confirm->popup_centered_minsize();
+}
+
+bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd,HashMap<String,int>& refs,TreeItem* p_parent){
+
+
+ if (!efsd)
+ return false;
+
+ bool has_childs=false;
+
+ for(int i=0;i<efsd->get_subdir_count();i++) {
+
+ TreeItem *dir_item=NULL;
+ if (p_parent) {
+ dir_item = files->create_item(p_parent);
+ dir_item->set_text(0,efsd->get_subdir(i)->get_name());
+ dir_item->set_icon(0,get_icon("folder","FileDialog"));
+
+ }
+ bool children = _fill_owners(efsd->get_subdir(i),refs,dir_item);
+
+ if (p_parent) {
+ if (!children) {
+ memdelete(dir_item);
+ } else {
+ has_childs=true;
+ }
+ }
+
+ }
+
+
+ for(int i=0;i<efsd->get_file_count();i++) {
+
+ if (!p_parent) {
+ Vector<String> deps = efsd->get_file_deps(i);
+ //print_line(":::"+efsd->get_file_path(i));
+ for(int j=0;j<deps.size();j++) {
+
+ if (!refs.has(deps[j])) {
+ refs[deps[j]]=1;
+ }
+ }
+ } else {
+
+ String path = efsd->get_file_path(i);
+ if (!refs.has(path)) {
+ TreeItem *ti=files->create_item(p_parent);
+ ti->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
+ ti->set_text(0,efsd->get_file(i));
+ ti->set_editable(0,true);
+
+ String type=efsd->get_file_type(i);
+
+ Ref<Texture> icon;
+ if (has_icon(type,"EditorIcons")) {
+ icon=get_icon(type,"EditorIcons");
+ } else {
+ icon=get_icon("Object","EditorIcons");
+ }
+ ti->set_icon(0,icon);
+ int ds = efsd->get_file_deps(i).size();
+ ti->set_text(1,itos(ds));
+ if (ds) {
+ ti->add_button(1,get_icon("Visible","EditorIcons"));
+ }
+ ti->set_metadata(0,path);
+ has_childs=true;
+ }
+ }
+
+ }
+
+ return has_childs;
+}
+
+
+void OrphanResourcesDialog::refresh() {
+ HashMap<String,int> refs;
+ _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(),refs,NULL);
+ files->clear();
+ TreeItem *root=files->create_item();
+ _fill_owners(EditorFileSystem::get_singleton()->get_filesystem(),refs,root);
+}
+
+
+void OrphanResourcesDialog::show(){
+
+ refresh();
+ popup_centered_ratio();
+}
+
+
+void OrphanResourcesDialog::_find_to_delete(TreeItem* p_item,List<String>& paths) {
+
+ while(p_item) {
+
+ if (p_item->get_cell_mode(0)==TreeItem::CELL_MODE_CHECK && p_item->is_checked(0)) {
+ paths.push_back(p_item->get_metadata(0));
+ }
+
+ if (p_item->get_children()) {
+ _find_to_delete(p_item->get_children(),paths);
+ }
+
+ p_item=p_item->get_next();
+ }
+
+
+}
+
+void OrphanResourcesDialog::_delete_confirm() {
+
+ DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
+ for (List<String>::Element *E=paths.front();E;E=E->next()) {
+
+ da->remove(E->get());
+ EditorFileSystem::get_singleton()->update_file(E->get());
+ }
+ memdelete(da);
+ refresh();
+}
+
+void OrphanResourcesDialog::_button_pressed(Object *p_item,int p_column, int p_id) {
+
+ TreeItem *ti=p_item->cast_to<TreeItem>();
+
+ String path = ti->get_metadata(0);
+ dep_edit->edit(path);
+
+}
+
+void OrphanResourcesDialog::_bind_methods() {
+
+ ObjectTypeDB::bind_method(_MD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm);
+ ObjectTypeDB::bind_method(_MD("_button_pressed"),&OrphanResourcesDialog::_button_pressed);
+
+}
+
+OrphanResourcesDialog::OrphanResourcesDialog(){
+
+ VBoxContainer *vbc = memnew( VBoxContainer );
+ add_child(vbc);
+ set_child_rect(vbc);
+ files = memnew( Tree );
+ files->set_columns(2);
+ files->set_column_titles_visible(true);
+ files->set_column_min_width(1,100);
+ files->set_column_expand(0,true);
+ files->set_column_expand(1,false);
+ files->set_column_title(0,"Resource");
+ files->set_column_title(1,"Owns");
+ files->set_hide_root(true);
+ vbc->add_margin_child("Resources Without Explicit Ownership:",files,true);
+ set_title("Orphan Resource Explorer");
+ delete_confirm = memnew( ConfirmationDialog );
+ delete_confirm->set_text("Delete selected files?");
+ get_ok()->set_text("Delete");
+ add_child(delete_confirm);
+ dep_edit = memnew( DependencyEditor );
+ add_child(dep_edit);
+ files->connect("button_pressed",this,"_button_pressed");
+ delete_confirm->connect("confirmed",this,"_delete_confirm");
+ set_hide_on_ok(false);
+
+}
diff --git a/tools/editor/dependency_editor.h b/tools/editor/dependency_editor.h
index 1c328e7a93..c372025ca0 100644
--- a/tools/editor/dependency_editor.h
+++ b/tools/editor/dependency_editor.h
@@ -91,4 +91,29 @@ public:
DependencyErrorDialog();
};
+
+
+class OrphanResourcesDialog : public ConfirmationDialog {
+ OBJ_TYPE(OrphanResourcesDialog,ConfirmationDialog);
+
+ DependencyEditor *dep_edit;
+ Tree *files;
+ ConfirmationDialog *delete_confirm;
+ void ok_pressed();
+
+ bool _fill_owners(EditorFileSystemDirectory *efsd, HashMap<String,int>& refs, TreeItem *p_parent);
+
+ List<String> paths;
+ void _find_to_delete(TreeItem* p_item,List<String>& paths);
+ void _delete_confirm();
+ void _button_pressed(Object *p_item,int p_column, int p_id);
+
+ void refresh();
+ static void _bind_methods();
+public:
+
+ void show();
+ OrphanResourcesDialog();
+};
+
#endif // DEPENDENCY_EDITOR_H
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index 321ac76240..a5a3890129 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -36,6 +36,14 @@
#include "os/keyboard.h"
+void EditorHelpSearch::popup() {
+ popup_centered_ratio(0.6);
+ if (search_box->get_text()!="") {
+ search_box->select_all();
+ _update_search();
+ }
+ search_box->grab_focus();
+}
void EditorHelpSearch::popup(const String& p_term) {
@@ -263,7 +271,7 @@ void EditorHelpSearch::_confirmed() {
String mdata=ti->get_metadata(0);
emit_signal("go_to_help",mdata);
- editor->call("_editor_select",3); // in case EditorHelpSearch beeen invoked on top of other editor window
+ editor->call("_editor_select",EditorNode::EDITOR_SCRIPT); // in case EditorHelpSearch beeen invoked on top of other editor window
// go to that
hide();
}
@@ -1049,7 +1057,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) {
void EditorHelp::_request_help(const String& p_string) {
Error err = _goto_desc(p_string);
if (err==OK) {
- editor->call("_editor_select",3);
+ editor->call("_editor_select",EditorNode::EDITOR_SCRIPT);
}
//100 palabras
}
@@ -1089,7 +1097,7 @@ void EditorHelp::_help_callback(const String& p_topic) {
line=constant_line[name];
}
- class_desc->scroll_to_line(line);
+ class_desc->call_deferred("scroll_to_line", line);
}
@@ -1350,7 +1358,6 @@ void EditorHelp::_notification(int p_what) {
// forward->set_icon(get_icon("Forward","EditorIcons"));
// back->set_icon(get_icon("Back","EditorIcons"));
_update_doc();
- editor->connect("request_help",this,"_request_help");
} break;
}
@@ -1408,7 +1415,6 @@ void EditorHelp::_bind_methods() {
ObjectTypeDB::bind_method("_unhandled_key_input",&EditorHelp::_unhandled_key_input);
ObjectTypeDB::bind_method("_search",&EditorHelp::_search);
ObjectTypeDB::bind_method("_search_cbk",&EditorHelp::_search_cbk);
-
ObjectTypeDB::bind_method("_help_callback",&EditorHelp::_help_callback);
ADD_SIGNAL(MethodInfo("go_to_help"));
diff --git a/tools/editor/editor_help.h b/tools/editor/editor_help.h
index b5ee6eca6c..04ac4d35ff 100644
--- a/tools/editor/editor_help.h
+++ b/tools/editor/editor_help.h
@@ -68,7 +68,8 @@ protected:
static void _bind_methods();
public:
- void popup(const String& p_term="");
+ void popup();
+ void popup(const String& p_term);
EditorHelpSearch();
};
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 4e22592880..7b96db56f2 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -167,11 +167,20 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) {
/*case KEY_F1:
if (!p_event.key.mod.shift && !p_event.key.mod.command)
- _editor_select(3);
+ _editor_select(EDITOR_SCRIPT);
break;*/
- case KEY_F1: _editor_select(0); break;
- case KEY_F2: _editor_select(1); break;
- case KEY_F3: _editor_select(2); break;
+ case KEY_F1:
+ if (!p_event.key.mod.shift && !p_event.key.mod.command)
+ _editor_select(EDITOR_2D);
+ break;
+ case KEY_F2:
+ if (!p_event.key.mod.shift && !p_event.key.mod.command)
+ _editor_select(EDITOR_3D);
+ break;
+ case KEY_F3:
+ if (!p_event.key.mod.shift && !p_event.key.mod.command)
+ _editor_select(EDITOR_SCRIPT);
+ break;
case KEY_F5: _menu_option_confirm((p_event.key.mod.control&&p_event.key.mod.shift)?RUN_PLAY_CUSTOM_SCENE:RUN_PLAY,true); break;
case KEY_F6: _menu_option_confirm(RUN_PLAY_SCENE,true); break;
case KEY_F7: _menu_option_confirm(RUN_PAUSE,true); break;
@@ -289,7 +298,7 @@ void EditorNode::_notification(int p_what) {
VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport(),true);
VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(),true);
- _editor_select(1);
+ _editor_select(EDITOR_3D);
if (defer_load_scene!="") {
@@ -879,7 +888,7 @@ void EditorNode::_save_scene_with_preview(String p_file) {
}
}
- _editor_select(is2d?0:1);
+ _editor_select(is2d?EDITOR_2D:EDITOR_3D);
VS::get_singleton()->viewport_queue_screen_capture(viewport);
save.step("Creating Thumbnail",2);
@@ -2379,6 +2388,10 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
log->add_message("REDO: "+action);
} break;
+ case TOOLS_ORPHAN_RESOURCES: {
+
+ orphan_resources->show();
+ } break;
case EDIT_REVERT: {
@@ -2519,7 +2532,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
case OBJECT_REQUEST_HELP: {
if (current) {
- _editor_select(3);
+ _editor_select(EDITOR_SCRIPT);
emit_signal("request_help",current->get_type());
}
@@ -3296,9 +3309,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state) {
int n2d=0,n3d=0;
_find_node_types(get_edited_scene(),n2d,n3d);
if (n2d>n3d) {
- _editor_select(0);
+ _editor_select(EDITOR_2D);
} else if (n3d>n2d) {
- _editor_select(1);
+ _editor_select(EDITOR_3D);
}
}
@@ -3534,13 +3547,14 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
if (p_set_inherited) {
Ref<SceneState> state = sdata->get_state();
- state->set_path(lpath);
+ state->set_path(lpath);
new_scene->set_scene_inherited_state(state);
new_scene->set_filename(String());
- if (new_scene->get_scene_instance_state().is_valid())
- new_scene->get_scene_instance_state()->set_path(String());
+ //if (new_scene->get_scene_instance_state().is_valid())
+ // new_scene->get_scene_instance_state()->set_path(String());
}
+ new_scene->set_scene_instance_state(Ref<SceneState>());
set_edited_scene(new_scene);
_get_scene_metadata();
@@ -3857,7 +3871,8 @@ bool EditorNode::_find_editing_changed_scene(Node *p_from) {
void EditorNode::add_io_error(const String& p_error) {
-
+ CharString err_ut = p_error.utf8();
+ ERR_PRINT(err_ut.get_data());
_load_error_notify(singleton,p_error);
}
@@ -5037,6 +5052,17 @@ EditorNode::EditorNode() {
p=import_menu->get_popup();
p->connect("item_pressed",this,"_menu_option");
+ tool_menu = memnew( MenuButton );
+ tool_menu->set_tooltip("Miscelaneous project or scene wide tools.");
+ tool_menu->set_text("Tools");
+
+ //tool_menu->set_icon(gui_base->get_icon("Save","EditorIcons"));
+ left_menu_hb->add_child( tool_menu );
+
+ p=tool_menu->get_popup();
+ p->connect("item_pressed",this,"_menu_option");
+ p->add_item("Orphan Resource Explorer",TOOLS_ORPHAN_RESOURCES);
+
export_button = memnew( ToolButton );
export_button->set_tooltip("Export the project to many platforms.");
export_button->set_text("Export");
@@ -5465,7 +5491,8 @@ EditorNode::EditorNode() {
-
+ orphan_resources = memnew( OrphanResourcesDialog );
+ gui_base->add_child(orphan_resources);
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index 7d8b97688e..5cc9d9eaa2 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -133,6 +133,7 @@ class EditorNode : public Node {
EDIT_UNDO,
EDIT_REDO,
EDIT_REVERT,
+ TOOLS_ORPHAN_RESOURCES,
RESOURCE_NEW,
RESOURCE_LOAD,
RESOURCE_SAVE,
@@ -237,6 +238,7 @@ class EditorNode : public Node {
Control *viewport;
MenuButton *file_menu;
MenuButton *import_menu;
+ MenuButton *tool_menu;
ToolButton *export_button;
ToolButton *prev_scene;
MenuButton *object_menu;
@@ -333,6 +335,7 @@ class EditorNode : public Node {
DependencyErrorDialog *dependency_error;
DependencyEditor *dependency_fixer;
+ OrphanResourcesDialog *orphan_resources;
TabContainer *dock_slot[DOCK_SLOT_MAX];
Rect2 dock_select_rect[DOCK_SLOT_MAX];
@@ -529,6 +532,12 @@ protected:
static void _bind_methods();
public:
+ enum EditorTable {
+ EDITOR_2D = 0,
+ EDITOR_3D,
+ EDITOR_SCRIPT
+ };
+
static EditorNode* get_singleton() { return singleton; }
diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp
index 2139513025..b32ab8cb0b 100644
--- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp
@@ -128,7 +128,7 @@ class EditorMeshImportDialog : public ConfirmationDialog {
LineEdit *save_path;
EditorFileDialog *file_select;
EditorDirDialog *save_select;
- ConfirmationDialog *error_dialog;
+ AcceptDialog *error_dialog;
PropertyEditor *option_editor;
_EditorMeshImportOptions *options;
@@ -169,13 +169,12 @@ public:
void _browse_target() {
save_select->popup_centered_ratio();
-
}
-
void popup_import(const String& p_path) {
popup_centered(Size2(400,400));
+
if (p_path!="") {
Ref<ResourceImportMetadata> rimd = ResourceLoader::load_import_metadata(p_path);
@@ -199,14 +198,13 @@ public:
}
}
-
void _import() {
Vector<String> meshes = import_path->get_text().split(",");
-
if (meshes.size()==0) {
error_dialog->set_text("No meshes to import!");
- error_dialog->popup_centered(Size2(200,100));
+ error_dialog->popup_centered_minsize();
+ return;
}
for(int i=0;i<meshes.size();i++) {
@@ -229,19 +227,18 @@ public:
String dst = save_path->get_text();
if (dst=="") {
error_dialog->set_text("Save path is empty!");
- error_dialog->popup_centered(Size2(200,100));
+ error_dialog->popup_centered_minsize();
+ return;
}
dst = dst.plus_file(meshes[i].get_file().basename()+".msh");
- Error err = plugin->import(dst,imd);
+ plugin->import(dst,imd);
}
hide();
-
}
-
void _notification(int p_what) {
@@ -253,27 +250,24 @@ public:
static void _bind_methods() {
-
ObjectTypeDB::bind_method("_choose_files",&EditorMeshImportDialog::_choose_files);
ObjectTypeDB::bind_method("_choose_save_dir",&EditorMeshImportDialog::_choose_save_dir);
ObjectTypeDB::bind_method("_import",&EditorMeshImportDialog::_import);
ObjectTypeDB::bind_method("_browse",&EditorMeshImportDialog::_browse);
ObjectTypeDB::bind_method("_browse_target",&EditorMeshImportDialog::_browse_target);
- // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) );
}
EditorMeshImportDialog(EditorMeshImportPlugin *p_plugin) {
plugin=p_plugin;
-
set_title("Single Mesh Import");
+ set_hide_on_ok(false);
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
-
HBoxContainer *hbc = memnew( HBoxContainer );
vbc->add_margin_child("Source Mesh(es):",hbc);
@@ -300,28 +294,23 @@ public:
save_choose->connect("pressed", this,"_browse_target");
- file_select = memnew(EditorFileDialog);
+ file_select = memnew( EditorFileDialog );
file_select->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
- add_child(file_select);
file_select->set_mode(EditorFileDialog::MODE_OPEN_FILES);
- file_select->connect("files_selected", this,"_choose_files");
file_select->add_filter("*.obj ; Wavefront OBJ");
- save_select = memnew( EditorDirDialog );
- add_child(save_select);
+ add_child(file_select);
+ file_select->connect("files_selected", this,"_choose_files");
- // save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
+ save_select = memnew( EditorDirDialog );
+ add_child(save_select);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
get_ok()->set_text("Import");
-
- error_dialog = memnew ( ConfirmationDialog );
+ error_dialog = memnew( AcceptDialog );
add_child(error_dialog);
- error_dialog->get_ok()->set_text("Accept");
- // error_dialog->get_cancel()->hide();
- set_hide_on_ok(false);
options = memnew( _EditorMeshImportOptions );
option_editor = memnew( PropertyEditor );
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 65ed420a51..e01cf72149 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -881,18 +881,17 @@ void ScriptEditor::_menu_option(int p_option) {
} break;
case SEARCH_HELP: {
- help_search_dialog->popup("current");
+ help_search_dialog->popup();
} break;
case SEARCH_CLASSES: {
- if (tab_container->get_tab_count()==0)
- break;
-
String current;
- EditorHelp *eh = tab_container->get_child( tab_container->get_current_tab() )->cast_to<EditorHelp>();
- if (eh) {
- current=eh->get_class_name();
+ if (tab_container->get_tab_count()>0) {
+ EditorHelp *eh = tab_container->get_child( tab_container->get_current_tab() )->cast_to<EditorHelp>();
+ if (eh) {
+ current=eh->get_class_name();
+ }
}
help_index->popup_centered_ratio(0.6);
@@ -1388,6 +1387,7 @@ void ScriptEditor::_notification(int p_what) {
if (p_what==NOTIFICATION_READY) {
get_tree()->connect("tree_changed",this,"_tree_changed");
+ editor->connect("request_help",this,"_request_help");
}
if (p_what==NOTIFICATION_EXIT_TREE) {
@@ -2205,6 +2205,7 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_script_split_dragged",&ScriptEditor::_script_split_dragged);
ObjectTypeDB::bind_method("_help_class_open",&ScriptEditor::_help_class_open);
ObjectTypeDB::bind_method("_help_class_goto",&ScriptEditor::_help_class_goto);
+ ObjectTypeDB::bind_method("_request_help",&ScriptEditor::_help_class_open);
ObjectTypeDB::bind_method("_history_forward",&ScriptEditor::_history_forward);
ObjectTypeDB::bind_method("_history_back",&ScriptEditor::_history_back);
}
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index cd6dc06f75..3464b3c9bb 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -491,6 +491,18 @@ Error ProjectExportDialog::export_platform(const String& p_platform, const Strin
Ref<EditorExportPlatform> exporter = EditorImportExport::get_singleton()->get_export_platform(p_platform);
if (exporter.is_null()) {
ERR_PRINT("Invalid platform for export");
+
+ List<StringName> platforms;
+ EditorImportExport::get_singleton()->get_export_platforms(&platforms);
+ print_line("Valid export plaftorms are:");
+ for (List<StringName>::Element *E=platforms.front();E;E=E->next())
+ print_line(" \""+E->get()+"\"");
+
+ if (p_quit_after) {
+ OS::get_singleton()->set_exit_code(255);
+ get_tree()->quit();
+ }
+
return ERR_INVALID_PARAMETER;
}
Error err = exporter->export_project(p_path,p_debug);
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp
index 893df04709..04705017d2 100644
--- a/tools/editor/project_manager.cpp
+++ b/tools/editor/project_manager.cpp
@@ -624,11 +624,6 @@ void ProjectManager::_open_project_confirm() {
args.push_back("-editor");
- const String &selected_main = E->get();
- if (selected_main!="") {
- args.push_back(selected_main);
- }
-
String exec = OS::get_singleton()->get_executable_path();
OS::ProcessID pid=0;
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp
index 31393ebcbc..0fe3dee2ea 100644
--- a/tools/editor/property_editor.cpp
+++ b/tools/editor/property_editor.cpp
@@ -1361,7 +1361,7 @@ void CustomPropertyEditor::_modified(String p_string) {
} break;
case Variant::MATRIX32: {
- Matrix3 m;
+ Matrix32 m;
for(int i=0;i<6;i++) {
m.elements[i/2][i%2]=value_editor[i]->get_text().to_double();
@@ -2846,6 +2846,13 @@ void PropertyEditor::update_tree() {
item->set_icon( 0,get_icon("Vector","EditorIcons") );
} break;
+ case Variant::MATRIX32:
+ case Variant::MATRIX3: {
+
+ item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
+ item->set_editable( 1, true );
+ item->set_text(1, obj->get(p.name));
+ } break;
case Variant::TRANSFORM: {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 0cafe7459b..8b5bf8c1e1 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -1264,7 +1264,10 @@ void SceneTreeDock::import_subscene() {
void SceneTreeDock::_import_subscene() {
Node* parent = scene_tree->get_selected();
- ERR_FAIL_COND(!parent);
+ if (!parent) {
+ parent = editor_data->get_edited_scene_root();
+ ERR_FAIL_COND(!parent);
+ }
import_subscene_dialog->move(parent,edited_scene);
editor_data->get_undo_redo().clear_history(); //no undo for now..
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index ac2f76acdc..6575603073 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -565,7 +565,6 @@ void SceneTreeEditor::_notification(int p_what) {
get_tree()->disconnect("node_removed",this,"_node_removed");
tree->disconnect("item_collapsed",this,"_cell_collapsed");
clear_inherit_confirm->disconnect("confirmed",this,"_subscene_option");
- _update_tree();
}
}
diff --git a/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj b/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj
index 7cd4da0f4a..4ae1ec8a53 100644
--- a/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj
+++ b/tools/ios_xcode_template/godot_ios.xcodeproj/project.pbxproj
@@ -192,7 +192,7 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
- ORGANIZATIONNAME = Okam;
+ ORGANIZATIONNAME = GodotEngine;
TargetAttributes = {
D0BCFE5F18AEBDA3004A7AAE = {
TestTargetID = D0BCFE3318AEBDA2004A7AAE;
diff --git a/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist b/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist
index f34ebb97f0..357970920a 100644
--- a/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist
+++ b/tools/ios_xcode_template/godot_ios/godot_ios-Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>godot_opt.iphone</string>
<key>CFBundleIdentifier</key>
- <string>com.okamstudios.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>org.godotengine.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
diff --git a/tools/ios_xcode_template/godot_ios/main.m b/tools/ios_xcode_template/godot_ios/main.m
index dca55f40ce..6bb6bc2188 100644
--- a/tools/ios_xcode_template/godot_ios/main.m
+++ b/tools/ios_xcode_template/godot_ios/main.m
@@ -1,10 +1,31 @@
-//
-// main.m
-// godot_ios
-//
-// Created by Ariel m on 2/14/14.
-// Copyright (c) 2014 Okam. All rights reserved.
-//
+/*************************************************************************/
+/* main.m */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
#import <UIKit/UIKit.h>
diff --git a/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist b/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist
index 3b3eec9a51..0f69aa80eb 100644
--- a/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist
+++ b/tools/ios_xcode_template/godot_iosTests/godot_iosTests-Info.plist
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.okamstudios.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>org.godotengine.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
diff --git a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m
index fce6288670..75e44659e0 100644
--- a/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m
+++ b/tools/ios_xcode_template/godot_iosTests/godot_iosTests.m
@@ -1,10 +1,31 @@
-//
-// godot_iosTests.m
-// godot_iosTests
-//
-// Created by Ariel m on 2/14/14.
-// Copyright (c) 2014 Okam. All rights reserved.
-//
+/*************************************************************************/
+/* godot_iosTests.m */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* http://www.godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
#import <XCTest/XCTest.h>