Commit Graph

3010 Commits

Author SHA1 Message Date
helixhorned 08260dbf25 polymost.c: rewite widescreen bit code, part 2.
Use integer math; both args to setaspect are constant.

git-svn-id: https://svn.eduke32.com/eduke32@2910 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:46 +00:00
helixhorned 20ccab9022 Clean up classic's and Polymost's dorotatesprite functions (triv. changes only)
git-svn-id: https://svn.eduke32.com/eduke32@2909 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:44 +00:00
helixhorned 8ac85eef54 polymost.c: rewrite dorotatesprite's widescreen bit handling (256,512,1024).
Instead of setting and resetting the [xy]dim globals, use them as locals
in a block (shadowing the globals).  Also, do some common subexpression
elimination for clarity.

git-svn-id: https://svn.eduke32.com/eduke32@2908 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:41 +00:00
helixhorned 21ee6fadc0 splitscreen: use updatesector instead of *z.
When shrunk, the player position is below the floor for some weird reason.
Updatesectorz would set the sector to -1, and the view would not be drawn.

git-svn-id: https://svn.eduke32.com/eduke32@2907 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:38 +00:00
helixhorned 1e74199bde splitscreen: remove weapon item drawing code.
git-svn-id: https://svn.eduke32.com/eduke32@2906 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:36 +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 9d3d7bfe2f splitscreen: remove HUD drawing code, draw view from EVENT_DISPLAYROOMS.
git-svn-id: https://svn.eduke32.com/eduke32@2904 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:31 +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 fca10f420a splitscreen: update to modified version posted at the Duke4.net forums.
git-svn-id: https://svn.eduke32.com/eduke32@2899 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:18 +00:00
helixhorned 84c69b5327 Add original splitscreen mod by Bloodclaw for reference.
git-svn-id: https://svn.eduke32.com/eduke32@2898 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:16 +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 d6e0009ec0 engine: in setaspect_new, determine the aspect with {x,y}dimen instead of {x,y}dim.
That is, use the view boundries instead of the whole screen.

git-svn-id: https://svn.eduke32.com/eduke32@2894 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:26:16 +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
helixhorned 00e99b2207 Rename a certain file to appease Windows file systems.
git-svn-id: https://svn.eduke32.com/eduke32@2870 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-08 19:32:40 +00:00
helixhorned 7f4eb4f5c3 Lunatic: implement a couple more 1.5 commands.
git-svn-id: https://svn.eduke32.com/eduke32@2869 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-08 19:32:35 +00:00
helixhorned 8fa80701bb Fix tile CAMERA1+4 being not changed to a CAMERA1 on spawn.
git-svn-id: https://svn.eduke32.com/eduke32@2868 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-07 13:09:00 +00:00
helixhorned af626df86b Fix slimers not disappearing on dnmonsters cheat, display 2nd 'on' state.
git-svn-id: https://svn.eduke32.com/eduke32@2867 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-07 13:08:57 +00:00
helixhorned 8f61b72ca2 Mapster32: add "extend all highlighted sectors" func to 'F menu via a.m32.
git-svn-id: https://svn.eduke32.com/eduke32@2866 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-06 20:00:35 +00:00
helixhorned 936ef3424b Clean up game.c and actors.c.
git-svn-id: https://svn.eduke32.com/eduke32@2865 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-06 20:00:31 +00:00
helixhorned f3970f9ac7 Lunatic: clean up handing of ac/mv internally, add control module.
git-svn-id: https://svn.eduke32.com/eduke32@2864 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-06 20:00:29 +00:00
helixhorned b983ec7b49 Lunatic: cleanup
git-svn-id: https://svn.eduke32.com/eduke32@2863 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-06 20:00:23 +00:00
helixhorned f4c7e3f77e Lunatic: 'bitar': rewrite ops for colon syntax, serialization, set ops.
git-svn-id: https://svn.eduke32.com/eduke32@2862 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:44 +00:00
helixhorned 569f0dbe7c sdlayer.c: Add high-resolution timer for OS X, using mach_absolute_time().
git-svn-id: https://svn.eduke32.com/eduke32@2861 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:41 +00:00