Commit Graph

7 Commits

Author SHA1 Message Date
John McCardle b114ec3085 cleaning up for merge 2024-03-21 22:22:35 -04:00
John McCardle d7228172c4 Messy, but monumental: PyTexture::pyObject works
this also coincidentally fixes a weird bug I encountered while
(mis?)using tp_alloc: by using PyType_GenericAlloc, I avoid the segfault
that tp_alloc sometimes causes. See the horrible UIDrawable retrieval
macro that I use in UI.h for a workaround that can probably be replaced
with this technique
2024-03-21 21:39:15 -04:00
John McCardle 2cf8f94310 Radical new example pattern for exposing a C++ class to Python 2024-03-20 21:16:52 -04:00
John McCardle 20f80c4114 Fixed sprite indexing error in PyTexture; needs non-square sprite tests, but feeling confident! 2024-03-17 16:23:52 -04:00
John McCardle afd4ff1925 good progress, we're building again. Issue with Grid (tile sprite) textures and I think the sprite indexes are being calculated wrong (x and y transposed?) 2024-03-16 21:53:24 -04:00
John McCardle bfd33102d1 Squashed basically all the compile bugs in UISprite, but UIEntity and UIGrid use textures as well, so they need to be fixed too before the project will build again 2024-03-16 14:52:35 -04:00
John McCardle 47d0e34a17 Initial PyTexture class
no testing done.
should enable rectangular (non-square) textures

"sprite" method; let's just overwrite sprites with texture coords
Hoping to replace awful code like:
`self->data->sprite.sprite.setTextureRect(self->data->sprite.itex->spriteCoordinates(val));`

with something like:
`self->data->sprite = self->data->texture->sprite(val);`
2024-03-16 11:31:39 -04:00