Skip to content

Lift freeslot limits 2: electric boogaloo

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

Supersedes !2337 (closed), taking a different approach at solving this issue. The main difference is that allocates everything as pointers in a list instead of the list itself, which solves a lot of issues related to dangling pointers when new freeslots are allocated. It also integrates more smoothly with !2211 (merged), solving numerous issues that arised once that patch was merged.

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.

Edited by Hanicef

Merge request reports