Merge pull request #10908 from hpvb/fix-unused-variables
Fix unused variable warnings
This commit is contained in:
commit
aabbd00284
38 changed files with 70 additions and 210 deletions
|
@ -87,6 +87,8 @@ void FileAccessNetworkClient::_thread_func() {
|
||||||
|
|
||||||
DEBUG_PRINT("SEM WAIT - " + itos(sem->get()));
|
DEBUG_PRINT("SEM WAIT - " + itos(sem->get()));
|
||||||
Error err = sem->wait();
|
Error err = sem->wait();
|
||||||
|
if (err != OK)
|
||||||
|
ERR_PRINT("sem->wait() failed");
|
||||||
DEBUG_TIME("sem_unlock");
|
DEBUG_TIME("sem_unlock");
|
||||||
//DEBUG_PRINT("semwait returned "+itos(werr));
|
//DEBUG_PRINT("semwait returned "+itos(werr));
|
||||||
DEBUG_PRINT("MUTEX LOCK " + itos(lockcount));
|
DEBUG_PRINT("MUTEX LOCK " + itos(lockcount));
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
|
||||||
//#define print_bl(m_what) print_line(m_what)
|
//#define print_bl(m_what) print_line(m_what)
|
||||||
#define print_bl(m_what)
|
#define print_bl(m_what) (void)(m_what)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
||||||
|
@ -854,12 +854,6 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool big_endian = f->get_32();
|
bool big_endian = f->get_32();
|
||||||
#ifdef BIG_ENDIAN_ENABLED
|
|
||||||
endian_swap = !big_endian;
|
|
||||||
#else
|
|
||||||
bool endian_swap = big_endian;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool use_real64 = f->get_32();
|
bool use_real64 = f->get_32();
|
||||||
|
|
||||||
f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian
|
f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian
|
||||||
|
@ -869,7 +863,11 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
|
||||||
uint32_t ver_format = f->get_32();
|
uint32_t ver_format = f->get_32();
|
||||||
|
|
||||||
print_bl("big endian: " + itos(big_endian));
|
print_bl("big endian: " + itos(big_endian));
|
||||||
print_bl("endian swap: " + itos(endian_swap));
|
#ifdef BIG_ENDIAN_ENABLED
|
||||||
|
print_bl("endian swap: " + itos(!big_endian));
|
||||||
|
#else
|
||||||
|
print_bl("endian swap: " + itos(big_endian));
|
||||||
|
#endif
|
||||||
print_bl("real64: " + itos(use_real64));
|
print_bl("real64: " + itos(use_real64));
|
||||||
print_bl("major: " + itos(ver_major));
|
print_bl("major: " + itos(ver_major));
|
||||||
print_bl("minor: " + itos(ver_minor));
|
print_bl("minor: " + itos(ver_minor));
|
||||||
|
@ -964,18 +962,12 @@ String ResourceInteractiveLoaderBinary::recognize(FileAccess *p_f) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool big_endian = f->get_32();
|
bool big_endian = f->get_32();
|
||||||
#ifdef BIG_ENDIAN_ENABLED
|
f->get_32(); // use_real64
|
||||||
endian_swap = !big_endian;
|
|
||||||
#else
|
|
||||||
bool endian_swap = big_endian;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool use_real64 = f->get_32();
|
|
||||||
|
|
||||||
f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian
|
f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian
|
||||||
|
|
||||||
uint32_t ver_major = f->get_32();
|
uint32_t ver_major = f->get_32();
|
||||||
uint32_t ver_minor = f->get_32();
|
f->get_32(); // ver_minor
|
||||||
uint32_t ver_format = f->get_32();
|
uint32_t ver_format = f->get_32();
|
||||||
|
|
||||||
if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) {
|
if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) {
|
||||||
|
@ -993,8 +985,6 @@ ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() {
|
||||||
|
|
||||||
f = NULL;
|
f = NULL;
|
||||||
stage = 0;
|
stage = 0;
|
||||||
endian_swap = false;
|
|
||||||
use_real64 = false;
|
|
||||||
error = OK;
|
error = OK;
|
||||||
translation_remapped = false;
|
translation_remapped = false;
|
||||||
}
|
}
|
||||||
|
@ -1123,16 +1113,14 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
bool big_endian = f->get_32();
|
bool big_endian = f->get_32();
|
||||||
#ifdef BIG_ENDIAN_ENABLED
|
|
||||||
endian_swap = !big_endian;
|
|
||||||
#else
|
|
||||||
bool endian_swap = big_endian;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool use_real64 = f->get_32();
|
bool use_real64 = f->get_32();
|
||||||
|
|
||||||
f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian
|
f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian
|
||||||
fw->store_32(endian_swap);
|
#ifdef BIG_ENDIAN_ENABLED
|
||||||
|
fw->store_32(!big_endian);
|
||||||
|
#else
|
||||||
|
fw->store_32(big_endian);
|
||||||
|
#endif
|
||||||
fw->set_endian_swap(big_endian != 0);
|
fw->set_endian_swap(big_endian != 0);
|
||||||
fw->store_32(use_real64); //use real64
|
fw->store_32(use_real64); //use real64
|
||||||
|
|
||||||
|
@ -1793,8 +1781,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
|
||||||
}
|
}
|
||||||
|
|
||||||
save_unicode_string(p_resource->get_class());
|
save_unicode_string(p_resource->get_class());
|
||||||
uint64_t md_at = f->get_pos();
|
f->store_64(0); //offset to import metadata
|
||||||
f->store_64(0); //offset to impoty metadata
|
|
||||||
for (int i = 0; i < 14; i++)
|
for (int i = 0; i < 14; i++)
|
||||||
f->store_32(0); // reserved
|
f->store_32(0); // reserved
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,6 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader {
|
||||||
|
|
||||||
FileAccess *f;
|
FileAccess *f;
|
||||||
|
|
||||||
bool endian_swap;
|
|
||||||
bool use_real64;
|
|
||||||
uint64_t importmd_ofs;
|
uint64_t importmd_ofs;
|
||||||
|
|
||||||
Vector<char> str_buf;
|
Vector<char> str_buf;
|
||||||
|
|
|
@ -131,7 +131,6 @@ void CameraMatrix::set_perspective(real_t p_fovy_degrees, real_t p_aspect, real_
|
||||||
|
|
||||||
void CameraMatrix::set_for_hmd(int p_eye, real_t p_aspect, real_t p_intraocular_dist, real_t p_display_width, real_t p_display_to_lens, real_t p_oversample, real_t p_z_near, real_t p_z_far) {
|
void CameraMatrix::set_for_hmd(int p_eye, real_t p_aspect, real_t p_intraocular_dist, real_t p_display_width, real_t p_display_to_lens, real_t p_oversample, real_t p_z_near, real_t p_z_far) {
|
||||||
// we first calculate our base frustum on our values without taking our lens magnification into account.
|
// we first calculate our base frustum on our values without taking our lens magnification into account.
|
||||||
real_t display_to_eye = 2.0 * p_display_to_lens;
|
|
||||||
real_t f1 = (p_intraocular_dist * 0.5) / p_display_to_lens;
|
real_t f1 = (p_intraocular_dist * 0.5) / p_display_to_lens;
|
||||||
real_t f2 = ((p_display_width - p_intraocular_dist) * 0.5) / p_display_to_lens;
|
real_t f2 = ((p_display_width - p_intraocular_dist) * 0.5) / p_display_to_lens;
|
||||||
real_t f3 = (p_display_width / 4.0) / p_display_to_lens;
|
real_t f3 = (p_display_width / 4.0) / p_display_to_lens;
|
||||||
|
|
|
@ -158,7 +158,7 @@ void TriangleMesh::create(const PoolVector<Vector3> &p_faces) {
|
||||||
|
|
||||||
max_depth = 0;
|
max_depth = 0;
|
||||||
int max_alloc = fc;
|
int max_alloc = fc;
|
||||||
int max = _create_bvh(bw.ptr(), bwp.ptr(), 0, fc, 1, max_depth, max_alloc);
|
_create_bvh(bw.ptr(), bwp.ptr(), 0, fc, 1, max_depth, max_alloc);
|
||||||
|
|
||||||
bw = PoolVector<BVH>::Write(); //clearup
|
bw = PoolVector<BVH>::Write(); //clearup
|
||||||
bvh.resize(max_alloc); //resize back
|
bvh.resize(max_alloc); //resize back
|
||||||
|
|
|
@ -125,6 +125,9 @@ void ScriptDebuggerRemote::_put_variable(const String &p_name, const Variant &p_
|
||||||
packet_peer_stream->put_var(p_name);
|
packet_peer_stream->put_var(p_name);
|
||||||
int len = 0;
|
int len = 0;
|
||||||
Error err = encode_variant(p_variable, NULL, len);
|
Error err = encode_variant(p_variable, NULL, len);
|
||||||
|
if (err != OK)
|
||||||
|
ERR_PRINT("Failed to encode variant");
|
||||||
|
|
||||||
if (len > packet_peer_stream->get_output_buffer_max_size()) { //limit to max size
|
if (len > packet_peer_stream->get_output_buffer_max_size()) { //limit to max size
|
||||||
packet_peer_stream->put_var(Variant());
|
packet_peer_stream->put_var(Variant());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -184,7 +184,6 @@ void ScriptInstance::call_multilevel(const StringName &p_method, VARIANT_ARG_DEC
|
||||||
argc++;
|
argc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant::CallError error;
|
|
||||||
call_multilevel(p_method, argptr, argc);
|
call_multilevel(p_method, argptr, argc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -595,7 +595,6 @@ RID RasterizerStorageGLES3::texture_create() {
|
||||||
|
|
||||||
void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags) {
|
void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags) {
|
||||||
|
|
||||||
int components;
|
|
||||||
GLenum format;
|
GLenum format;
|
||||||
GLenum internal_format;
|
GLenum internal_format;
|
||||||
GLenum type;
|
GLenum type;
|
||||||
|
@ -777,8 +776,6 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p
|
||||||
|
|
||||||
int tsize = 0;
|
int tsize = 0;
|
||||||
|
|
||||||
int block = Image::get_format_block_size(img->get_format());
|
|
||||||
|
|
||||||
for (int i = 0; i < mipmaps; i++) {
|
for (int i = 0; i < mipmaps; i++) {
|
||||||
|
|
||||||
int size, ofs;
|
int size, ofs;
|
||||||
|
@ -789,10 +786,6 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p
|
||||||
if (texture->compressed) {
|
if (texture->compressed) {
|
||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||||
|
|
||||||
//this is not needed, as compressed takes the regular size, even if blocks extend it
|
|
||||||
//int bw = (w % block != 0) ? w + (block - w % block) : w;
|
|
||||||
//int bh = (h % block != 0) ? h + (block - h % block) : h;
|
|
||||||
|
|
||||||
int bw = w;
|
int bw = w;
|
||||||
int bh = h;
|
int bh = h;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,6 @@ static size_t _set_sockaddr(struct sockaddr_storage *p_addr, const IP_Address &p
|
||||||
// IPv4 socket with IPv6 address
|
// IPv4 socket with IPv6 address
|
||||||
ERR_FAIL_COND_V(!p_ip.is_ipv4(), 0);
|
ERR_FAIL_COND_V(!p_ip.is_ipv4(), 0);
|
||||||
|
|
||||||
uint32_t ipv4 = *((uint32_t *)p_ip.get_ipv4());
|
|
||||||
struct sockaddr_in *addr4 = (struct sockaddr_in *)p_addr;
|
struct sockaddr_in *addr4 = (struct sockaddr_in *)p_addr;
|
||||||
addr4->sin_family = AF_INET;
|
addr4->sin_family = AF_INET;
|
||||||
addr4->sin_port = htons(p_port); // short, network byte order
|
addr4->sin_port = htons(p_port); // short, network byte order
|
||||||
|
|
|
@ -697,6 +697,8 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co
|
||||||
zd.zip = zip;
|
zd.zip = zip;
|
||||||
|
|
||||||
Error err = export_project_files(p_preset, _save_zip_file, &zd);
|
Error err = export_project_files(p_preset, _save_zip_file, &zd);
|
||||||
|
if (err != OK)
|
||||||
|
ERR_PRINT("Failed to export project files");
|
||||||
|
|
||||||
zipClose(zip, NULL);
|
zipClose(zip, NULL);
|
||||||
|
|
||||||
|
|
|
@ -412,7 +412,6 @@ void EditorNode::_fs_changed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed.size()) {
|
if (changed.size()) {
|
||||||
int idx = 0;
|
|
||||||
for (List<Ref<Resource> >::Element *E = changed.front(); E; E = E->next()) {
|
for (List<Ref<Resource> >::Element *E = changed.front(); E; E = E->next()) {
|
||||||
E->get()->reload_from_file();
|
E->get()->reload_from_file();
|
||||||
}
|
}
|
||||||
|
@ -1997,6 +1996,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
||||||
int cur_idx = editor_data.get_edited_scene();
|
int cur_idx = editor_data.get_edited_scene();
|
||||||
_remove_edited_scene();
|
_remove_edited_scene();
|
||||||
Error err = load_scene(filename);
|
Error err = load_scene(filename);
|
||||||
|
if (err != OK)
|
||||||
|
ERR_PRINT("Failed to load scene");
|
||||||
editor_data.move_edited_scene_to_index(cur_idx);
|
editor_data.move_edited_scene_to_index(cur_idx);
|
||||||
get_undo_redo()->clear_history();
|
get_undo_redo()->clear_history();
|
||||||
scene_tabs->set_current_tab(cur_idx);
|
scene_tabs->set_current_tab(cur_idx);
|
||||||
|
@ -3607,13 +3608,6 @@ void EditorNode::_update_dock_slots_visibility() {
|
||||||
right_r_vsplit,
|
right_r_vsplit,
|
||||||
};
|
};
|
||||||
|
|
||||||
HSplitContainer *h_splits[4] = {
|
|
||||||
left_l_hsplit,
|
|
||||||
left_r_hsplit,
|
|
||||||
main_hsplit,
|
|
||||||
right_hsplit,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!docks_visible) {
|
if (!docks_visible) {
|
||||||
|
|
||||||
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
|
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
|
||||||
|
|
|
@ -55,8 +55,8 @@ Error EditorSceneImporterGLTF::_parse_glb(const String &p_path, GLTFState &state
|
||||||
|
|
||||||
uint32_t magic = f->get_32();
|
uint32_t magic = f->get_32();
|
||||||
ERR_FAIL_COND_V(magic != 0x46546C67, ERR_FILE_UNRECOGNIZED); //glTF
|
ERR_FAIL_COND_V(magic != 0x46546C67, ERR_FILE_UNRECOGNIZED); //glTF
|
||||||
uint32_t version = f->get_32();
|
f->get_32(); // version
|
||||||
uint32_t length = f->get_32();
|
f->get_32(); // length
|
||||||
|
|
||||||
uint32_t chunk_length = f->get_32();
|
uint32_t chunk_length = f->get_32();
|
||||||
uint32_t chunk_type = f->get_32();
|
uint32_t chunk_type = f->get_32();
|
||||||
|
@ -1945,7 +1945,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
|
||||||
bool last = false;
|
bool last = false;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
float value = _interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, track.weight_tracks[i].interpolation);
|
_interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, track.weight_tracks[i].interpolation);
|
||||||
if (last) {
|
if (last) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GET FILESIZE */
|
/* GET FILESIZE */
|
||||||
uint32_t filesize = file->get_32();
|
file->get_32(); // filesize
|
||||||
|
|
||||||
/* CHECK WAVE */
|
/* CHECK WAVE */
|
||||||
|
|
||||||
|
|
|
@ -624,7 +624,7 @@ void ScriptTextEditor::_code_complete_script(const String &p_code, List<String>
|
||||||
}
|
}
|
||||||
String hint;
|
String hint;
|
||||||
Error err = script->get_language()->complete_code(p_code, script->get_path().get_base_dir(), base, r_options, r_force, hint);
|
Error err = script->get_language()->complete_code(p_code, script->get_path().get_base_dir(), base, r_options, r_force, hint);
|
||||||
if (hint != "") {
|
if (err == OK && hint != "") {
|
||||||
code_editor->get_text_edit()->set_code_hint(hint);
|
code_editor->get_text_edit()->set_code_hint(hint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,6 +164,8 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<String>
|
||||||
String calltip;
|
String calltip;
|
||||||
|
|
||||||
Error err = sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip);
|
Error err = sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip);
|
||||||
|
if (err != OK)
|
||||||
|
ERR_PRINT("Shaderlang complete failed");
|
||||||
|
|
||||||
if (calltip != "") {
|
if (calltip != "") {
|
||||||
get_text_edit()->set_code_hint(calltip);
|
get_text_edit()->set_code_hint(calltip);
|
||||||
|
@ -403,13 +405,7 @@ void ShaderEditorPlugin::edit(Object *p_object) {
|
||||||
|
|
||||||
bool ShaderEditorPlugin::handles(Object *p_object) const {
|
bool ShaderEditorPlugin::handles(Object *p_object) const {
|
||||||
|
|
||||||
bool handles = true;
|
|
||||||
Shader *shader = Object::cast_to<Shader>(p_object);
|
Shader *shader = Object::cast_to<Shader>(p_object);
|
||||||
/*
|
|
||||||
if (Object::cast_to<ShaderGraph>(shader)) // Don't handle ShaderGraph's
|
|
||||||
handles = false;
|
|
||||||
*/
|
|
||||||
|
|
||||||
return shader != NULL;
|
return shader != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2528,7 +2528,6 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const
|
||||||
|
|
||||||
found_gizmos.insert(seg);
|
found_gizmos.insert(seg);
|
||||||
|
|
||||||
int handle = -1;
|
|
||||||
Vector3 hit_point;
|
Vector3 hit_point;
|
||||||
Vector3 hit_normal;
|
Vector3 hit_normal;
|
||||||
bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal, NULL, false);
|
bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal, NULL, false);
|
||||||
|
@ -3423,13 +3422,6 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
|
||||||
settings_znear->set_value(float(d["znear"]));
|
settings_znear->set_value(float(d["znear"]));
|
||||||
if (d.has("fov"))
|
if (d.has("fov"))
|
||||||
settings_fov->set_value(float(d["fov"]));
|
settings_fov->set_value(float(d["fov"]));
|
||||||
|
|
||||||
if (d.has("default_srgb")) {
|
|
||||||
bool use = d["default_srgb"];
|
|
||||||
|
|
||||||
//viewport_environment->set_enable_fx(Environment::FX_SRGB,use);
|
|
||||||
//view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB), use );
|
|
||||||
}
|
|
||||||
if (d.has("show_grid")) {
|
if (d.has("show_grid")) {
|
||||||
bool use = d["show_grid"];
|
bool use = d["show_grid"];
|
||||||
|
|
||||||
|
|
|
@ -550,7 +550,6 @@ void TileMapEditor::_draw_fill_preview(int p_cell, const Point2i &p_point, bool
|
||||||
PoolVector<Vector2> points = _bucket_fill(p_point, false, true);
|
PoolVector<Vector2> points = _bucket_fill(p_point, false, true);
|
||||||
PoolVector<Vector2>::Read pr = points.read();
|
PoolVector<Vector2>::Read pr = points.read();
|
||||||
int len = points.size();
|
int len = points.size();
|
||||||
int time_after = OS::get_singleton()->get_ticks_msec();
|
|
||||||
|
|
||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; ++i) {
|
||||||
_draw_cell(p_cell, pr[i], p_flip_h, p_flip_v, p_transpose, p_xform);
|
_draw_cell(p_cell, pr[i], p_flip_h, p_flip_v, p_transpose, p_xform);
|
||||||
|
|
|
@ -732,6 +732,8 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) {
|
||||||
ERR_FAIL_COND(platform.is_null());
|
ERR_FAIL_COND(platform.is_null());
|
||||||
|
|
||||||
Error err = platform->export_project(current, export_debug->is_pressed(), p_path, 0);
|
Error err = platform->export_project(current, export_debug->is_pressed(), p_path, 0);
|
||||||
|
if (err != OK)
|
||||||
|
ERR_PRINT("Failed to export project");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectExportDialog::_bind_methods() {
|
void ProjectExportDialog::_bind_methods() {
|
||||||
|
|
|
@ -2275,19 +2275,6 @@ void PropertyEditor::_check_reload_status(const String &p_name, TreeItem *item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_might_be_in_instance()) {
|
|
||||||
|
|
||||||
Variant vorig;
|
|
||||||
Dictionary d = item->get_metadata(0);
|
|
||||||
int usage = d.has("usage") ? int(int(d["usage"]) & (PROPERTY_USAGE_STORE_IF_NONONE | PROPERTY_USAGE_STORE_IF_NONZERO)) : 0;
|
|
||||||
|
|
||||||
if (_get_instanced_node_original_property(p_name, vorig) || usage) {
|
|
||||||
Variant v = obj->get(p_name);
|
|
||||||
|
|
||||||
bool has_reload = _is_property_different(v, vorig, usage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj->call("property_can_revert", p_name).operator bool()) {
|
if (obj->call("property_can_revert", p_name).operator bool()) {
|
||||||
|
|
||||||
has_reload = true;
|
has_reload = true;
|
||||||
|
|
|
@ -1387,6 +1387,8 @@ bool Main::start() {
|
||||||
if (editor) {
|
if (editor) {
|
||||||
|
|
||||||
Error serr = editor_node->load_scene(local_game_path);
|
Error serr = editor_node->load_scene(local_game_path);
|
||||||
|
if (serr != OK)
|
||||||
|
ERR_PRINT("Failed to load scene");
|
||||||
OS::get_singleton()->set_context(OS::CONTEXT_EDITOR);
|
OS::get_singleton()->set_context(OS::CONTEXT_EDITOR);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1026,9 +1026,6 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs):
|
||||||
fd.write("\t\t\t{" + x["set_mask"] + "," + x["clear_mask"] + "},\n")
|
fd.write("\t\t\t{" + x["set_mask"] + "," + x["clear_mask"] + "},\n")
|
||||||
|
|
||||||
fd.write("\t\t};\n\n")
|
fd.write("\t\t};\n\n")
|
||||||
else:
|
|
||||||
fd.write("\t\tstatic const Enum *_enums=NULL;\n")
|
|
||||||
fd.write("\t\tstatic const EnumValue *_enum_values=NULL;\n")
|
|
||||||
|
|
||||||
conditionals_found = []
|
conditionals_found = []
|
||||||
if (len(header_data.conditionals)):
|
if (len(header_data.conditionals)):
|
||||||
|
|
|
@ -74,15 +74,11 @@ RES ResourceFormatPVR::load(const String &p_path, const String &p_original_path,
|
||||||
uint32_t mipmaps = f->get_32();
|
uint32_t mipmaps = f->get_32();
|
||||||
uint32_t flags = f->get_32();
|
uint32_t flags = f->get_32();
|
||||||
uint32_t surfsize = f->get_32();
|
uint32_t surfsize = f->get_32();
|
||||||
uint32_t bpp = f->get_32();
|
f->seek(f->get_pos() + 20); // bpp, rmask, gmask, bmask, amask
|
||||||
uint32_t rmask = f->get_32();
|
|
||||||
uint32_t gmask = f->get_32();
|
|
||||||
uint32_t bmask = f->get_32();
|
|
||||||
uint32_t amask = f->get_32();
|
|
||||||
uint8_t pvrid[5] = { 0, 0, 0, 0, 0 };
|
uint8_t pvrid[5] = { 0, 0, 0, 0, 0 };
|
||||||
f->get_buffer(pvrid, 4);
|
f->get_buffer(pvrid, 4);
|
||||||
ERR_FAIL_COND_V(String((char *)pvrid) != "PVR!", RES());
|
ERR_FAIL_COND_V(String((char *)pvrid) != "PVR!", RES());
|
||||||
uint32_t surfcount = f->get_32();
|
f->get_32(); // surfcount
|
||||||
|
|
||||||
/*
|
/*
|
||||||
print_line("height: "+itos(height));
|
print_line("height: "+itos(height));
|
||||||
|
|
|
@ -831,7 +831,6 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
|
||||||
case TK_BUILTIN_FUNC: {
|
case TK_BUILTIN_FUNC: {
|
||||||
//builtin function
|
//builtin function
|
||||||
|
|
||||||
Variant::Type bt = Variant::Type(int(tk.value));
|
|
||||||
_get_token(tk);
|
_get_token(tk);
|
||||||
if (tk.type != TK_PARENTHESIS_OPEN) {
|
if (tk.type != TK_PARENTHESIS_OPEN) {
|
||||||
_set_error("Expected '('");
|
_set_error("Expected '('");
|
||||||
|
|
|
@ -520,25 +520,21 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
|
|
||||||
void _fix_manifest(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &p_manifest, bool p_give_internet) {
|
void _fix_manifest(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &p_manifest, bool p_give_internet) {
|
||||||
|
|
||||||
const int CHUNK_AXML_FILE = 0x00080003;
|
// Leaving the unused types commented because looking these constants up
|
||||||
const int CHUNK_RESOURCEIDS = 0x00080180;
|
// again later would be annoying
|
||||||
|
// const int CHUNK_AXML_FILE = 0x00080003;
|
||||||
|
// const int CHUNK_RESOURCEIDS = 0x00080180;
|
||||||
const int CHUNK_STRINGS = 0x001C0001;
|
const int CHUNK_STRINGS = 0x001C0001;
|
||||||
const int CHUNK_XML_END_NAMESPACE = 0x00100101;
|
// const int CHUNK_XML_END_NAMESPACE = 0x00100101;
|
||||||
const int CHUNK_XML_END_TAG = 0x00100103;
|
// const int CHUNK_XML_END_TAG = 0x00100103;
|
||||||
const int CHUNK_XML_START_NAMESPACE = 0x00100100;
|
// const int CHUNK_XML_START_NAMESPACE = 0x00100100;
|
||||||
const int CHUNK_XML_START_TAG = 0x00100102;
|
const int CHUNK_XML_START_TAG = 0x00100102;
|
||||||
const int CHUNK_XML_TEXT = 0x00100104;
|
// const int CHUNK_XML_TEXT = 0x00100104;
|
||||||
const int UTF8_FLAG = 0x00000100;
|
const int UTF8_FLAG = 0x00000100;
|
||||||
|
|
||||||
Vector<String> string_table;
|
Vector<String> string_table;
|
||||||
|
|
||||||
uint32_t ofs = 0;
|
uint32_t ofs = 8;
|
||||||
|
|
||||||
uint32_t header = decode_uint32(&p_manifest[ofs]);
|
|
||||||
uint32_t filesize = decode_uint32(&p_manifest[ofs + 4]);
|
|
||||||
ofs += 8;
|
|
||||||
|
|
||||||
//print_line("FILESIZE: "+itos(filesize)+" ACTUAL: "+itos(p_manifest.size()));
|
|
||||||
|
|
||||||
uint32_t string_count = 0;
|
uint32_t string_count = 0;
|
||||||
uint32_t styles_count = 0;
|
uint32_t styles_count = 0;
|
||||||
|
@ -646,24 +642,16 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
case CHUNK_XML_START_TAG: {
|
case CHUNK_XML_START_TAG: {
|
||||||
|
|
||||||
int iofs = ofs + 8;
|
int iofs = ofs + 8;
|
||||||
uint32_t line = decode_uint32(&p_manifest[iofs]);
|
|
||||||
uint32_t nspace = decode_uint32(&p_manifest[iofs + 8]);
|
|
||||||
uint32_t name = decode_uint32(&p_manifest[iofs + 12]);
|
uint32_t name = decode_uint32(&p_manifest[iofs + 12]);
|
||||||
uint32_t check = decode_uint32(&p_manifest[iofs + 16]);
|
|
||||||
|
|
||||||
String tname = string_table[name];
|
String tname = string_table[name];
|
||||||
|
|
||||||
//printf("NSPACE: %i\n",nspace);
|
|
||||||
//printf("NAME: %i (%s)\n",name,tname.utf8().get_data());
|
|
||||||
//printf("CHECK: %x\n",check);
|
|
||||||
uint32_t attrcount = decode_uint32(&p_manifest[iofs + 20]);
|
uint32_t attrcount = decode_uint32(&p_manifest[iofs + 20]);
|
||||||
iofs += 28;
|
iofs += 28;
|
||||||
//printf("ATTRCOUNT: %x\n",attrcount);
|
|
||||||
for (uint32_t i = 0; i < attrcount; i++) {
|
for (uint32_t i = 0; i < attrcount; i++) {
|
||||||
uint32_t attr_nspace = decode_uint32(&p_manifest[iofs]);
|
uint32_t attr_nspace = decode_uint32(&p_manifest[iofs]);
|
||||||
uint32_t attr_name = decode_uint32(&p_manifest[iofs + 4]);
|
uint32_t attr_name = decode_uint32(&p_manifest[iofs + 4]);
|
||||||
uint32_t attr_value = decode_uint32(&p_manifest[iofs + 8]);
|
uint32_t attr_value = decode_uint32(&p_manifest[iofs + 8]);
|
||||||
uint32_t attr_flags = decode_uint32(&p_manifest[iofs + 12]);
|
|
||||||
uint32_t attr_resid = decode_uint32(&p_manifest[iofs + 16]);
|
uint32_t attr_resid = decode_uint32(&p_manifest[iofs + 16]);
|
||||||
|
|
||||||
String value;
|
String value;
|
||||||
|
@ -678,12 +666,6 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
else
|
else
|
||||||
nspace = "";
|
nspace = "";
|
||||||
|
|
||||||
//printf("ATTR %i NSPACE: %i\n",i,attr_nspace);
|
|
||||||
//printf("ATTR %i NAME: %i (%s)\n",i,attr_name,attrname.utf8().get_data());
|
|
||||||
//printf("ATTR %i VALUE: %i (%s)\n",i,attr_value,value.utf8().get_data());
|
|
||||||
//printf("ATTR %i FLAGS: %x\n",i,attr_flags);
|
|
||||||
//printf("ATTR %i RESID: %x\n",i,attr_resid);
|
|
||||||
|
|
||||||
//replace project information
|
//replace project information
|
||||||
if (tname == "manifest" && attrname == "package") {
|
if (tname == "manifest" && attrname == "package") {
|
||||||
|
|
||||||
|
@ -691,9 +673,6 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
string_table[attr_value] = get_package_name(package_name);
|
string_table[attr_value] = get_package_name(package_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
//print_line("tname: "+tname);
|
|
||||||
//print_line("nspace: "+nspace);
|
|
||||||
//print_line("attrname: "+attrname);
|
|
||||||
if (tname == "manifest" && /*nspace=="android" &&*/ attrname == "versionCode") {
|
if (tname == "manifest" && /*nspace=="android" &&*/ attrname == "versionCode") {
|
||||||
|
|
||||||
print_line("FOUND versionCode");
|
print_line("FOUND versionCode");
|
||||||
|
@ -712,13 +691,6 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
if (tname == "activity" && /*nspace=="android" &&*/ attrname == "screenOrientation") {
|
if (tname == "activity" && /*nspace=="android" &&*/ attrname == "screenOrientation") {
|
||||||
|
|
||||||
encode_uint32(orientation == 0 ? 0 : 1, &p_manifest[iofs + 16]);
|
encode_uint32(orientation == 0 ? 0 : 1, &p_manifest[iofs + 16]);
|
||||||
/*
|
|
||||||
print_line("FOUND screen orientation");
|
|
||||||
if (attr_value==0xFFFFFFFF) {
|
|
||||||
WARN_PRINT("Version name in a resource, should be plaintext")
|
|
||||||
} else {
|
|
||||||
string_table[attr_value]=(orientation==0?"landscape":"portrait");
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tname == "uses-feature" && /*nspace=="android" &&*/ attrname == "glEsVersion") {
|
if (tname == "uses-feature" && /*nspace=="android" &&*/ attrname == "glEsVersion") {
|
||||||
|
@ -771,13 +743,10 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
//printf("chunk %x: size: %d\n",chunk,size);
|
|
||||||
|
|
||||||
ofs += size;
|
ofs += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("end\n");
|
|
||||||
|
|
||||||
//create new andriodmanifest binary
|
//create new andriodmanifest binary
|
||||||
|
|
||||||
Vector<uint8_t> ret;
|
Vector<uint8_t> ret;
|
||||||
|
@ -876,8 +845,6 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
const int UTF8_FLAG = 0x00000100;
|
const int UTF8_FLAG = 0x00000100;
|
||||||
print_line("*******************GORRRGLE***********************");
|
print_line("*******************GORRRGLE***********************");
|
||||||
|
|
||||||
uint32_t header = decode_uint32(&p_manifest[0]);
|
|
||||||
uint32_t filesize = decode_uint32(&p_manifest[4]);
|
|
||||||
uint32_t string_block_len = decode_uint32(&p_manifest[16]);
|
uint32_t string_block_len = decode_uint32(&p_manifest[16]);
|
||||||
uint32_t string_count = decode_uint32(&p_manifest[20]);
|
uint32_t string_count = decode_uint32(&p_manifest[20]);
|
||||||
uint32_t string_flags = decode_uint32(&p_manifest[28]);
|
uint32_t string_flags = decode_uint32(&p_manifest[28]);
|
||||||
|
@ -887,10 +854,6 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
|
|
||||||
String package_name = p_preset->get("package/name");
|
String package_name = p_preset->get("package/name");
|
||||||
|
|
||||||
//printf("stirng block len: %i\n",string_block_len);
|
|
||||||
//printf("stirng count: %i\n",string_count);
|
|
||||||
//printf("flags: %x\n",string_flags);
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < string_count; i++) {
|
for (uint32_t i = 0; i < string_count; i++) {
|
||||||
|
|
||||||
uint32_t offset = decode_uint32(&p_manifest[string_table_begins + i * 4]);
|
uint32_t offset = decode_uint32(&p_manifest[string_table_begins + i * 4]);
|
||||||
|
|
|
@ -466,8 +466,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t
|
||||||
EditorNode::progress_task_step(progress_task, "File: " + p_file_name, (p_file_no * 100) / p_total_files);
|
EditorNode::progress_task_step(progress_task, "File: " + p_file_name, (p_file_no * 100) / p_total_files);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool do_hash = p_file_name != "AppxSignature.p7x";
|
|
||||||
|
|
||||||
FileMeta meta;
|
FileMeta meta;
|
||||||
meta.name = p_file_name;
|
meta.name = p_file_name;
|
||||||
meta.uncompressed_size = p_len;
|
meta.uncompressed_size = p_len;
|
||||||
|
|
|
@ -338,7 +338,6 @@ void CanvasItem::_update_callback() {
|
||||||
notification(NOTIFICATION_DRAW);
|
notification(NOTIFICATION_DRAW);
|
||||||
emit_signal(SceneStringNames::get_singleton()->draw);
|
emit_signal(SceneStringNames::get_singleton()->draw);
|
||||||
if (get_script_instance()) {
|
if (get_script_instance()) {
|
||||||
Variant::CallError err;
|
|
||||||
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_draw, NULL, 0);
|
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_draw, NULL, 0);
|
||||||
}
|
}
|
||||||
drawing = false;
|
drawing = false;
|
||||||
|
|
|
@ -696,22 +696,6 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons
|
||||||
p_baker->bake_cells[p_idx].normal[2] += normal_accum.z;
|
p_baker->bake_cells[p_idx].normal[2] += normal_accum.z;
|
||||||
p_baker->bake_cells[p_idx].alpha += alpha;
|
p_baker->bake_cells[p_idx].alpha += alpha;
|
||||||
|
|
||||||
static const Vector3 side_normals[6] = {
|
|
||||||
Vector3(-1, 0, 0),
|
|
||||||
Vector3(1, 0, 0),
|
|
||||||
Vector3(0, -1, 0),
|
|
||||||
Vector3(0, 1, 0),
|
|
||||||
Vector3(0, 0, -1),
|
|
||||||
Vector3(0, 0, 1),
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
for(int i=0;i<6;i++) {
|
|
||||||
if (normal.dot(side_normals[i])>CMP_EPSILON) {
|
|
||||||
p_baker->bake_cells[p_idx].used_sides|=(1<<i);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//go down
|
//go down
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,6 @@ void Spatial::_notification(int p_what) {
|
||||||
|
|
||||||
if (get_script_instance()) {
|
if (get_script_instance()) {
|
||||||
|
|
||||||
Variant::CallError err;
|
|
||||||
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_enter_world, NULL, 0);
|
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_enter_world, NULL, 0);
|
||||||
}
|
}
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
|
@ -207,7 +206,6 @@ void Spatial::_notification(int p_what) {
|
||||||
|
|
||||||
if (get_script_instance()) {
|
if (get_script_instance()) {
|
||||||
|
|
||||||
Variant::CallError err;
|
|
||||||
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_world, NULL, 0);
|
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_world, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2478,7 +2478,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
|
||||||
pressing_for_editor = false;
|
pressing_for_editor = false;
|
||||||
|
|
||||||
blocked++;
|
blocked++;
|
||||||
bool handled = propagate_mouse_event(pos + cache.offset, 0, 0, b->is_doubleclick(), root, b->get_button_index(), b);
|
propagate_mouse_event(pos + cache.offset, 0, 0, b->is_doubleclick(), root, b->get_button_index(), b);
|
||||||
blocked--;
|
blocked--;
|
||||||
|
|
||||||
if (pressing_for_editor) {
|
if (pressing_for_editor) {
|
||||||
|
|
|
@ -50,7 +50,6 @@ void Node::_notification(int p_notification) {
|
||||||
|
|
||||||
Variant time = get_process_delta_time();
|
Variant time = get_process_delta_time();
|
||||||
const Variant *ptr[1] = { &time };
|
const Variant *ptr[1] = { &time };
|
||||||
Variant::CallError err;
|
|
||||||
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_process, ptr, 1);
|
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_process, ptr, 1);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -60,7 +59,6 @@ void Node::_notification(int p_notification) {
|
||||||
|
|
||||||
Variant time = get_fixed_process_delta_time();
|
Variant time = get_fixed_process_delta_time();
|
||||||
const Variant *ptr[1] = { &time };
|
const Variant *ptr[1] = { &time };
|
||||||
Variant::CallError err;
|
|
||||||
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_fixed_process, ptr, 1);
|
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_fixed_process, ptr, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +132,6 @@ void Node::_notification(int p_notification) {
|
||||||
set_fixed_process(true);
|
set_fixed_process(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant::CallError err;
|
|
||||||
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_ready, NULL, 0);
|
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_ready, NULL, 0);
|
||||||
}
|
}
|
||||||
//emit_signal(SceneStringNames::get_singleton()->enter_tree);
|
//emit_signal(SceneStringNames::get_singleton()->enter_tree);
|
||||||
|
@ -209,7 +206,6 @@ void Node::_propagate_enter_tree() {
|
||||||
|
|
||||||
if (get_script_instance()) {
|
if (get_script_instance()) {
|
||||||
|
|
||||||
Variant::CallError err;
|
|
||||||
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_enter_tree, NULL, 0);
|
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_enter_tree, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +269,6 @@ void Node::_propagate_exit_tree() {
|
||||||
|
|
||||||
if (get_script_instance()) {
|
if (get_script_instance()) {
|
||||||
|
|
||||||
Variant::CallError err;
|
|
||||||
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_tree, NULL, 0);
|
get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_tree, NULL, 0);
|
||||||
}
|
}
|
||||||
emit_signal(SceneStringNames::get_singleton()->tree_exited);
|
emit_signal(SceneStringNames::get_singleton()->tree_exited);
|
||||||
|
|
|
@ -870,7 +870,6 @@ void SceneTree::_call_input_pause(const StringName &p_group, const StringName &p
|
||||||
if (!n->can_process())
|
if (!n->can_process())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Variant::CallError ce;
|
|
||||||
n->call_multilevel(p_method, (const Variant **)v, 1);
|
n->call_multilevel(p_method, (const Variant **)v, 1);
|
||||||
//ERR_FAIL_COND(node_count != g.nodes.size());
|
//ERR_FAIL_COND(node_count != g.nodes.size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,15 +84,6 @@ int Curve::add_point(Vector2 p_pos, real_t left_tangent, real_t right_tangent, T
|
||||||
|
|
||||||
int i = get_index(p_pos.x);
|
int i = get_index(p_pos.x);
|
||||||
|
|
||||||
int nearest_index = i;
|
|
||||||
if (i + 1 < _points.size()) {
|
|
||||||
real_t diff0 = p_pos.x - _points[i].pos.x;
|
|
||||||
real_t diff1 = _points[i + 1].pos.x - p_pos.x;
|
|
||||||
|
|
||||||
if (diff1 < diff0)
|
|
||||||
nearest_index = i + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i == 0 && p_pos.x < _points[0].pos.x) {
|
if (i == 0 && p_pos.x < _points[0].pos.x) {
|
||||||
// Insert before anything else
|
// Insert before anything else
|
||||||
_points.insert(0, Point(p_pos, left_tangent, right_tangent, left_mode, right_mode));
|
_points.insert(0, Point(p_pos, left_tangent, right_tangent, left_mode, right_mode));
|
||||||
|
|
|
@ -130,7 +130,6 @@ void ARVRServer::request_reference_frame(bool p_ignore_tilt, bool p_keep_height)
|
||||||
void ARVRServer::add_interface(const Ref<ARVRInterface> &p_interface) {
|
void ARVRServer::add_interface(const Ref<ARVRInterface> &p_interface) {
|
||||||
ERR_FAIL_COND(p_interface.is_null());
|
ERR_FAIL_COND(p_interface.is_null());
|
||||||
|
|
||||||
int idx = -1;
|
|
||||||
for (int i = 0; i < interfaces.size(); i++) {
|
for (int i = 0; i < interfaces.size(); i++) {
|
||||||
|
|
||||||
if (interfaces[i] == p_interface) {
|
if (interfaces[i] == p_interface) {
|
||||||
|
|
|
@ -31,18 +31,13 @@
|
||||||
|
|
||||||
void AudioEffectLimiterInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
|
void AudioEffectLimiterInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) {
|
||||||
|
|
||||||
float thresh = Math::db2linear(base->threshold);
|
|
||||||
float threshdb = base->threshold;
|
float threshdb = base->threshold;
|
||||||
float ceiling = Math::db2linear(base->ceiling);
|
float ceiling = Math::db2linear(base->ceiling);
|
||||||
float ceildb = base->ceiling;
|
float ceildb = base->ceiling;
|
||||||
float makeup = Math::db2linear(ceildb - threshdb);
|
float makeup = Math::db2linear(ceildb - threshdb);
|
||||||
float makeupdb = ceildb - threshdb;
|
|
||||||
float sc = -base->soft_clip;
|
float sc = -base->soft_clip;
|
||||||
float scv = Math::db2linear(sc);
|
float scv = Math::db2linear(sc);
|
||||||
float sccomp = Math::db2linear(-sc);
|
|
||||||
float peakdb = ceildb + 25;
|
float peakdb = ceildb + 25;
|
||||||
float peaklvl = Math::db2linear(peakdb);
|
|
||||||
float scratio = base->soft_clip_ratio;
|
|
||||||
float scmult = Math::abs((ceildb - sc) / (peakdb - sc));
|
float scmult = Math::abs((ceildb - sc) / (peakdb - sc));
|
||||||
|
|
||||||
for (int i = 0; i < p_frame_count; i++) {
|
for (int i = 0; i < p_frame_count; i++) {
|
||||||
|
|
|
@ -954,6 +954,9 @@ Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const {
|
||||||
void ConvexPolygonShapeSW::_setup(const Vector<Vector3> &p_vertices) {
|
void ConvexPolygonShapeSW::_setup(const Vector<Vector3> &p_vertices) {
|
||||||
|
|
||||||
Error err = QuickHull::build(p_vertices, mesh);
|
Error err = QuickHull::build(p_vertices, mesh);
|
||||||
|
if (err != OK)
|
||||||
|
ERR_PRINT("Failed to build QuickHull");
|
||||||
|
|
||||||
Rect3 _aabb;
|
Rect3 _aabb;
|
||||||
|
|
||||||
for (int i = 0; i < mesh.vertices.size(); i++) {
|
for (int i = 0; i < mesh.vertices.size(); i++) {
|
||||||
|
|
|
@ -62,7 +62,7 @@ void StepSW::_setup_island(ConstraintSW *p_island, real_t p_delta) {
|
||||||
|
|
||||||
ConstraintSW *ci = p_island;
|
ConstraintSW *ci = p_island;
|
||||||
while (ci) {
|
while (ci) {
|
||||||
bool process = ci->setup(p_delta);
|
ci->setup(p_delta);
|
||||||
//todo remove from island if process fails
|
//todo remove from island if process fails
|
||||||
ci = ci->get_island_next();
|
ci = ci->get_island_next();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3000,8 +3000,6 @@ ShaderLanguage::Node *ShaderLanguage::_reduce_expression(BlockNode *p_block, Sha
|
||||||
if (op->op == OP_CONSTRUCT) {
|
if (op->op == OP_CONSTRUCT) {
|
||||||
|
|
||||||
ERR_FAIL_COND_V(op->arguments[0]->type != Node::TYPE_VARIABLE, p_node);
|
ERR_FAIL_COND_V(op->arguments[0]->type != Node::TYPE_VARIABLE, p_node);
|
||||||
VariableNode *vn = static_cast<VariableNode *>(op->arguments[0]);
|
|
||||||
//StringName name=vn->name;
|
|
||||||
|
|
||||||
DataType base = get_scalar_type(op->get_datatype());
|
DataType base = get_scalar_type(op->get_datatype());
|
||||||
|
|
||||||
|
@ -3121,8 +3119,8 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
|
|
||||||
VariableDeclarationNode *vardecl = alloc_node<VariableDeclarationNode>();
|
VariableDeclarationNode *vardecl = alloc_node<VariableDeclarationNode>();
|
||||||
vardecl->datatype=type;
|
vardecl->datatype = type;
|
||||||
vardecl->precision=precision;
|
vardecl->precision = precision;
|
||||||
|
|
||||||
p_block->statements.push_back(vardecl);
|
p_block->statements.push_back(vardecl);
|
||||||
|
|
||||||
|
@ -3148,8 +3146,8 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
|
||||||
|
|
||||||
VariableDeclarationNode::Declaration decl;
|
VariableDeclarationNode::Declaration decl;
|
||||||
|
|
||||||
decl.name=name;
|
decl.name = name;
|
||||||
decl.initializer=NULL;
|
decl.initializer = NULL;
|
||||||
|
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
|
|
||||||
|
@ -3161,13 +3159,11 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
|
||||||
|
|
||||||
decl.initializer = n;
|
decl.initializer = n;
|
||||||
|
|
||||||
if (var.type!=n->get_datatype()) {
|
if (var.type != n->get_datatype()) {
|
||||||
_set_error("Invalid assignment of '" + get_datatype_name(n->get_datatype()) + "' to '" + get_datatype_name(var.type) + "'");
|
_set_error("Invalid assignment of '" + get_datatype_name(n->get_datatype()) + "' to '" + get_datatype_name(var.type) + "'");
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
|
|
||||||
}
|
}
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vardecl->declarations.push_back(decl);
|
vardecl->declarations.push_back(decl);
|
||||||
|
@ -3272,9 +3268,9 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
|
||||||
|
|
||||||
BlockNode *init_block = alloc_node<BlockNode>();
|
BlockNode *init_block = alloc_node<BlockNode>();
|
||||||
init_block->parent_block = p_block;
|
init_block->parent_block = p_block;
|
||||||
init_block->single_statement=true;
|
init_block->single_statement = true;
|
||||||
cf->blocks.push_back(init_block);
|
cf->blocks.push_back(init_block);
|
||||||
if (_parse_block(init_block,p_builtin_types,true,false,false)!=OK) {
|
if (_parse_block(init_block, p_builtin_types, true, false, false) != OK) {
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3282,10 +3278,9 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
|
||||||
if (!n)
|
if (!n)
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
|
|
||||||
if (n->get_datatype()!=TYPE_BOOL) {
|
if (n->get_datatype() != TYPE_BOOL) {
|
||||||
_set_error("Middle expression is expected to be boolean.");
|
_set_error("Middle expression is expected to be boolean.");
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
|
@ -3392,7 +3387,6 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
|
||||||
p_block->statements.push_back(flow);
|
p_block->statements.push_back(flow);
|
||||||
} else if (tk.type == TK_CF_BREAK) {
|
} else if (tk.type == TK_CF_BREAK) {
|
||||||
|
|
||||||
|
|
||||||
if (!p_can_break) {
|
if (!p_can_break) {
|
||||||
//all is good
|
//all is good
|
||||||
_set_error("Breaking is not allowed here");
|
_set_error("Breaking is not allowed here");
|
||||||
|
@ -3411,7 +3405,6 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat
|
||||||
p_block->statements.push_back(flow);
|
p_block->statements.push_back(flow);
|
||||||
} else if (tk.type == TK_CF_CONTINUE) {
|
} else if (tk.type == TK_CF_CONTINUE) {
|
||||||
|
|
||||||
|
|
||||||
if (!p_can_break) {
|
if (!p_can_break) {
|
||||||
//all is good
|
//all is good
|
||||||
_set_error("Contiuning is not allowed here");
|
_set_error("Contiuning is not allowed here");
|
||||||
|
@ -3980,6 +3973,8 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
|
||||||
|
|
||||||
shader = alloc_node<ShaderNode>();
|
shader = alloc_node<ShaderNode>();
|
||||||
Error err = _parse_shader(p_functions, p_render_modes, p_shader_types);
|
Error err = _parse_shader(p_functions, p_render_modes, p_shader_types);
|
||||||
|
if (err != OK)
|
||||||
|
ERR_PRINT("Failed to parse shader");
|
||||||
|
|
||||||
switch (completion_type) {
|
switch (completion_type) {
|
||||||
|
|
||||||
|
|
|
@ -151,8 +151,6 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance
|
||||||
} else if (B->base_type == VS::INSTANCE_GI_PROBE && A->base_type == VS::INSTANCE_LIGHT) {
|
} else if (B->base_type == VS::INSTANCE_GI_PROBE && A->base_type == VS::INSTANCE_LIGHT) {
|
||||||
|
|
||||||
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data);
|
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data);
|
||||||
InstanceLightData *light = static_cast<InstanceLightData *>(A->base_data);
|
|
||||||
|
|
||||||
return gi_probe->lights.insert(A);
|
return gi_probe->lights.insert(A);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,8 +209,6 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance
|
||||||
} else if (B->base_type == VS::INSTANCE_GI_PROBE && A->base_type == VS::INSTANCE_LIGHT) {
|
} else if (B->base_type == VS::INSTANCE_GI_PROBE && A->base_type == VS::INSTANCE_LIGHT) {
|
||||||
|
|
||||||
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data);
|
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data);
|
||||||
InstanceLightData *light = static_cast<InstanceLightData *>(A->base_data);
|
|
||||||
|
|
||||||
Set<Instance *>::Element *E = reinterpret_cast<Set<Instance *>::Element *>(udata);
|
Set<Instance *>::Element *E = reinterpret_cast<Set<Instance *>::Element *>(udata);
|
||||||
|
|
||||||
gi_probe->lights.erase(E);
|
gi_probe->lights.erase(E);
|
||||||
|
@ -2130,7 +2126,7 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
|
||||||
|
|
||||||
int success_count = 0;
|
int success_count = 0;
|
||||||
|
|
||||||
uint64_t us = OS::get_singleton()->get_ticks_usec();
|
// uint64_t us = OS::get_singleton()->get_ticks_usec();
|
||||||
|
|
||||||
for (int i = 0; i < p_leaf_count; i++) {
|
for (int i = 0; i < p_leaf_count; i++) {
|
||||||
|
|
||||||
|
@ -2183,14 +2179,15 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
|
||||||
success_count++;
|
success_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
|
|
||||||
//print_line("valid cells: " + itos(success_count));
|
// print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
|
||||||
|
// print_line("valid cells: " + itos(success_count));
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case VS::LIGHT_OMNI:
|
case VS::LIGHT_OMNI:
|
||||||
case VS::LIGHT_SPOT: {
|
case VS::LIGHT_SPOT: {
|
||||||
|
|
||||||
uint64_t us = OS::get_singleton()->get_ticks_usec();
|
// uint64_t us = OS::get_singleton()->get_ticks_usec();
|
||||||
|
|
||||||
Vector3 light_pos = light_cache.transform.origin;
|
Vector3 light_pos = light_cache.transform.origin;
|
||||||
Vector3 spot_axis = -light_cache.transform.basis.get_axis(2).normalized();
|
Vector3 spot_axis = -light_cache.transform.basis.get_axis(2).normalized();
|
||||||
|
@ -2289,8 +2286,7 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
|
||||||
light->energy[2] += int32_t(light_b * att * ((cell->albedo) & 0xFF) / 255.0);
|
light->energy[2] += int32_t(light_b * att * ((cell->albedo) & 0xFF) / 255.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
|
// print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2702,18 +2698,17 @@ void VisualServerScene::render_probes() {
|
||||||
} break;
|
} break;
|
||||||
case GI_UPDATE_STAGE_UPLOADING: {
|
case GI_UPDATE_STAGE_UPLOADING: {
|
||||||
|
|
||||||
uint64_t us = OS::get_singleton()->get_ticks_usec();
|
// uint64_t us = OS::get_singleton()->get_ticks_usec();
|
||||||
|
|
||||||
for (int i = 0; i < (int)probe->dynamic.mipmaps_3d.size(); i++) {
|
for (int i = 0; i < (int)probe->dynamic.mipmaps_3d.size(); i++) {
|
||||||
|
|
||||||
int mmsize = probe->dynamic.mipmaps_3d[i].size();
|
|
||||||
PoolVector<uint8_t>::Read r = probe->dynamic.mipmaps_3d[i].read();
|
PoolVector<uint8_t>::Read r = probe->dynamic.mipmaps_3d[i].read();
|
||||||
VSG::storage->gi_probe_dynamic_data_update(probe->dynamic.probe_data, 0, probe->dynamic.grid_size[2] >> i, i, r.ptr());
|
VSG::storage->gi_probe_dynamic_data_update(probe->dynamic.probe_data, 0, probe->dynamic.grid_size[2] >> i, i, r.ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
probe->dynamic.updating_stage = GI_UPDATE_STAGE_CHECK;
|
probe->dynamic.updating_stage = GI_UPDATE_STAGE_CHECK;
|
||||||
|
|
||||||
//print_line("UPLOAD TIME: "+rtos((OS::get_singleton()->get_ticks_usec()-us)/1000000.0));
|
// print_line("UPLOAD TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue