Switch to using an index for sprite tracking

Frees up two bytes in GPUCell. Doesn't require a minimum texture row
size. Makes a bunch of code faster. Index uses 31 bits which gives us
2,147,483,647 aka ~ 2 billion sprites.
This commit is contained in:
Kovid Goyal
2024-12-11 08:36:03 +05:30
parent 203a5f4e00
commit 0fb49f4139
12 changed files with 97 additions and 71 deletions

View File

@@ -710,11 +710,6 @@ shift_to_first_set_bit(CellAttrs x) {
EXPORTED PyMODINIT_FUNC
PyInit_fast_data_types(void) {
PyObject *m;
if (sizeof(CellAttrs) != 2u) {
PyErr_SetString(PyExc_RuntimeError, "Size of CellAttrs is not 2 on this platform");
return NULL;
}
m = PyModule_Create(&module);
if (m == NULL) return NULL;
init_monotonic();