summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/compression.cpp2
-rw-r--r--core/io/file_access_pack.cpp4
-rw-r--r--core/io/image_loader.cpp1
-rw-r--r--core/io/marshalls.cpp2
-rw-r--r--core/io/multiplayer_api.cpp4
-rw-r--r--core/io/resource_loader.cpp2
-rw-r--r--core/io/resource_loader.h4
7 files changed, 11 insertions, 8 deletions
diff --git a/core/io/compression.cpp b/core/io/compression.cpp
index e456a85c65..3c0b6541bd 100644
--- a/core/io/compression.cpp
+++ b/core/io/compression.cpp
@@ -175,7 +175,7 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
} break;
case MODE_ZSTD: {
ZSTD_DCtx *dctx = ZSTD_createDCtx();
- if (zstd_long_distance_matching) ZSTD_DCtx_setMaxWindowSize(dctx, 1 << zstd_window_log_size);
+ if (zstd_long_distance_matching) ZSTD_DCtx_setMaxWindowSize(dctx, (size_t)1 << zstd_window_log_size);
int ret = ZSTD_decompressDCtx(dctx, p_dst, p_dst_max_size, p_src, p_src_size);
ZSTD_freeDCtx(dctx);
return ret;
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index e3c8fb9eb8..40f756ba9a 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -169,11 +169,11 @@ bool PackedSourcePCK::try_open_pack(const String &p_path) {
uint32_t version = f->get_32();
uint32_t ver_major = f->get_32();
uint32_t ver_minor = f->get_32();
- uint32_t ver_rev = f->get_32();
+ f->get_32(); // ver_rev
ERR_EXPLAIN("Pack version unsupported: " + itos(version));
ERR_FAIL_COND_V(version != PACK_VERSION, false);
- ERR_EXPLAIN("Pack created with a newer version of the engine: " + itos(ver_major) + "." + itos(ver_minor) + "." + itos(ver_rev));
+ ERR_EXPLAIN("Pack created with a newer version of the engine: " + itos(ver_major) + "." + itos(ver_minor));
ERR_FAIL_COND_V(ver_major > VERSION_MAJOR || (ver_major == VERSION_MAJOR && ver_minor > VERSION_MINOR), false);
for (int i = 0; i < 16; i++) {
diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp
index f202320043..3ae9ff676c 100644
--- a/core/io/image_loader.cpp
+++ b/core/io/image_loader.cpp
@@ -118,7 +118,6 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String &p_origin
if (r_error) {
*r_error = ERR_CANT_OPEN;
}
- memdelete(f);
return RES();
}
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 628019ef7f..ec430d41a9 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -868,8 +868,6 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
} break;
case Variant::REAL: {
- double d = p_variant;
- float f = d;
if (flags & ENCODE_FLAG_64) {
if (buf) {
encode_double(p_variant.operator double(), buf);
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp
index 17b77bc535..b3f0a76a80 100644
--- a/core/io/multiplayer_api.cpp
+++ b/core/io/multiplayer_api.cpp
@@ -416,7 +416,7 @@ bool MultiplayerAPI::_send_confirm_path(NodePath p_path, PathSentCache *psc, int
Map<int, bool>::Element *F = psc->confirmed_peers.find(E->get());
- if (!F || F->get() == false) {
+ if (!F || !F->get()) {
// Path was not cached, or was cached but is unconfirmed.
if (!F) {
// Not cached at all, take note.
@@ -578,7 +578,7 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p
network_peer->set_target_peer(E->get()); // To this one specifically.
- if (F->get() == true) {
+ if (F->get()) {
// This one confirmed path, so use id.
encode_uint32(psc->id, &(packet_cache.write[1]));
network_peer->put_packet(packet_cache.ptr(), ofs);
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 8c56d55e85..d156a9f4bd 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -647,3 +647,5 @@ bool ResourceLoader::timestamp_on_load = false;
SelfList<Resource>::List ResourceLoader::remapped_list;
HashMap<String, Vector<String> > ResourceLoader::translation_remaps;
HashMap<String, String> ResourceLoader::path_remaps;
+
+ResourceLoaderImport ResourceLoader::import = NULL;
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h
index de0981350d..96bc6fa8dd 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -77,6 +77,8 @@ public:
typedef void (*ResourceLoadErrorNotify)(void *p_ud, const String &p_text);
typedef void (*DependencyErrorNotify)(void *p_ud, const String &p_loading, const String &p_which, const String &p_type);
+typedef Error (*ResourceLoaderImport)(const String &p_path);
+
class ResourceLoader {
enum {
@@ -147,6 +149,8 @@ public:
static void reload_translation_remaps();
static void load_translation_remaps();
static void clear_translation_remaps();
+
+ static ResourceLoaderImport import;
};
#endif