Commit Graph

2049 Commits

Author SHA1 Message Date
helixhorned ef7e057fd9 Make demos be named edemoXXX.edm, XXX ranging from 000 to 999.
Also, don't stop playback cycling at the 10th demo and show the demo
number when beginning to record one.

git-svn-id: https://svn.eduke32.com/eduke32@3003 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:28 +00:00
helixhorned a1aac0480b Fix entering the game from within a demo, but don't enable it.
git-svn-id: https://svn.eduke32.com/eduke32@3002 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:26 +00:00
helixhorned 312609d9ab demo.c: minor cleanup; comment the G_PlaybackDemo() a little.
git-svn-id: https://svn.eduke32.com/eduke32@3001 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:22 +00:00
helixhorned 7305fbbae9 Add macro CON_ERRPRINTF(Fmt, ...) and use that everywhere.
git-svn-id: https://svn.eduke32.com/eduke32@3000 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:47 +00:00
helixhorned 1729f8fa38 Factor out some repeated code into G_{Load,Save}PlayerMaybeMulti.
This currently says that MP saving/loading isn't supported, but doesn't
really work correctly.  Also, properly bound-check the immediate argument
to CON's 'save' command and one more ... -> G_HandleAsync().

git-svn-id: https://svn.eduke32.com/eduke32@2999 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:43 +00:00
helixhorned 0665d961d2 Use Bstrncpyz in 1 place; fix displaying err msg if write-opening savegame fails
git-svn-id: https://svn.eduke32.com/eduke32@2998 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:40 +00:00
helixhorned bb5d3496ee Factor out snprintf'ing a maybe-modDir'd file name into macro G_ModDirSnprintf().
... and use it in three places. In two of these uses,
1) CON {read,write}arrayfromfile and
2) G_SavePlayer,
display an error message if the file name such generated is too long.

In the CON commands of 1), also error out if the file couldn't be opened.

git-svn-id: https://svn.eduke32.com/eduke32@2997 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:37 +00:00
helixhorned e417274c1e Move G_HandleAsync() into game.h as 'static inline' and use everywhere else.
git-svn-id: https://svn.eduke32.com/eduke32@2996 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:34 +00:00
helixhorned 9311432cbf Fix crash when recording demo, stooping it, going to title screen, and exiting.
A macro MAYBE_FCLOSE_AND_NULL(fileptr) is introduced in compat.h that does
what it says.

git-svn-id: https://svn.eduke32.com/eduke32@2995 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:31 +00:00
helixhorned 667de29e01 Demo: rename some functions for new-style conventions, functionize one marco...
git-svn-id: https://svn.eduke32.com/eduke32@2994 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:26 +00:00
terminx a0d993c900 Rename a couple functions local to actors.c, remove IFHITSECT macro. This is mostly a test commit to make sure our CIA.vc script is properly updated now.
git-svn-id: https://svn.eduke32.com/eduke32@2993 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:30:32 +00:00
helixhorned dd681886c3 Add lunatic/test/tables.lua, which was used to compare the calc'd sin/atan values.
git-svn-id: https://svn.eduke32.com/eduke32@2989 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:09:49 +00:00
helixhorned 52bb35361b Some [U]INT_MAX --> [U]INT32_MAX.
git-svn-id: https://svn.eduke32.com/eduke32@2986 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:06:30 +00:00
helixhorned 7f74880c96 Move #include <math.h> from polymer.h to polymer.c.
git-svn-id: https://svn.eduke32.com/eduke32@2985 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:05:23 +00:00
helixhorned 6fe5eb2863 Clean up A_FindPlayer(), constify some function args, some 0x7fffffff->INT32_MAX
git-svn-id: https://svn.eduke32.com/eduke32@2984 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:04:16 +00:00
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
helixhorned 6253113476 Clean up player.c's weapon display code (no functional changes).
git-svn-id: https://svn.eduke32.com/eduke32@2917 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:47:55 +00:00
helixhorned a5d68d46f0 Redraw background when ud.screen_size >= 8, unconditional on ud.statusbarscale.
Classic HUD now has correct aspect in widescreen modes, so with the full status
bar, there may be patches of free room left to the left and right.

git-svn-id: https://svn.eduke32.com/eduke32@2914 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:58 +00:00
helixhorned 786df72c6d In setaspect_new, determine the aspect with {x,y}dim again except for showview.
setaspect(), which is called by setaspect_new, already uses the *dimen variables,
so it's the same thing done twice.  Now, a change from the original full status
bar to the original mini status bar keeps the horizontal FOV again and only
bumps the view a little higher, as with the classic aspect determination.

git-svn-id: https://svn.eduke32.com/eduke32@2913 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:56 +00:00
helixhorned 008c93636c Clear the screen first in some non-in-game places, also in classic.
Compare with revision 2584.

git-svn-id: https://svn.eduke32.com/eduke32@2912 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:52 +00:00
helixhorned ad88878328 fake multi: draw weapons for both players.
git-svn-id: https://svn.eduke32.com/eduke32@2905 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:33 +00:00
helixhorned d60bffd35d In fake multi, never draw the screen rotated.
git-svn-id: https://svn.eduke32.com/eduke32@2903 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:28 +00:00
helixhorned 4fc1376fcb Splitscreen hack: draw status bar for both players.
git-svn-id: https://svn.eduke32.com/eduke32@2902 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:26 +00:00
helixhorned 400a1ba895 Always draw the frag bar in fake multi.
git-svn-id: https://svn.eduke32.com/eduke32@2901 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:23 +00:00
helixhorned 4076f5a1c4 In fake multi-mode, always draw the original mini status bar.
git-svn-id: https://svn.eduke32.com/eduke32@2900 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:21 +00:00
helixhorned c6f30669b1 Fake multi-mode: better -q* messages, make surplus APLAYER sprites invisible.
Also, change type of g_numPlayerSprites (global and mapstate) from inconsistent
uint8_t/char to int8_t.

git-svn-id: https://svn.eduke32.com/eduke32@2897 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:13 +00:00
helixhorned 2913ee5211 Clean up build.h and status bar drawing code in game.c.
git-svn-id: https://svn.eduke32.com/eduke32@2896 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:08 +00:00
helixhorned 32d721a055 CON: in showview*, use new aspect determination if r_usenewaspect is 1.
git-svn-id: https://svn.eduke32.com/eduke32@2895 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:18 +00:00
helixhorned 6aad2578a3 Rewrite the EVENT_ANIMATESPRITES loop (G_DoEventAnimSprites calls) for clarity.
git-svn-id: https://svn.eduke32.com/eduke32@2893 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:13 +00:00
helixhorned 0aec79ef8f game.c: factor out 2 inst. of dup. code into G_DoEventAnimSprites().
git-svn-id: https://svn.eduke32.com/eduke32@2892 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:11 +00:00
helixhorned 27ebcc41b4 Hack for fake multimode/splitscreen: also draw mirrors from showview*.
See the source for why this hack is ugly.

git-svn-id: https://svn.eduke32.com/eduke32@2891 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:08 +00:00
helixhorned cb812625a7 CON: in fake multi-mode, play 'globalsound' even if player index isn't screenpeek.
This makes sounds like DUKE_GET (item pickup) be heard for the second player
in the splitscreen mod, too.

git-svn-id: https://svn.eduke32.com/eduke32@2890 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:06 +00:00
helixhorned d1e9116c23 If a value of 1 is returned from EVENT_DISPLAYROOMS, don't draw them.
This includes mirrors, rooms and masks.  Any value other than 0 or 1
that is returned is considered an error (reserved for future use).

git-svn-id: https://svn.eduke32.com/eduke32@2889 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:03 +00:00
helixhorned 0cac20c2d6 Fix mirrors in Polymost.
git-svn-id: https://svn.eduke32.com/eduke32@2888 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:01 +00:00
helixhorned e420dc84bd Clean up G_MoveFX() a little.
git-svn-id: https://svn.eduke32.com/eduke32@2887 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:59 +00:00
helixhorned b93deba4c2 Splitscreen mod hacks: handle screen tinting from both players.
Of course, it still affects the whole screen.  Handles pain and lizard spit.

git-svn-id: https://svn.eduke32.com/eduke32@2886 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:56 +00:00
helixhorned 8039db5ff2 Hacks for the splitscreen mod: play sounds from both players.
The sound distance is the minimum of the two.  Both point sources as well
as MUSICANDSFX ambient sound is handled.

git-svn-id: https://svn.eduke32.com/eduke32@2885 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:53 +00:00
helixhorned af05fe18be sounds.c: Factor out duplicate code into S_CalcDistAndAng().
The two instances in S_PlaySound3D() and S_Update() were slightly
different as far as sequencing is concerned.  However, I think making
it the same has only benefits and may fix some popping sounds when
starting to play a sound and updating it with a different distance
value on the second buffer fill.

git-svn-id: https://svn.eduke32.com/eduke32@2884 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:51 +00:00
helixhorned 847c886c14 First round of sounds.c cleanup, no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@2883 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:48 +00:00
helixhorned 458b202ce3 Also draw TROR from showview* commands.
git-svn-id: https://svn.eduke32.com/eduke32@2882 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:46 +00:00
helixhorned 21a9cb3581 Rename args in G_DoSpriteAnimations(), for easier grepping.
git-svn-id: https://svn.eduke32.com/eduke32@2881 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:40 +00:00
helixhorned 2b2be071d4 High-level TROR drawing: clean up how things are passed around.
git-svn-id: https://svn.eduke32.com/eduke32@2880 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:37 +00:00
helixhorned 8eafee0636 Resurrect fake multiplayer mode a little (no bots).
Just enough so that Bloodclaw's splitscreen mod can be played.

git-svn-id: https://svn.eduke32.com/eduke32@2879 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:32 +00:00
helixhorned a19dcdc48e Correct premap.c's clearfrags().
The story: Duke3D 1.5 source had "short frags[MAXPLAYERS][MAXPLAYERS]" and
"clearbufbyte(&frags[0][0],(MAXPLAYERS*MAXPLAYERS)<<1,0L);". In r1625,
g_player[].frags[MAXPLAYERS] was changed from an array of int32_t to one of
uint8_t, but the clearing code
("clearbufbyte(&g_player[i].frags[0],MAXPLAYERS<<1,0L);") stayed. In r2201, I
rewrote clearfrags() under the assumption that it really is supposed to clear
stuff beyond .frags[].
The moral:
1. Write clean code.
2. Use sizeof.
3. Write clean code!

git-svn-id: https://svn.eduke32.com/eduke32@2878 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:28 +00:00
helixhorned 4dca439d8f Text-repl.: hitinfo variables -> hit, hit{sprite,sect,wall} members -> no "hit"
This makes the code rather more readable in some places.  Unlike the two
preceding commits, this one is actually purely textual replacement.

git-svn-id: https://svn.eduke32.com/eduke32@2877 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:12:01 +00:00
helixhorned 971d816235 Mass text replacement g_player[p].ps --> ps, part 2 (harder)
Functions affected are G_Move* in actors.c and A_Shoot in player.c.
Here, the p variable had function scope, now it's redeclared in shorter
blocks. I'm still relatively sure that no observable behavior was changed,
though not as sure as in part 1.  Also, some dead assignments and the like
are eliminated.

git-svn-id: https://svn.eduke32.com/eduke32@2876 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:11:56 +00:00
helixhorned e1d6fe534d Mass text replacement g_player[p].ps --> ps, part 1 (the easy one).
The p variable (sometimes named differently) has short scope in all cases,
so I'm almost sure that the replacements amount to an identity transformation.

git-svn-id: https://svn.eduke32.com/eduke32@2875 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:11:53 +00:00
helixhorned 689788c65b actors.c: factor out 4 instances of id. code (up to args) into nudge_player().
git-svn-id: https://svn.eduke32.com/eduke32@2874 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:11:49 +00:00
helixhorned 5084d08249 CON: factor out addammo/addweapon{,var} common code, harden addweaponvar...
... against invalid weapon indices and arguments accessed from arrays/structs.

git-svn-id: https://svn.eduke32.com/eduke32@2873 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:11:47 +00:00
helixhorned 26df580dac Lunatic: rewrite bitar to use arrays of int32, more convenience ops.
git-svn-id: https://svn.eduke32.com/eduke32@2872 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:11:43 +00:00
helixhorned 761c2d1c84 Lunatic: reflect the preceding rename in the sources.
git-svn-id: https://svn.eduke32.com/eduke32@2871 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-08 19:32:45 +00:00