diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-07-04 22:54:32 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-11 11:53:28 +0100 |
commit | a7b2ac7bb1b5f9155866382f14138e86e52efded (patch) | |
tree | 605181a1f1fed96e484e89efaa05201d2db7fcc3 /core | |
parent | 92b27bccf10a68f04a3553f1c925bdf09e076a89 (diff) |
Normalmapping and Specularmapping working in 2D engine
Added support for Sprite, AnimatedSprite and Polygon2D (should add for tileset eventually).
Diffstat (limited to 'core')
-rw-r--r-- | core/rid_owner.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/rid_owner.h b/core/rid_owner.h index 971218120f..7490416c19 100644 --- a/core/rid_owner.h +++ b/core/rid_owner.h @@ -141,6 +141,16 @@ public: free_list_chunks[alloc_count / elements_in_chunk][alloc_count % elements_in_chunk] = idx; } + _FORCE_INLINE_ uint32_t get_rid_count() const { + return alloc_count; + } + + _FORCE_INLINE_ T *get_rid_by_index(uint32_t p_index) { + ERR_FAIL_INDEX_V(p_index, alloc_count, NULL); + uint64_t idx = free_list_chunks[p_index / elements_in_chunk][p_index % elements_in_chunk]; + return &chunks[idx / elements_in_chunk][idx % elements_in_chunk]; + } + void get_owned_list(List<RID> *p_owned) { for (size_t i = 0; i < alloc_count; i++) { uint64_t idx = free_list_chunks[i / elements_in_chunk][i % elements_in_chunk]; @@ -250,6 +260,14 @@ public: alloc.free(p_rid); } + _FORCE_INLINE_ uint32_t get_rid_count() const { + return alloc.get_rid_count(); + } + + _FORCE_INLINE_ T *get_rid_by_index(uint32_t p_index) { + return alloc.get_rid_by_index(p_index); + } + _FORCE_INLINE_ void get_owned_list(List<RID> *p_owned) { return alloc.get_owned_list(p_owned); } |