Commit graph

88 commits

Author SHA1 Message Date
hendricks266
d466b2ae51 Add bit 1 to action flags: use the viewpoint's position relative to the actor when calculating which rotation to display, instead of the viewpoint's angle, for viewtypes 2/3/4/8. 5/7 already do this.
git-svn-id: https://svn.eduke32.com/eduke32@5850 1a8010ca-5511-0410-912e-c29ae57300e0
2016-09-06 02:15:31 +00:00
hendricks266
d8ce0f042d CON: Add an optional sixth parameter, a flags bitfield, to action definitions. Bump BYTEVERSION.
git-svn-id: https://svn.eduke32.com/eduke32@5849 1a8010ca-5511-0410-912e-c29ae57300e0
2016-09-06 02:15:28 +00:00
hendricks266
abd1523477 Enumify stuff having to do with action parameters.
git-svn-id: https://svn.eduke32.com/eduke32@5848 1a8010ca-5511-0410-912e-c29ae57300e0
2016-09-06 02:15:23 +00:00
terminx
d7d6623364 More readability cleanup. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5835 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:42:01 +00:00
terminx
638312e7f9 More cleanup. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5833 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:41:46 +00:00
terminx
aae66ccb11 Further cleanup. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5828 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:41:04 +00:00
terminx
34453f5090 Continued cleanup. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5827 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:56 +00:00
terminx
5c6d8c96ad The great cleanup continues. This one also adds a new feature, SFLAG_WAKEUPBADGUYS. When awoken (changed to an active actor), any sprite with this flag set will wake up any enemy it has line of sight with.
git-svn-id: https://svn.eduke32.com/eduke32@5826 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:46 +00:00
terminx
52f678a743 Massive readability cleanup of game code part 1. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5825 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:35 +00:00
terminx
ae5f941ad0 You're just going to have to trust me that this is 10000 lines worth of formatting and variable name cleanup, and not 10000 lines of functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@5821 1a8010ca-5511-0410-912e-c29ae57300e0
2016-08-27 01:40:06 +00:00
terminx
03daded192 Vectorize a few more things.
git-svn-id: https://svn.eduke32.com/eduke32@5800 1a8010ca-5511-0410-912e-c29ae57300e0
2016-06-21 00:34:18 +00:00
terminx
5800cd588c tsectortype -> usectortype
twalltype -> uwalltype
tspritetype -> uspritetype

No other changes.

git-svn-id: https://svn.eduke32.com/eduke32@5796 1a8010ca-5511-0410-912e-c29ae57300e0
2016-06-21 00:33:58 +00:00
terminx
0562de125f More changes similar to the previous commit
git-svn-id: https://svn.eduke32.com/eduke32@5795 1a8010ca-5511-0410-912e-c29ae57300e0
2016-06-21 00:33:45 +00:00
terminx
6173a8c339 Revert r5496
git-svn-id: https://svn.eduke32.com/eduke32@5700 1a8010ca-5511-0410-912e-c29ae57300e0
2016-04-13 04:04:13 +00:00
terminx
9c927bcb36 Don't squish the player in lotag 1 sectors that have a SE7.
git-svn-id: https://svn.eduke32.com/eduke32@5657 1a8010ca-5511-0410-912e-c29ae57300e0
2016-03-14 00:07:12 +00:00
terminx
8ac3e86da3 Add SFLAG_REALCLIPDIST to bypass hard-coded clipdist fuckery based on xrepeat and picnum. This also changes some bad uses of A_CheckSpriteTileFlags() into A_CheckSpriteFlags() instead.
git-svn-id: https://svn.eduke32.com/eduke32@5602 1a8010ca-5511-0410-912e-c29ae57300e0
2016-02-02 00:21:17 +00:00
hendricks266
93884b1a91 Fix potential build failure when static inline G_CheckForSpace{Ceiling,Floor} are declared without namesdyn.h first being included.
Exposed by lunatic_game.c when LUNATIC=1.

git-svn-id: https://svn.eduke32.com/eduke32@5593 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-27 07:30:34 +00:00
terminx
3e82145e2c CON_MOVESECTOR. Triggers built-in sector movement routines... not really appropriate to use outside of EVENT_MOVEEFFECTORS.
git-svn-id: https://svn.eduke32.com/eduke32@5581 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-21 19:35:34 +00:00
hendricks266
3a8d53573c Remove actors_inline, game_inline, and sector_inline objects, and move their code into other headers, set up to be compiled into well-fitting objects if inlining them is disabled.
git-svn-id: https://svn.eduke32.com/eduke32@5529 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-08 01:33:35 +00:00
hendricks266
5d9b8a2bb1 C-CON: Clean up pointer handling in the parser so we have less to re-offset in C_SetScriptSize. Also fixes bugs in r5093 and/or r5097.
git-svn-id: https://svn.eduke32.com/eduke32@5521 1a8010ca-5511-0410-912e-c29ae57300e0
2016-01-08 01:33:01 +00:00
terminx
0871e56b92 Projectile changes:
-palette is now set at spawn time, instead of during movement (oops!)
-projectiles can no longer hit their owner during their first tic of movement

git-svn-id: https://svn.eduke32.com/eduke32@5498 1a8010ca-5511-0410-912e-c29ae57300e0
2015-12-28 02:04:41 +00:00
terminx
1d17d2c6f6 Polymer lighting tweaks, mostly internal.
git-svn-id: https://svn.eduke32.com/eduke32@5496 1a8010ca-5511-0410-912e-c29ae57300e0
2015-12-28 02:04:29 +00:00
hendricks266
aac1900472 Add new spriteflag SFLAG_GREENSLIMEFOOD = 8388608, which controls whether GREENSLIME will eat a given actor.
The flag is automatically set on LIZTROOP, LIZMAN, PIGCOP, and NEWBEAST, in a similar fashion as SFLAG_NOWATERDIP (r4956) and SFLAG_NODAMAGEPUSH (r4371).

git-svn-id: https://svn.eduke32.com/eduke32@5492 1a8010ca-5511-0410-912e-c29ae57300e0
2015-12-26 15:41:59 +00:00
terminx
f22dbc6fdb Add r_pr_lighting 2, which disables the hard-coded lights while leaving lights added in maps enabled.
This also adds a menu option to control r_pr_lighting.

git-svn-id: https://svn.eduke32.com/eduke32@5406 1a8010ca-5511-0410-912e-c29ae57300e0
2015-10-23 23:00:21 +00:00
helixhorned
3730901f43 Game: don't spawn FRAMEEFFECT1 for BOUNCEMINE.
There's no point, really. Since the bouncemine is immobile, the tsprites
will all be overlaid at one point and show the same picture, as far
as I can see. Worse, since r4876, the generated sprites may draw on top
of the actual one. The former have their shade always set to
sprite[t->owner].shade though, and will then appear fully bright (shade
-127, since BOUNCEMINE sets it like this).

This fixes issue number 4 from
http://forums.duke4.net/topic/8042-five-minor-problems-report/

git-svn-id: https://svn.eduke32.com/eduke32@5316 1a8010ca-5511-0410-912e-c29ae57300e0
2015-08-02 08:40:42 +00:00
hendricks266
25543b521b Add SFLAG_HURTSPAWNBLOOD, which allows actors (particularly useractor enemies) to spawn blood when hurt as hardcoded enemies do.
git-svn-id: https://svn.eduke32.com/eduke32@5250 1a8010ca-5511-0410-912e-c29ae57300e0
2015-05-27 08:45:59 +00:00
helixhorned
5683beec3d Do "typedef projectile_t defaultprojectile_t;" instead of having an indetical-member type.
Move projectile_t to player.h.

git-svn-id: https://svn.eduke32.com/eduke32@5159 1a8010ca-5511-0410-912e-c29ae57300e0
2015-04-18 21:59:21 +00:00
hendricks266
806bbe6d71 CON: Add projectile workslike flag PROJECTILE_NOSETOWNERSHADE = 0x00200000 = 2097152 that prevents actors from inheriting a projectile's shade when shooting it.
git-svn-id: https://svn.eduke32.com/eduke32@5106 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-28 09:48:51 +00:00
terminx
c9ce545ab8 A lot of CON rewrites/optimizations. Converts projectile system to dynamic allocation, saving a bunch of memory (something like sizeof(projectile_t) * MAXTILES * 2). This commit also contains changes that reduce overhead for CON commands that take a lot of parameters, by way of adding a Gv_GetManyVars() to replace long strings of subsequent calls to Gv_GetVarX().
Savegame version has been bumped due to the projectile changes. There is no way this commit doesn't cause at least one bug, so DONT_BUILD. ;)

git-svn-id: https://svn.eduke32.com/eduke32@5080 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 00:40:55 +00:00
terminx
7845f5e2fe "Stylistic changes"
Translation: I made some stuff const because I felt like it.

git-svn-id: https://svn.eduke32.com/eduke32@5067 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 00:40:05 +00:00
helixhorned
57079dfee1 Add SFLAG_NOWATERDIP, unconditionally preventing actors from dipping into ST1 water.
By default, the following enemies have this flag set: OCTABRAIN, COMMANDER, DRONE.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4956 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-05 16:30:14 +00:00
terminx
4911b9a949 Revise C++ structure trackers for performance and introduce "tspritetype", for temporary sprites or other usages where using the trackers would be invalid or undesired. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4898 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:55:07 +00:00
hendricks266
9268b9f0b6 Make a bunch of things extern "C". This should fix C++ builds on OS X and with Lunatic. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4766 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-26 04:39:23 +00:00
terminx
99e21ffa94 Part 1 of attempting to adhere to C standard section 7.1.3. It turns out it's illegal to use identifiers that begin with _ or have __ anywhere in them. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4747 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:32:56 +00:00
terminx
bf3c0de73a Mainly misc cleanups (and a fix for the C++ build), but there are a few important changes in here.
VM_OnEvent() has become VM_OnEvent(), VM_OnEventWithReturn(), VM_OnEventWithDist(), and VM_OnEventWithBoth() (the latter of which is only ever used once...). Of course, this required every call to VM_OnEvent() be changed.

memberlabel_t and vmstate_t have been changed to use the regular "int" type versus explicitly specifying int32_t as they did previously. The rationale for this change is simply that it looks cleaner, and I think we should move toward just using "int" in most cases where there's no particular reason to specify an explicit data type.

Also changes CON_KILLIT to just "return" instead of "continue". DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4745 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:29:25 +00:00
helixhorned
40c2fc7d07 Lunatic: add actor.move() static function and documentation stub.
git-svn-id: https://svn.eduke32.com/eduke32@4590 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-07 18:10:16 +00:00
hendricks266
c1c01f0e0b Replace the funkily-formatted GNU.TXT with the FSF's official gpl-2.0.txt. Also, update the FSF's address in all source files that contain it.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4541 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-20 08:55:56 +00:00
helixhorned
10a0e82736 Fix the "fix for flying/jumping monsters getting stuck in water".
In C and Lunatic, split 'jumptoplayer' of enum amoveflags_t / action.MOVFLAGS
into 'jumptoplayer_bits' and 'jumptoplayer_only' (see updated Lunatic doc).

git-svn-id: https://svn.eduke32.com/eduke32@4378 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-16 14:37:52 +00:00
helixhorned
5cb6e20c63 Add new actor flag and predefined CON label SFLAG_NODAMAGEPUSH.
This flag is set from C for some enemies that should not be pushed back when
damaged, such as TANK. Both the tile flag and the per-sprite flag are used
(i.e. the ultimate flag value is the XOR of the two).
Add currently non-functional example to test.lua that attempts to set this bit
for NEWBEAST.

git-svn-id: https://svn.eduke32.com/eduke32@4371 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-15 14:10:47 +00:00
helixhorned
b8bd2069ea Rename SPRITE_* flag enum constants to SFLAG_*, for consistency with CON.
git-svn-id: https://svn.eduke32.com/eduke32@4351 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:52 +00:00
terminx
e83927c2f8 Refactor projectiles a bit. Tested with all of the original weapons and with the weapons in the Duke 64 mod.
git-svn-id: https://svn.eduke32.com/eduke32@3992 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:34 +00:00
helixhorned
f4d74e4df8 Lose the 'packed' attribute on actor_t.
Its members are already laid out on the natural alignment boundaries.
Compilation tested with {32-bit, 64-bit} x {Lunatic, non-Lua} builds.

git-svn-id: https://svn.eduke32.com/eduke32@3968 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:08 +00:00
helixhorned
cad7d49bd1 Lunatic: retire an actor's sprite[].hitag/lotag for new actor[] members.
git-svn-id: https://svn.eduke32.com/eduke32@3922 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:52 +00:00
helixhorned
73b5d064da Retire actor[].shootzvel, as it was only ever used in local scope.
That is, its value was only referenced during the duration of a function call
that had previously set it. It was also never accessible from CON.

git-svn-id: https://svn.eduke32.com/eduke32@3921 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:50 +00:00
helixhorned
e164bd7f1e Actor-related code cleanup part 2: give actor t_data[] indexes names.
Using macros like AC_COUNT(t). Clean up related code:
 - comment out the dead condition noted in the previous commit
 - Lunatic: use get_count() instead of get_t_data(0) in one place,
   rename to _get_t_data(), i.e. make that method internal

git-svn-id: https://svn.eduke32.com/eduke32@3920 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:48 +00:00
helixhorned
36f3a8e47c Lunatic: don't register con.action/move/ai by name, make these return a cdata.
git-svn-id: https://svn.eduke32.com/eduke32@3916 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:39 +00:00
helixhorned
2003954492 CON: add projectile member .userdata and predefined label PROJ_USERDATA.
It is a 32-bit signed integer. No version bump necessary, although CON code
accessing this new member will not work with earlier revisions (obviously).

git-svn-id: https://svn.eduke32.com/eduke32@3866 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:18 +00:00
helixhorned
8dd73d0fe8 Tweak r3681 to obtain the same behavior in the pre-r3681 undefined behavior case.
That is, assume that switch(DYNAMICTILEMAP(-1)) (which is an oob access and thus
undefined behavior) gets us to the 'default:' label.

git-svn-id: https://svn.eduke32.com/eduke32@3743 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-10 12:31:33 +00:00
helixhorned
8064bd2f30 Clean up of mostly actors.c, but some other files along the way too.
- Rewrite some sprites-of-{stat,sector} loops using the SPRITES_OF,
  SPRITES_OF_SECT and new SPRITES_OF_SECT_SAFE macros.
- In passing, identify some problems and mark them with 'XXX', but don't
  attempt to fix them yet.
- The usual readability improvements...

git-svn-id: https://svn.eduke32.com/eduke32@3679 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:09 +00:00
helixhorned
52fc0bdfc5 TROR no-SE7 water: handle projectiles.
Actually, the tweaked code in VM_Move() is not specific to projectiles, so
other sprites now may pass no-SE7 water boundaries too, but it's most noticeable
with projectiles.

git-svn-id: https://svn.eduke32.com/eduke32@3678 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:05 +00:00