Skip to content

Lift freeslot limits

Hanicef requested to merge Hanicef/SRB2:lift-freeslot-limits into next

This is a pretty big change that completely removes the freeslot limits, allowing any amount of freeslot allocations assuming you don't run out of memory. It replaces the hardcoded fixed-sized arrays with dynamically resizable arrays, allowing more data to be allocated whenever more freeslots are being requested.

The following freeslots have been lifted:

  • Sound effects
  • Sprites
  • States
  • Mobjs
  • Sprite2s

As for skincolors, it is not possible to lift those due to a problematic design with Lua and SOC, in particular the fact that MAXSKINCOLORS, FIRSTSUPERCOLOR and NUMSUPERCOLORS are exposed on those interfaces. To lift freeslots, those constants must be removed, which cannot be done without risking a breaking change and thus must wait until 2.3. Also, lifting TOL requires a considerably large redesign on the freeslot, since that freeslot type uses bit masks which already covers all bits in a 32-bit number.

NOTE: While sprite2 limits have been lifted, the amount of sprites per skin is still limited. This effectively means that you still can't have any number of sprites on a single skin, but you will be able to have as many sprites as you like across multiple skins as long as you don't pass the sprite limit per skin. No longer an issue since !2211 (merged) was merged.

EDIT: Sound effect lifting has been reverted in favor of !2376; other freeslots are still relevant, though.

Edited by Hanicef

Merge request reports