Commit graph

7284 commits

Author SHA1 Message Date
Christoph Oelckers
c13916ea18 - converted more Heretic actors. 2016-10-17 10:07:12 +02:00
Braden Obrzut
b4bdb8fa7d - Fixed: Assertion failure if a save was loaded without starting a new game (due to uninitialized RNG). 2016-10-17 00:22:06 -04:00
Braden Obrzut
741c9edf42 - Clear out GCC 6.2 warnings (interestingly they now check for misleading indentation which found a good case in fragglescript/t_func.cpp even though I believe it was harmless) 2016-10-17 00:19:08 -04:00
Christoph Oelckers
c623539d2d Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-10-17 00:33:28 +02:00
Christoph Oelckers
6650e2bbfb - converted some Heretic stuff to ZScript for testing.
- added type casts to the arguments of function calls.
- added string constant to state conversion to FxTypeCast.
2016-10-16 22:32:52 +02:00
Braden Obrzut
9dd42be15f - Fixed: Demo playback on Windows XP since we don't patch fstat for v140_xp bug. 2016-10-16 16:22:21 -04:00
Christoph Oelckers
afd9347087 - changed order of script files to match the old DECORATE list for easy comparison of the disassembly.
- added a descriptive name to all types for error messages.
- added a generic type cast node to the code generator.
- added a few more cast operations to the 'cast' VM instruction.
- extended FxClassTypeCast to handle all possible input that can be cast to a class pointer, not just names.
2016-10-16 19:42:22 +02:00
Christoph Oelckers
2da52cedc9 - restrict 8 and 16 bit integer types to struct and class members - and I am not really sure if they should even be allowed there, aside from legacy readonly properties. For 32 bit floats the same would hold, but those are already mapped to 64 bit doubles silently.
ZDoom only uses these types in a very few isolated places, and even those can be removed without problems, so it's very doubtful that having support for these types is of any benefit - on the other hand, having them will most likely introduce more code than is saved in the data by using them...
2016-10-16 12:47:26 +02:00
Christoph Oelckers
59ab8b7ccd - implemented array-style syntax for Random calls.
- implemented handling of the basic math operators so that heretic/beast.txt can be processed.

This is working, aside from still needing the type casts to properly transform the strings to class pointers.
2016-10-16 10:59:12 +02:00
Christoph Oelckers
2c7c04e803 - when simplifying a non-constant expression, leave any identifier that cannot be trivially simplified to a constant alone. It is better to defer resolution to more context-aware code for those. 2016-10-16 09:31:03 +02:00
Marisa Heit
e4281454ce Split ANIMATED into three parts, filtered by game that uses them
- ANIMATED contained definitions for Doom, Heretic, and Strife, all
  crammed into a single file. This meant that animations from one game
  could erroneously make their way into maps for another game that
  provided custom textures with names that matched textures that animated
  in the other game. There are now three separate ANIMATED lumps with only
  the animations defined for the original game and no others. The one
  that gets loaded depends on the game being played.
- Added documentation for the ANIMATED file format to the comment for
  FTextureManager::InitAnimated(), since I had to figure it out from the
  code.
2016-10-15 21:40:24 -05:00
Marisa Heit
ae14993ba4 Fixed: Possible invalid processing for Crash states that immediately destroy the actor
- Setting an actor's Crash state has the potential to destroy the actor if
  the Crash state has one or more 0-tic states that end with Stop. This
  was not taken into account when the object's Z velocity was 0, but it
  was under the floor anyway.
2016-10-15 21:14:34 -05:00
Marisa Heit
58ec0e4594 Add OF_Transient flag for objects that shouldn't be written to disk 2016-10-15 20:57:56 -05:00
Christoph Oelckers
847b8c45ef - Changed ZCCCompiler::Simplify to allow running in constant and non-constant mode. The difference is that non-constant mode does not attempt to simplify function name expressions because these cannot be processed without destroying them, if some identifier in there is not referencing a symbol, which is quite common. 2016-10-16 01:33:36 +02:00
Christoph Oelckers
d6ce60f63a - added named RNG support to FxFunctionCall.
This looks simpler than duplicating all that stuff and avoids a lot code duplication.
2016-10-16 01:08:02 +02:00
Christoph Oelckers
55f6661c87 - added handling for all the builtins supported by DECORATE to FxFunctionCall.
For the random functions this class only handles the default-RNG version. The one with an explicit RNG needs to be done separately because the parser produces different output for them.
2016-10-16 00:12:33 +02:00
Christoph Oelckers
b299b64e47 - the compile context now knows if it is invoked by ZScript or DECORATE, so that it can be more strict with ZScript if needed.
- added a truncation warning to FxIntCast, which only occurs with ZScript, not with DECORATE. FxBoolCast is intentionally left out because it would defeat the reason for this cast type.
2016-10-15 21:35:31 +02:00
Christoph Oelckers
c3e693b507 - added FindClassMemberFunction which retrieves a function symbol and performs some verification.
- removed Self parameter from FxFunctionCall. Actual member function calls through an object require quite different handling so lumping these two together makes no sense.
- added a workaround to deal with ACS_NamedExecuteWithResult to both the compiler and FindClassMemberFunction. The way the ZScript compiler sets this up means that it will call the builtin, not the actual action function, so the parser needs to do some explicit check to get past the same-named action function.
- pass a proper self pointer to FxActionSpecial. Although it's still not being used, propagating design shortcuts through several function levels is a very, very bad idea.
2016-10-15 20:16:44 +02:00
Christoph Oelckers
cbb990a79e - pass the current function to the compile context instead of just the containing class. 2016-10-15 17:40:27 +02:00
Christoph Oelckers
db8ab1bc4a - give PFunction a bit more information:
* explicitly require passing the owning class when creating it.
 * extract self pointer class when adding a variant.
 * put the flags on the single variants, we can not fully rule out that they will be 100% identical, if variants ever get allowed.
2016-10-15 15:50:45 +02:00
Christoph Oelckers
091da92819 - Added AStateProvider class which is used to define the special action function behavior of weapons and custom inventorys. The class itself does not do anything, but the compiler will use it to set up the action function prototypes differently which in turn will be used to do type checking during code generation. 2016-10-15 15:10:48 +02:00
Christoph Oelckers
32a3f57a54 - more preparations to compile functions:
* Allow PFunction to work without a VMFunction being attached.
 * The Variant for a function must store the prototype itself instead of relying on the VMFunction it points to. Otherwise it would not be possible to reference a prototype during compilation of the function because it does not exist yet.
 * Give the variant a list of the function's argument's names, because these are also needed to compile the function.
 * create an anonymous function symbol when the function gets registered to the builder. At this point we have all the needed information to set it up correctly, but later this is no longer the case. This is the most convenient info to have here because it contains everything that's needed to compile the function in the proper context, so it has to be present when starting compilation.
 * added some preparations to implement special handling for weapons and custom inventory items, which can run action functions in another actor's context. This part is not active yet but the basics are present in SetImplicitArgs.
2016-10-15 14:36:08 +02:00
Christoph Oelckers
2cb5839c11 - count errors in the parser and abort afterward if there were some.
- use FScriptPosition's error counter throughout the compiler so that there is only one counter for everything, not two.

Parts of the compiler use FScriptPosition, so this is easier to handle than having a separate counter in the compiler class. It also avoids having to pass the compiler object to any function where an error may be output. The TreeNodes contain sufficient data to be converted to an FScriptPosition and using that for error message formatting.
2016-10-15 12:15:25 +02:00
Christoph Oelckers
5f5da26321 Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-10-15 10:52:35 +02:00
Christoph Oelckers
162da2fcaf - allow to specify "none" to set an actor's translation to the identity table. 2016-10-15 10:51:48 +02:00
Christoph Oelckers
3b0d687b22 - committed from the wrong subdirectory and missed all files that just changed the #include line. 2016-10-15 10:43:02 +02:00
Christoph Oelckers
f86e64e712 - renamed thingdef_expression to codegen. Eventually this needs to be split up into smaller units because the file is already quite large and there's still a lot to add here. 2016-10-15 10:39:58 +02:00
Christoph Oelckers
d8a8b59006 - cleaned up the loop statement nodes in the code generator, which put some handling in FCompileContext and some of their data into the base FxExpression class instead of having an intermediate base class for all loops which is responsible for the relevant data. All this is now encapsulated in a new FxLoopStatement class which serves as base for the actual loop statements. 2016-10-15 10:34:26 +02:00
Christoph Oelckers
7bdd320f13 - forgot to save this. 2016-10-14 23:51:38 +02:00
Christoph Oelckers
2e882a41a3 - removed some redundancy. 2016-10-14 23:13:08 +02:00
FishyClockwork
08504dcbe2 Added a small check just in case... 2016-10-14 23:11:58 +02:00
FishyClockwork
ecffd0bea6 Done the code changes.
This time only nulls I've added are nullptrs
2016-10-14 23:11:57 +02:00
alexey.lysiuk
0370592422 Fixed serialization of DSeqPolyNode class objects
Polyobject pointer was not serialized at all
2016-10-14 23:05:02 +02:00
Magnus Norddahl
36aff68501 Fix divide by zero if yscale is too small a number 2016-10-14 23:02:16 +02:00
Magnus Norddahl
657abb374b Fix SkyViewpoint skyboxes not being rendered 2016-10-14 23:01:10 +02:00
Christoph Oelckers
9def9ec095 - added more casting kludges so that I can run some tests with Heretic's definitions. 2016-10-14 22:54:22 +02:00
Christoph Oelckers
d00e93bdab - fixed order of state setup.
It looks like the setup of the action function and the adding of the states got inverted by something I tried, leaving the ActionFunc member empty on the real states.
2016-10-14 21:56:45 +02:00
Christoph Oelckers
52005214c1 - Added some fudging so that A_PlayerSkinCheck creates proper code until I can rewrite the FunctionCall expression to match what the script compiler needs. The current version of this class is too much geared toward DECORATE. 2016-10-14 21:15:46 +02:00
Christoph Oelckers
784f7ed671 - converted all of Doom's actors.
- fixed a few problems that were encountered during conversion:
 * action specials as action functions were not recognized by the parser.
 * Player.StartItem could not be parsed.
 * disabled the naming hack for PowerupType. ZScript, unlike DECORATE will never prepend 'Power' to the power's name, it always needs to specified by its full name.
 * states and defaults were not checked for empty bodies.
 * the scope qualifier for goto labels was not properly converted to a string, because it is an ENamedName, not an FName.
2016-10-14 20:08:41 +02:00
alexey.lysiuk
d6b3cbe0c9 Fixed serialization of MovePoly class objects
See http://forum.zdoom.org/viewtopic.php?t=53787
Removed "speed" field which is serialized in the parent class
2016-10-14 14:33:13 +03:00
Christoph Oelckers
9e2830a3db - converted the rest of actors/shared.
- moved damagetype definitions to MAPINFO. These were in DECORATE which is not correct. The old code is left for compatibility.
2016-10-14 10:46:15 +02:00
Christoph Oelckers
b8a2059aa9 Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-10-14 09:11:54 +02:00
Marisa Heit
97107b6b6d Update lempar.c to 2016-10-04 version
- Every update rolled into one, because I'm pretty sure I missed some while
updating lemon.c (not counting today's commits), since it wasn't always
updated at the same time as lemon.c.
- In particular, I think this check-in from 2016-06-06 was very important to
  us after commit 3d5867d29e (For the
  Lemon-generated parser, add a new action type SHIFTREDUCE and use it to
  further compress the parser tables and improve parser performance.):
  * Fix lempar.c so that the shift-reduce optimization works for error
    processing.
2016-10-13 22:30:12 -05:00
Christoph Oelckers
7de683f9f5 - converted a few more DECORATE files.
- started with the AST converter. So far it only deals with direct function calls with simple constants as parameters.
- added an error condition for the defaults block to get rid of some asserts.
2016-10-14 00:40:20 +02:00
Christoph Oelckers
7e8d7eb2ec - fixed parsing of 'damage' default property.
- fixed processing of goto labels.
2016-10-13 22:52:31 +02:00
Christoph Oelckers
433bf46010 - removed token 'mode' because it isn't used anywhere and clashed with some actor properties.
- fixed uninitialized counter variable in DECORATE parser.
- allow dottable_id of xxx.color so that the property parser can parse 'powerup.color'.
- fixed crash with actor replacement in script compiler.
- add the lump number to tree nodes because parts of the property parser need that to make decisions.
- removed test stuff.
- converted inventory.txt, player.txt and specialspot.txt to ZSCRIPT. These were the minimal files required to allow actor.txt to parse successfully.
- removed the converted files from the DECORATE include list so that these are entirely handled by ZSCRIPT now.
2016-10-13 20:45:52 +02:00
Christoph Oelckers
a72fbb771f - separated the code generation from the DECORATE parser and cleaned up the interface to the code generator. Most importantly, the VMScriptFunctions are now preallocated when being added to the list of functions to compile and will be filled in later by the code generator. This allowed the removal of some ugly maintenance code. 2016-10-13 00:53:59 +02:00
Christoph Oelckers
59ed26c0b6 - resorted some of thingdef.cpp's contents into more appropriate files.
- split FinishActor into several functions. While DECORATE can, ZSCRIPT cannot do all this in one go.
- split the state finalization into several class-specific virtual functions.
2016-10-12 20:42:41 +02:00
Christoph Oelckers
b1a83bfd26 - started with cleanup and separation of DECORATE code.
* everything related to scripting is now placed in a subdirectory 'scripting', which itself is separated into DECORATE, ZSCRIPT, the VM and code generation.
 * a few items have been moved to different headers so that the DECORATE parser definitions can mostly be kept local. The only exception at the moment is the flags interface on which 3 source files depend.
2016-10-12 19:22:33 +02:00
Christoph Oelckers
6a8ab9a4d3 - implemented the state compiler. So far all it can handle is parameter-less functions.
To do the rest, some cleanup is needed first, to untangle the DECORATE parser from the actual code generation so that the low end stuff can actually be reused here instead of having to be redone.
2016-10-12 17:50:23 +02:00
Christoph Oelckers
900644e465 Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-10-12 12:43:56 +02:00
Christoph Oelckers
6f92efc72c - renamed thingdef_codeptr.cpp and moved it out of thingdef/.
Ultimately, thingdef should only contain code that is directly related to the DECORATE parser, but that's not the case with this file. It's only function definitions which get used during gameplay and will also be accessed by ZScript.
The change is intentionally on master so that pull requests can adjust to it now instead of creating conflicts later.
2016-10-12 12:43:26 +02:00
Major Cooke
3de83b8943 Added PSPF_FLIP.
Flips the overlay on the X axis.
2016-10-11 17:20:58 -05:00
Christoph Oelckers
f46b6b5be5 - fixed some issues with the grammar for parsing states:
* Goto did not support the class scope operator '::'. Like in DECORATE, this cannot be done with a simple '.' because it creates semantic problems with first part of a state label. This requires different syntax so that it can unambiguously distinguish between a scope identifier and the actual label
 * Goto used the incorrect token PLUS for '+' instead of ADD.
 * The state's duration was not stored in the AST.
 * Truncating the sprite name inside the parser is probably not the best idea because it used a simple Printf to report this. Let's do this during processing of the AST where this can be properly handled as an error.
2016-10-12 00:04:30 +02:00
Major Cooke
5dc94a10c3 Added A_SetInventory.
- Sets the absolute amount of an inventory actor.
- Limits itself to the range [0, MaxAmount]. Setting beyondMax to true disregards the MaxAmount. Default is false.
2016-10-11 14:44:31 -05:00
Christoph Oelckers
d8c689d874 - initialize function symbols. At the moment all it does is process the existing native functions. Any further processing will be done once the base classes of the engine can be parsed from the scripting files.
- switched the types of the internal 'self' and 'stateowner' parameters so that they get assigned correctly. I can't tell if this will error out if fields get accessed from the caller with the wrong class, but for actual scripting to work these must be correct.

The committed 'actor.txt' can be parsed successfully, with the exception of a few subclass references that cannot be resolved yet.
2016-10-11 18:53:10 +02:00
Christoph Oelckers
bdbc7c3fb7 - removed CreateDamageFunction, because it's no longer needed for defining a 'damage' constant. 2016-10-11 14:43:17 +02:00
Christoph Oelckers
6989b81688 - extended the grammar so that the DECORATE function declaration list can almost be used as-is, with the sole exception of requiring any action function to declare a return type, even if it is void.
This adds:
 * builtin types color, state and sound.
 * ending a parameter list with an ellipsis to declare a varargs list. (A_Jump uses this.)
 * allowing to declare optional arguments by giving them a default value.
 * adding an 'action' qualifier for function declarations.
2016-10-11 13:11:40 +02:00
Christoph Oelckers
acec2e5b07 Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-10-11 00:57:31 +02:00
Christoph Oelckers
3b19887637 - implemented the Defaults property initializer.
This uses the same property and flag tables as DECORATE with a few changes:

 * it sets the parse mode to strict, so that several DECORATE warnings are now errors.
 * trying to change a deprecated flag will print a warning.
 * setting of editor numbers, spawn and conversation ID id not possible. Use MAPINFO to do this.
 * all subclass flags must use the qualified name now (e.g. +ALWAYSPICKUP will print an error.)
 * the scriptable Damage property is not yet implemented. This will require a special case with a differently named property in the processing function because in the AST it is no longer possible to distinguish between a damage value and a constant damage function.
2016-10-11 00:56:47 +02:00
Christoph Oelckers
084bf8c576 - fixed: VisibleAngle and VisiblePitch actor properties require both parameters to be present, but the second one was set to optional. 2016-10-11 00:23:50 +02:00
Christoph Oelckers
2b9af0176c - changed grammar for a class's default block to look and act like DECORATE, so that it can hook into the same property dispatcher.
This had been defined as a regular compound statement but in the context this will be used in, that makes very little sense, because all it can do is set some constant values.
The most important thing here is that it doesn't provide an unnecessary learning curve to its users and doing it this way will not only ensure that but also avoid redundant documentation.
To allow initialization of other user-defined properties it will require some extensions but that's a job for later and can just as easily be done in the current framework, rather than throwing everything out and start from zero.
2016-10-10 16:53:24 +02:00
Major Cooke
31ca5a1900 Added OverlayX/Y(int layer)
- Retrieves the X/Y positions of an overlay.
- A_OverlayFlags and A_OverlayOffset now interpret a layer of 0 to mean 'use this calling layer'.
2016-10-10 10:48:50 +02:00
alexey.lysiuk
a771a3edd4 Fixed potential crash caused by A_Warp()
ACSF_Warp case was refactored to express its intention clearly
http://forum.zdoom.org/viewtopic.php?f=2&t=53734
2016-10-10 10:47:43 +02:00
Christoph Oelckers
e84d6a06d8 - changed PClass:AddField so that it doesn't create defaults if none are present. The ZScript compiler will not create any defaults until after all fields have been added and this function created bad data if it was run on a class without defaults.
- added checks for duplicate field names.
- moved the tree node symbol tables out of PSymbolTreeNode to the worker data. That symbol is a bad location because it restricts the usefulness of the symbol class which is also needed for variables which use different AST structs.
- fixed some memory management issues with the work classes for the compiler that became apparent after moving the symbol tables in there. In several places these were copied around, possibly losing data.
2016-10-10 01:18:47 +02:00
Christoph Oelckers
4ecd7dd13a - a bit of cleanup. 2016-10-09 22:01:23 +02:00
Christoph Oelckers
ad43f2bc7e - parse the list of class/struct fields and add the PField entries to their type.
- fixed a few issues with trying to access a class's Type before it got initialized.
2016-10-09 21:54:23 +02:00
Christoph Oelckers
49f18c0a19 - renamed the symbol tables holding the tree nodes so that the code becomes clearer to read. Necessary because the unclear naming caused:
- fixed: The tree nodes for classes and struct members were stored in the global tree nodes table.
- sort variable declarations into their own list for processing.
2016-10-09 09:09:17 +02:00
Christoph Oelckers
efcd5a8683 - forgot to delete these lines. 2016-10-08 22:18:51 +02:00
Christoph Oelckers
08f313d011 - implemented complete resolving of constants - both global and class-local.
This uses a different algorithm as the old implementation - instead of recursively resolving unknown symbols it will first collect all constants from all scopes and then process them in one operation, doing multiple passes over the list until no more constants can be resolved anymore.
2016-10-08 22:16:10 +02:00
Christoph Oelckers
5bb6bb31ca - added ProcessStruct, analogous to ProcessClass.
Now everything should be in place to resolve all constants - inside and outside classes or structs.
2016-10-08 15:39:54 +02:00
Christoph Oelckers
d139ee9f68 - give the 'default' block its own node type in the AST.
- group a class's body the same way as the global AST. Only partially implemented so far so that constants can be processed.
2016-10-08 15:27:20 +02:00
alexey.lysiuk
9a72ef1bf1 Added detection of current macOS version 2016-10-08 15:47:16 +03:00
Christoph Oelckers
82ac2081b6 - create struct types.
- fixed class creation. There was an infinite loop and some missing checks for native classes.
- do not write the compiler's symbols to the same symbol table as the output. The output must go to GlobalSymbols but the internal symbols must go to a namespace specific table that can be discarded after compilation.
2016-10-08 13:34:37 +02:00
Christoph Oelckers
b71e8d09ed - create class types from the AST.
This is the first thing the compiler has to do to get access to the class's symbol table. Of course at this point the final size of a class is not known yet so these are currently all treated as tentative.
2016-10-08 11:54:33 +02:00
Christoph Oelckers
fff428c71d - added copyright headers to scripting files. 2016-10-08 08:35:16 +02:00
Christoph Oelckers
994bb4fc7a - started to make ZScript parser work on real-life data. It will now read a lump named ZSCRIPT which is a list of filenames to be compiled.
- place generated symbols into GlobalSymbols instead of a scratch table that will be discarded right away.
- allow the state object to change source file scanners (I hope this works, but the old implementation was unable to do more than one with with a parse state so I had to change it.)
- It can now parse constants.txt and insert everything in it into the global symbol table and make subsequent DECORATE compile properly.
2016-10-08 01:05:27 +02:00
Christoph Oelckers
d819aafcf3 - changed handling of duplicate classes in DECORATE.
Instead of replacing the original, the second class will get renamed now, using the originating file as an identifier. In the vast majority of cases this should do exactly what is needed: Create an unconflicting second class that can coexist with the original. Unless the class is used by name this should eliminate all problems with this, but so far I haven't seen anything that used them by name.

This is choosing the lesser of two evils. While some mod out there may get broken, the old setup meant that the first class of a given name could not be written out to a savegame because it was not retrievable when loading it back.
2016-10-07 15:28:25 +02:00
Christoph Oelckers
06ca41f8b5 - do not declare PNamedType::Outer as DObject.
Ultimately we may have to get a fully qualified name out of this, so Outer should be a type that can handle this feature. The new class for this is currently used as base for PType and PSymbol so that PNamedType inherits from it and maybe later a namespace symbol can, too.
2016-10-07 13:59:29 +02:00
Christoph Oelckers
ee66d22034 Revert "- added an option to disable the pickup screen flash."
This reverts commit 2d320a2e86.

The feature has been superseded by pickup_fade_scalar and is no longer needed.
2016-10-07 08:46:06 +02:00
raa-eruanna
02f66fa34e - Backported blood_fade_scalar from Skulltag
- Added new pickup_fade_scalar which works the same way for pickups
- Default for blood_fade_scalar is 1.0 instead of 0.5 from Skulltag.
2016-10-06 20:01:20 -04:00
Christoph Oelckers
99c4d03ad4 - fixed: DCeiling's main constructor could leave some fields uninitialized. 2016-10-06 21:20:49 +02:00
Christoph Oelckers
d7bb5bb41e - fixed: ZCC_OpInfoType::FindBestProto was missing checks for exact match of the required conversion before testing if it is a F32->F64 conversion.
Of course, since 0 means that there is no conversion it also means that there is no data that could be checked.
2016-10-06 12:08:38 +02:00
Christoph Oelckers
c56d2eecb0 - rewrote AActor::DestroyAllInventory so that it clears the item's link to its owner and the owner's inventory list before destroying them.
There have been reports about crashes in here with Linux that point to some of the code that gets called here doing unwanted things on the owner, so with these links cleared that should no longer be possible.
2016-10-06 08:50:46 +02:00
Christoph Oelckers
59d5b42abf - fixed: G_UnsnapshotLevel should abort with an error if it cannot read the savegame.
- fixed: The exception handler in G_DoLoadGame needs to rethrow the exception it receives.
2016-10-05 19:02:53 +02:00
Christoph Oelckers
aeb5377821 - do not generate SYSEX events when playing MIDIs through FMod, because there has been a report that it doesn't work correctly. 2016-10-05 16:45:12 +02:00
Christoph Oelckers
2d320a2e86 - added an option to disable the pickup screen flash. 2016-10-05 09:59:19 +02:00
Christoph Oelckers
15cbf4bae6 - fixed: DecoHandleRuntimeState must check all parent classes when trying to determine if the target is a valid state. It should also ensure that both the calling and target state belong to the same actor. Although unlikely it cannot be entirely ruled out that a bogus index randomly points to a seemingly valid state elsewhere. 2016-10-04 09:28:19 +02:00
Marisa Heit
594b344be9 Don't use MIN<short> when clamping topclip.
- This was fine with fixed point numbers, since they could never be
  outside of short range when converted to regular ints. With floating
  point numbers now, that condition no longer holds.
2016-10-03 22:05:02 -05:00
alexey.lysiuk
d6346fb0c6 Fixed compilation with GCC or Clang 2016-10-03 21:44:00 +03:00
Christoph Oelckers
41ab08ee47 - fixed: TVector::Resized needs to consider that the input vector has a length of 0. In this case just performing the normal calculations results in an invalid vector. 2016-10-03 11:00:26 +02:00
Major Cooke
201ae3c60f Added OverlayID() for retrieving psprite layer numbers. 2016-10-03 00:44:06 +02:00
N.E.C
671646be26 Fix errors encountered when compiling for v140_xp target 2016-10-02 13:05:26 -07:00
Major Cooke
1620ff58c8 Added INTCVAR to DrawNumber.
- Allows retrieval and displaying of an int/bool user/server cvar.
2016-10-02 20:11:13 +02:00
Christoph Oelckers
e84a7de390 - variable was in the wrong scope. 2016-10-02 18:56:04 +02:00
Christoph Oelckers
37d61167ea - hotfix for a RapidJSON bug: If the Writer tries to process an INF or NaN value, it aborts and leaves the writer in a broken state, unable to recover. Changed so that it writes a 0 value so that the resulting JSON at least parses correctly. 2016-10-02 18:50:37 +02:00
Christoph Oelckers
3418710a38 - be a bit more thorough and also call Effect() on vertically moving missiles with zero damage. 2016-10-02 14:38:48 +02:00
Christoph Oelckers
865863ab6f - fixed: AFastProjectile did not work properly for perfectly vertically moving missiles. Like AActor::Tick it needs to ensure that a tiny bit of lateral movement is present so that collision detection and the Effect() function work as intended. 2016-10-02 14:37:26 +02:00
Christoph Oelckers
0bce6e3925 - added ACS and DECORATE setter functions for named translations. 2016-10-02 14:09:45 +02:00
Christoph Oelckers
a505e91032 - added TRNSLATE lump for defining global translations which are accessible by name.
This is only the definition part, manipulation functions for ACS and DECORATE still to do.
2016-10-02 13:35:25 +02:00
alexey.lysiuk
d7683a8c55 Fixed crash on early fatal error exit
Process terminates correctly if zdoom.pk3 is missing
2016-10-02 10:13:45 +03:00
Marisa Heit
efc9ed2fe9 Fix state lookup from non-action functions (i.e. Damage functions) 2016-10-01 22:31:07 -05:00
Marisa Heit
eb2ee33950 FxVMFunctionCall must pass null pointers when calling an action function from a non-action function 2016-10-01 22:29:57 -05:00
Marisa Heit
944ae2bc09 Only generate the self==stateowner check inside action functions 2016-10-01 21:47:43 -05:00
Christoph Oelckers
51ffd6d9c6 - fixed some warnings.
- A_SetRenderStyle should not default to STYLE_None.
2016-10-02 01:00:07 +02:00
Christoph Oelckers
80f2f5829f - added A_SetRenderStyle function which replaces A_SetTranslucent. A_SetTranslucent had to be deprecated due to obsolete semantics of the renderstyle argument. 2016-10-02 00:43:05 +02:00
Christoph Oelckers
ff0b879323 - added UDMF portal flags. Names are identical with Eternity for compatibility reasons. 2016-10-02 00:31:25 +02:00
Christoph Oelckers
7720359f4c - fixed: AActor::Masacre must restore the flag if it cannot kill the monster. 2016-10-01 12:08:07 +02:00
alexey.lysiuk
099bfed806 Fixed endianness issue with precaching of MUS files 2016-10-01 11:50:29 +02:00
alexey.lysiuk
e9ce699042 Fixed compilation with GCC or Clang 2016-10-01 12:17:15 +03:00
Christoph Oelckers
b400cf1454 - added an integrity check to the SNDINFO parser to detect and eliminate recursive links. Normally these would crash the sound code later.
- allow recursive linking of $random definitions (as long as they do not link back, see above.)
- fixed the sound precaching which did not handle $alias inside $random. Normally this went undetected but in cases where the random sound index was the same as a sound index in the current link chain this could hang the function.
2016-09-30 10:50:41 +02:00
Christoph Oelckers
2d5061e81f - fixed: DScroller did not initialize m_LastHeight in all situations. This caused a problem with the serializer because RapidJSON aborts the write of a floating point value if it is invalid.
- ensure that floats are always written out. If the actual value causes an error (i.e. INF or NaN), write a 0 to guarantee proper formatting.
2016-09-28 11:58:12 +02:00
Christoph Oelckers
676d2365e1 - fixed: The ACS strings deserializer set incorrect indices in the bucket array. This only caused a problem if there were gaps in the string pool. 2016-09-28 09:49:41 +02:00
Christoph Oelckers
12ea8ffbe4 - removed some leftover garbage from the floating point rewrite in the floorRaiseToLowestCeiling case of DFloor. 2016-09-28 08:06:15 +02:00
Marisa Heit
e3be6e4819 Fixed: The menu no longer refreshed the screen border 2016-09-27 18:58:09 -05:00
Marisa Heit
40f0dbf51c Fixed: Y and Z were flipped for sound velocity 2016-09-27 16:27:31 -05:00
Christoph Oelckers
f4462a7b93 - fixed: Any DSectorEffect thinker must be placed into STAT_SECTOREFFECT.
The slot had been there forever to address this same problem but only one of the two constructors actually set it, too bad that it was the wrong one...

This is something that normally won't be noticed. But if some actor is spawned on a moving platform, with both thinkers on the same statnum it means that the order of execution is not correct with the platform being done first, resulting in the actor to 'jump' while the platform is moving. To prevent this it is necessary that all sector movers only tick after all actors have completed their thinking turn.
2016-09-25 09:43:17 +02:00
Christoph Oelckers
92d0043a81 - undid part of the last commit and hopefully corrected it for good now.
We have to be extremely careful with the player data, because there's just too much code littered around that has certain expectations about what needs to be present and what not.
Obviously, when travelling in a hub, the player_t should be retained from the previous level. But we still have to set player_t::mo to the PlayerPawn from the savegame so that G_UnsnapshotLevel doesn't prematurely delete it and all associated voodoo dolls, because it checks player_t::mo to decide whether a player is valid or not.
The actual deletion of this redundant PlayerPawn should only be done in G_FinishTravel, after the actual player has been fully set up
2016-09-25 09:23:44 +02:00
Christoph Oelckers
6a6a0e8017 - removed some more hubtravel related player start fudging.
* do not skip the player_t init when travelling in a hub. The old player may still be needed in some edge cases. This applies only to singleplayer for now. The multiplayer version still needs reviewing. I left it alone because it may shuffle players around which is not wanted when doing hub travelling.
 * do not spawn two temp players in G_FinishTravel. Instead handle the case where no player_t::mo can be found gracefully by adding a few nullptr checks. This temp player served no real purpose except for having a valid pointer. The actual start position was retrieved from somewhere else.
2016-09-25 01:28:27 +02:00
Major Cooke
74b8e9f286 - Don't use Normalized180() on angles. This could result in ranges being wrongly inverted.
- Fixed properties not having the proper indices.
- Use ViewPos-to-actor instead of measuring actor-to-actor.
- Use the actual camera instead of the actor so camera textures can work.
2016-09-24 17:54:09 +02:00
alexey.lysiuk
a419b581a8 Fixed compilation on macOS 2016-09-24 13:15:45 +03:00
Christoph Oelckers
3f17d64f90 - fixed pitch comparison in visibility checking. 2016-09-24 09:42:35 +02:00
Christoph Oelckers
3862c77b4b - undid savegame version bump because it's not needed. 2016-09-24 09:18:25 +02:00
Major Cooke
dfa4f38c8f Updated to new save game code. 2016-09-24 09:17:18 +02:00
Edoardo Prezioso
7e4d0ecdbf - Fixed GCC/Clang regression post serialization. 2016-09-24 09:00:31 +02:00
Christoph Oelckers
b7c822d208 - fixed secplane_t serializer. It passed incorrect defaults to the sub-serializers and calculated negiC wrong. 2016-09-23 23:47:25 +02:00
Christoph Oelckers
69291b9cf9 - completely eliminated the horrible fudging that went on with players during hub travel. This means that DestroyMostThinkers and the player substitution mechanism in the object deserializer are gone now.
I wish I had realized this the last time it came up - it would have saved me a lot of trouble.
But as it turns out, the more recent travelling code makes all of this completely unnecessary, working perfectly fine with deleting the player pawns along with the rest of the thinkers before loading the stored ones from the savegame (and getting rid of those in G_FinishTravel.)
And with a sane savegame format that does not depend on side effects from how the thinker serializing handled linking into the lists the old code was even harmful, leaving voodoo dolls behind.
I had the exact same effect when I tried to reshuffle some things for reliably restoring portals, but did not make the connection to interference between two mutually incompatible player travelling mechanisms that just worked by sheer happenstance with the original order of things.
2016-09-23 23:03:11 +02:00
Christoph Oelckers
2318db0b1a - let DWaggleBase use the interpolation pointer of its parent instead of defining its own one.
- do not call checking code for loading savegames when writing them in ACS module serializer.
2016-09-23 22:03:44 +02:00
Christoph Oelckers
36bf099d54 - fixed: object pointers as array members may not be skipped if they are null.
- changed S_GetMusic to return a const pointer to the actual music name instead of a copy. The only thing this is used for is the savegame code and it has no use for a copy, it can work far more efficiently with a const pointer.
2016-09-23 21:24:56 +02:00
Christoph Oelckers
02b3884dff - added copyright header to serializer.cpp. 2016-09-23 20:13:22 +02:00
Christoph Oelckers
e4924c3d47 - added some missing End... calls in player deserialization code.
- fixed reading of music name.

In its current state the code is now capable of reading an E1M1 savegame and continuing play.
2016-09-23 20:05:12 +02:00
Christoph Oelckers
b844ab137e - added some comments about the special player treatment in hub travels because this is not really intuitive... 2016-09-23 18:12:38 +02:00
Christoph Oelckers
01d28e3eb2 - added the last missing bits of the savegame code - thinker list deserialization and handling of players during hub travel. Now testing is what remains... 2016-09-23 17:49:33 +02:00
Christoph Oelckers
edb7f7959e - re-enable some commented-out stuff. 2016-09-23 14:06:51 +02:00
Christoph Oelckers
86e9282193 - removed the sequential processing of JSON objects because the benefit is too small.
After testing with a savegame on ZDCMP2 which is probably the largest map in existence, timing both methods resulted in a speed difference of less than 40 ms (70 vs 110 ms for reading all sectory, linedefs, sidedefs and objects).
This compares to an overall restoration time, including reloading the level, precaching all textures and setting everything up, of approx. 1.2 s, meaning an increase of 3% of the entire reloading time.
That's simply not worth all the negative side effects that may happen with a method that highly depends on proper code construction.
On the other hand, using random access means that a savegame version change is only needed now when the semantics of a field change, but not if some get added or deleted.

- do not I_Error out in the serializer unless caused by a programming error.

It is better to let the serializer finish, collect all the errors and I_Error out when the game is known to be in a stable enough state to allow unwinding.
2016-09-23 14:04:05 +02:00
Christoph Oelckers
5a3f1dcdb6 - made reading of objects from the savegame work.
It turned out this may not be done automatically when opening the savegame - it has to be done later, after the pre-spawned map thinkers and all connected objects have been destroyed.
The object deserializer also has to be rather careful about dealing with parse errors, because if something goes wrong a whole batch of uninitialized or partially initialized objects will be left behind to destroy.
This means that no object class may assume that anything but the default constructor has been run on it and needs to check any variable it may reference.
2016-09-23 09:38:55 +02:00
Christoph Oelckers
a83ea4ddd2 - fixed two typos in property names. 2016-09-23 09:20:58 +02:00
Christoph Oelckers
cad2be46ac - fixed several Destroy methods which blanketly assumed that the object's pointers were valid to use without checks.
This is not the case if deserialization prematurely aborts. The entire object may be invalid if something in the deserializer I_Error's out.
2016-09-23 08:49:30 +02:00
Christoph Oelckers
657140f985 - fixed: The canvastexture serializer did not call EndArray to close the containing object. 2016-09-23 08:27:31 +02:00
Christoph Oelckers
4964f94de1 - added a destructor zo DFsScript, because if this gets deleted outside the GC process it'll leave an allocated buffer behind, so make sure it always gets destroyed. 2016-09-23 08:26:36 +02:00
Christoph Oelckers
f397a4943c - added OutputDebugString calls to I_Error functions in Win32, so that these messages can be seen in the debug output. 2016-09-23 08:14:40 +02:00
Christoph Oelckers
c17da32dbd - added object deserialization. It seems to work, at least the stuff I sampled looked like it was properly reatored and it triggers no error condition.
- always make the top level object randomaccess when opening a JSON file for reading. Some things won't work right if this is opened for sequential access.
2016-09-23 00:45:41 +02:00
Christoph Oelckers
604b2b316b - we need to save the OF_JustSpawned flag to insert thinkers into the proper list. 2016-09-22 21:17:34 +02:00
Christoph Oelckers
c22e8c50af - fixed some errors with parsing globals.json. It looks like this file is being processed correctly now. 2016-09-22 19:36:23 +02:00
Christoph Oelckers
d9dbf26f63 - do not list savegames for different IWADs. 2016-09-22 17:39:09 +02:00
Christoph Oelckers
f52e2a8cc4 - removed bogus BeginObject call in deferred script serializer. 2016-09-22 12:36:29 +02:00
Christoph Oelckers
d5b771afdd - fixed: Both array serializers need the bounds check. 2016-09-22 11:53:09 +02:00
Christoph Oelckers
68dc75bf9e - fixed: array clamping may only be done when reading a savegame.
- fixed generation of savegame names for level snapshots.
2016-09-22 11:51:29 +02:00
Christoph Oelckers
e01965b747 - fixed deserialization of level.Scrolls. 2016-09-22 11:22:15 +02:00
Christoph Oelckers
f0e8e860f1 Merge branch 'master' into json 2016-09-22 09:09:48 +02:00
nashmuhandes
a49e15c541 Added REOPEN script type. These scripts behave just like OPEN scripts, except they will re-execute themselves every time the level is re-entered (ie as part of a hub). 2016-09-22 08:57:22 +02:00
LordMisfit
715aa80cf2 - Fix for DamageFactor bug w/ PowerDamage & PowerProtection 2016-09-22 08:52:43 +02:00
alexey.lysiuk
2d55f713c2 Fixed support for automatic graphics switching on macOS
The corresponding setting in .plist is wrong but Xcode fixes it automatically
This doesn't happen however when building via makefiles
2016-09-22 08:52:43 +02:00
Major Cooke
1383355be7 Removed the positive-only ripper level requirement.
- Several mods were able to just take advantage of A_SetRipperLevel and the likes, essentially bypassing this gate so there really is no point in doing this anymore.
2016-09-22 08:50:38 +02:00
raa-eruanna
76c5ff29fe If Inventory.MaxAmount > 1 on weapons, allow and track multiple pickups. 2016-09-22 08:47:23 +02:00
alexey.lysiuk
0a24c15445 Added ability to customize path to FluidSynth dynamic library
Use fluid_lib CVAR to set path or default name of dynamic library will be used instead
2016-09-22 08:43:00 +02:00
alexey.lysiuk
4f7e1f0171 FluisSynth dynamic library is now referenced by system specific name on macOS 2016-09-22 08:43:00 +02:00
raa-eruanna
bc0624e3b2 Fixed my error where I was using a local session variable rather than the proper user info for the weapon bob speed. 2016-09-22 08:42:59 +02:00
raa-eruanna
780d672b25 Adds user-definable weapon bob speed 2016-09-22 08:42:59 +02:00
Leonard2
b5b9baaa87 The VM now aborts when a wrong self pointer is used with user variables to avoid random crashes 2016-09-22 08:42:59 +02:00
Christoph Oelckers
5dfc396bb9 - read snapshots from zip. 2016-09-22 01:28:05 +02:00
Christoph Oelckers
f93e4813d1 - removed farchive.cpp and .h 2016-09-22 00:48:22 +02:00
Christoph Oelckers
1c9dbc3c36 - converted the basic savegame loader so that all remnant of FArchive have been removed now. 2016-09-22 00:18:31 +02:00
Christoph Oelckers
88c27e2cc0 - allow the compact and pretty writers for JSON to coexist by wrapping the whole stuff into another class that calls the proper one as needed. Due to the implementation it is not possible to decide at run time how this should behave so there have to be two different objects for either mode.
- savegame code handles new format.
2016-09-21 21:57:24 +02:00
Christoph Oelckers
ac3c00883d - implemented saving of new format savegames as zips. The code for that was adapted from zipdir.c. 2016-09-21 17:37:56 +02:00
Christoph Oelckers
810ef8f775 - save global savegame data to JSON as well.
This is incomplete and untested, just a safety commit before going on.
2016-09-21 12:19:13 +02:00
Christoph Oelckers
dbea80e943 - put savegame extension in version.h 2016-09-21 09:06:04 +02:00
Christoph Oelckers
67239cd623 - added a FileWriter class (taken from another project of mine) and changed m_png.cpp to use it.
This is so that PNGs can be written to memory, not just to an external file. stdio's FILE cannot be easily redirected but a C++ class can.
The writer is very simple and primitive right now, allowing no seeking, but for the job at hand it is sufficient.

Note that large parts of savegame creation have been disabled, because they are about to be rewritten and it makes no sense to adjust them all before.
2016-09-21 09:01:12 +02:00
Braden Obrzut
8aa09768f0 - Fixed: Memory(Array)Reader's seek range didn't include the end of file. Since GetLength exists this is inconsequential for ZDoom, but still incorrect. 2016-09-20 21:23:37 -04:00
Christoph Oelckers
075e98c967 - use FCompressedBuffer to store level snapshots. FCompressedMemFile has been removed. 2016-09-21 01:48:23 +02:00
Christoph Oelckers
da83d9e2bd - converted player serializer and everything it needs.
This means that everything belonging to the level snapshot will be generated in the JSON output.
2016-09-21 01:18:29 +02:00
Christoph Oelckers
3a1191281f - some preparations for converting the player serialization code.
- converted sound and canvas texture serialization.
- refactored file_zip, so that it can be used to load loose zip files and extract their compressed data directly.
- added handling to FSerializer to generate and consume compressed Zip file entries.

If all goes well this will allow saving savegames as Zips when the rework is done, which will make analyzing them a lot easier.
2016-09-20 23:13:12 +02:00
Christoph Oelckers
970c168b13 - re-added serialization of treanslations.
- removed more dead code.
2016-09-20 19:45:32 +02:00
Christoph Oelckers
e101014432 - converted the user variable serializer. 2016-09-20 18:27:47 +02:00
Christoph Oelckers
e41296a64d - added some separators to dobject.cpp
- added restore code for subsector automap info.
2016-09-20 13:30:31 +02:00
Christoph Oelckers
f3e8c7c241 - fixed incomplete hudmessage serialization.
- fixed a few errors in the ACS module serializer.
- reordered a few things to how they were in the old code.
- optimized serialization of the level.Scrolls array to happen within the sector. This is to allow skipping 0-entries which normally constitute the vast majority of them.
2016-09-20 13:21:41 +02:00
Christoph Oelckers
cf1e6d5275 - converted FBehavior::StaticSerializeModuleStates.
- removed some code which is no longer needed.
2016-09-20 11:35:25 +02:00
Christoph Oelckers
42e38f6cc1 - more cleanup to reduce references to FArchive. 2016-09-20 10:59:48 +02:00
Christoph Oelckers
af6404f763 - all DObjects converted.
- cleaned out some old cruft that's no longer needed.
2016-09-20 10:27:53 +02:00
Christoph Oelckers
daf43f9d35 - added polyobject serializer.
- added sanity checks to prevent a savegame from being loaded with an incompatible map
- refactored a few things to simplify serialization.
- started work on main level serializer function.
2016-09-20 09:11:13 +02:00
Christoph Oelckers
ab43e0c8cb - all thinker serializers done. 2016-09-20 00:41:22 +02:00
Christoph Oelckers
a5000ead4c - another batch. 2016-09-19 19:58:04 +02:00
Christoph Oelckers
e89d072abc - most thinkers are done. Some stuff about polyobject pointers is temporarily disabled right now because some of the required functions have already been pulled out. 2016-09-19 19:14:30 +02:00
Christoph Oelckers
340c7795f3 - clean out the dump. It's not like this branch is ever going zo be used for saving with the old code anyway. Only the stuff needed to not make it crash or fail on compilation is kept. 2016-09-19 16:10:25 +02:00
Christoph Oelckers
88eab9d1f9 - And another batch of serializers. 2016-09-19 15:07:53 +02:00
Christoph Oelckers
a542e99143 - a few more 2016-09-19 13:36:58 +02:00
Christoph Oelckers
7edf4c1afc - added new serializers to several classes and moved the old ones to the dump file. 2016-09-19 12:53:42 +02:00
Christoph Oelckers
d24aa5dec9 - reformatting for easier search. 2016-09-19 10:47:59 +02:00
Christoph Oelckers
e754fae0a8 - removed FS HUD pics. No mod in existence ever used them and a quickly thrown together test showed that the code did not even work. And since there's no reason to fix it they are gone now. 2016-09-19 10:41:21 +02:00
Christoph Oelckers
c665cc53f9 - moved new code to its proper location and started moving the replaced old archive code to a placeholder file for easy removal later. 2016-09-19 10:34:54 +02:00
Christoph Oelckers
65c6388d44 Merge branch 'master' into json 2016-09-19 03:54:36 +02:00
Christoph Oelckers
3eb1af6957 - added a GetMissileDamage function to DECORATE which can be used to properly retrieve an actor's damage value.
The damage property should be considered deprecated inside expressions from now on.
2016-09-19 03:45:22 +02:00
Christoph Oelckers
f1ba19073f - split Damage into two variables: DamageVal for the old constant and DamageFunc for the DECORATE function.
The way this was done was a major headache inducer, requiring reconstruction of the function each time the value was changed and in general made actor damage a major hassle.
There was a DECORATE wrapper to mimic the original behavior but this looked quite broken because it completely ignored the different semantics of both damage calculation types.
It also made it impossible to determine if damage was a function or a value.
This accessor has been reverted to what it should be, only returning the constant, which now is -1 for a damage function. I am sorry if this may break the odd mod out but a quick look over some DECORATE-heavy stuff showed that this was never combined in any of them so that accessing 'damage' in DECORATE code depended on an actual damage function.

To get proper damage, a future commit will add a DECORATE function which calls AActor::GetMissileDamage.
2016-09-19 03:36:51 +02:00
Christoph Oelckers
967ed48fd3 - fixing. 2016-09-19 01:48:48 +02:00
Christoph Oelckers
718614a820 - cleanup 2016-09-19 01:07:51 +02:00
Christoph Oelckers
a5628518c1 - cut down on data size by not saving trivial defaults. 2016-09-18 16:41:34 +02:00
Christoph Oelckers
9313a99e12 - started implementing a JSON based serializer. Unfortunately it is far too slow to be of any real use. 2016-09-18 13:26:34 +02:00
Christoph Oelckers
3db7d9ad84 - fixed: AActor::alternative was not declared as a pointer. 2016-09-18 12:22:56 +02:00
raa-eruanna
476b727d5d "actorlist" and "actornum" no longer return already-owned inventory objects 2016-09-16 00:47:56 -04:00
raa-eruanna
ac70f77e44 Added the following ccmds:
actorlist, actornum, monsternum, itemsnum, countitemsnum
Modified the following ccmds:
 monster, items, countitems

All commands with "num" at the end simply print a count of their respective filters, all other listed commands now print a list and a count.
2016-09-15 15:09:36 -04:00
Magnus Norddahl
0d27996a64 Replace CheckRatio with AspectTallerThanWide in DrawHUD 2016-09-15 07:52:53 +02:00
Magnus Norddahl
48f491cfd1 Fix video mode selection bug 2016-09-15 07:52:53 +02:00
Leonard2
cb17e109f1 Added "division by zero" to the VM-aborting errors 2016-09-14 20:47:00 +02:00
Leonard2
65af26f962 The VM now properly aborts on critical errors 2016-09-14 20:46:18 +02:00
Major Cooke
3b2359959e Quakes must use their own independent falloffs.This caused discrepencies and sudden drop-outs in stacked quakes otherwise. 2016-09-13 23:06:57 -05:00
Braden Obrzut
f1bca9d20e The old DirectX setup is required to utilize v140_xp.
Revert "- removed DirectX setup from CMakeLists for Visual Studio"

This reverts commit 954ac8ce5e.
2016-09-13 20:12:59 -04:00
Magnus Norddahl
017d1cee29 Change canvas rendering to use the aspect ratio of the canvas and generalize 5:4 rendering as AspectTallerThanWide 2016-09-13 23:42:05 +02:00
Magnus Norddahl
172f58c165 Fix 5:4 aspect ratio gun and status bar 2016-09-13 23:42:05 +02:00
Christoph Oelckers
ba68cfd611 - do not even allow creation of names in C_RemoveTabCommands if there are no tab commands, so that FindName cannot be called after the NameManager has been destroyed. 2016-09-13 21:01:50 +02:00
Christoph Oelckers
e10abcad06 - fixed: The TabCommands array needs to be cleared before the NameManager is destroyed.
TabCommands use an FName to store the command's name so once the NameManager is destroyed its data will become invalid.
This is a problem because C_RemoveTabCommand is being called from FBaseCVar's destructor and most CVARs are global variables.
2016-09-13 10:43:53 +02:00
Christoph Oelckers
823f75e592 - fixed: UDMF user value lists need to be sorted for binary search to work but weren't. 2016-09-12 21:32:17 +02:00
alexey.lysiuk
b308a7df52 Proper name of FMOD .dylib in loading path adjustment for macOS 2016-09-12 20:37:13 +02:00
alexey.lysiuk
9c91686e0f Set delay loading for proper .dll depending on FMOD version (Studio vs. Ex) 2016-09-12 20:37:13 +02:00
alexey.lysiuk
7e61a1ce2b Added simple detection for FMOD Studio API in CMake 2016-09-12 20:37:12 +02:00
alexey.lysiuk
c88eec3d73 Fixed 'unreferenced local variable' warnings when building with FMOD Studio API 2016-09-12 20:37:12 +02:00
alexey.lysiuk
764705a8e0 Fixed 'Could not set resampler method. Defaults will be used. (Error 31)' message with FMOD Studio API 2016-09-12 20:37:11 +02:00
alexey.lysiuk
a2a1d2a36d Fixed significant distortion of sound effects with FMOD Studio API 2016-09-12 20:37:11 +02:00
Magnus Norddahl
01b1efe9ee Switch from abs to fabs 2016-09-12 18:44:04 +02:00
Magnus Norddahl
4e58e6626c Fix buffer overrun in CommandAspectRatio for 21:9 aspect ratio 2016-09-12 16:05:42 +02:00
Magnus Norddahl
5b438d220f Switch from ratio enum to float 2016-09-12 15:51:50 +02:00
Magnus Norddahl
6d4e4dad25 BaseRatioSizes replacement functions 2016-09-12 14:37:10 +02:00
Magnus Norddahl
5720634045 Add ActiveRatio to be used where CheckRatio is used today 2016-09-12 13:59:01 +02:00
Magnus Norddahl
b003c47e3e Improve CheckRatio to always return the closest ratio 2016-09-12 13:37:05 +02:00
Magnus Norddahl
d3d8180f57 Resize framebuffer in windowed mode to match the client area 2016-09-12 13:04:36 +02:00
raa-eruanna
02e4ba464a Fixed mirror angle issue, fixes rendering of mirrors 2016-09-10 08:56:40 +02:00
Magnus Norddahl
303da0e071 Fix center text alignment issue 2016-09-09 20:09:54 +02:00
Magnus Norddahl
e794e59cd2 Add con_scale for scaling just the console 2016-09-08 00:39:52 +02:00
Magnus Norddahl
d2f8fc63fc Scale the console itself as specified by con_scaletext 2016-09-08 00:39:51 +02:00
Magnus Norddahl
6414e01354 Add uiscale slider controlling what scale the On setting uses for hud_scale, hud_althudscale and con_scaletext 2016-09-08 00:39:51 +02:00
Major Cooke
01e9d351b4 - Don't pass flags directly from A_Explode to P_RadiusAttack. XF_EXPLICITDAMAGETYPE would cause explosions to deal no damage otherwise. 2016-09-08 00:38:12 +02:00
Major Cooke
043ada24da Wave quakes now stack. 2016-09-08 00:38:12 +02:00
Major Cooke
ce13b5c6e1 Enhanced FastProjectile trails.
- Trails now copy pitch, and set the projectile as the target.
- Added GETOWNER flag. Using it sets the owner of the fast projectile as the target instead, if it has an owner.
2016-09-08 00:38:11 +02:00
yqco
2e8aa53e6a Add SetActorFlag ACS function
int SetActorFlag(int tid, str flagname, bool value);

- Mimics DECORATE's A_ChangeFlag
- Returns number of actors affected (number of things with the flag)
- Affects activator if TID is 0

# Conflicts:
#	src/p_acs.cpp
2016-09-07 20:44:56 +02:00
Christoph Oelckers
f536523fbd - It's Height, not height... 2016-09-06 22:36:53 +02:00
Christoph Oelckers
5a3147407e - fixed floatification error in A_MaulerTorpedoWave. 2016-09-06 22:34:59 +02:00
Christoph Oelckers
3ce25bc348 - fixed: FxPreIncrDecr depended on undefined compiler behavior.
It could only work with right to left function argument processing, but with left to right it failed because the ParseExpressionA call altered sc.TokenType.
Note that with register-based arguments on 64 bit platforms this is a very critical issue!
2016-09-06 08:41:13 +02:00
Christoph Oelckers
954ac8ce5e - removed DirectX setup from CMakeLists for Visual Studio
For VS 2015 this is no longer needed, the DX headers and libraries are part of the Windows SDK and do not need to be looked for explicitly.
2016-09-04 10:28:29 +02:00
Christoph Oelckers
eff03d13f0 - fixed last commit. 2016-09-04 10:28:29 +02:00
alexey.lysiuk
677efb73bc Fixed compilation with GCC/Clang
No longer aborts with error: cannot pass object of non-trivial type 'FString' through variadic method; call will abort at runtime
2016-09-04 10:05:07 +03:00
Christoph Oelckers
77ac3bb265 - fixed angle range checks in A_CheckIfTargetInLOS.
The fixed point version had a mostly useless check that excluded ANGLE_MAX, this got incorrectly converted to floating point.
Note that this version will clamp the angle to 360°, not merely overflow like it did with the fixed point code
2016-09-04 08:33:19 +02:00
Blue-Shadow
2ed4208a1b Added IfCVarInt SBARINFO command 2016-09-03 18:55:19 +03:00
Christoph Oelckers
f31346968f - added missing #include. 2016-09-03 17:29:28 +02:00
Christoph Oelckers
5770e5dfaf - split up m_specialpaths.cpp to be a separate file for each operating system.
The reason for this is that the macOS version uses a deprecated API and in order to correct this, the file needs to be compiled as Objective-C++ which requires a different extension.
2016-09-03 12:00:08 +02:00
arookas
d7b5bdc0f7 Renamed Thing_Damage3 to DamageActor 2016-09-03 08:27:38 +02:00
arookas
d14782fb37 Added Thing_Damage3 function
It acts as a simple wrapper around P_DamageMobj which can damage a
single actor, but can also set the actor inflicting the damage. It
returns the amount of damage actually done, or -1 if the damaging was
cancelled.
2016-09-03 08:27:38 +02:00
Major Cooke
c4357bd352 Tracer pointer is no longer a safe candidate for storing player morph pointers. Instead, actors must have a new, non-manipulatable pointer. This fixes the following circumstances:
- Crashes occurred if a particular actor was a tracer to the player and the actor was not gone by the time the player unmorphs.
- Failed unmorphs occur if tracer was manipulated through means like A_RearrangePointers, etc.
2016-09-01 13:49:58 -05:00
Christoph Oelckers
4993018520 - fixed: Actor velocity requires an upper limit to prevent uncontrolled accumulation, as can happen when multiple exploding and pushable objects overlap. The value 5000 was chosen because it is high enough to not occur under regular circumstances and small enough to prevent severe slowdowns. In the old fixed point code the lack of such a check just caused random overflows. 2016-08-31 09:18:59 +02:00
Christoph Oelckers
3299a29c44 - added CheckClass ACS function. 2016-08-28 16:14:24 +02:00
Christoph Oelckers
e04055dbb2 - added multiple message levels for 'developer' CVAR so that the important stuff won't get drowned in pointless notification spam that's of no use to anyone.
- made 'developer' CVAR persist across launches and added some menu entries for it.
- added checks for 'developer' to ACS's CheckInventory function.
2016-08-28 09:55:04 +02:00
Braden Obrzut
716fbec8ee - Added support for building with FMOD Studio Low Level API (partially based off of Emile Belanger's/Beloko Games Android work)
- Use with FMOD Studio 1.06.x. 1.07 and 1.08 compile but for some reason produce a lot of noise on vanilla Doom sounds.
	- Crashes when used with fluidsynth provided by Ubuntu 16.04, but a self compiled version of the library works just fine.
	- Reverbs are mostly untested, but implemented.
	- Debug waveform drawing is not implemented as it requires a non-trivial amount of work.
	- It will still show as FMOD Ex in the menus since I'm too lazy at the moment to make it a "separate" backend.
2016-08-27 22:14:57 -04:00
Christoph Oelckers
5303526c70 - actually use the parameter... 2016-08-26 08:34:27 +02:00
Christoph Oelckers
465792df0a - make sure that after travelling has finished, no travelling thinkers are left in the list.
Since this list is excluded from regular thinker cleaning, anything that may survive through the end of G_FinishTravel will endlessly multiply and severely break the following savegames or just simply crash on broken pointers.
2016-08-26 02:16:06 +02:00
Christoph Oelckers
9ca6764556 Revert "- removed STAT_INVENTORY."
This reverts commit 5ff0abe568.

- use STAT_INVENTORY only for held items.

Seems this was causing some strange issues with hubs, but for items placed in the world it still cannot be allowed to have them in a different statnum.
2016-08-25 21:41:17 +02:00
Christoph Oelckers
48430d9b1a - don't assume that deserializing an actor will result in a valid pointer.
This addresses a very strange crash I encounteded while travelling in a hub, and ended up with a NULL pointer after the 'Serialize' call which means that some code cleared the variable that is currently being deserialized. I was completely unable to find out what caused this because there is so much recursion going on in the deserializer. All actions on the deserialized actor are now being done with a local copy of that variable so that altering the actual one won't have any adverse effects.
2016-08-25 21:15:53 +02:00
Major Cooke
e22043a25b Fixed: A_FaceMovementDirection would not adjust the angle if it was actually under the limit. 2016-08-22 09:46:00 +02:00
yqco
df4a8e38c5 Add CheckActorState ACS function
bool CheckActorState(int tid, str statename, bool exact = false);

- Same parameter order as SetActorState
- Returns true if actor has the state; else returns false
2016-08-22 01:21:38 -06:00
Christoph Oelckers
5ff0abe568 - removed STAT_INVENTORY.
This was causing issues with sprite sorting. For this to work as intended, all actors in the world that display sprites need to remain in spawn order, including inventory items.
The only thing this statnum was used for were some bot related search actions which are simply not worth breaking actual maps for some very minor performance gain.
2016-08-20 19:10:14 +02:00
Christoph Oelckers
314e89b84f - fixed what looks like a copy/paste error in A_Explode. 2016-08-16 10:53:30 +02:00
Leonard2
e93b64f249 Fixed: a register from a return statement's value would not be freed 2016-08-16 08:59:27 +02:00
Major Cooke
aa2ca77412 Added damagetype parameter and XF_NOACTORTYPE to A_Explode.
- By default, A_Explode will refer to the actor's damagetype if using none. The flag forces the function's type if used regardless of type.
2016-08-16 08:59:27 +02:00
Christoph Oelckers
c02960e2cf - added error message highlighting for one overlooked DECORATE error. 2016-08-16 08:58:29 +02:00
Christoph Oelckers
df0f06a5ce - fixed: FraggleScript's SetCamera function must call SetOrigin to set the camera's z. This needs updating of floorz and ceilingz, in case the camera is moved past a 3D floor. 2016-08-14 23:33:31 +02:00
Christoph Oelckers
6deb185b46 - fixed another typo in scroller code.
Now Scroll_Texture_Model is working properly again. (Note: Whoever designed this function must have been on drugs - its use of the source data in Boom is completely insane.)
2016-08-14 22:10:44 +02:00
Christoph Oelckers
47d2fd403c - fixed typos in scroll code. 2016-08-14 21:55:20 +02:00
Christoph Oelckers
a0d66be6e9 - fixed: Terrain splashes could be generated for 3D floors that were below the sector's actual floor. 2016-08-14 20:52:13 +02:00
Major Cooke
9dd458030e This isn't needed. It's already checked at this point. 2016-08-12 09:17:21 +02:00
Major Cooke
7ffccd0009 Fixed: RGF_KILLED was not part of the mask.
- Greatly optimized DoRadiusGive by putting actor flag checking first ahead of pointer, classname and species checking.
2016-08-12 09:17:20 +02:00
Major Cooke
ec14dd94a7 A_Explode now returns the number of actors damaged and can be used in expressions.
- Enemies that do not take damage in any way are not counted.
2016-08-12 09:17:20 +02:00
yqco
ee7d933ed6 Add assert for previous I_Error condition 2016-08-11 04:47:17 -06:00
yqco
054f5c963e Use verbose error message with DECORATE array indices 2016-08-11 04:22:37 -06:00
Christoph Oelckers
b4e712ab01 - made disabling the push window check a real compatibility option.
No idea why this was a hidden one, this one definitely needs to be in the menu.

- set some required compatibility options for Super Sonic Doom.
2016-08-09 20:15:13 +02:00
Christoph Oelckers
7104b01193 - added Hexen compatible handling to specials that stop perpetual sector movement.
This uses the same logic as Eternity.
2016-08-09 17:09:12 +02:00
Christoph Oelckers
6b27d0c3ba - fixed: FPolyObj::RecalcActorFloorCeil altered the floorz of all actors in the same blockmap block as the polyobject, even when they were nowhere near its bounding box.
This fix is still incomplete, it should really discard everything outside the polyobject, not outside its bounding box, but at least it eliminates the most severe occurences of dislocated items.
2016-08-09 15:11:11 +02:00
yqco
b2a6512981 Fix partial initialization in ACS PickActor function 2016-08-09 02:11:13 -06:00
Christoph Oelckers
19b65195ea - added an internal compatibility option to disable setting the line ID for the Plane_Align special.
There have been reports for some Skulltag maps a few years back and I just ran across an old beta version of a map that got completely broken by this.
2016-08-09 10:07:06 +02:00
Christoph Oelckers
d62d345a7b - fixed: The cosine of 0° is 1, not 0, as the portal code assumed for linked portals. 2016-08-08 13:06:29 +02:00
Leonard2
b97024b710 The return statement now accepts any expression as its return value
So something like 'return ++user_x;' is now possible
Admittedly this needed quite a bit of refactoring mainly due to the fact that return types now have to be checked after resolving the function rather than before
2016-08-07 22:10:02 +02:00
Leonard2
e79c0225ed Added all compound assignment operators to DECORATE 2016-08-07 22:10:02 +02:00
Leonard2
90cc79a902 Added the direct assignment operator to DECORATE 2016-08-07 22:10:01 +02:00
Leonard2
8437313e7c Added post/pre increment/decrement operators to DECORATE 2016-08-07 22:10:01 +02:00
Leonard2
2ef51d0d50 Re-allow casts in sequences 2016-08-07 22:10:00 +02:00
Leonard2
db9f4c1385 Re-allow indexes as state parameter in sequences 2016-08-07 22:10:00 +02:00
Leonard2
a4142ad9fb Re-allow action function calls with no argument list in sequences 2016-08-07 22:09:59 +02:00
Leonard2
078881a941 Parse statements as expressions in sequences
This will be needed for assignment operators to work
2016-08-07 22:09:59 +02:00
Christoph Oelckers
ab837b608d - compatibility optioned triggering sector actions by indirectly initiated teleports
There's several old maps depending on this not happening.

- Set the option for Hell's Twisted Influence Part 1.
2016-08-07 22:04:16 +02:00
Edoardo Prezioso
5a66fdf9be - Hide Clang -Winconsistent-missing-override warnings in non-Apple targets, too. 2016-08-07 20:55:16 +02:00
alexey.lysiuk
5b079dd40b Fixed wrong height of player coordinates text 2016-08-07 11:32:55 +02:00
Christoph Oelckers
fd7b833ad5 - added some helper code mainly designed to help GZDoom maintain the vertex buffer for the textured automap. 2016-08-06 19:20:41 +02:00
Magnus Norddahl
a893013dbb Adds HUD quadruple scale and a scale slider for the crosshair 2016-08-05 12:20:34 +02:00
Leonard2
01fb2eaecc Fixed a typo in FxBoolCast::Emit 2016-08-05 12:16:13 +02:00
Leonard2
73d0ed78fe Fixed: the game could crash while resolving expressions in some places 2016-08-05 12:16:13 +02:00
Leonard2
4a859393fe Fixed: the game could crash while parsing expressions in some places 2016-08-05 12:16:12 +02:00
Christoph Oelckers
9229146eeb - fixed: DFloor set the 'gap' for one wrong movement type. 2016-08-05 12:13:47 +02:00
Christoph Oelckers
1d434add50 - fixed: monsters which were made friendly by the MBF map flag lost their friendliness when being revived with Thing_Raise. 2016-08-04 17:14:31 +02:00
Christoph Oelckers
c1a4dd74c4 - added handling for Eternity's 'gap' parameter to:
Ceiling_LowerToFloor
Ceiling_LowerToHighestFloor
Ceiling_ToFloorInstant
Floor_RaiseToCeiling
Floor_RaiseToLowestCeiling
Floor_ToCeilingInstant
2016-08-03 12:59:40 +02:00
Christoph Oelckers
95c3464973 - properly handle 3D floors with inverted planes in the list sorter. 2016-08-03 12:17:22 +02:00
Leonard2
c0d3eb997a Fixed: the instant weapon switch flag didn't work anymore 2016-07-30 23:50:14 +02:00
alexey.lysiuk
bd3fd22ac9 Do not use unicode characters in macOS console window
The same characters as in stdout are now used to draw bars in console window on macOS
All messages are treated as in ISO Latin 1 encoding and bars looked like garbage output
2016-07-30 16:21:48 +03:00
alexey.lysiuk
cbe0a34f0b Fixed usages of abs() function with double arguments
Clang no longer issues "warning: using integer absolute value function 'abs' when argument is of floating point type"
2016-07-30 14:03:57 +02:00
Christoph Oelckers
5ddee98e70 - fixed: Voxels with scaled to 0 caused a division by zero crash. 2016-07-30 13:19:02 +02:00
alexey.lysiuk
0648ef693f Fixed compilation with Clang and GCC
No more "error: cannot pass object of non-trivial type 'FString' through variadic method; call will abort at runtime"
2016-07-30 13:04:16 +02:00
Xaser Acheron
a1a0da1f13 added SWF_SELECTPRIORITY flag to A_SelectWeapon 2016-07-29 18:48:54 -05:00
Major Cooke
13fa06fe7a Renamed GetProximity to CountProximity.
# Conflicts:
#	wadsrc/static/actors/actor.txt
2016-07-30 00:27:12 +02:00
Major Cooke
167cb28563 Added GetProximity(classname, distance, flags, ptr).
- Behaves similarly to A_CheckProximity but returns the count of classname instead of true/false.

# Conflicts:
#	wadsrc/static/actors/actor.txt
2016-07-30 00:26:55 +02:00
Leonard2
d0b953cbb7 Added for loops to DECORATE 2016-07-30 00:26:42 +02:00
Leonard2
e2fa8c2257 Added do-while loops to DECORATE 2016-07-30 00:26:41 +02:00
Leonard2
d1749233ec Added while loops to DECORATE 2016-07-30 00:26:41 +02:00
Leonard2
c4eafc1c38 DECORATE can now handle jump statements
break and continue were added but are not yet useable anywhere
This was made general enough so that loops and switch statements that accept breaks/continues can be done without much difficulty as well as goto statements with explicit labels if those are ever wanted
2016-07-30 00:26:41 +02:00
Major Cooke
dfed6ac1fb Added SpriteAngle and SpriteRotation properties.
- Includes four functions, A_SetSprite(Angle/Rotation) and GetSprite(Angle/Rotation).
- SpriteRotation offsets the angle of the sprite, allowing for actors to move backwards or sideways for example.
- SpriteAngle requires +SPRITEANGLE and sets the actor's sprite to the absolute rotation found at that angle. Overrides SpriteRotation once the flag is on.
2016-07-30 00:26:40 +02:00
Major Cooke
6ada8aa644 Fixed A_CopySpriteFrame not working under certain circumstances. 2016-07-28 15:55:49 -05:00
Leonard2
5907ff662d Added a new state that the weapon jumps to when it is lowered all the way and the player is currently dead
The state is undefined by default to preserve the original behavior of having the weapon layer deleted which modders can now avoid by defining it properly
2016-07-28 17:42:22 +02:00
Christoph Oelckers
759753eadc - replaced more copystrings with FString. 2016-07-28 09:06:49 +02:00
Christoph Oelckers
66006a5c14 - use an FString to handle the new message. 2016-07-28 08:54:51 +02:00
yqco
58a6d7df1f Added optional prompt argument to MENUDEF's SafeCommand 2016-07-28 08:41:55 +02:00
MajorCooke
3d9591229e Added A_CopySpriteFrame(from, to, flags)..
- Copies a sprite/frame from one actor pointer to another. Sprite and/or frame copying can be disabled with flags CPSF_NO<SPRITE/FRAME>.
2016-07-28 08:39:32 +02:00
Jordon Moss
c0eb8f3b96 Added KILL Script type and associated flags and GameInfo keyword.
This is different from the original "Death Scripts" idea. This tackles
some issues I've found with the original idea (now you can have as many
scripts as you want, not just global and actor-defined). Also takes care
of other complaints about the original idea and push request. Flags and
their use are in code comments.
2016-07-28 08:34:23 +02:00
MajorCooke
1322ef2449 Renamed NODEATHJUMP to NODEATHDESELECT. 2016-07-28 08:29:47 +02:00
Leonard2
797f3aec0a Added a weapon flag to ignore a player's input when dead
The reason this is not set by default is because before that anyone could call A_WeaponReady within their Deselect state which would have allowed players to fire even when dead
2016-07-28 08:29:46 +02:00
Leonard2
bcb18cf7d8 Added a flag to prevent the weapon from jumping to its Deselect state when the player dies 2016-07-28 08:29:46 +02:00
alexey.lysiuk
f38f7adf17 Automatic layout for ammo images in alternative HUD
When ammo icon is displayed before text its position depends on number of digits in current and maximum amounts
2016-07-28 08:19:31 +02:00
Christoph Oelckers
f67243a40f - fixed: The NO_CHANGE constant shouldn't have been floatified because this is an input value for action specials which will remain integers. 2016-07-27 08:23:00 +02:00
alexey.lysiuk
4345623e28 Fixed incorrect scaling of particles
http://forum.zdoom.org/viewtopic.php?t=52906
2016-07-24 14:25:31 +03:00
MajorCooke
41414830a5 - Fixed: A_Warp never properly positioned actors on floors, if they wound up in or on one 2016-07-24 01:02:21 +02:00
Blue-Shadow
121db8fd37 Fixed: The player failed to unmorph upon resurrection
This happened if the morphing was triggered by a PowerMorph power-up.
2016-07-24 00:59:35 +02:00
Blue-Shadow
69a00ddabb Added TRANSFERTRANSLATION morph flag 2016-07-24 00:56:57 +02:00
alexey.lysiuk
a1a0bdefff Added support for older versions of DeHackEd patches
Patches from DeHackEd 2.3 and 2.4 are now loaded without warnings/errors
2016-07-23 11:09:52 +03:00
yqco
4d6532d303 Added RGF_NORANDOMPUFFZ flag for A_CustomRailgun and A_RailAttack 2016-07-22 02:46:41 -06:00
Christoph Oelckers
fa22acca5d - fixed: Dehacked's 'Speed' value should be treated as signed when being assigned to a double variable. 2016-07-21 12:01:06 +02:00
Blue-Shadow
c428e376cd Added INFLICTORDMGTYPE flag to A_Damage* action functions
It forces the use of the inflictor's damagetype instead of whatever is
passed to the functions.
2016-07-19 08:34:55 +02:00
Blue-Shadow
d09ec5a930 Added DamageType ACS actor property 2016-07-19 03:16:12 +03:00
Christoph Oelckers
d4352dd1a7 - fixed slope calculation error. 2016-07-17 23:13:10 +02:00
alexey.lysiuk
8369833dc5 Fixed setting of custom color for static text in menu 2016-07-17 17:28:46 +02:00
Leonard2
446bc1018c Fixed: weapons didn't clear their flash layer when the player died 2016-07-17 17:28:45 +02:00
Leonard2
e482a54389 Fixed a crash with A_ClearOverlays 2016-07-17 14:27:56 +02:00
alexey.lysiuk
39042dc4bf macOS application controller is now using proper delegate protocol
Fixes compilation error with Xcode 8:
cannot initialize a parameter of type 'id<NSApplicationDelegate> _Nullable' with an lvalue of type 'ApplicationController *'
2016-07-17 08:02:55 +02:00
Christoph Oelckers
c150116f79 - fixed: When changing weapons due to starting or ending a Tome of Power effect, the PSprite's caller needs to be changed.
In this case the PSprite animation won't be changed, only the ReadyWeapon. But in order to work, the PSprite's caller needs to change as well so that the next weapon check does not fail.
2016-07-16 19:55:00 +02:00
MajorCooke
7544adfc91 Combined the target/master/tracer checking into AimBulletMissile. 2016-07-16 17:43:00 +02:00
MajorCooke
376c9b0306 - Optimized handling of puffs in the event they're null.
- Only spawn the puff as needed again if the projectile actually spawns.
2016-07-16 17:41:28 +02:00
MajorCooke
02064437c5 Fixed wrong angle/slopes being used and one too many &s for NOINTERACT. 2016-07-16 17:34:17 +02:00
MajorCooke
10fabc3ab7 Cleaned up code. Puffs no longer need ALWAYSPUFF.
- A_CustomBulletAttack and A_FireBullets will perform a second P_LineAttack to get a puff which only returns to the previous function after a tracer.
2016-07-16 17:34:17 +02:00
MajorCooke
4750dfd8b6 Added ability to set the puffs directly as the spawned projectile's target, master, and/or tracer. 2016-07-16 17:34:16 +02:00
MajorCooke
cc8e7f8de6 Cleaning finished. 2016-07-16 17:34:16 +02:00
MajorCooke
791852a6bd Cleaned up. 2016-07-16 17:34:15 +02:00
MajorCooke
3c7e1e0528 - Added the tracer actor spawning for A_FireBullets and A_CustomBulletAttack.
The projectiles spawning conditions rely upon the puff successfully spawning.

# Conflicts:
#	wadsrc/static/actors/actor.txt
2016-07-16 17:34:15 +02:00
alexey.lysiuk
ee72760f3a libc++ is now used by the linker too (when applicable) 2016-07-16 17:04:38 +02:00
alexey.lysiuk
58fb993402 Added ability to select ammo image and text display order in alternative HUD
Controlled via hud_ammo_order CVAR:
* 0 (default): image and text
* any other value: text and image
2016-07-16 16:15:59 +02:00
alexey.lysiuk
74fc45d7b7 Fixed instant boss brain spawning
There was a possibility of division by zero which led to nonsensical spawn time
http://forum.zdoom.org/viewtopic.php?t=52760
2016-07-16 15:39:57 +03:00
MajorCooke
b121284fc0 Added GAF_SWITCH to GetAngle, inverting the function to get the caller's angle on the pointer instead. 2016-07-14 17:14:17 +02:00
MajorCooke
09175a6a7a This wasn't supposed to be committed... 2016-07-14 09:55:13 -05:00
MajorCooke
59593e57c6 - Fixed: RGF_ITEMS wasn't considered a part of the RGF_MASK flag. 2016-07-14 09:27:29 -05:00
Leonard2
5c182c7fd7 Fixed a crash with heretic's ChickenPlayer class 2016-07-13 13:01:32 +02:00
Leonard2
05d1df3571 Fixed crashes with the A_CrispyPlayer and A_HandLower action functions
Simply using FindPSprite in those functions wouldn't be enough because if a mod is using the firehands layer when they are called this would go very wrong
2016-07-13 13:01:32 +02:00
Leonard2
3ea70980f9 Fixed: the strife firehands were interpolated if a mod used the layer before them
The flags were also already reset, no need to do it twice
2016-07-13 13:01:32 +02:00
Leonard2
b8e1bead0a Removed unneeded checks
GetPSprite cannot return a null pointer and calling setstate with a null pointer destroys it
2016-07-13 13:01:32 +02:00
Leonard2
da6e12d5bc Fixed: the weapon layer offsets were interpolated even after the player switched his weapon 2016-07-13 13:01:32 +02:00
Leonard2
75cb8c00a6 Fixed: the flags weren't properly reset if a mod used the old layers before the code used them 2016-07-13 13:01:32 +02:00
MajorCooke
7ded355d5d Added rollcenter compatibility. 2016-07-13 09:29:36 +02:00
Christoph Oelckers
79264cb8cd - fixed missing QuakeEx parameter conversion. 2016-07-12 19:57:32 +02:00
Leonard2
bdeb233849 Fixed: conditionals didn't properly compile to vm code 2016-07-12 19:50:37 +02:00
Leonard2
bbdc64a955 Fixed bad serialization of float types
The value was written twice if it couldn't be reduced to a single precision value
2016-07-12 19:37:00 +02:00
Leonard2
af53f5a825 Properly use the boolean type in function declarations
This will get rid of useless casts like 'if (isPointerEqual(x))'
It will also allow for proper casting in parameters like using a state as a boolean which is allowed in if statements for example
2016-07-12 19:36:59 +02:00
Leonard2
371896b2cc Properly use the boolean type in expressions
This fixes things like 'if (GetCVar(x))' not working
2016-07-12 19:36:59 +02:00
subenji
7d1dc46665 Implemented fix discussed in http://forum.zdoom.org/viewtopic.php?f=2&t=52428 rearding UserVar corruption in savegames 2016-07-12 19:36:59 +02:00
Blue-Shadow
1f2c8181bb Added IfWaterLevel SBARINFO command 2016-07-12 19:36:58 +02:00
Braden Obrzut
e401588f40 - Set -stdlib=libc++ and disable inconsistent-missing-override warning with OS X Clang (the latter may be useful for recent versions of Clang in general, but I can't tell at the moment.) 2016-07-11 01:22:37 -04:00
Christoph Oelckers
b2a88c1abd - fixed: mapthinghexen_t::flags needs to be unsigned.
This is necessary so that an incorrectly set 0x8000 bit won't enable all high flags.
2016-07-05 01:17:12 +02:00
Christoph Oelckers
b81876698f - changed P_ChangeSector so that for bridges it only keeps the floorz and ceilingz of the spawn position.
This is necessary to prevent moving sectors from altering the bridge's z-position. The bridge should remain at its current z, even if the sector change would cause floorz or ceilingz to be changed in a way that would make P_ZMovement adjust the bridge.
2016-07-04 22:36:27 +02:00
Christoph Oelckers
0b93e9b897 Merge branch 'roll' of https://github.com/MajorCooke/zdoom 2016-07-04 00:43:16 +02:00
Christoph Oelckers
d87665bfe0 - fixed: A_CheckTerrain must add to the actor's current velocity, not set it. 2016-07-04 00:39:35 +02:00
Christoph Oelckers
d6d9057f1f - removed the old way to stop the AnimatedDoor interpolation, now that the parent class can be told that we do not want one. This old code was no longer functionsl. 2016-07-03 13:42:54 +02:00
Christoph Oelckers
1b6a850bf6 - fixed: DAnimatedDoor's main constructor did not disable ceiling interpolation. 2016-07-03 13:39:33 +02:00
Christoph Oelckers
7bdb98cc0b - removed debug stuff. 2016-06-30 11:31:00 +02:00
Christoph Oelckers
fc3682006a - fixed PointOnSide functions to consider 'on the line' as 'in front of'.
The bad code was taken from the 2005 floating point rewrite that, by comparing the value with '> -EQUAL_EPSILON', returned 1 for any value close to 0 (as 'on the line') so it was mistakenly reported as 'behind the line'.
2016-06-30 11:30:32 +02:00
Christoph Oelckers
c6fb35ed52 - added per-item colors for static text items in the menu.
For option menus this replaces the 'highlighted' parameter with an actual color, for list menus it adds a new parameter.
2016-06-30 10:27:14 +02:00
Edoardo Prezioso
4defb6e967 - Fix myoffsetof using misaligned pointer access.
That could be a problem for particularly pedantic platforms.
2016-06-29 13:04:31 +02:00
MajorCooke
41d20fa6cf Fixed freeze with A_ClearOverlays. 2016-06-29 12:46:50 +02:00
Christoph Oelckers
6cf96372ba - fixed: incorrect flag masking for polyobjects disabled all line portals. 2016-06-29 12:46:20 +02:00
Christoph Oelckers
f8ae166281 - fixed return value inversion of FS's ceilingheight and floorheight functions. 2016-06-29 12:46:20 +02:00
Christoph Oelckers
a3450ab824 - removed unused cruft in FS code. 2016-06-29 12:46:19 +02:00
Christoph Oelckers
c6d8125b45 - fixed FraggleScript's resurrect function to call AActor::Revive to ensure that everything gets reset. 2016-06-29 12:46:19 +02:00
Christoph Oelckers
4899c405c3 - fixed: all non-ZDoom compatibility profiles need compat_maskedmidtex set.
This was neither fixed in Boom nor MBF.
2016-06-21 10:45:17 +02:00
MajorCooke
613fa4c9e4 Fixed: GetDistance was missing the original Z check disabling introduced in commit bd16ccb. 2016-06-21 10:14:25 +02:00
MajorCooke
9df65f73fc Localized the input checker into P_Thing_CheckInputNum now called by both ACS and DECORATE.. 2016-06-20 09:41:46 -05:00
MajorCooke
26408a5043 Switched the pointer to AAPTR_DEFAULT. 2016-06-20 09:11:38 -05:00
MajorCooke
85a34bbb88 Added GetPlayerInput(int numinput, int ptr = AAPTR_PLAYER1).
- Works exactly like the ACS version, but with pointers instead. The pointer can be anything, so long as it can be identified as a player.
2016-06-20 08:49:57 -05:00
Edoardo Prezioso
6384e81d0f - Add support for Skulltag ACS IsNetworkGame.
Once known as PlayerOnTeam, then it became IsMultiplayer, but Skulltag code ignored emulated multiplayer, hence the new and clearer name.
2016-06-20 09:34:41 +02:00
MajorCooke
e02ed3a6f7 Take in the targeter layers if someone disables the safety and uses 0 for start and stop. 2016-06-20 01:15:51 +02:00
MajorCooke
ecfa7415b3 This small change was left out by mistake. 2016-06-20 01:15:51 +02:00
MajorCooke
30880aab79 And a bit more optimization... 2016-06-20 01:15:50 +02:00
MajorCooke
2b91db7b3a Refactored A_ClearOverlays. 2016-06-20 01:15:50 +02:00
MajorCooke
dd410876cf Added A_ClearOverlays(int start, int stop, bool safety).
- Clears a set of overlays in ranges [start,stop]. If unspecified, wipes all non-hardcoded layers. Safety determines whether to affect core layers or not (i.e. weapon). Returns the number of layers cleared.

Added no override boolean to A_Overlay and a boolean return type.

- If true, and a layer already has an active layer, the function returns false. Otherwise, sets the layer and returns true.
2016-06-20 01:15:49 +02:00
Edoardo Prezioso
2f6c98ead3 - Added support for old Skulltag ACS PlayerTeam. 2016-06-19 22:57:42 +02:00
Edoardo Prezioso
de55d693f9 - Fixed ACS Singleplayer for non-net multiplayer. 2016-06-19 12:59:46 +02:00
Christoph Oelckers
8cf150e68a - set up portal rotations in the finalizing step, not during initialization.
Anything earlier may miss some information required to do this correctly.
2016-06-19 12:40:38 +02:00
Christoph Oelckers
da05dfa72e fixed: Polyobject-based line portals may not cache their angle as it may change at any time. 2016-06-19 12:32:45 +02:00
Edoardo Prezioso
4e148f00e6 - Fixed wrong Skulltag ConsoleCommand pcode name.
Also report this pcode as not supported by the program.
2016-06-19 12:01:29 +02:00
Christoph Oelckers
cebd877191 - fixed the center point calculation for triangular sectors.
The old method does not work as expected with the higher precision of doubles, so instead just average the 3 vertex positions to get the triangle's center.
2016-06-19 11:48:20 +02:00
Edoardo Prezioso
56508a2d82 - Avoid issues with misused Strife actions. 2016-06-17 23:09:34 +02:00
Leonard2
24c73071f4 Fixed a crash with A_JumpIfNoAmmo
Non-weapon layers can pass the caller check even when there is no ReadyWeapon
2016-06-17 18:36:57 +02:00
Leonard2
68c483c041 Renamed the weapon action function caller check to ACTION_CALL_FROM_PSPRITE to avoid confusion
This was always checking for every psprites rather than just weapon layers
2016-06-17 18:36:57 +02:00