Update for PR
Readd sprite tracker to not reuse indices check for capacity when returning pool entries Update script for printing memory map
This commit is contained in:
+4
-3
@@ -10,6 +10,7 @@ typedef struct PoolBitmap {
|
||||
u32 *w;
|
||||
u32 nbits;
|
||||
u32 nwords;
|
||||
u32 cap;
|
||||
} PoolBitmap;
|
||||
|
||||
void pool_bm_clear_idx(PoolBitmap *bm, int idx);
|
||||
@@ -20,7 +21,6 @@ int pool_bm_get_free_idx(PoolBitmap *bm);
|
||||
{ \
|
||||
PoolBitmap bm; \
|
||||
type * objects; \
|
||||
u32 max_entries; \
|
||||
} type##Pool; \
|
||||
type *pool_get_##type(); \
|
||||
void pool_free_##type(type *obj); \
|
||||
@@ -33,9 +33,10 @@ int pool_bm_get_free_idx(PoolBitmap *bm);
|
||||
.bm = { \
|
||||
.w = type##_bitmap_w, \
|
||||
.nbits = POOL_BITS_PER_WORD, \
|
||||
.nwords = sizeof(u32)}, \
|
||||
.nwords = sizeof(u32), \
|
||||
.cap = capacity, \
|
||||
}, \
|
||||
.objects = type##_storage, \
|
||||
.max_entries = capacity, \
|
||||
}; \
|
||||
type * pool_get_##type() \
|
||||
{ \
|
||||
|
||||
+2
-1
@@ -14,6 +14,7 @@ typedef struct
|
||||
OBJ_ATTR *obj;
|
||||
OBJ_AFFINE *aff;
|
||||
POINT pos;
|
||||
int idx;
|
||||
} Sprite;
|
||||
|
||||
// A sprite object is a sprite that is selectable and movable in animation
|
||||
@@ -66,4 +67,4 @@ Sprite* sprite_object_get_sprite(SpriteObject* sprite_object);
|
||||
void sprite_object_set_focus(SpriteObject* sprite_object, bool focus);
|
||||
bool sprite_object_is_focused(SpriteObject* sprite_object);
|
||||
|
||||
#endif // SPRITE_H
|
||||
#endif // SPRITE_H
|
||||
|
||||
Reference in New Issue
Block a user