Requires changes in the script to support which I am not awake enough to finalise or make compatible with other branches. This took far longer than appropriate.
Instead of storing this during binary-UDMF conversion and then copying it for certain argument fields, put it directly onto stringarg[0] (or [1] if it's the backside), then make relevant changes with those.
Reduces the amount of Zone memory used for binary converted maps, and the amount of struct memory used for all types of maps.
They have also been removed from the Lua API. Fret not, the stringargs on line_t have far more utility.
Previously, concatenated texture field strings were turned to text, then had that string run through get_number, then had it converted back into a string to become a stringarg.
Now, the concatenated string is copied directly to the relevant stringarg.
This fixes an issue where a map with object or state properties would have "context drift" - breaking when the object or state list changed, due to differently ordered freeslots, or new hardcoded objects.
This is also made consistent and with less repeated code via the addition of multile P_Write functions to replace both P_WriteConstant and multiple copypasted blocks of zone allocation and memcpy.
- P_WriteDuplicateText -- fresh zone memory copy with PU_LEVEL
- P_WriteSkinColor -- converts ID to SKINCOLOR_ name, then runs it through P_WriteDuplicateText
- P_WriteSfx -- converts ID to SFX_ name, then runs it through P_WriteDuplicateText
In order to avoid making p_setup.c dependent on `deh_tables.h`, object type 1202 simply artifically produces the expected range of MT_ROCKCRUMBLE1 to MT_ROCKCRUMBLE16. It was technically possible to produce unexpected effects with extremely high offsets, but if your map was doing something like that, you're intelligent enough to go back and swap the MT_ constant out with your intended goal.
The linedef's behaviour was broken horribly by long map names, and it's not worth the effort to fix it for the following reasons.
- It was considered a security vulnerability to have free access to the console when it was written.
- The game literally had a cvar to disable running console scripts. That's "I am willingly distributing ActiveX Word Documents in 2023" levels of foolhardery.
- Anything GOOD it can do, both Lua and ACS can do better.
UDMF now has a native ring drainer effect.
Also fixes the WriteTextmap warning for the deprecated sector effect, which should have been encouraging you to use this action, not action 462!?
- The function is back to producing zone-allocated memory copies, like its precursor V_WordWrap
- The author of this commit got rid of that dependency originally because it seemed like a fair part of the API, and meant static buffers could be used in certain circumstances, but it was necessary to revert for the following change.
- Newlines can now be inserted mid-word, treating the width provided as ironclad except in the case of single characters wider than the region.
- This will be necessary for future work with the in-game chat.
- Reserves 8 characters at first, then Z_Reallocs double that every time it runs out.
Moves WordWrap to the font/V_GetFontSpecification system.
Much healthier long-term for our purposes, including the possibility of changing fonts for various contexts freely.
Reduces quantity of copypasted code between V_StringWidthScaled and V_DrawStringScaled to far more manageable "this is an inner loop and cannot be abstracted" levels.
Guarantees consistency in handling across existing and future functions.
Content of commit was originally written by Sal, but as a monolithic commit. The author of this commit is chunking it up for easier review.
Adds the additional font. This requires a little cleanup before we can use it as the primary menu font, but worth at least putting this in the relevant places for later.
Content of commit was originally written by Sal, but as a monolithic commit. The author of this commit is chunking it up for easier review.
Simple inversion on the face of things, but with a long tail of consequences, including 19 changed files.
Forced uppercase has been applied in a handful of locations where it was aesthetically imperative. Most menus will follow in another commit, so that that may be reverted if we change the default menu font.
Content of commit was originally written by Sal, but as a monolithic commit. The author of this commit is chunking it up for easier review.
- V_CharacterValid
- Makes checks for valid character drawing consistent and cleaner
- If a case isn't being forced, characters that can have case applied but don't exist will attempt to draw their other case.
- V_DrawCharacterScaled
- Saner core function that doesn't overload the character provided
- Previous terrible is supported for now via backwards-compatible shim function
It will be safe to call many of these functions in Vulkan even if a
context is active, but the contents of buffers and textures will be
considered undefined until updated.