Commit Graph

10747 Commits

Author SHA1 Message Date
Christoph Oelckers 456ac64723 - implemented version checks for compile-time type determination and for class inheritance.
Note that in this system, DECORATE counts as version 2.0, so any data that should be available to DECORATE should not use version restriction.
2017-03-05 17:58:55 +01:00
Christoph Oelckers 7df698dad8 - implemented the parser basics of a ZScript versioning system.
Note that this completely disables the newly added keywords 'play' and 'ui' for unversioned code to allow using them as identifiers as I have found at least one mod that uses a variable named 'play' that would have been rendered broken otherwise.
This also disables many ZScript only keywords for other parsing jobs.
2017-03-05 14:13:00 +01:00
alexey.lysiuk 5d3244c3a7 Fixed minor issues in config file reader
Removed hardcoded values from long lines handling and made sure that pointer to the last character is always initialized
2017-03-05 13:07:51 +02:00
alexey.lysiuk 27376b1697 Fixed compilation of Debug configuration
src/scripting/vm/vmexec.cpp:204:44: error: no member named 'Native' in 'VMScriptFunction'
2017-03-05 11:39:25 +02:00
ZZYZX 38b86ad83c No need for explicit EFX_Self check in FxStructMember::RequestAddress if self is set to readonly elsewhere. 2017-03-05 09:49:31 +01:00
ZZYZX 1832531726 Fixed: check protected fields against analog of OwningClass in functions, as opposed to the type that the field was accessed from. 2017-03-05 09:49:31 +01:00
ZZYZX 3eafc13b08 Removed BarrierSide from VMFunction, since it's obsolete with addition of VarFlags 2017-03-05 09:49:31 +01:00
ZZYZX 7cbabfb0d4 Implemented implicit 'protected' inheritance in virtual functions 2017-03-05 09:49:31 +01:00
ZZYZX b87f9b540e Implemented 'protected' on fields and methods 2017-03-05 09:49:31 +01:00
ZZYZX 9d4179ca06 Protected on methods of StaticEventHandler is completely useless 2017-03-05 09:49:31 +01:00
ZZYZX a43bc279a3 Gave static methods in EventHandler/StaticEventHandler clearscope 2017-03-05 09:49:31 +01:00
ZZYZX 6af5c1fa2b Produce a warning if clearscope is used on non-inner structs. Also now checking for outer class presence correctly. 2017-03-05 09:49:31 +01:00
ZZYZX 86a494aacd Can use clearscope on struct to signify that it should be plain data even if defined inside a play/ui class 2017-03-05 09:49:31 +01:00
ZZYZX 6c90d05407 By default, inner struct in class should take the scope of it's outer class 2017-03-05 09:49:31 +01:00
ZZYZX 0a7aebae93 Fixed const method qualifier. Also, fixed: const is not clearscope, treat differently. 2017-03-05 09:49:31 +01:00
Christoph Oelckers f07bd5ec65 - fixed some mess by two nearly similarly named flags. 2017-03-05 00:36:32 +01:00
Christoph Oelckers 600f57405f - fixed typo in TexMan.GetSize. 2017-03-05 00:28:15 +01:00
Christoph Oelckers cfafbfe4f2 - removed FStringNoInit.
This was development garbage.
2017-03-04 12:55:20 +01:00
Christoph Oelckers 7dbc6939c4 - declared most native getters in Actor as const.
- made the self pointer of const functions readonly.

This seems to work fine. Both calling a non-const function and trying to assign a value to a member fail with an error message.
2017-03-04 12:43:07 +01:00
Christoph Oelckers 4c5794b6d5 - made GetObituary non-constant.
This gets only called from within the play code and making it const would block potential use cases that involve changing some internal variables like counters.
2017-03-04 12:11:56 +01:00
Christoph Oelckers b3ba5bfe2c - allow 'const' on class functions. This is preferable to 'clearscope' so that the UI code can call getter functions without having to declare things as 'clearscope'.
Clearscope is a dangerous context and should be limited to the minimum extent possible and preferably be blocked in user code.
This may still need some work on const functions but better have it in now.
2017-03-04 12:07:45 +01:00
Christoph Oelckers 5551f3a8c5 - declared the sectorplanes in Sector as read only and marked all relevant functions in the planes themselves const.
This is to block modification of the planes directly. For future-proofness with renderer changes everything that alters these values should go through he function interface.
2017-03-04 11:48:36 +01:00
Christoph Oelckers 3879e67cee - the #if was in the wrong place. 2017-03-04 11:34:53 +01:00
alexey.lysiuk a5edd48996 Fixed remaining warning reported by Clang
src/scripting/zscript/zcc_compile.cpp:2456:54: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
2017-03-04 12:23:15 +02:00
alexey.lysiuk d8cee4d3a5 Fixed most of warnings reported by Clang
src/scripting/zscript/zcc_compile.cpp: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
src/p_acs.cpp: warning: format specifies type 'char *' but the argument has type 'PClass *' [-Wformat]
2017-03-04 12:17:53 +02:00
alexey.lysiuk 8a1e0ee4b5 Fixed compilation with GCC/Clang
src/menu/menu.cpp:806:20: error: cannot pass non-trivial object of type 'FString' to variadic function; expected type from format string was 'char *' [-Wnon-pod-varargs]
2017-03-04 12:03:31 +02:00
Christoph Oelckers a7fdf4b90d - fixed: M_Init needs to catch VM exceptions from MENUDEF init to print out meaningful error messages in case something goes wrong. 2017-03-04 10:58:34 +01:00
Christoph Oelckers fd4727e701 - did a bit of cleanup.
- disabled the runtime check in OP_CALL because as implemented it doesn't clean up properly and is not fully implemented.
2017-03-04 10:28:51 +01:00
ZZYZX 3338fb7f33 Added SendNetworkEvent static method to EventHandler; Fixed qualified static method call from own class (previously was 'shadowed' by qualified virtual method call) 2017-03-04 00:57:41 +02:00
ZZYZX c9a994a885 Fixed: clearscope should also clear the inherited scope (through struct member access chain); Fixed: struct member access chain should ONLY work for structs (forgot that FxClassMember inherits FxStructMember) 2017-03-04 00:04:19 +02:00
ZZYZX 723f9770a4 Merge remote-tracking branch 'gz/master' into gz_master2 2017-03-03 23:33:02 +02:00
ZZYZX 1433b78301 Assigned all map data to play 2017-03-03 23:26:06 +02:00
ZZYZX a924564bf3 Implemented hard separation between playsim ConsoleEvent and networked ConsoleEvent (ConsoleProcess, NetworkProcess) 2017-03-03 23:21:12 +02:00
Rachael Alexanderson 4b63092c7a - disable size checking in windowed mode for vid_setmode, allowing it to set arbitrary sizes. 2017-03-03 22:19:58 +01:00
ZZYZX 43d3e3e5c3 Assigned barrier sides to Event structures, added clearscope to ConsoleProcess because it handles both sides 2017-03-03 23:17:21 +02:00
ZZYZX f4a546aee6 Moved menus to ui side, moved AlterWeaponSprite to ui side, moved StaticEventHandler to play side (except ui virtuals) 2017-03-03 23:15:18 +02:00
ZZYZX 421f78c771 Fixed potential crash with new() in anonymous functions (is that even allowed?); Added compile-time check for disallowed new() 2017-03-03 22:52:35 +02:00
ZZYZX 3a57a9809f Removed nonew class modifier 2017-03-03 22:42:12 +02:00
ZZYZX 78533cc316 Fixed: the name of accessed field is now properly retrieved in FxStructMember::RequestAddress 2017-03-03 22:38:33 +02:00
Christoph Oelckers fd20e1d78f - allow hooking custom serializers into PPointer so that serializable types can be handled without having to create new type classes which would be a bit unwieldy thanks to how the type system works. 2017-03-03 20:11:13 +01:00
Christoph Oelckers c630b07011 - replaced SDWORD with int32_t globally.
This type wasn't used in the software rendering code so it could be removed already. The other homegrown types will have to be dealt with later.
2017-03-03 19:35:08 +01:00
Christoph Oelckers f563a296c2 - added an ACS ScriptCall function. So far only superficially tested. 2017-03-03 19:23:27 +01:00
Christoph Oelckers 217bcb847d - fixed: When the savegame code errors out, some cleanup is required in G_DoSaveGame. 2017-03-03 19:19:19 +01:00
Christoph Oelckers 7736e42740 - fixed: The respawn event handler was not called for a regular in-game respawn, only for a cheat resurrection. 2017-03-03 18:53:11 +01:00
Magnus Norddahl 6055f136d8 Make sure SwapInterval is only ever called while the default frame buffer is bound to avoid problems with some drivers 2017-03-03 16:55:18 +01:00
Christoph Oelckers 1761da6079 - fixed: AActor::Howl checked HowlSound for the wrong type. 2017-03-02 18:40:01 +01:00
Christoph Oelckers 8253b91d97 - fixed: The stair and donut builders did not initialize FFloor::m_Instant. 2017-03-02 18:18:34 +01:00
Christoph Oelckers e64f1e645d - exported constants for SetGlobalFogParameter to ZScript. 2017-03-02 13:14:55 +01:00
Christoph Oelckers 62dd810a4e - fixed: A_ProgrammerMelee damaged the caller, not the target. 2017-03-02 13:14:54 +01:00
Rachael Alexanderson 26f7902c3f - fixed: If player is killed by world, attacker was not checked for nullptr, causing a crash. 2017-03-02 13:02:25 +01:00