Commit graph

1162 commits

Author SHA1 Message Date
Christoph Oelckers
ef3e5ef01e - moved a few parts from g_level.cpp to better fitting places. 2019-02-23 15:21:54 +01:00
Christoph Oelckers
5e7fb16d05 - preparation work for substituting the menu and intermission screen text graphics for localization 2019-02-19 01:22:12 +01:00
Christoph Oelckers
aa550310f6 - allow the language table to supersede the title patches, if appropriate
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.
2019-02-15 00:29:24 +01:00
Christoph Oelckers
deb233677e - made the menu's text input handler Unicode capable.
Also make sure that the savegame description remains readable. Unlike in-game text this can be done without double-encoding existing UTF-8.
2019-02-16 21:29:46 +01:00
Christoph Oelckers
64685705d0 - made the console Unicode-capable.
This also necessitated some character remapping in the console font to move the Windows-1252 extra characters to their proper Unicode code points.
2019-02-16 13:05:19 +01:00
Christoph Oelckers
88e227f1f3 Merge branch 'new_level_refactor' into localization 2019-02-09 12:22:15 +01:00
Christoph Oelckers
3d3f260137 - exported LevelLocals's compatibility flags to scripting and fixed all places where access to combined compatibility flags is needed. 2019-02-09 09:17:57 +01:00
Major Cooke
acc510dfb3 Added inflictor, source and flag parameters to GetModifiedDamage on actors and ModifyDamage on inventory.
- The flags are used by DamageMobj so modders can determine radius damage, for example, by checking for DMG_EXPLOSION.
2019-02-08 20:07:49 +01:00
Christoph Oelckers
449610496f - fixed: 'level.frozen' still needs to be writable and have an effect. 2019-02-08 20:04:45 +01:00
Christoph Oelckers
4d2bb11317 - reworked font loader to make adding multi-lump fonts easier.
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
2019-02-07 13:12:39 +01:00
Rachael Alexanderson
20a9587bb7 Merge remote-tracking branch 'origin/master' into HEAD 2019-02-06 08:05:38 -05:00
alexey.lysiuk
78c0b7f230 - changed type of Nop expression to void
Control flow statements with constant condition no longer cause misleading fatal errors in ZScript

https://forum.zdoom.org/viewtopic.php?t=63566
2019-02-06 12:09:14 +02:00
Christoph Oelckers
979f1df281 Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor
# Conflicts:
#	src/g_level.cpp
#	src/p_user.cpp
2019-02-05 13:49:07 +01:00
alexey.lysiuk
2765159fc6 - disabled VM JIT completely on unsuported platforms 2019-02-04 15:53:35 +02:00
Christoph Oelckers
e41c898817 Merge branch 'master' into new_level_refactor 2019-02-04 13:11:01 +01:00
alexey.lysiuk
20f29ab808 - fixed erroneous removal of property flag members
https://forum.zdoom.org/viewtopic.php?t=63520
2019-02-03 12:33:06 +02:00
Christoph Oelckers
9f7fe203fc - had to fix a few things. 2019-02-02 17:29:13 +01:00
Christoph Oelckers
66eb4e5048 - separation of static and map-local event handlers into separate lists.
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!
2019-02-02 16:43:11 +01:00
Christoph Oelckers
45dc9a7b47 - renamed the level variables.
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.
2019-02-02 00:25:51 +01:00
Christoph Oelckers
6c006a5fbd - added the missing Level parameters to AActor::StaticSpawn and P_ExecuteSpecial.
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.
2019-02-01 22:02:16 +01:00
Christoph Oelckers
edb34b9f7f Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor 2019-02-01 17:59:25 +01:00
alexey.lysiuk
5e9001e7bc - fixed potentially incomplete list of argument flags for virtual function
https://forum.zdoom.org/viewtopic.php?t=63450
2019-02-01 17:58:06 +01:00
Christoph Oelckers
202f3d7d80 - changed most places where a player index is calculated by subtracting the player array's base access. 2019-02-01 17:31:11 +01:00
alexey.lysiuk
5278274acf - fixed compilation errors with POSIX targets
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
2019-02-01 11:08:58 +02:00
Christoph Oelckers
e3eaa5964d - removed v_video.h include from portals.h
This has no business in a play related file which also made no use of it.
2019-02-01 00:30:21 +01:00
Christoph Oelckers
f6a91e1722 - moved the I_Error prototypes to doomerrors.h to avoid having to include the low level system header for this. 2019-01-31 19:38:04 +01:00
Christoph Oelckers
0f2938089d - started cleaning up the contents of the g_shared directory, starting with a_dynlight.cpp
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.
2019-01-31 02:05:16 +01:00
Christoph Oelckers
64ac6dbc6e - moved thinker storage into FLevelLocals. 2019-01-30 19:09:21 +01:00
Christoph Oelckers
b12de04258 - fixed the remaining deprecation warnings in the base script.
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.
2019-01-30 00:58:44 +01:00
Christoph Oelckers
ebdb2643c4 - moved UDMF custom properties into FLevelLocals. 2019-01-30 00:47:20 +01:00
Christoph Oelckers
6451b7d592 - moved the combined compatibility flags into FLevelLocals. 2019-01-29 19:28:22 +01:00
Christoph Oelckers
de1b89707d Handle level in block iterators.
The scripted interface isn't done yet.
2019-01-29 03:26:22 +01:00
Christoph Oelckers
f823e57446 Handle level check in texture coordinate calculation 2019-01-29 02:51:06 +01:00
Christoph Oelckers
f9239f6e0f - added a compiler-side workaround for the formerly static methods of FLevelLocals.
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.
2019-01-29 02:04:31 +01:00
Christoph Oelckers
60873bc5d6 Moved the PointInSector functions into FLevelLocals 2019-01-29 01:30:41 +01:00
Christoph Oelckers
68667e5eaa - moved particle storage into FLevelLocals.
- 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.
2019-01-29 01:09:02 +01:00
Christoph Oelckers
259ae41774 - sanitized the 'frozen level' 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.
2019-01-28 20:15:48 +01:00
Christoph Oelckers
648e472744 - handled approx. half of all cases where the address of level is taken. 2019-01-28 00:55:21 +01:00
Christoph Oelckers
b4acb857ad - the final batch of easy level replacements.
What's left will require a bit more work...
2019-01-27 21:59:19 +01:00
Christoph Oelckers
b4a95ccaa9 - roughly 50 more, mostly search and replace. 2019-01-27 19:16:14 +01:00
Christoph Oelckers
84baa5bb4d - deprecated the global 'level' variable.
This will currently output 9 warnings for the UDMF property getters. To silence these a bit more work is needed.
2019-01-27 14:33:02 +01:00
Christoph Oelckers
8323524014 - give thinkers a 'level' member and change linking to the chain to happen outside the constructor. 2019-01-27 01:49:20 +01:00
Christoph Oelckers
05830455e7 - made the automap an object.
This simplifies handling a lot because it allows to make the level the owner of its map.
2019-01-26 15:21:20 +01:00
Christoph Oelckers
4e052f2857 - use a separate variable pointing to the current level for the UI 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.
2019-01-25 18:31:40 +01:00
Christoph Oelckers
3cef56249d - moved most functions of portals.cpp into FLevelLocals.
Much of this is used during level init and needs to be independent of the current level.
2019-01-25 00:30:55 +01:00
Christoph Oelckers
0e5986769e - moved the tid hash into FLevelLocals and adjusted the interface to the iterators. 2019-01-24 19:28:40 +01:00
Christoph Oelckers
1f2162fea8 - moved the scripted creation functions for tag iterators to LevelLocals
The old static methods are now deprecated, this was done to clarify the relationships at play here.
2019-01-24 02:17:10 +01:00
Christoph Oelckers
97495e1857 - moved the tag manager into FLevelLocals 2019-01-24 01:53:05 +01:00
Christoph Oelckers
ac7a9183aa - re-applied the changes for p_spec.cpp
This is mostly map loader code which really should not operate on the global level.
2019-01-24 00:02:51 +01:00
Christoph Oelckers
83d464d1be - fixed code emission for constant ZScript function arguments 2019-01-23 22:37:16 +01:00