Skip to content

Accept '+' as substitute for '\' for sprite frames (PK3)

mazmazz requested to merge frame-backslash-fix into next

Modifies R_Char2Frame() to handle '+' as '', upon @toaster 's suggestion. This sidesteps the PK3 limitation that lumps can't be named with backslash.

For reference, the ASCII sort order:

image

2.1 takes any subsequent char from 'A' and numbers that as the frame number (frame = char - 'A'). This change simply returns frame = '\\' - 'A' if '+' is used.

Note that R_Frame2Char() will return backslash no matter what (char = 'A' + '\\') because we discard the '+' substitute moniker. I don't think it's necessary to support both directions.

It's worth noting that ZDoom also does char substitution for PK3. From ZDoom Wiki:

Sprite lumps for the \ frame in a WAD (such as VILE\* for one of the Arch-Vile's healing frames) can be put in a ZIP file, the backslash character just has to be changed to a caret character (^). So, VILE^1 to VILE^8 in a ZIP file will be interpreted as the VILE\1 to VILE\8 lumps. This replacement only works for sprites, any other lump name should not contain backslashes anywhere.
Edited by mazmazz

Merge request reports