Commit graph

133 commits

Author SHA1 Message Date
Christoph Oelckers
6d28aa3541 - do not use strtol for parsing critical values that can get large.
This function will truncate everything that is larger than LONG_MAX or smaller than LONG_MIN to fit into a long variable, but longs are 32 bit on Windows and 64 bit elsewhere, so to ensure consistency and the ability to parse larger values better use strtoll which does not truncate 32 bit values.
2017-02-01 11:19:55 +01:00
Christoph Oelckers
e96f231420 - added Doom64 colors for sprites. 2017-01-28 21:02:03 +01:00
Christoph Oelckers
ee22a9371b - use Doom64 colors on sectors and linedefs. 2017-01-28 20:44:46 +01:00
Christoph Oelckers
dbbd797baa - added the needed properties for Doom64 colors and a little FraggleScript hack to test it with existing maps. 2017-01-28 19:05:39 +01:00
Christoph Oelckers
7c6542e595 - partial scriptification of AInventory.
- scriptification of CustomInventory.
2017-01-19 19:14:22 +01:00
Christoph Oelckers
d9fd2d509f - scriptified the remains of AAmmo. 2017-01-18 14:18:17 +01:00
Christoph Oelckers
4759f9a399 - scriptified the backpack.
- added GetParentClass builtin to compiler.
2017-01-14 23:34:47 +01:00
Christoph Oelckers
a597979738 - scriptified ammo.
- moved inventory stuff into its own directory.
2017-01-14 21:27:31 +01:00
Christoph Oelckers
7b7623d2c4 - split DObject::Destroy into the main method, a native OnDestroy and a scripted OnDestroy method and made the main method non-virtual
This was done to ensure it can be properly overridden in scripts without causing problems when called during engine shutdown for the type and symbol objects the VM needs to work and to have the scripted version always run first.
Since the scripted OnDestroy method never calls the native version - the native one is run after the scripted one - this can be simply skipped over during shutdown.
2017-01-12 22:49:18 +01:00
Christoph Oelckers
23482735a0 - removed PClassAmmo.
No need to maintain these clunky meta class for one single property. The overhead the mere existence of this class creates is far more than 100 spawned ammo items would cost.
There is no need to serialize AAmmo::DropAmount, this value has no meaning on an already spawned item.
2017-01-12 11:44:33 +01:00
Christoph Oelckers
cd7986b1b1 - refactored global sides array to be more VM friendly.
- moved FLevelLocals to its own header to resolve some circular include conflicts.
2017-01-08 18:46:17 +01:00
Christoph Oelckers
71d1138376 - refactored the global lines array into a more VM friendly form, moved it to FLevelLocals and exported it to ZScript.
- disabled the Build map loader after finding out that it has been completely broken and nonfunctional for a long time. Since this has no real value it will probably removed entirely in an upcoming commit.
2017-01-08 14:39:16 +01:00
Christoph Oelckers
c02281a439 - refactored the global sectors array into a more VM friendly type and moved it into FLevelLocals. 2017-01-07 19:32:24 +01:00
alexey.lysiuk
e825918451 Fixed format strings warnings reported by GCC/Clang
See https://forum.zdoom.org/viewtopic.php?t=54541 and https://forum.zdoom.org/viewtopic.php?t=54709
2016-12-24 23:51:08 +01:00
Edoardo Prezioso
45e5e5c6ee - Add missing GCCPRINTF to FraggleScript script_error function.
This will help spotting errors inside FraggleScript.
2016-12-10 14:02:12 +01:00
Christoph Oelckers
967f6c0269 - use a separate exception type for reporting errors from FraggleScript.
CRecoverableError is used in other parts as well and it might create interference.
2016-12-02 16:56:50 +01:00
Christoph Oelckers
229c55ce61 - moved ammo to its own file, including the backpack.
- moved weapon declarations to their own header.
2016-11-30 12:24:50 +01:00
Christoph Oelckers
66d28a24b8 - disabled the scripted virtual function module after finding out that it only works if each single class that may serve as a parent for scripting is explicitly declared.
Needless to say, this is simply too volatile and would require constant active maintenance, not to mention a huge amount of work up front to get going.
It also hid a nasty problem with the Destroy method. Due to the way the garbage collector works, Destroy cannot be exposed to scripts as-is. It may be called from scripts but it may not be overridden from scripts because the garbage collector can call this function after all data needed for calling a scripted override has already been destroyed because if that data is also being collected there is no guarantee that proper order of destruction is observed. So for now Destroy is just a normal native method to scripted classes
2016-11-25 00:25:26 +01:00
Leonard2
7dbc4710f1 Add the new argument to all uses of the implement macro 2016-11-09 17:45:55 +01:00
Leonard2
bb2d61de50 Replaced the many implement macros with a single one that takes arguments instead 2016-11-09 17:45:53 +01:00
Leonard2
0b3585c83f Separate the pointer list from the implement macro 2016-11-09 17:45:52 +01:00
Christoph Oelckers
646f9b21c7 Merge branch 'master' of https://github.com/rheit/zdoom into zscript
# Conflicts:
#	src/scripting/codegeneration/codegen.cpp
2016-10-18 00:55:56 +02:00
Christoph Oelckers
938ab4ca70 - implemented '**' (power) operator. To ensure reliability, acustom 'pow' function will be used to calculate it.
- fixed: FxBinary::ResolveLR' check for numeric operations was incomplete. Like far too many other places it just assumed that everything with ValueType->GetRegType() == REGT_INT is a numeric type, but for names this is not the case.
2016-10-17 15:17:48 +02: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
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
ab43e0c8cb - all thinker serializers done. 2016-09-20 00:41:22 +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
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
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
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
Randy Heit
96a0bee651 Quiet two more warnings from GCC 2016-04-23 21:00:35 -05:00
Edoardo Prezioso
6aca7604eb - Clean the code by using AActor::GiveInventory.
This fixes also a bug in FraggleScript GiveInventory, which tried to access the 'SaveAmount' member of 'ABasicArmorBonus' with the wrong cast.
2016-04-21 16:02:43 +02:00
Christoph Oelckers
bc7e159be0 - cleaned up ceiling creation and moved the Create function out of the DCeiling class.
- did the same for floors so that FraggleScript no longer needs access to the thinkers themselves.
2016-04-09 12:07:34 +02:00
Christoph Oelckers
caae61de4c - removed DMoveCeiling and let FS call DCeiling::Create instead. Made a minor change to DCeiling::Create to keep it compatible, because handling for instantly moving ceilings is a bit different. 2016-04-08 20:44:55 +02:00
Christoph Oelckers
39d03f12b1 - fixed float <-> fixed conversion errors in Fragglescript. 2016-04-08 15:14:26 +02:00
Christoph Oelckers
8535a973cf - made MoveAttached, MoveCeiling and MoveFloor members of sector_t instead of DMover.
- call MoveFloor and MoveCeiling directly in FS's floorheight and ceilingheight functions and remove the dummy thinkers it had to use before.
2016-04-08 14:18:46 +02:00
Christoph Oelckers
e505bfd7a3 - took EResult out of DMover and made it an enum class. 2016-04-08 13:59:03 +02:00
Christoph Oelckers
9b5a4b6d43 - removed several unused setter functions for level data structures and fixed some incorrect uses. 2016-04-02 22:05:23 +02:00
Christoph Oelckers
77f2530236 - floatified the sector plane movers and removed some of the ZatPoint conversion cruft. 2016-03-30 09:41:46 +02:00
Christoph Oelckers
25f5e8449a - replaced all direct access to sector plane coefficients with wrapper functions. 2016-03-29 12:40:41 +02:00
Christoph Oelckers
d87f861e87 Merge branch 'master' into floatcvt
# Conflicts:
#	src/p_spec.cpp
#	src/p_spec.h
2016-03-28 22:23:41 +02:00
Christoph Oelckers
263051a77b - removed a few unnecessary #includes. 2016-03-28 22:20:25 +02:00
Christoph Oelckers
dabed04d2a - floatification of p_3dfloors, p_3dmidtex and p_acs.cpp plus some leftovers.
- removed all references to Doom specific headers from xs_Float.h and cmath.h.
2016-03-26 12:36:15 +01:00
Christoph Oelckers
35bb686281 - floatification of sector_t::centerspot. 2016-03-26 09:38:58 +01:00
Christoph Oelckers
eac0bfeaeb - removed fixed_t and associated utility macros from FraggleScript code. 2016-03-24 09:16:35 +01:00
Christoph Oelckers
4a79602325 - floatification of g_shared.
- rewrote FraggleScript's movecamera function because it was utterly incomprehensible.
2016-03-24 01:46:11 +01:00