Commit Graph

3043 Commits

Author SHA1 Message Date
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
helixhorned b7cfd2fe2c Lunatic: fix build on OS X, pass LUNATIC define to build/ sources.
git-svn-id: https://svn.eduke32.com/eduke32@2860 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:38 +00:00
helixhorned 86a3603edd Lunatic: fix hex literal parsing on Windows, add two comments.
git-svn-id: https://svn.eduke32.com/eduke32@2859 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:35 +00:00
helixhorned a00f411b3b Lunatic: add 'stat' module for running statistics.
Also, rewrite the mapastats iterator and the LIZTROOP hitscan timing
in terms of that.

git-svn-id: https://svn.eduke32.com/eduke32@2858 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:32 +00:00
helixhorned fdfcca557b Lunatic: add 'randgen' module, implementing an encapsulated JKISS PRNG.
Also fix error handling path in our_require(), i.e. when loadstring fails.

git-svn-id: https://svn.eduke32.com/eduke32@2857 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:28 +00:00
helixhorned e7d3dcba78 gethitickms(): replace division by multiplication.
git-svn-id: https://svn.eduke32.com/eduke32@2856 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:25 +00:00
helixhorned 69365f2a0b Lunatic: add 'geom' module, sporting a vec2 type and a general 'intersect' func.
git-svn-id: https://svn.eduke32.com/eduke32@2855 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:21 +00:00
helixhorned defe79216d Lunatic: update DukePlayer_t, fix build.
git-svn-id: https://svn.eduke32.com/eduke32@2854 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:17 +00:00
helixhorned f1ffd6d90a Factor out 5 instances of functionally identical code into G_ClearCameraView().
git-svn-id: https://svn.eduke32.com/eduke32@2853 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:13 +00:00
helixhorned 19d426ba02 OSX build: mighty tweak osxbuild.sh and link to LibPNG from Fink on x86_64.
The build script now has two more presets: helix and installtools
(which was previously attempted after the build; untested). Also,
 - when detecting git, run commands such that the SVN repo isn't accessed
 - package kextract, kgroup and arttool into tools/ in the zip
 - try to exit on failure in some places, though that doesn't seem to work

git-svn-id: https://svn.eduke32.com/eduke32@2852 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-29 23:35:12 +00:00
helixhorned b1f98d241e osxbuild.sh: factor out building commands and exit 1 on failure
git-svn-id: https://svn.eduke32.com/eduke32@2851 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-29 23:35:09 +00:00
helixhorned 109457994e Classic: on x86 GCC asm builds, fix crash with floor sprites of (x or y) size 2.
The idiv instruction also signals an FPE when the resulting *signed* quotient
overflows, so we simply use div instead.

git-svn-id: https://svn.eduke32.com/eduke32@2850 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-29 12:46:56 +00:00
helixhorned 0e6c83bb1b Lunatic: build fix on Windows and translator fix with 32-bit archs?
erratum in r2844 commit message:
ydim vs. bytesperline --> xdim vs. bytesperline

git-svn-id: https://svn.eduke32.com/eduke32@2849 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-25 18:56:18 +00:00
helixhorned 568f213de8 Add gethitickms() to the Windows layer.
git-svn-id: https://svn.eduke32.com/eduke32@2848 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-25 18:56:15 +00:00
helixhorned 25e25b71fd Make DukePlayer_t's transporter_hold an int16_t again.
This was narrowed to int8_t in r1625, breaking CON code that wanted
to lock the player for a longer time than 127 game tics.

git-svn-id: https://svn.eduke32.com/eduke32@2847 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-25 18:56:11 +00:00
helixhorned d20bb4e3a1 Prevent integer div-by-0 (SIGFPE) when drawing console background with void tiles.
The tiles used are BIGHOLE (1141) and VIEWBORDER (3250).  Ideally we'd draw the
console background using something specially-coded instead of rotatesprite if
it's fully black anyway.

git-svn-id: https://svn.eduke32.com/eduke32@2846 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-22 11:10:08 +00:00
helixhorned f39c4306ec Fix SHOW MAP ON/OFF message in the game.
git-svn-id: https://svn.eduke32.com/eduke32@2845 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:59 +00:00
helixhorned 49ab0eb6e9 PNG screenshots: fix oob read of malloc'd mem on Windows.
These could manifest themselves as garbage lines on the bottom and
happened because of the ydim vs. bytesperline discrepancy again.

git-svn-id: https://svn.eduke32.com/eduke32@2844 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:56 +00:00
helixhorned 2a2f56f510 Add custom-built lean zlib and libpng and enable PNG screenshots on Windows.
Instructions on how I built the libs are in Windows/src/minipng.dfa.

git-svn-id: https://svn.eduke32.com/eduke32@2843 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:53 +00:00
helixhorned b47c18518f Lunatic: time every event and actor call and print summary at game exit.
git-svn-id: https://svn.eduke32.com/eduke32@2842 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:44 +00:00
helixhorned 528ccbca4a Lunatic: add "bit array" helper module, rewrite the bit test in terms of that.
git-svn-id: https://svn.eduke32.com/eduke32@2841 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:40 +00:00
helixhorned 3c5e36feb4 Lunatic: protect user modules from tampering, too.
git-svn-id: https://svn.eduke32.com/eduke32@2840 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:37 +00:00
helixhorned ee9991adbd Lunatic: more bitop profiling; make undeclared-var reads forbidden in modules
git-svn-id: https://svn.eduke32.com/eduke32@2839 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:34 +00:00
helixhorned 1ffab1bf1a Lunatic: override 'error' so that a string is always returned to C.
git-svn-id: https://svn.eduke32.com/eduke32@2838 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:31 +00:00
helixhorned 55d474990f Lunatic: module(), require() for custom modules, bit op test from LJ homepage.
git-svn-id: https://svn.eduke32.com/eduke32@2837 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:28 +00:00
helixhorned a464527f8f In game.c's kopen4loadfrommod, use snprintf.
git-svn-id: https://svn.eduke32.com/eduke32@2836 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:24 +00:00
helixhorned a17cdd9d95 Polymer: fix underwalls being not animated (introduced in r2823).
git-svn-id: https://svn.eduke32.com/eduke32@2835 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-15 09:23:58 +00:00
helixhorned ba2a0c602e VP8: clamp GL texture to edge if possible, preventing potential stray lines
git-svn-id: https://svn.eduke32.com/eduke32@2834 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:21:00 +00:00
helixhorned f42ab0044f VP8: don't call I_ClearAllInput() before idle loop.
If input is cleared before, it can become impossible to cancel the video
when decoding and displaying a frame takes longer than a frame.

git-svn-id: https://svn.eduke32.com/eduke32@2833 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:58 +00:00
helixhorned 5802857eb7 VP8: collect times while playing the video and print a summary to the log afterwards.
git-svn-id: https://svn.eduke32.com/eduke32@2832 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:55 +00:00
helixhorned 0cb2d3e528 Update LibVPX prebuilt library and headers to git commit 3eb4143fc3381497128d.
The library was built with GCC 4.6.1 and configured like
 ./configure --disable-vp8-encoder --disable-multithread --disable-spatial-resampling

On the aforementioned AMD system, this reduces the mean time for decoding a frame
from 18.2 to 15.4 ms, so IMO it's worth the somewhat hefty addition of 430 Kb.

git-svn-id: https://svn.eduke32.com/eduke32@2831 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:52 +00:00
helixhorned 43fe858652 VP8: unroll 3 planes -> packed conversion loop.
On an AMD Phenom II X4 system with generic memory modules, this brings down
the mean time for this conversion from 16.5 to 10.5 ms.
(GCC 4.6.1, optimized build)

git-svn-id: https://svn.eduke32.com/eduke32@2830 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:43 +00:00
helixhorned cd1401fb52 Lunatic: extend must-fail tests with a check for the expected error messages.
git-svn-id: https://svn.eduke32.com/eduke32@2829 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:40 +00:00
helixhorned 91b7a10bd0 Lunatic: overridden 'require', currently for base modules only.
git-svn-id: https://svn.eduke32.com/eduke32@2828 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:38 +00:00
helixhorned b86dbc0818 Lunatic: make baselib functions used in defs.c local, be more disciplined with stack.
Also, print a backtrace if we return to C with an error.

git-svn-id: https://svn.eduke32.com/eduke32@2827 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:35 +00:00
helixhorned 420e61d0f8 a.m32: in collect_*_sectors from the 'F menu, start query with sector under mouse
git-svn-id: https://svn.eduke32.com/eduke32@2826 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:31 +00:00
Plagman 7e16357c68 Revert hightile factoring for now.
git-svn-id: https://svn.eduke32.com/eduke32@2825 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-11 04:39:01 +00:00
helixhorned 0482d67894 This should fix the "assignment discards 'const' qualifier" warning in music.c.
git-svn-id: https://svn.eduke32.com/eduke32@2824 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-09 19:00:23 +00:00
helixhorned 9000e23683 Polymer: simplify some code while I'm at it (equivalence tranformations only)
git-svn-id: https://svn.eduke32.com/eduke32@2823 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-09 19:00:21 +00:00
helixhorned d66856eeea Polymer: bring the ypanning correction for non-pow2 walls closer to Pmost's, pt2
This changes a constant inside the panning calculation from 256 to 255 (making
e.g. panning 255 and 0 the same in the "San Andreas fault" sign in E1L5) and
uses the correct reference wall for the "do panning correction?" conditional.
Now, the problematic walls should look the same as in Polymost.

git-svn-id: https://svn.eduke32.com/eduke32@2822 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-09 19:00:17 +00:00
helixhorned fe1a5fe2a6 Polymer: bring the ypanning correction for non-pow2 walls closer to Pmost's, pt1
This makes the corrections conditional on where they appear in (under-, over-,
white or mask wall).

git-svn-id: https://svn.eduke32.com/eduke32@2821 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-09 19:00:14 +00:00
helixhorned 6bafc7d176 a.m32: add some commented out example code for the screenshot functionality.
git-svn-id: https://svn.eduke32.com/eduke32@2820 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:49:31 +00:00
helixhorned 98f7be1ace Classic: draw walls with non-pow2 ysizes in the old fashion for the time being.
I'm willing to make this one concession to correctness in the name of backward-
compatibility.  I think that one reason why this has never cause a crash is that
tiles in BUILD are allocated in Ken's big allocache buffer, so oob accesses were
dampened by that (though they hit uninitialized data).

git-svn-id: https://svn.eduke32.com/eduke32@2819 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:25 +00:00
helixhorned e02843b133 m32script: EVENT_DRAW3DSCREEN, screenshot functonality.
The event is run after drawing the scene, but before the overlays. To
make a screenshot from a script, set DOSCRSHOT to non-zero. It will then
be scheduled to run once after the drawing but before the above-mentioned
event.  The screenshots will be called mcapXXXX.{png,tga}.

git-svn-id: https://svn.eduke32.com/eduke32@2818 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:23 +00:00
helixhorned f6c1c125ac Comment out printext256's GL mode fallback code.
This would only hit when polymost_printext256 erred out (mem alloc failure,
glGenTextures failure), i.e. "almost never".

Also, tweak a bound check in polymost_printext256.

git-svn-id: https://svn.eduke32.com/eduke32@2817 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:19 +00:00
helixhorned e71c7cc2a8 m32script: if printext256's <col> arg is negative, use editorcolors[-<col>].
The editor colors are the ones listed on page 9 of the Mapster32 built-in help.

git-svn-id: https://svn.eduke32.com/eduke32@2816 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:16 +00:00
helixhorned 20da833bdb Polymost: factor out y panning coefficient calculation code.
git-svn-id: https://svn.eduke32.com/eduke32@2815 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:14 +00:00
helixhorned 3697842bc5 Add ART loader for the LuaJIT BUILD struct loader module, 2 more examples.
The map iterator now has init/finish capability, making it possible to
write scripts that aggregate data over multiple map files.  One such example
calculates some statistics, the other loads art metadata and looks for
red walls with non-pow2 ysize tiles.

git-svn-id: https://svn.eduke32.com/eduke32@2814 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:11 +00:00
helixhorned 6b0f6176f6 Add LuaJIT-based BUILD map loader and batch processing script + example.
git-svn-id: https://svn.eduke32.com/eduke32@2813 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:06 +00:00
terminx 886f2e5a26 Update our prebuilt MinGW libogg/libvorbis/libvorbisfile to the newest versions, courtesy of forum user LeoD
git-svn-id: https://svn.eduke32.com/eduke32@2812 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 18:40:54 +00:00
helixhorned dfdcce090b Polymer: factor out wall y panning coefficient calculation.
Non-pow2 wall/mask drawing in classic introduced cases where walls are
drawn "incorrectly" because they were constructed with the old behavior
in mind.  Polymer appears to "correct" for it partially, but doesn't cover
all cases.  Specifically, now we have:
 - E1L1 first inside secret room (5000, 50000): Polymer draws like Duke 1.5,
   classic now draws with an offset.
 - E3L2 near the vault (-20000, 25000): both classic and Polymer draw with
   offsets compared to Duke 1.5, but they're different!

This means that more research is needed into what makes these two cases
diverge, even though both have the same root cause.

!!! Also, mappers should abstain from using non-power-of two textures on
    walls until this issue is resolved in a satisfactory fashion !!!

git-svn-id: https://svn.eduke32.com/eduke32@2811 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 15:36:50 +00:00
helixhorned 6ed9241f0a Classic: fix glitches where stuff would be drawn transiently on sect change.
This was introduced with r2771, which fixed e.g. AMC TC city_si's mirrors,
but instructed the base drawrooms inside yax_drawrooms to not correct the
passed sectnum.  Therefore, stuff would get drawn wrongly when passing
sector boundaries, like from the platform to the rails in trueror1.map.

git-svn-id: https://svn.eduke32.com/eduke32@2810 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 15:36:46 +00:00
helixhorned eae25756a8 Classic: fix drawing mirrors, introduced by nonpow2-ysize wall/mask drawing.
Some more drawing glitches remain.

git-svn-id: https://svn.eduke32.com/eduke32@2809 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 14:16:31 +00:00
helixhorned 39e944dffe Add description for 'remap' to mapster32.cfg, add 'setstartpos' to a.m32.
The latter is commented out, since it has to be *compiled* with
script_expertmode enabled.

git-svn-id: https://svn.eduke32.com/eduke32@2808 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 11:27:52 +00:00
helixhorned caa36c9d77 Classic: hook up non-power-of-two ysize wall/mask drawing in asm builds, too.
git-svn-id: https://svn.eduke32.com/eduke32@2807 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 11:27:49 +00:00
helixhorned 6c4c4fed15 Classic: add {,m,t}vlineasm1nonpow2, currently unreferenced from high-level drawing.
git-svn-id: https://svn.eduke32.com/eduke32@2806 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 11:27:46 +00:00
helixhorned 5a96b4e572 Classic-noasm: fix drawing of walls and maskwalls with non-pow2 y size tiles.
Related to that, it looks like out-of-bounds accesses when drawing such walls/
maskwalls or *sprites* are fixed, too.  Sprites still show a stray lines on some
occasions, but Valgrind doesn't complain then.

git-svn-id: https://svn.eduke32.com/eduke32@2805 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-06 11:26:24 +00:00
hendricks266 51331e11a0 Wii: Minor adjustments to the joystick defaults for the Classic Controller.
git-svn-id: https://svn.eduke32.com/eduke32@2804 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-05 17:55:44 +00:00
hendricks266 acbfa9ad05 Fix disabling EVENT_DISPLAYCROSSHAIR by setting RETURN to 1. SECTOREFFECTOR is not a useful crosshair.
git-svn-id: https://svn.eduke32.com/eduke32@2803 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-05 17:55:15 +00:00
hendricks266 00cb9caa2c Remove BUTTON(gamefunc_Jump) and KB_KeyPressed(sc_Space) from AdvanceTrigger so you can type spaces in savegame names.
git-svn-id: https://svn.eduke32.com/eduke32@2802 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-05 17:53:27 +00:00
terminx 9a69b481cf Fix for "undefined reference to `clock_gettime'" linking error on some Linux systems
git-svn-id: https://svn.eduke32.com/eduke32@2801 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-05 17:43:58 +00:00
Plagman 5b887587f3 mdsprite: don't try to factor textures from fallback skins
git-svn-id: https://svn.eduke32.com/eduke32@2800 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-02 04:51:24 +00:00
Plagman 4055e446c0 hightile: enable the texture factoring code for all palettes
git-svn-id: https://svn.eduke32.com/eduke32@2799 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-02 04:24:04 +00:00
Plagman 5a8d61d479 Fix MinGW build.
git-svn-id: https://svn.eduke32.com/eduke32@2798 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-02 03:44:54 +00:00
helixhorned 57dbedf59d Makefile.common: add a couple of C warning flags.
Most notably, -Wdeclaration-after-statement.  This and -Wpointer-arith
give some warning on linux, but this is "harmless" as it's assumed that
we'll be always compiling with GCC or Clang there.

Also, erratum in the "Make ksqrt take uint32_t ..." commit:
 hypotenuse -> squared length of the hypotenuse

git-svn-id: https://svn.eduke32.com/eduke32@2797 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:35 +00:00
helixhorned bdedbc6f76 Constify various char* vars, parameters, etc. for more -Wwrite-strings cleanness
-Wwrite-strings is useful to detect code where string literals and e.g. alloc'd
strings are used side-by-side, potentially creating dangerous situations, or to
find uses of old, non-constified APIs.  However, enabling it would still flood
the log with too many warnings.  Also, GCC wrongly warns for initializations of
char arrays.

git-svn-id: https://svn.eduke32.com/eduke32@2796 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:33 +00:00
helixhorned 8a89c07261 editor: const char *scripthist -> char *, since it's alloc'd/freed
git-svn-id: https://svn.eduke32.com/eduke32@2795 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:25 +00:00
helixhorned 650d859a6f actors.c: factor out 4 almost identical code instances into proj_spawn_and_sound
Most differences are handled with function parameters, except that one instance
checked SpriteProjectile[i].spawns for being >0 instead of >=0.  The factored
function always checks for >=0.

git-svn-id: https://svn.eduke32.com/eduke32@2794 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:22 +00:00
helixhorned 35e4f19ceb Make nsqrtasm return int32_t (instead of uint32_t) when compiled with GCC/x86.
git-svn-id: https://svn.eduke32.com/eduke32@2793 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:20 +00:00
helixhorned 10de03aa7d Lunatic translator: a first codegen ansatz.
git-svn-id: https://svn.eduke32.com/eduke32@2792 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:17 +00:00
helixhorned 54721d7461 Make ksqrt take uint32_t, add helper function uint32_t uhypsq(int32_t,int32_t).
uhypsq calculates the hypotenuse using unsigned multiplication. This is
permissible since for arbitrary int32s a and b, the following holds in
two's complement arithmetic:
  (int32_t)((uint32_t)a * b) == (int32_t)((int64_t)a * b)
("Signed and unsigned multiplication is the same on the bit level.")

This fixes various overflows where wall lengths for walls of length > 46340
are calculated, but does not rid us of other overflows in the same vein
(usually dot products between vectors where one point is a wall vertex and
the other a position in a sector).

git-svn-id: https://svn.eduke32.com/eduke32@2791 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:14 +00:00
helixhorned 9431207c74 Lunatic: ksqrt, with timing and value test.
The latter shows that "int32_t ksqrt(int32_t)" also copes with values in the
range INT32_MIN..-1, effectively interpreting them as uint32_t (i.e. adding
2**32).  However, this should not be relied on from CON.

git-svn-id: https://svn.eduke32.com/eduke32@2790 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:07 +00:00
hendricks266 da4fcec462 Fix the overlooking of EDUKE.CON in the absence of DUKE3D.GRP caused by r2726. Also, tweak a few string literals' use of quotation marks.
git-svn-id: https://svn.eduke32.com/eduke32@2789 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-27 17:45:52 +00:00
helixhorned c001749dee Fix actors at action 0 executing the action C code protion in gameexec.c.
The bug was introduced with SAMESIZE_ACTOR_T enabling in r2208.
This fixes being unable to read the messages in A.Dream* by zykov eddy.

git-svn-id: https://svn.eduke32.com/eduke32@2788 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:50:04 +00:00
helixhorned 9dbf439f45 some trivial mapster tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2787 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:50:02 +00:00
helixhorned 2d324c97be Lunatic: safety tweaks, expose more stuff
Arrays inside structs must not be accessible, since they're not bound-checked
by the FFI. Therefore, we flatten them into repeated scalar fields and need
to write accessor functions later.

git-svn-id: https://svn.eduke32.com/eduke32@2786 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:49:59 +00:00
helixhorned 7f409f08bb When teleporting silently, also set g_player[].ps->bobposx/y to the new position
This fixes an integer overflow when a distance is calculated later.

git-svn-id: https://svn.eduke32.com/eduke32@2785 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:49:56 +00:00
helixhorned 3e4357c6a4 Integer Overflow Offensive continued: first round of -ftrapv - cleanness.
That is, "clang -ftrapv" builds don't abort almost immediately after entering
a level.

There are various classes of overflow bugs, needing different handling:
 - Some texture mapping code was written with signed integer wrapping semantics
   in mind.  In some places, we're able to get away with unsigned casts.
 - sometimes, we really need a wider range, like when calculating distances or
   dot products
 - negating INT_MIN.  Here, we cast to int64_t temporarily.  Note that if the
   result is 32-bit wide, no 64-bit code may actually need to be generated.
 - shifting into a signed integer's sign bit.  We cast to uint32 here.
 - in hitscan(), at the "abyss crash prevention code" comment, it's clearly
   the other code that is better...

This is not merely done for pedantry, but rather makes it easier to track down
overflow bugs having a real impact on the game.

git-svn-id: https://svn.eduke32.com/eduke32@2784 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:49:53 +00:00
helixhorned 221461f05d Fix a thinko in a comment (about commenting) in build/Makefile.
git-svn-id: https://svn.eduke32.com/eduke32@2783 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:49:50 +00:00
helixhorned b9dd289800 engine.c: factor out two instances of dup code into setup_globals_sprite1()
git-svn-id: https://svn.eduke32.com/eduke32@2782 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:49:48 +00:00
helixhorned fde3e99f06 premap.c: make P_RandomSpawnPoint more readable by factoring out g_player[snum].ps
git-svn-id: https://svn.eduke32.com/eduke32@2781 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:49:44 +00:00
helixhorned 2aee18ff9a Fix being unable to hit ENTER on VIDEO SETTINS -> RENDERER SETUP with classic.
git-svn-id: https://svn.eduke32.com/eduke32@2780 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-22 21:40:04 +00:00
helixhorned ff9cae033a Lunatic: various stuff
- hitscan & related types and constants
- profiling with gethitickms
- translator: eval the opening parts of block commands early
- fix getbunch

git-svn-id: https://svn.eduke32.com/eduke32@2779 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-22 21:40:01 +00:00
helixhorned bfd1700ceb SDL layer: tweak high-resolution timers for profiling, add gethitickms().
For SDL 1.2 and when building on linux, the code using
clock_gettime(CLOCK_MONOTINIC, ...) is taken over from SDL HG.
gethitickms() is a convenience function that return milliseconds as
doubles and isn't exposed in any header file, yet.

git-svn-id: https://svn.eduke32.com/eduke32@2778 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-22 21:39:57 +00:00
helixhorned ed5e5b5881 Add prototypical SDL 2.X support.
Doesn't work: indexed-color modes, gamma (at least for X11), mouse wheel,
special keys like ENTER or BACKSPACE in the OSD, probably more...

In build/Makefile.shared, we now have logic to autodetect an SDL2 installed
in /usr/local, however OS X and Wii builds follow other Makefile code paths,
it seems.  Note that the matching SDL2_mixer must be used then, too.
In source/jaudiolib/src/driver_sdl.c, change the #includes from <SDL/SDL_xxx.h>
to "SDL_xxx.h".  SDL wiki says this is the most portable way, hopefully this
doesn't break builds for anyone.

git-svn-id: https://svn.eduke32.com/eduke32@2777 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-22 21:39:53 +00:00
terminx ef32d9cb64 Fix a single usage of S_IREAD instead of our BS_IREAD compatibility version
git-svn-id: https://svn.eduke32.com/eduke32@2776 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-21 19:48:54 +00:00
terminx 4002492146 Fix useless "No error" message when loading palette.dat fails, change file casing in error message for failing to load tables.dat to reflect the filename actually passed to kopen4load().
git-svn-id: https://svn.eduke32.com/eduke32@2775 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-21 19:47:02 +00:00
helixhorned 13a2f97a72 Relative-aligned non-flipped ceiling/floor texture alignment ([;]+[ENTER])
Flipped reference ceilings/floors aren't handled correctly yet.

git-svn-id: https://svn.eduke32.com/eduke32@2774 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-20 20:55:03 +00:00
helixhorned d5dd5fec9d Mapster32: Fix tweaking TROR wall links when flipping sectors ([X], [Y]).
This was actually broken all the time except when ALL sectors were selected
(which was what I tested incidentally when I wrote the first "fix"). D'oh!

git-svn-id: https://svn.eduke32.com/eduke32@2773 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-20 20:54:59 +00:00
helixhorned 716ea1f3b2 Fix a drawing glitch with mirrors and TROR in classic.
git-svn-id: https://svn.eduke32.com/eduke32@2772 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-20 20:54:55 +00:00
terminx 1002ceb240 Wii: offset displayed quotes a bit from the top of the screen to deal with overscan
git-svn-id: https://svn.eduke32.com/eduke32@2771 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-20 20:03:51 +00:00
helixhorned 8a28b3ad80 Allow fogpal DEF command to fogify pal 0.
git-svn-id: https://svn.eduke32.com/eduke32@2770 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-18 20:09:03 +00:00
helixhorned d2e0909139 Add samples/r_usenewshading.map.
This is to the cvar of the same name as samples/aspect.map is to r_usenewaspect.

git-svn-id: https://svn.eduke32.com/eduke32@2769 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:53 +00:00
helixhorned 2875a45b68 polymost.c: make polymost_checkcoordinates() static
git-svn-id: https://svn.eduke32.com/eduke32@2768 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:51 +00:00
helixhorned d741df358d Mapster32: display zero-length walls as level-3 corruptions.
git-svn-id: https://svn.eduke32.com/eduke32@2767 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:48 +00:00
helixhorned 3975e34625 gamedef.c: some bound tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2766 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:46 +00:00
helixhorned cbb71c088a Lunatic translator: ai/move/action.
This exposes some problems in the default/in-the-wild CONs. As usual,
we'll have to retrofit sensible semantics :rolleyes:.

git-svn-id: https://svn.eduke32.com/eduke32@2765 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:43 +00:00
helixhorned 23e43886a8 Lunatic translator: define* et al
git-svn-id: https://svn.eduke32.com/eduke32@2764 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:41 +00:00
helixhorned 67dabd84f8 Lunatic t.: handle prefix-problematic commands for real, definelevelname, ...
git-svn-id: https://svn.eduke32.com/eduke32@2763 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:37 +00:00
helixhorned 5bdbd2eda5 Lunatic/LT: provide the predefined labels in con_lang, add "strict" from luajit.
The latter is only for development, since the embedded version already has a
undeclared-var-reference handling similar to that.  Also fix parm2memberpat.

git-svn-id: https://svn.eduke32.com/eduke32@2762 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:33 +00:00
helixhorned b30ac41147 Integer Overflow Offensive, First Act: rintersect, hitscan, neartag.
It's time to replace some int32s with 64-bit ints in core engine functions.
The problem is that for example, the dot product is taken between vectors that
may be the difference between two arbitrary points in a sector, so even if one
sticks to the "no blue walls" rule, that doesn't guarantee freedom from
overflows.

git-svn-id: https://svn.eduke32.com/eduke32@2761 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:39 +00:00
helixhorned 41921e728c Polymost: don't attempt to draw sprite with void tile, preventing div-by-0s later
git-svn-id: https://svn.eduke32.com/eduke32@2760 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:36 +00:00
helixhorned 84cb4fd6ca Mapster32: draw a wall blue if its squared length exceeds INT_MAX (not UINT_MAX)
git-svn-id: https://svn.eduke32.com/eduke32@2759 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:34 +00:00
helixhorned 4353170b47 Fix a div by zero in polymost_internal_nonparallaxed.
git-svn-id: https://svn.eduke32.com/eduke32@2758 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:31 +00:00
helixhorned 8d8196993b Mapster32: fix a div by zero when drawing tile info for void tile in 3D mode.
This was exposed by Clang with -ftrapv, which apparently also traps those.

git-svn-id: https://svn.eduke32.com/eduke32@2757 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:28 +00:00
helixhorned f2789ab90f Lunatic translator: fix dangling else and add a test file, tweak warnings
git-svn-id: https://svn.eduke32.com/eduke32@2756 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:26 +00:00
helixhorned ec56b8e2d9 build/Makefile: Always compile a-c.o with -O2 and without -fcatch-undefined-behavior
This is to not slow down the core drawing functions too much in debugging builds
and mimics the way things are on x86.

git-svn-id: https://svn.eduke32.com/eduke32@2755 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:23 +00:00
helixhorned ad908070a7 a.m32: new state "collect_ceilsky_sectors" collecting parallaxed ceilings.
git-svn-id: https://svn.eduke32.com/eduke32@2754 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:20 +00:00
helixhorned 88d7a77fdc Mapster32: disallow joining non-adjacent sectors when expert mode is disabled.
git-svn-id: https://svn.eduke32.com/eduke32@2753 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:15 +00:00
helixhorned d8721f743e Factor out r2726' kopen4load checks into testkopen, closing opened files.
git-svn-id: https://svn.eduke32.com/eduke32@2752 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-11 20:35:47 +00:00
helixhorned e57a8715fc CON: warn on out-of-range hex literals and ignored redefines with different values
git-svn-id: https://svn.eduke32.com/eduke32@2751 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:27 +00:00
helixhorned c3955f7462 CON parser/runtime: two bound tweaks, defer setting insptr in (load)actor.
git-svn-id: https://svn.eduke32.com/eduke32@2750 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:24 +00:00
helixhorned c2c8b00a78 Lunatic translator: define, include, fix "music" parsing, ...
git-svn-id: https://svn.eduke32.com/eduke32@2749 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:21 +00:00
helixhorned 5531888c8b Lunatic: take a stab at semantic actions; tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2748 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:18 +00:00
helixhorned 59df76f0b6 Lunatic: actors
git-svn-id: https://svn.eduke32.com/eduke32@2747 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:15 +00:00
helixhorned 90b169d8c8 Lunatic: in event interface, pass actor, player, dist.
git-svn-id: https://svn.eduke32.com/eduke32@2746 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:10 +00:00
helixhorned 0ac242293b gameexec.c: factor out stuff, make code more readable overall.
git-svn-id: https://svn.eduke32.com/eduke32@2745 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-07 17:38:01 +00:00
helixhorned 2ddd6df14a Classic: don't attempt drawing sprites with (cstat&48) == 48 that aren't voxels.
Bang! One more invalid internals exposure squashed. Maybe one day we'll be able
to call EDuke32 "stable"...

Actually the offending sprite IS drawn as face sprite with shade 32 and xrepeat
and yrepeat 255 for the convenience of the CON coder who will have to debug it.

git-svn-id: https://svn.eduke32.com/eduke32@2744 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-07 17:37:57 +00:00
terminx 169587b5b4 Fix MSVC build error caused by the use of a C99 feature (that should have been added to the compiler about 13 years ago)
git-svn-id: https://svn.eduke32.com/eduke32@2743 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-07 02:59:24 +00:00
helixhorned f9077dc9cd Silence "number greater than INT32_MAX converted to a negative one" warning.
Literals written out as if they were unsigned and having the highest-order
bit set are all too ubiquitous, like hitscan masks for example.

git-svn-id: https://svn.eduke32.com/eduke32@2742 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-06 22:03:35 +00:00
helixhorned 9e5696a486 TROR/classic: same fix as r2739, intersecting case.
git-svn-id: https://svn.eduke32.com/eduke32@2741 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-06 22:03:32 +00:00
helixhorned cf429d0e76 engine.c: cleanup / readability tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2740 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-05 22:21:26 +00:00
helixhorned 2fa7ccf9dd TROR/classic: fix a certain class of underdraw glitches.
Those were happening when wall drawing in an upper/lower layer "closed" too
much of the "curtain" (umost/dmost) for subsequent drawing in that portal.
Example: looking down the sewer manhole at the beginning of Retaliation will
now render without HOM.

git-svn-id: https://svn.eduke32.com/eduke32@2739 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-05 22:21:22 +00:00
terminx 9f40f84cbe This probably fixes the music breakage caused by r2727.
git-svn-id: https://svn.eduke32.com/eduke32@2738 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-04 22:01:45 +00:00
helixhorned 3fbf46ce3a net: do strtok on a duplicated string containing the address in Net_Connect().
Also,
 - don't strip const when passing the char ptr to it and a couple more
   instances in game.c
 - use g_netPort when -connect parameter doesn't have a port suffix (":XXXX"),
   so that e.g.
    eduke32 -port 1700 -connect localhost
   is the same as
    eduke32 -connect localhost:1700
   (-port must come before -connect, unfortunately.)

git-svn-id: https://svn.eduke32.com/eduke32@2737 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 19:20:41 +00:00
helixhorned 9b40534c8f net: second part of buffer overflow check correction.
This was supposed to go into the last commit, but I did
 git commit --amend
without adding the changes to the index. Now I'm too lazy to sort
things out.

git-svn-id: https://svn.eduke32.com/eduke32@2736 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 19:20:39 +00:00
helixhorned 18eba11657 net: correct packet buffer overflow checks.
The GAMESTATE one has to be carried out twice, first on the data from
xd3_encode_memory, and then with the compressed data (because it might have
increased in size, though this is very unlikely).  The MOVE check is
similar, though there, failure of the first check implies corrupt memory
(which is why we're Bassert'ing that condition).

Currently, the overflow on GAMESTATE sending happens when switching to a
different map.

git-svn-id: https://svn.eduke32.com/eduke32@2735 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 19:20:36 +00:00
helixhorned 8ffb35add0 net: remove (char *) casts where they amount to no-ops.
git-svn-id: https://svn.eduke32.com/eduke32@2734 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 19:20:34 +00:00
helixhorned 2df94e8bc7 Fix a "set but not used warning" in xdelta3.c, revert definition of XD3_ASSERT.
git-svn-id: https://svn.eduke32.com/eduke32@2733 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 19:20:32 +00:00
helixhorned 1404174584 Revert a change in xdelta3.c done in r2683.
git-svn-id: https://svn.eduke32.com/eduke32@2732 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 19:20:29 +00:00
helixhorned 56114a608d net: eliminate ptr->byte idx conversion of action/move/ai in t_data.
These are element indices for a while now.  Also eliminate some dead
code afterwards.

git-svn-id: https://svn.eduke32.com/eduke32@2731 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 19:20:26 +00:00
helixhorned 6fc99bcdf3 Bump BYTEVERSION, correct actor_t size on x64, add assert(sizeof(actor_t)==128).
r2727 made old savegames incompatible, as an array with MAXVOLUMES*MAXLEVELS
is saved in Gv_WriteSave().

git-svn-id: https://svn.eduke32.com/eduke32@2730 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 19:20:23 +00:00
hendricks266 3a3284e2a3 Prevent the reserved cheats from displaying a finished time and from clobbering personal map time records.
git-svn-id: https://svn.eduke32.com/eduke32@2729 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:12:44 +00:00
hendricks266 d3a3c74112 Massive menu input control revamp/cleanup/factor. (added: input.[ch])
New Wii control defaults for the Wii Remote + Nunchuk and the Classic Controller. This includes new code added just so that the Home key brings up the menu in-game, reducing the need for a USB keyboard.

On the technical side, raw joystick access (comparable to what is available for keyboard and mouse) is now present in jmact, on the game side. (added: joystick.[ch])

Using this new raw joystick access, I replaced tueidj's hack to map A and B to LMB/RMB and D-Pad Up/Down to the scrollwheel.

I made the menus more friendly to mouse and joystick browsing by adding and unifying checks and clears for various buttons and gamefuncs. In fact, the majority of the time spent on this commit was tracking down problems that appeared with the factoring and trying to understand the menu system and the way input checks are precariously executed.

In addition, "Press any key or button to continue" now truly means what it says.

As a result of incorporating proper raw access into control.c instead of it directly accessing the implementaiton, the program *may* no longer be affected by joystick input when it is out of focus. This follows the pattern set by the mouse, and I think this is a positive change.

A small bonus: In the classic/old keyboard preset, the key for Show_Console has been changed from '`' to 'C' because '`' is taken by Quick_Kick.

git-svn-id: https://svn.eduke32.com/eduke32@2728 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:11:22 +00:00
hendricks266 f9713011f4 Bump MAXLEVELS to 64, per user request.
git-svn-id: https://svn.eduke32.com/eduke32@2727 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:10:08 +00:00
hendricks266 67ed6945fd The handling for grp, con, and def filenames has been massively cleaned up and factored into common.c. A new header, common_game.h, was created because common.h was placed in build/include (see r2542) and we need a common header for things that strictly should not be in the engine. RTS file names were also improved but some of the patterned changes were already made in r2420, and they were not factored because they are strictly part of the game, not the editor.
NAM and Napalm can now share their con, def, and rts files if the one for their respective game is not present because the con and rts files are identical.

Also, decapitalize two string literals missed in r2540.

git-svn-id: https://svn.eduke32.com/eduke32@2726 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:09:33 +00:00
hendricks266 19d9d0a71e Incorporate some use of Bfflush(NULL) in hopes to alleviate Wii configuration saving concerns.
git-svn-id: https://svn.eduke32.com/eduke32@2725 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:08:27 +00:00
helixhorned 59fa419506 Lunatic: pack actor/move parameters into t_data, which is enlarged to 14 elements.
(LUNATIC build only.)
Also, a minor problem is identified.  sizeof(actor_t) is 124 on 64-bit platforms,
while the expected size is 128 bytes.  This needs to be corrected whenever the
next savegame version bump happens.

git-svn-id: https://svn.eduke32.com/eduke32@2724 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 15:46:08 +00:00
helixhorned 39261018b4 In G_GameExit, rename arg 't' to 'msg' for (slightly) easier grepping of t_data etc.
git-svn-id: https://svn.eduke32.com/eduke32@2723 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 15:46:05 +00:00
helixhorned b3a6b0a93b Lunatic: one const char * --> char *, since we alloc/free it.
git-svn-id: https://svn.eduke32.com/eduke32@2722 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 15:46:02 +00:00
helixhorned ae15643a73 Rename LUNATIC_ENABLE macro to just LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@2721 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 15:45:59 +00:00
terminx f3c009b146 Replace a couple uses of S_IREAD with our platform-aware BS_IREAD
git-svn-id: https://svn.eduke32.com/eduke32@2720 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-02 00:02:57 +00:00
terminx cbbaec7694 Replace a few "#ifdef GEKKO" statements added for the Wii port with "#ifdef HAVE_VORBIS" like they should have been in the first place. Allows jaudiolib to build without Ogg support on platforms other than the Wii if desired.
git-svn-id: https://svn.eduke32.com/eduke32@2719 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-02 00:01:36 +00:00
helixhorned b9c553624b For me (helixhorned), do SDL_WarpMouse even in debugging builds again.
This introduces a Makefile variable EDUKE32_MY_DEVELOPER_ID, which is
expected to come from the environment, so that minor disagreements/
preferences can be handled -- don't let it go overboard though! -- to keep
the working directory clean of stuff that one doesn't actually work on.

My ID is 805120924, i.e. "helix".

git-svn-id: https://svn.eduke32.com/eduke32@2718 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:27 +00:00
helixhorned 55bd1ecc34 M32 auto-aligner: calculate panning for non-firstwall-aligned ceilings/floors.
Also, print failure messages on some occasions.

git-svn-id: https://svn.eduke32.com/eduke32@2717 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:24 +00:00
helixhorned 520f84b569 Mapster32: keep the temp sector on some more occasions that don't delete them.
git-svn-id: https://svn.eduke32.com/eduke32@2716 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:22 +00:00
helixhorned df105128cb Mapster32: Part 1 of ceiling/floor auto-alignment functionality.
Usage is from 3D mode only.  When a sector (or wall) is committed to the
clipboard, it (or the wall's sector) is saved, and is subsequently used
when auto-aligning [;-ENTER] another sector's ceiling or floor against the
reference one's.  This temp. sector is reset on any structurally modifying
operation except setting first walls; also, aligning extended ceilings or
floors is impossible as they use .*xrepeat internally.

The auto-alignment does not change picnums (this can be accomplished with
the ['+ENTER] combination), but copies the orientation bits 2^{2..6} to the
alignee.  Afterwards, if the reference is relative-aligned, it tweaks them,
so that every case where the two firstwalls are either parallel or perpendi-
cular is handled correctly.

It does not yet calculate the panning values.

git-svn-id: https://svn.eduke32.com/eduke32@2715 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:19 +00:00
helixhorned d1f9cb230c Throw a commented #define DEBUG_TEXTURE_NAMES into glbuild.h.
This is so that people know where to enable it. One day, all these
debugging switches ought to go into the Makefiles in one form or
another.

git-svn-id: https://svn.eduke32.com/eduke32@2714 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:15 +00:00
helixhorned f5e884314e Mapster32: in textured 2D mode, make floor flipping [F] work.
git-svn-id: https://svn.eduke32.com/eduke32@2713 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:09 +00:00
helixhorned 85844f96dd Mapster32: In textured 2D mode, allow setting floor relativity [R].
Also factor out the code (2x) setting the alignment bits for sprites.

git-svn-id: https://svn.eduke32.com/eduke32@2712 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:09:00 +00:00
helixhorned 62727ebd9c Mapster32: more descriptive message when flipping stuff [F], reverse w/ SHIFT.
git-svn-id: https://svn.eduke32.com/eduke32@2711 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-01 20:08:57 +00:00
helixhorned fc23045675 Lunatic: fix one stack index, comment on a problem with ffi.C access.
git-svn-id: https://svn.eduke32.com/eduke32@2710 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:58 +00:00
helixhorned 35d989646e A couple of minor fixes and comments that got accumulated in my tree.
git-svn-id: https://svn.eduke32.com/eduke32@2709 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:55 +00:00
helixhorned 7cd44d6cdb Makefile.shared: don't link with libsupc++ on linux.
It works perfectly fine without it for me, and including it for no reason
is just an annoyance to other people building from source.

git-svn-id: https://svn.eduke32.com/eduke32@2708 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:50 +00:00
helixhorned 5b387f7a08 Introduce two convenient sprite iteration macros in build.h, add a few uses.
Defines SPRITES_OF(Statnum, Iter) and SPRITES_OF_SECT(Sectnum, Iter)
[The first is so that STAT_* can be substituted for Iter and it reads nicely.]

Usage should be self-explanatory, but one thing to keep in mind is that
the sprites that are iterated over MUST NOT be deleted.

git-svn-id: https://svn.eduke32.com/eduke32@2707 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:48 +00:00
helixhorned cea07d0125 In CON showview, if drawing off-screen, clear the view with pal 0 and bail out.
This fixes the glitches/corruption whereever showview is used from
EVENT_DISPLAYROOMS while the scene is actually rendered to a tile instead of the
frame buffer, for example because we have a tilted view or "pixel doubling"
enabled.  Fixing it for real (i.e. so that the showview actually completes)
will require more effort.

git-svn-id: https://svn.eduke32.com/eduke32@2706 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:44 +00:00
helixhorned 32c76d14b4 mdsprite.c: patch up bad array access in loadkvx, remove const from kopen4load arg.
vbit was being accessed with an int32 e.g. at address 3200 when only 3203 were
allocated.  We simply alloc +1 byte.

git-svn-id: https://svn.eduke32.com/eduke32@2705 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:40 +00:00
helixhorned efa0079474 On Windows, check file name case with 'sound' and 'music' CON commands.
This is done by kopen4loadfrommod'ing and immediately closing the file
(since the checker is still run from there when not ingame).
On my system, times were like 0.12 ms, 0.2 ms and 0.5 ms for each
openfrompath/findfrompath, openfrompath/Bopen and SHGetFileInfo
respectively, so it shouldn't have a too noticable impact on initial
loading times.

git-svn-id: https://svn.eduke32.com/eduke32@2704 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-28 18:15:26 +00:00
helixhorned c081f3ab2e In kopen4loadfrommod, don't try g_modDir if it's the default "/".
I experienced the following on Windows XP: a few openfrompath() -->
findfrompath() calls were taking enormously long (4.5 secs) to complete, having
been passed a file name like "//bla/qwe.asd".  My guess is that Windows then
tried to interpret these as a network FS path in access(), and the 4.5 secs
represents a timeout value.

git-svn-id: https://svn.eduke32.com/eduke32@2703 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-28 18:15:22 +00:00