Clean up some more bin2c calls from the Makefile (#286)

* Remove some bin2c calls from the Makefile

* Found a way to make n64graphics use shared tluts

* Added an option that makes n64graphics operate in a mode where it
 takes an image and tlut (as pngs) and spits out the appropriate
 CI8 indices inc.c form

* Turns out all the TLUTs for Lakitu are kept in one place, far away
 from the textures that use them

* Names some textures and tluts

* Pretty helpful actually, helped identify where a few different
 objects types are initialized. Should be a little useful to
 whoever dives into the object stuff more deeply

* Minor cleanup in n64graphics

* Added some comments, gave more appropriate names to some
 variables.

* Leaving the new mode argument as `-Z` for now

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>

* Textures compile using makefile rules

* Patched n64 graphics memory leak and ci output

* Added memset16safe to initialize ci palettes to magic numbers (transparent pixels).

---------

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
Tyler McGavran
2023-02-07 00:52:34 -05:00
committed by GitHub
parent 533d035875
commit 3a99685c2f
39 changed files with 1442 additions and 1564 deletions
+17
View File
@@ -37,6 +37,23 @@ float read_f32_be(unsigned char *buf)
return ret.f;
}
void *memset16safe(void *m, uint16_t val, size_t count)
{
char *buf = m;
union
{
uint8_t d8[2];
uint16_t d16;
}u16 = {.d16 = val};
while(count--)
{
*buf++ = u16.d8[0];
*buf++ = u16.d8[1];
}
return m;
}
int is_power2(unsigned int val)
{
while (((val & 1) == 0) && (val > 1)) {