Commit Graph

339 Commits

Author SHA1 Message Date
helixhorned d56e5451d9 Fix one more 1<<31 calculation, remove one unneeded cast.
git-svn-id: https://svn.eduke32.com/eduke32@3724 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-04 16:36:08 +00:00
helixhorned c6d7c08d58 Generalize ZRANGE and ANGRANGE to accept any nonnegative number.
Numbers 0 and 1 mean 'no spread', but the latter does one krand() call.
Negative numbers are reserved for potential future use.

git-svn-id: https://svn.eduke32.com/eduke32@3715 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-29 19:24:12 +00:00
helixhorned 08b10ca03c Draw the flat on-screen CHAINGUN in a way inspired by 3688, preventing seam.
Specifically, in GL modes, and if the CHAINGUN is not replaced by a model,
 - draw the upper part twice: first, two screen pixels * weapon scale lower,
   then at the original position
 - reverse the previous order: draw the upper part first, then the lower part

This is much preferable to the previous engine-side hack, and to my eye,
it looks perfect now.

git-svn-id: https://svn.eduke32.com/eduke32@3695 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-21 19:55:11 +00:00
helixhorned dac18a99e9 A couple of trivial stylistic changes.
git-svn-id: https://svn.eduke32.com/eduke32@3694 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-21 19:55:03 +00:00
terminx 3c5c8b44dc Mask the seam that shows up when drawing the scuba HUD overlay in OpenGL by drawing SCUBAMASK 3 times... once at the left position + 1, and then at the proper left and right positions. It's definitely a hack, but at least it lives on the game side of things.
git-svn-id: https://svn.eduke32.com/eduke32@3688 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-16 22:37:31 +00:00
helixhorned 6be448c534 Fix SPRITES_OF_SECT_SAFE macro. Oops!
git-svn-id: https://svn.eduke32.com/eduke32@3685 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 18:50:21 +00:00
helixhorned 3b39a87bd1 Fix a couple of issues identified in the preceding commit.
- In S_PlaySound(), move the sound index bound check above an indexing.
- For A_CheckHitSprite(), and A_FindPlayer(), allow NULL second arg.
- In A_ShootWithZvel(), make some one-letter vars be int32_t, making
  storing safeldist() results in them meaningful.
- In MaybeTrainKillEnemies(), remove two redundant checks and move another
  one further up.
- Comment that SIDEBOLT1 will never be translucent as was probably intended.
- In G_MoveFX(), fix an always-true comparison.

git-svn-id: https://svn.eduke32.com/eduke32@3680 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:13 +00:00
hendricks266 e2ab98261f Fix a signed/unsigned comparison.
git-svn-id: https://svn.eduke32.com/eduke32@3673 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:51:17 +00:00
helixhorned bbdc035335 Lunatic: replace DukePlayer_t set-member methods with metatable magic.
So that members needing it are checked when they're assigned to using the
usual syntax. What kind of check to perform (sector, player, ... x whether
negative values are allowed) is written in a declarative fashion inside the
C declaration.

Also, make Lunatic's MAXQUOTES be C's OBITQUOTEINDEX and bound-check an
access of sprite[p->wackedbyplayer] in the C code.

git-svn-id: https://svn.eduke32.com/eduke32@3653 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:41 +00:00
helixhorned fb41d91a50 Lunatic: get rid of some now unneeded set-member methods, add others.
git-svn-id: https://svn.eduke32.com/eduke32@3652 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:37 +00:00
helixhorned cbfd2eb438 In 'tip' display code, extrapolate four more values of the y coord table.
Also, for tip_incs values greater or equal than the number of elements in
this table, return early reporting that the hand has been drawn, so that
the otherwise selected weapon is not drawn.

git-svn-id: https://svn.eduke32.com/eduke32@3630 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:58:09 +00:00
terminx cd235d2ec2 Don't continue animating Ripper, Shrinker, Expander and Freezethrower when the game is paused or the menu is up.
git-svn-id: https://svn.eduke32.com/eduke32@3616 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-27 06:37:19 +00:00
terminx f96788866c Fix shrunk player fist animation speed as requested on the forums. I didn't test this against the DOS version but it seems about right according to my memory. Let me know if it's still wrong and you care that much about it.
git-svn-id: https://svn.eduke32.com/eduke32@3614 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-27 01:38:42 +00:00
hendricks266 72156dd4c1 Prevent the middle chaingun muzzleflash from animating its position when the player is frozen.
The unmodified behavior is completely wrong and I don't see how any mod could ever use it.

git-svn-id: https://svn.eduke32.com/eduke32@3578 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-19 06:22:52 +00:00
hendricks266 e2701c9a5a Patch up some broken hardcoded behavior with regard to the Sentry versions of the bosses (minibosses), as suggested by Fox.
This should have no adverse effects or side-effects. The changes only apply if a modder chose to use completely broken functionality in the first place.

git-svn-id: https://svn.eduke32.com/eduke32@3544 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-04 01:23:55 +00:00
helixhorned c66b891a38 Lunatic: export C functions that may call into CON events using the Lua C API.
We must not call these functions using the FFI, since the Lua state is
considered locked across such calls.

git-svn-id: https://svn.eduke32.com/eduke32@3520 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:47 +00:00
helixhorned 2d61216758 Lunatic translator: sprite list commands, findnear*, protect player[].ftq.
git-svn-id: https://svn.eduke32.com/eduke32@3498 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:32 +00:00
helixhorned 7c861cac42 Rework how the z velocity is passed from *zshoot to A_Shoot().
Previously, actor[].shootzvel (implementation detail, not available to CON)
was checked, and if it was !=0, that was the overridden velocity. The value
0 meant "hardcoded, projectile-dependent velocity". But that neccesiated a
hack where if zvel 0 was passed and really meant, it needed to be set to
1 instead.  Now we have A_ShootWithZvel() taking an additional last argument
plus a macro SHOOT_HARDCODED_ZVEL permissible for that argument.

git-svn-id: https://svn.eduke32.com/eduke32@3465 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:12 +00:00
helixhorned 24e6aca5f7 player.c: factor out more identical code into Proj_DoHitscan().
Also, simplify a couple of other lines.

git-svn-id: https://svn.eduke32.com/eduke32@3464 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:06 +00:00
helixhorned 9bf6115d1f player.c: factor out a repeated 3-liner into safeldist(), remove some commented code.
git-svn-id: https://svn.eduke32.com/eduke32@3462 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:00:58 +00:00
helixhorned b5aa49953e player.c: remove a couple of unnecessary casts.
git-svn-id: https://svn.eduke32.com/eduke32@3457 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:20 +00:00
helixhorned 77ecaa900a Fix all hitscan weapons (not only pistol) wrongly fire without spread at enemies.
Introduced in r3358, where I missed a condition inside an 'if'.

git-svn-id: https://svn.eduke32.com/eduke32@3453 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 19:56:26 +00:00
terminx 9bd041cb9d Fix knuckle cracking animation broken in r3436
git-svn-id: https://svn.eduke32.com/eduke32@3440 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-27 17:06:41 +00:00
helixhorned 9d7d58d678 player.c: return early from various P_Display*() if player's *incs are oob.
git-svn-id: https://svn.eduke32.com/eduke32@3436 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:07:48 +00:00
helixhorned 671bd67aa8 player.c: make four functions file-local.
git-svn-id: https://svn.eduke32.com/eduke32@3418 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:19 +00:00
helixhorned b6ca618694 Lunatic: hook up PIPEBOMB_CONTROL etc. with the player members.
git-svn-id: https://svn.eduke32.com/eduke32@3414 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:16:58 +00:00
helixhorned cd1f3739d9 player.c: factor out repeated code into P_SetWeaponGamevars().
git-svn-id: https://svn.eduke32.com/eduke32@3413 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:16:54 +00:00
helixhorned fb1db25c4e Consolidate badly named HUD weapon globals ("g_looking_angSR1") into struct.
git-svn-id: https://svn.eduke32.com/eduke32@3408 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:48 +00:00
helixhorned c9190e79ae Wrap some ud.camera* and g_camera{Distance,Clock} into CAMERA* macros.
In Lunatic, make it a struct type "camera_t" instead.

git-svn-id: https://svn.eduke32.com/eduke32@3405 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:32 +00:00
helixhorned 0c44056945 Lunatic: getting closer to the first milestone.
On the C side, zrange, angrange and autoaimang are represented as
DukePlayer_t members then.

git-svn-id: https://svn.eduke32.com/eduke32@3366 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-02 22:33:37 +00:00
helixhorned 2528fd3bf5 player.c: factoring continued.
New local functions:
Proj_DoRandDecalSize, SectorContainsSE13, HandleHitWall, Proj_CheckBlood,
Proj_HandleKnee.

git-svn-id: https://svn.eduke32.com/eduke32@3362 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:42 +00:00
helixhorned 10feaeb5b4 player.c: cleanup. "ProjectileData[atwith]." --> "proj->", ...
The diff may look daunting, but it's clear what is changed with
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]' -b

git-svn-id: https://svn.eduke32.com/eduke32@3361 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:39 +00:00
helixhorned 552708103f player.c: finish hitscan projectile handling cleanup.
Factoring out 2x almost duplicated code into {P,A}_PostFireHitscan().

git-svn-id: https://svn.eduke32.com/eduke32@3360 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:36 +00:00
helixhorned f65f547fef player.c: hitscan projectile handling cleanup continued.
git-svn-id: https://svn.eduke32.com/eduke32@3359 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:33 +00:00
helixhorned 15b7444b46 player.c: factor out 2x almost dup'd code preparing hitscan weapon firing.
The code is duplicated with small changes for the hardcoded and custom
projectiles.
Adding local functions P_PreFireHitscan(), A_PreFireHitscan() and
Proj_MaybeAddSpread().

git-svn-id: https://svn.eduke32.com/eduke32@3358 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:31 +00:00
helixhorned 37d8cda701 Clean up actors.c and player.c.
git-svn-id: https://svn.eduke32.com/eduke32@3353 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:14 +00:00
terminx 79e45c23d5 Add predefined REND_CLASSIC, REND_POLYMOST and REND_POLYMER constants and use them everywhere getrendermode() is called.
git-svn-id: https://svn.eduke32.com/eduke32@3346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-30 20:34:34 +00:00
helixhorned 80f3e132b0 Replace "if (g_tile[..].execPtr)" -> "if (G_HaveActor(...))".
git-svn-id: https://svn.eduke32.com/eduke32@3344 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:28 +00:00
helixhorned 9c328bf0a5 Encapsulate aplWeapon* array accesses in a PWEAPON(Player, Weapon, Wmember) macro.
In the normal game, these arrays are conceptually [MAX_WEAPONS][MAXPLAYERS],
allocated as CON per-player gamevars (e.g. WEAPONx_WORKSLIKE).
For Lunatic, they are replaced with
weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS].

git-svn-id: https://svn.eduke32.com/eduke32@3328 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:16 +00:00
helixhorned 9d2260c3c8 Replace outer apScriptGameEvent[...] checks with G_HaveEvent().
git-svn-id: https://svn.eduke32.com/eduke32@3266 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:57 +00:00
helixhorned fc048658dc Experimental NETCODE Makefile variable, enabled by default.
Disabling netcode compilation can be interesting on memory-constrained
systems, or those that have no means of accessing the network anyway.
Note: I'm OK with maintaining this myself, i.e. it's fine if netcode dev
breaks compilation with NETCODE=0.

git-svn-id: https://svn.eduke32.com/eduke32@3260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:44 +00:00
helixhorned 4b66769bcb Couple of tweaks in player.c to match all ProjectileData[...].xxx with a regexp.
It would be something like "ProjectileData\[([^]]+)]\.([a-z_]+)".

git-svn-id: https://svn.eduke32.com/eduke32@3152 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:57:09 +00:00
helixhorned a76a796ebb Fix demo playback with diff application enabled.
This requires ripping out the .proj member of tiledata_t back into
ProjectileData[] again because it was the only one in g_tile[] that
changed during the course of a game.  The g_tile[] array is now also
correctly flagged as "constant throughout a game" (DS_NOCHK).
Savegame version bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3151 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:57:06 +00:00
helixhorned 3d74c8a9fd Fix viewing through moving cameras.
It's still not pretty though since there's no interpolation from G_DrawRooms().

git-svn-id: https://svn.eduke32.com/eduke32@3149 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:56:57 +00:00
helixhorned e7e777348b When found a camera sprite for viewscreen, set position etc. immediately.
Instead of later in P_ProcessInput(). This fixes one drawrooms() call in
between where the sectnum is the camera's, but the position the player's,
which can lead to a slow "outer view" render in Polymer.

git-svn-id: https://svn.eduke32.com/eduke32@3142 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:07 +00:00
terminx 5cca0d4ffe Add some compile time defined names for p->inven_icon values. Too bad these values aren't in the same order as the inventory items themselves... (dukeinv_t and dukeinvicon_t values do not match).
git-svn-id: https://svn.eduke32.com/eduke32@3115 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:41:05 +00:00
terminx 88c95a18f7 Retire the actorscrptr[], actorLoadEventScrptr[], SpriteFlags[], ActorType[], SpriteCacheList[], ProjectileData[] and DefaultProjectile[] arrays in favor of a tile_t structure exposed as g_tile[]. This consolidates most of the MAXTILES sized arrays on the game side into one place.
git-svn-id: https://svn.eduke32.com/eduke32@3102 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-30 15:54:35 +00:00
hendricks266 2066656aed Two new player structure members: "autostep" and "autostep_sbw".
These control the maximum difference in height between two sectors that the player will automatically traverse without needing to jump.

The latter controls the special case when the player's sector's lotag is ST_1_ABOVE_WATER or p->spritebridge == 1.

BYTEVERSION bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3100 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:29:17 +00:00
terminx f6a11eacc1 Clean up a couple of functions, namely P_IncurDamage()
git-svn-id: https://svn.eduke32.com/eduke32@3081 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:10:29 +00:00
helixhorned a92d5486c4 Replace all/most literal SE lotags 1/2 with SE_1_ABOVE_WATER or SE_2_UNDERWATER.
Also catch some other literal SEs and statnums.

git-svn-id: https://svn.eduke32.com/eduke32@3073 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:21 +00:00