Open sttng opened 2 years ago
I can tell you that packing Sidedefs helped me a lot in GBAFreeDoom to save on ram. The idea of building Optimization for it right into GbaWadUtil would be sweet.
W_CacheLumpXXX returns a const* to the location in ROM.
On the GBA, the mapsector_t isn't loaded into ram.
The main memory usage on Plutonia Map 28 (Highest ram in Doom/2/Final Doom)
sector_t 17,836 side_t 44,416 linedata_t 20,168 _g->blocklinks 15,640 subsector_t 13,104 line_t 14,328 mobj_t 74,172
You could save ROM space with the suggestion I guess. As far as I can see:
Plutonia Map 28 (original <- not 'touched' with GBAWadUtil) SIDEDEFS: 108.40KB SECTORS: 7.54KB
Plutonia Map 28 (Texture Indices) SIDEDEFS: 43.36KB (60% smaller) SECTORS: 6.39KB (15% smaller)
Looking at the Sidedefs and Sectors format
Sidedef
Sectors
Idea: Change Texture Name entry to Index (int16_t) similar to Doom 64 format.
This would need to be 1st implemented within GbaWadUtil. I guess a hashtable that keeps track of Texturenames already seen and replacing it with an int counter as necessary would work.
This could save a couple of bytes in cart/rom space. Not sure if there would be performance hits in the game to look-up
Also not sure if it'll be better to create an new look-up table for Texture-Index -> Name or directly modify the Map textures structure (name entry).