Cleanup for PR, return old sprite tracker
This commit is contained in:
+10
-3
@@ -1,11 +1,18 @@
|
||||
#include "pool.h"
|
||||
#include "util.h"
|
||||
|
||||
void pool_bm_clear_idx(PoolBitmap *bm, int idx)
|
||||
{
|
||||
// Divide by 32 to get the word index
|
||||
uint32_t i = idx >> 5;
|
||||
uint32_t i = idx / 32;
|
||||
// Get last 5-bits, same as a modulo (% 32) operation on positive numbers
|
||||
uint32_t b = idx & 0x1F;
|
||||
uint32_t b = idx % 32;
|
||||
|
||||
// Below are the "fast" forms of the above operations, respectively.
|
||||
// These are more efficient, but removed for readability
|
||||
// See: https://github.com/cellos51/balatro-gba/pull/132#discussion_r2365966071
|
||||
//uint32_t i = idx >> 5;
|
||||
//uint32_t b = idx & 0x1F;
|
||||
bm->w[i] &= ~((uint32_t)1 << b);
|
||||
}
|
||||
|
||||
@@ -32,7 +39,7 @@ int pool_bm_get_free_idx(PoolBitmap *bm)
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user