Commit Graph

1984 Commits

Author SHA1 Message Date
helixhorned 59151dd045 player.c: factor out 7x similar code into GetAutoAimAngle().
This is one of the cases where the duplicated code has minor modifications
at each site. These are handled by function args here.

git-svn-id: https://svn.eduke32.com/eduke32@2983 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:03:10 +00:00
helixhorned a9d3103373 Remove commented out AI Duke opponent code.
git-svn-id: https://svn.eduke32.com/eduke32@2982 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:02:04 +00:00
helixhorned b8ed142c6b Remove some #if 0 blocks that are probably of no interest any more.
For reference, they are the following:
 - cache1d.c: suckcache()
 - build.c: compare_wall_coords()
 - make switch-invisible heuristic
 - Mapster32: old sprite search
 - Mapster32: manual z range
 - m32script: read/writearray, qgetsysstr
 - menus.c: savetemp()

git-svn-id: https://svn.eduke32.com/eduke32@2981 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:00:58 +00:00
helixhorned e4bb83cd39 player.c: factor out inline checks for shootable switch picnums.
git-svn-id: https://svn.eduke32.com/eduke32@2980 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 13:59:50 +00:00
helixhorned 08a19e19f3 player.c: factor out multiple instances of a 3-liner into A_SetHitData().
Playing around with Coccinelle's semantic patches... be prepared for more.

git-svn-id: https://svn.eduke32.com/eduke32@2979 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 13:58:45 +00:00
helixhorned 8efcc81096 Remove some unneeded NULL checks.
Found by http://coccinelle.lip6.fr/rules/notnull.cocci

git-svn-id: https://svn.eduke32.com/eduke32@2978 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 13:57:39 +00:00
helixhorned 26c540e736 Fix "shooting" tripbombs from non-players such as the SE shooter.
Well, this never worked anyway, but invoking demons flying out of your
nose is never a good idea.

git-svn-id: https://svn.eduke32.com/eduke32@2977 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-28 21:42:49 +00:00
hendricks266 3c5aeae341 Modify EVENT_CHANGEWEAPON so that it actually serves a purpose. Instead of being triggered before curr_weapon is changed, with nothing used for input or output with RETURN (meaning you could not cancel), now RETURN is set to the prospective new weapon ID and you can change it or cancel it in the event.
Note that since setting RETURN did nothing before, there is no backwards compatibility to uphold. Therefore, setting RETURN to 1 will cause the pistol to be selected, not disable the event. Set RETURN to -1 to cancel switching.

git-svn-id: https://svn.eduke32.com/eduke32@2976 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-27 03:53:59 +00:00
hendricks266 a0dc378eda Expand "Switch weapons on pickup" to three options: "Off", "All weapons", and a new one, "Fav priority". It switches to the weapon you have just picked up only if it is ranked higher in the favorite weapon hierarchy using the "-u" parameter.
Suggested at: http://forums.duke4.net/topic/5667-tiny-request/

git-svn-id: https://svn.eduke32.com/eduke32@2975 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-27 03:52:38 +00:00
hendricks266 2620738eb9 Add EVENT_PREGAME. Now all sprites are processed in the following fashion:
1. EVENT_PREGAME
2. hardcoded stuff
3. EVENT_GAME

One potential use is to examine values which are clobbered by commands such as ifhitweapon/ifwasweapon.

git-svn-id: https://svn.eduke32.com/eduke32@2973 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-27 03:49:55 +00:00
helixhorned ffa4e8ebb3 Quit the game if SE17 (warp elevator) setup fails.
The spawn-time SE 17 setup uses nextsectorneighborz() which can fail
(return -1) on some circumstances and would cause an OOB sector[] access.

git-svn-id: https://svn.eduke32.com/eduke32@2971 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:17:14 +00:00
helixhorned 2b58c6de4c Replace some literal numbers denoting SEs/STs by symbolic enumeration values.
git-svn-id: https://svn.eduke32.com/eduke32@2970 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:16:08 +00:00
helixhorned 948b4f82fc build.lua map loader: add the option of canonicalizing sprite order.
This is mostly for debugging, since currently, Mapster32 restores sprites
not in the same order as the original sprite index order.  Also, expose
this option from map2text.lua and mapdiff.sh.

git-svn-id: https://svn.eduke32.com/eduke32@2968 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:13:57 +00:00
helixhorned b73d16b8cc foreachmap.lua: add -e"some code..." switch to execute code from the cmdline.
git-svn-id: https://svn.eduke32.com/eduke32@2967 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:12:51 +00:00
helixhorned a7eaac1add build.lua: add 'numbunches' field to map loader.
git-svn-id: https://svn.eduke32.com/eduke32@2966 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:11:46 +00:00
helixhorned f133be4ae8 Add map2text.lua and helper script mapdiff.sh.
git-svn-id: https://svn.eduke32.com/eduke32@2964 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-26 22:09:34 +00:00
helixhorned 4724f5d18c On Linux build without startup GUI, don't save ModDir to config.
git-svn-id: https://svn.eduke32.com/eduke32@2962 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-24 18:55:06 +00:00
helixhorned 9abc415a24 A couple of trivial changes.
git-svn-id: https://svn.eduke32.com/eduke32@2961 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-24 18:54:01 +00:00
helixhorned a8af22ba9a Fix stack corruption when demo was attempted to be written with non-empty mod dir.
git-svn-id: https://svn.eduke32.com/eduke32@2960 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-24 18:52:55 +00:00
helixhorned 772778205b Pack how many players fake multi was started with into g_fakeMultiMode.
git-svn-id: https://svn.eduke32.com/eduke32@2957 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:51:38 +00:00
helixhorned 95de2abb3a splitscreen: don't wrongly change pitch for sounds originating from 2nd player.
For example, if the first one is underwater.

git-svn-id: https://svn.eduke32.com/eduke32@2956 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:50:32 +00:00
helixhorned 481a986a30 splitscreen: tweak base palette application, remove resp. code from splitscr.con.
Basically, base palettes with lower indices trump higher ones.  For example,
when one player is underwater and the other above, the normal palette takes
precedence.

git-svn-id: https://svn.eduke32.com/eduke32@2955 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:49:27 +00:00
helixhorned 96acc3dc52 Generalize fullscreen tint application to more than one tint.
Currently, the only kinds of tint that can be applied simultaneously are
one "palfrom" per player, plus one loogie tint per player.  Each palfrom
still overrides the preceding one.  However, this is not a big problem IMO
since palfroms decrease at the same rate (loogie tint decreases at half the
speed).  This change is especially good for the splitscreen mod, since now
the tints of the two players won't compete with each other.  See the comment
in the source for some properties of the blending formula.

git-svn-id: https://svn.eduke32.com/eduke32@2954 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:48:21 +00:00
helixhorned ef8adcc51f Don't clear loogie tint transiently on changing palette.
git-svn-id: https://svn.eduke32.com/eduke32@2953 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:47:16 +00:00
helixhorned a53e9b60d8 Keep full-screen tints through palette changes again.
A debug macro to test tints being stuck at the least intense non-zero value
is provided in engine.c.

git-svn-id: https://svn.eduke32.com/eduke32@2952 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:46:09 +00:00
helixhorned 19c2c57ffb Make a colored REACTOR/REACTOR2 sprite disappear in single player again.
Noted by Nukey.  See Duke3D 1.5 GAME.C line 4220.

git-svn-id: https://svn.eduke32.com/eduke32@2951 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-21 17:40:05 +00:00
helixhorned d2d10a4c4c splitscreen: print "reserved" quotes in the upper half of the screen.
Reverved quotes are ones like "Killed by xxx". Since they're only
shown for the first player for now, printing them in the upper part
makes more sense (in above/below split, the first player is above).

git-svn-id: https://svn.eduke32.com/eduke32@2950 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-21 17:39:00 +00:00
helixhorned 6953dbd964 Print quotes for both players in fake multi, remove quote code in splitscr.con.
git-svn-id: https://svn.eduke32.com/eduke32@2948 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:32:11 +00:00
helixhorned bb02f861e4 game.c: clean up G_PrintGameText() a little.
git-svn-id: https://svn.eduke32.com/eduke32@2947 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:31:05 +00:00
helixhorned 75457adaab game.c: clean up G_PrintGameQuotes().
git-svn-id: https://svn.eduke32.com/eduke32@2946 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:30:00 +00:00
helixhorned 60b876aa46 splitscreen: handle crosshairs for above/below split and regard crosshairscale.
git-svn-id: https://svn.eduke32.com/eduke32@2945 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:29:54 +00:00
helixhorned b6090152ac splitscreen: support for above/below screen split.
To enable it, the HUD-less (maximized) screen size must be selected.

git-svn-id: https://svn.eduke32.com/eduke32@2944 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:28:48 +00:00
helixhorned 13178b7cda Mapster32: properly reset highlights in undo/redo.
git-svn-id: https://svn.eduke32.com/eduke32@2943 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:27:42 +00:00
helixhorned 7807f35691 control layer: comment out some unused functions and stuff.
git-svn-id: https://svn.eduke32.com/eduke32@2940 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:24:54 +00:00
helixhorned d24aad08dc splitscreen: tweak view drawing: use player's cursectnum and simulate z clamping.
Using the players's cursectnum instead of "updating" the sectnum means that it
won't glitch on SoS.  The z clamping (basically a port of some code from
G_DrawRooms) is so that the view won't be drawn from under the floor when shrunk.

git-svn-id: https://svn.eduke32.com/eduke32@2939 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:23:48 +00:00
helixhorned 627476541b In G_DisplayRest, be sure to always un-apply a previously applied tint.
This fixes the screen keeping the bluish tint even after shattering a
frozen player in the splitscreen mod.

git-svn-id: https://svn.eduke32.com/eduke32@2938 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-20 21:22:41 +00:00
helixhorned 1f858e8fc7 fake multi: don't display name when aiming at opponents.
git-svn-id: https://svn.eduke32.com/eduke32@2936 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 13:02:43 +00:00
helixhorned dc3a523eed Fake multi: fix display of item percentage and on/off states.
git-svn-id: https://svn.eduke32.com/eduke32@2935 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 13:02:37 +00:00
helixhorned 5e6642df2a Display the firsts-when-shrunk hud-weaponscaled, tweak for fake multi.
git-svn-id: https://svn.eduke32.com/eduke32@2934 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 13:01:30 +00:00
helixhorned 1ac7dd16be Make the scuba HUD be affected by hud_weaponscale, tweak for fake multi.
git-svn-id: https://svn.eduke32.com/eduke32@2933 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 13:01:24 +00:00
helixhorned 04ff274f77 Display the nukebutton punching fist with viewport clipping bounds.
Using rotatesprite with bit 8 clear (scale to viewport) but using
fullscreen clipping bounds is never what we want.  Also, tweak for
fake multi.

git-svn-id: https://svn.eduke32.com/eduke32@2932 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 13:00:19 +00:00
helixhorned 5806582805 Fake multi: draw the HUD weapons and status bar with the proper aspect.
This uses the new rotatesprite bit introduced earlier.  Also, allow the
HUD-less screen size.

git-svn-id: https://svn.eduke32.com/eduke32@2931 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 13:00:08 +00:00
helixhorned eca0959740 player.c: In G_DrawTileScaled, lose bit 1024 (prior to r1658, bit 256).
I checked all direct and transitive uses of that function and am fairly
confident that it is never used.

git-svn-id: https://svn.eduke32.com/eduke32@2930 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:59:03 +00:00
helixhorned 99160ede88 Introduce additional rotatesprite bit for internal use and mask ext. ones from CON.
ROTATESPRITE_MAX is moved to build.h and all orientation bits from CON commands
using rotatesprite are ANDed with (ROTATESPRITE_MAX-1).  Some of the functions
use ROTATESPRITE_MAX for different internal purposes, which will not be exposed
to CON now (a good thing).  Also, dorotspr_handle_bit2 is made clearer.

git-svn-id: https://svn.eduke32.com/eduke32@2929 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:57:57 +00:00
helixhorned 88eb1fac78 Clean up a couple of rotatesprite uses.
The black translucent background underneath the user map list will now
be drawn with a shade 32 tile 0 instead of tile BLANK, since I've seen
the latter being replaced in some mod. Also, it will look the same
regardless of screen aspect.

git-svn-id: https://svn.eduke32.com/eduke32@2928 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:56:51 +00:00
helixhorned d83de40608 Always draw the full original status bar fully instead of in patches.
It seems like I broke the blitty/patchy way of drawing it with one of
the last commits.

git-svn-id: https://svn.eduke32.com/eduke32@2926 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:55:35 +00:00
helixhorned ea74aad3a6 Some g_netServer || g_netServer --> g_netServer.
git-svn-id: https://svn.eduke32.com/eduke32@2925 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:54:30 +00:00
helixhorned 9caf442177 In places where fullscreen tiles are drawn (logo etc.), use clearallviews().
This really fixes clearing the borders to the left and right with widescreen
and hud_bgstretch=0.  Also, it seems to fix glitches when the "screen size"
is small (ud.screen_size is large).

git-svn-id: https://svn.eduke32.com/eduke32@2924 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:53:24 +00:00
helixhorned e9095c8470 Lunatic: rotatesprite+test, player access, misc.
git-svn-id: https://svn.eduke32.com/eduke32@2923 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:52:18 +00:00
helixhorned e014246d82 player.c: fix a check of md_tilehasmodel return value against >0 (should be >=0)
git-svn-id: https://svn.eduke32.com/eduke32@2920 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:50:42 +00:00