summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-06-19 17:03:19 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-11 11:53:27 +0100
commit42b44f43ee52eb664d3610d0fdae0eff14c00f0a (patch)
tree3125054b1d86f9eb1b10dd760b12010c3d6a1e89 /core
parent9b0dd4f571ff431e23b9097e7f29746f4157be12 (diff)
Basic 2D engine is more or less working, needs more work for editor to be usable.
Diffstat (limited to 'core')
-rw-r--r--core/rid_owner.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/rid_owner.h b/core/rid_owner.h
index 2443aac0a4..3e5635d385 100644
--- a/core/rid_owner.h
+++ b/core/rid_owner.h
@@ -45,7 +45,7 @@ public:
if (alloc_count == max_alloc) {
//allocate a new chunk
- uint32_t chunk_count = alloc_count == 0 ? 0 : (max_alloc / elements_in_chunk + 1);
+ uint32_t chunk_count = alloc_count == 0 ? 0 : (max_alloc / elements_in_chunk);
//grow chunks
chunks = (T **)memrealloc(chunks, sizeof(T *) * (chunk_count + 1));
@@ -140,8 +140,8 @@ public:
chunks[idx_chunk][idx_element].~T();
validator_chunks[idx_chunk][idx_element] = 0xFFFFFFFF; // go invalid
- free_list_chunks[alloc_count / elements_in_chunk][alloc_count % elements_in_chunk] = idx;
alloc_count--;
+ free_list_chunks[alloc_count / elements_in_chunk][alloc_count % elements_in_chunk] = idx;
}
void get_owned_list(List<RID> *p_owned) {