summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/io/file_access_network.cpp2
-rw-r--r--core/io/resource_format_binary.cpp41
-rw-r--r--core/io/resource_format_binary.h2
-rw-r--r--core/math/camera_matrix.cpp1
-rw-r--r--core/math/triangle_mesh.cpp2
-rw-r--r--core/script_debugger_remote.cpp3
-rw-r--r--core/script_language.cpp1
7 files changed, 20 insertions, 32 deletions
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp
index d8b8c8c200..58ca2d4c58 100644
--- a/core/io/file_access_network.cpp
+++ b/core/io/file_access_network.cpp
@@ -87,6 +87,8 @@ void FileAccessNetworkClient::_thread_func() {
DEBUG_PRINT("SEM WAIT - " + itos(sem->get()));
Error err = sem->wait();
+ if (err != OK)
+ ERR_PRINT("sem->wait() failed");
DEBUG_TIME("sem_unlock");
//DEBUG_PRINT("semwait returned "+itos(werr));
DEBUG_PRINT("MUTEX LOCK " + itos(lockcount));
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 661eba2106..16ec6cd3c5 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -37,7 +37,7 @@
#include "core/version.h"
//#define print_bl(m_what) print_line(m_what)
-#define print_bl(m_what)
+#define print_bl(m_what) (void)(m_what)
enum {
@@ -854,12 +854,6 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
}
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();
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();
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("major: " + itos(ver_major));
print_bl("minor: " + itos(ver_minor));
@@ -964,18 +962,12 @@ String ResourceInteractiveLoaderBinary::recognize(FileAccess *p_f) {
}
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();
+ f->get_32(); // use_real64
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_minor = f->get_32();
+ f->get_32(); // ver_minor
uint32_t ver_format = f->get_32();
if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) {
@@ -993,8 +985,6 @@ ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() {
f = NULL;
stage = 0;
- endian_swap = false;
- use_real64 = false;
error = OK;
translation_remapped = false;
}
@@ -1123,16 +1113,14 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
}
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();
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->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());
- uint64_t md_at = f->get_pos();
- f->store_64(0); //offset to impoty metadata
+ f->store_64(0); //offset to import metadata
for (int i = 0; i < 14; i++)
f->store_32(0); // reserved
diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h
index ab77c2c9d3..2316f05b3c 100644
--- a/core/io/resource_format_binary.h
+++ b/core/io/resource_format_binary.h
@@ -44,8 +44,6 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader {
FileAccess *f;
- bool endian_swap;
- bool use_real64;
uint64_t importmd_ofs;
Vector<char> str_buf;
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp
index b7a929c8e0..7132b6573e 100644
--- a/core/math/camera_matrix.cpp
+++ b/core/math/camera_matrix.cpp
@@ -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) {
// 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 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;
diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp
index 614104f698..3b246cb183 100644
--- a/core/math/triangle_mesh.cpp
+++ b/core/math/triangle_mesh.cpp
@@ -158,7 +158,7 @@ void TriangleMesh::create(const PoolVector<Vector3> &p_faces) {
max_depth = 0;
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
bvh.resize(max_alloc); //resize back
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 8875732b8e..f0097054b1 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -125,6 +125,9 @@ void ScriptDebuggerRemote::_put_variable(const String &p_name, const Variant &p_
packet_peer_stream->put_var(p_name);
int len = 0;
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
packet_peer_stream->put_var(Variant());
} else {
diff --git a/core/script_language.cpp b/core/script_language.cpp
index bde80a30bc..5ead91f26e 100644
--- a/core/script_language.cpp
+++ b/core/script_language.cpp
@@ -184,7 +184,6 @@ void ScriptInstance::call_multilevel(const StringName &p_method, VARIANT_ARG_DEC
argc++;
}
- Variant::CallError error;
call_multilevel(p_method, argptr, argc);
}