For the Doom IWADs the provided font looks almost identical to the characters used on the title patches. So, for any level name that got replaced in some language, it will now check if the retrieved name comes from the default table, and if not, ignore the title patch and print the name with the specified font.
This also required removing the 'en' label from the default table, because with this present, the text would always be picked from 'en' instead of 'default'. Since 'en' and 'default' had the same contents, in any English locale the 'default' table was never hit, so this won't make any difference for the texts being chosen.
Last but not least, wminfo has been made a local variable in G_DoCompleted. There were two places where this was accessed from outside the summary screen or its setup code, and both were incorrect.
A multi-lump font can be created by putting all characters into a subdirectory of fonts/ with the intended name. Each character needs to be named by its character index as hex number.
So far this is only active for the predefined small fonts
Having everything lumped together made this a maintenance hassle because it affected how the level has to be stored.
This hasn't been tested yet, so it may not work as intended!
currentUILevel is now primaryLevel.
For ZScript, currentVMLevel was added. This is also exported as 'level' and will change as needed.
This also means that no breaking deprecations will be needed in the future, because in order to sandbox a level only 4 variables need to be handled: level, players, playeringame and consoleplayer.
The remaining global variables are not relevant for the level state.
The static 'level' has been mostly removed from the code except some places that still need work.
I think these were the last two still missing it, all remaining uses of the global level variable are in code that doesn't get run through a level tick and are supposed to access the primary level.
src/posix/cocoa/i_video.mm:559:2: error: use of undeclared identifier 'atterm'
src/posix/sdl/hardware.cpp:85:28: error: ‘atterm’ was not declared in this scope
src/posix/sdl/i_input.cpp:261:10: error: ‘gamestate’ was not declared in this scope
src/posix/sdl/i_input.cpp:261:23: error: ‘GS_LEVEL’ was not declared in this scope
src/posix/sdl/i_input.cpp:263:48: error: ‘GS_INTERMISSION’ was not declared in this scope
src/posix/sdl/i_input.cpp:263:80: error: ‘GS_FINALE’ was not declared in this scope
src/posix/sdl/i_system.cpp:115:25: error: ‘atterm’ was not declared in this scope
src/posix/sdl/i_system.cpp:372:30: error: invalid use of incomplete type ‘const struct dirent’
src/posix/sdl/i_system.cpp:375:42: error: ‘findstate_t’ has not been declared
src/posix/sdl/i_system.cpp:391:12: error: request for member ‘current’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:392:12: error: request for member ‘count’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:392:56: error: request for member ‘namelist’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:393:22: error: ‘alphasort’ was not declared in this scope
src/posix/sdl/i_system.cpp:393:31: error: ‘scandir’ was not declared in this scope
src/posix/sdl/i_system.cpp:394:16: error: request for member ‘count’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:401:31: error: ‘findstate_t’ has not been declared
src/posix/sdl/i_system.cpp:403:2: error: ‘findstate_t’ was not declared in this scope
src/posix/sdl/i_system.cpp:403:15: error: ‘state’ was not declared in this scope
src/posix/sdl/i_system.cpp:403:37: error: expected primary-expression before ‘)’ token
src/posix/sdl/i_system.cpp:404:33: error: request for member ‘count’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:406:39: error: request for member ‘count’ in ‘* fileinfo’, which is of non-class type ‘int’
src/posix/sdl/i_system.cpp:413:2: error: ‘findstate_t’ was not declared in this scope
src/posix/sdl/i_system.cpp:413:15: error: ‘state’ was not declared in this scope
src/posix/sdl/i_system.cpp:413:37: error: expected primary-expression before ‘)’ token
src/posix/sdl/i_system.cpp:425:16: error: ‘findstate_t’ was not declared in this scope
src/posix/sdl/i_system.cpp:425:29: error: expected primary-expression before ‘const’
src/posix/sdl/i_system.cpp:426:1: error: expected ‘,’ or ‘;’ before ‘{’ token
src/posix/sdl/i_main.cpp:160:6: error: ‘gamestate’ was not declared in this scope
src/posix/sdl/i_main.cpp:160:19: error: ‘GS_LEVEL’ was not declared in this scope
src/posix/sdl/i_main.cpp:160:44: error: ‘GS_TITLELEVEL’ was not declared in this scope
src/posix/sdl/i_main.cpp:217:18: error: ‘atterm’ was not declared in this scope
src/posix/sdl/i_main.cpp:242:11: error: ‘I_Quit’ was not declared in this scope
src/gameconfigfile.cpp:126:27: error: ‘SHARE_DIR’ was not declared in this scope
src/scripting/decorate/thingdef_parse.cpp:929:2: error: use of undeclared identifier 'strlwr'; did you mean 'strlen'?
src/scripting/decorate/thingdef_parse.cpp:937:3: error: use of undeclared identifier 'strlwr'; did you mean 'strlen'?
src/scripting/decorate/thingdef_states.cpp:564:2: error: use of undeclared identifier 'strlwr'; did you mean 'strlen'?
src/scripting/vm/jit_runtime.cpp:957:2: error: ‘unique_ptr’ is not a member of ‘std’
src/scripting/vm/jit_runtime.cpp:957:38: error: expected primary-expression before ‘>’ token
src/scripting/vm/jit_runtime.cpp:957:40: error: ‘nativeSymbols’ was not declared in this scope
src/utility/cmdlib.cpp:962:2: error: ‘DIR’ was not declared in this scope
src/utility/cmdlib.cpp:962:7: error: ‘directory’ was not declared in this scope
src/utility/cmdlib.cpp:962:34: error: ‘opendir’ was not declared in this scope
src/utility/cmdlib.cpp:967:33: error: ‘readdir’ was not declared in this scope
src/utility/cmdlib.cpp:969:10: error: invalid use of incomplete type ‘struct ScanDirectory(TArray<FFileList>&, const char*)::dirent’
src/utility/cmdlib.cpp:973:34: error: invalid use of incomplete type ‘struct ScanDirectory(TArray<FFileList>&, const char*)::dirent’
src/utility/cmdlib.cpp:985:20: error: ‘closedir’ was not declared in this scope
This is supposed to be come the place where all pure play code should be placed, but for that all CVARs and CCMDs and other things that do not directly handle play data should be taken out to make code reviewing easier. These now get collected in two separate files, g_cvars.cpp and g_dumpinfo.cpp respectively.
The sole ZScript property in here has also been moved - to thingdef_properties.cpp.
All these required access to the sector's Level reference.
The remaining references to the global 'level' variable are all in deprecated functions which is ok.
LevelLocals on the left side of.a function call will now always be remapped to 'Level', which will either remap to the same-named instance variable or the global deprecated one.
In a few degenerate cases where there is a conflicting local variable named 'level' it may error out but that is unavoidable here but this is very unlikely.
- moved parts of the render setup out of the separate render functions.
Things like particle and polyobject linking were duplicated several times for rendering different things in different renderers.
These things only need to be set up once before the renderer is started so it makes a lot more sense to consolidate them into one place outside the actual rendering code.
This had two different flags that were checked totally inconsistently, and one was not even saved.
Moved everything into a few subfunctions so that these checks do not have to be scattered all over the code.
UI always runs on the primary level, so this does not need the ability to operate on multiple levels. Additionally, this can later be set to null when running play code so that scope violations result in an abort.