Commit Graph

2770 Commits

Author SHA1 Message Date
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
helixhorned 0088ed0591 Only check file name case when not in-game; don't warn for ALLUPPER or alllower.
The first means that the expensive (~0.5 ms) SHGetFileInfo() calls won't inter-
fere with smooth gameplay, but files that are opened only at game-time like
sounds won't be checked.  The second means that there are now less false
positives, i.e. warnings about files that would be found due to the
check-all-{upper,lower} hack.

git-svn-id: https://svn.eduke32.com/eduke32@2702 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-28 18:15:19 +00:00
helixhorned 689e1b7167 engine.c: make horizlookup/horizlookup2 have int32_t elts instead of intptr_t.
git-svn-id: https://svn.eduke32.com/eduke32@2701 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-26 21:58:31 +00:00
helixhorned 2e635a8a30 In tilted-view setup code, allocate TILE_TILT storage more tightly.
git-svn-id: https://svn.eduke32.com/eduke32@2700 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-26 21:58:29 +00:00
helixhorned 5efab4d850 build.c: factor out two identical code instances into handle_sprite_in_clipboard
git-svn-id: https://svn.eduke32.com/eduke32@2699 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-26 21:58:26 +00:00
helixhorned eeb42f20bf Disallow high-quality (640x480) tilted screen if MAXYDIM is less than 640.
This fixes the crash on Wii when looking sidewards (e.g. when dying), but
makes the tilted view look more pixelated.
The problem was that an attempt was made to render onto a 640x640 tile for
the rotated view, but the base engine arrays were too small for that.

git-svn-id: https://svn.eduke32.com/eduke32@2698 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-26 21:58:24 +00:00
helixhorned 2fc6e2e6b0 Various cleanup and rewrites.
- make allocatepermanenttile() return intptr_t
- the usual

git-svn-id: https://svn.eduke32.com/eduke32@2697 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-26 21:58:21 +00:00
helixhorned a485ee8ca0 Fix harmless "cast to pointer from integer of different size" warning with x64.
git-svn-id: https://svn.eduke32.com/eduke32@2696 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 18:39:25 +00:00
helixhorned eebddcd559 Cleanup & minor rewrites, among other things in premap.c:G_EnterLevel().
git-svn-id: https://svn.eduke32.com/eduke32@2695 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 18:39:22 +00:00
helixhorned 5af2088c06 With engine compiled for V7 limits, refuse loading maps exceeding them.
Also, correct the loadboard() return value checks in premap.c to be
aware of a returned -2 ("wrong map version").

git-svn-id: https://svn.eduke32.com/eduke32@2694 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 18:39:19 +00:00
helixhorned 000cfffe32 On Windows, don't try to lowercase/uppercase filenames.
Most of the time, Windows file name lookup is case-insensitive. Reading the
docs (see MSDN's CreateFile help, for example), it seems like case-sensitivity
can be controlled on a per-file basis where applicable (NTFS), but people
should be concerned about matching case in the DEFs/on disk *especially* in
that case.

Also, note that this hack will not always help on systems with case-sensitive
lookup.

git-svn-id: https://svn.eduke32.com/eduke32@2693 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 15:23:58 +00:00
helixhorned 68c701fb4a On Windows, check for case-mismatched file names on successful kopen4load().
When a file from the local file system is opened, its real file name is gotten
with SHGetFileInfo() and compared against the one that was passed. In the case
they're not identical, a warning is issued.

This is one step towards eliminating mismatched file names in DEFs etc., which
cause trouble on systems that look them up case-sensitively.  However, it's not
perfect because the issue is trickier than it appears on first sight.
For one thing, this will only check the last (i.e. file) part in the path,
falsely accepting mismatched directory names.  However for these, it reports
them ruthlessly, even for those names where the try-other-case hack (try all
uppercase, all lowercase) would find the correctly-cased file.

git-svn-id: https://svn.eduke32.com/eduke32@2692 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 15:23:55 +00:00
helixhorned f69d9f241d Fix some *printf format-char/vararg mismatches on x86_64 in net.c.
git-svn-id: https://svn.eduke32.com/eduke32@2691 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 15:23:53 +00:00
helixhorned a72a2dbf20 Bump BYTEVERSION because of the preceding change.
git-svn-id: https://svn.eduke32.com/eduke32@2690 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 15:23:50 +00:00
helixhorned 05af53ac4b Fix gamearrays on 64-bit platforms.
They were broken by r2666, which made their elements intptr_t instead of
int32_t, but this change was not reflected in related allocation code.
WARNING: players on 64-bit platforms should not attempt to load games saved
with r2665 or earlier.

git-svn-id: https://svn.eduke32.com/eduke32@2689 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 15:23:48 +00:00
hendricks266 7f920c5541 Add EVENT_LOADGAME and EVENT_SAVEGAME, self-explanatory. Also make EVENT_NEWGAME use myconnectindex for player ID instead of screenpeek.
git-svn-id: https://svn.eduke32.com/eduke32@2688 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 05:14:19 +00:00
hendricks266 af511ed275 Setting RETURN in EVENT_DISPLAYCROSSHAIR will now change the crosshair's picnum while allowing the game to position it, etc. As usual, setting RETURN to -1 disables hardcoded drawing of the crosshair completely.
git-svn-id: https://svn.eduke32.com/eduke32@2687 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 05:13:41 +00:00
terminx 0330821c37 Bump build date from 20110312 to 20120522.
git-svn-id: https://svn.eduke32.com/eduke32@2686 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-22 15:28:51 +00:00
hendricks266 f303ac2f2a EDuke32 Wii: Ready for action!
git-svn-id: https://svn.eduke32.com/eduke32@2685 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-20 07:25:25 +00:00
hendricks266 d015c4acdc Mac OS X: Add correct default values for 'gameexecutable' cfg string so that the Mapster32 test feature works with .app bundles.
Note: You may encounter a crash if you try to test your map and Mapster32 is running fullscreen.

git-svn-id: https://svn.eduke32.com/eduke32@2684 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-20 07:24:28 +00:00
hendricks266 9df8c00bdc Fix warnings in net.c and xdelta3.
git-svn-id: https://svn.eduke32.com/eduke32@2683 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-20 07:23:56 +00:00
terminx 6db214c112 Correct an oversight and make handleevents() call our own window processing function instead of the default Windows one.
git-svn-id: https://svn.eduke32.com/eduke32@2681 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-20 05:36:32 +00:00
terminx 977a6bea65 Minor formatting fix
git-svn-id: https://svn.eduke32.com/eduke32@2680 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-19 22:47:47 +00:00
helixhorned 341f8e7432 net: less-trivial, but not non-trivial changes
git-svn-id: https://svn.eduke32.com/eduke32@2679 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-19 16:25:52 +00:00
helixhorned a59e5f40fe net: trivial changes
git-svn-id: https://svn.eduke32.com/eduke32@2678 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-19 16:25:38 +00:00
helixhorned 4f72e0b7f5 net: factor out common packet handling code
git-svn-id: https://svn.eduke32.com/eduke32@2677 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-19 16:25:22 +00:00
plagman c8b4894975 netcode: unblock stuff
git-svn-id: https://svn.eduke32.com/eduke32@2676 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-19 15:12:08 +00:00
terminx 5207f91978 Fix the previous/next weapon events
git-svn-id: https://svn.eduke32.com/eduke32@2675 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-19 14:39:29 +00:00
helixhorned 5e60b989ab net.c tweaks, just for the sake of pushing them to SVN.
- alloc_multimapstate() helper
- make g_netMapRevision a uint32 and store save->revision in sequence order
  (without &(NET_REVISIONS-1))
- one assert, one XXX comment, stylistic changes

git-svn-id: https://svn.eduke32.com/eduke32@2674 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 21:41:08 +00:00
helixhorned 94f9c03123 PNG screenshots: don't save custom gAMA.
This should be more correct, since previously, the saved PNGs were way too
contrasty when looked from within a browser.  Now, they'll always be
slightly darker than in-game (assuming one has a gamma greater than 1).

git-svn-id: https://svn.eduke32.com/eduke32@2673 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 21:40:54 +00:00
helixhorned 1c530d4b2f With Clang, compile in GNU89 mode and fix clang detection in the Makefiles.
The default C99 mode is giving us linking errors from xdelta3.

git-svn-id: https://svn.eduke32.com/eduke32@2672 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 21:40:38 +00:00
helixhorned 8a4519324e Fix one ptr size mismatch and one format letter/arg mismatch on x86_64.
git-svn-id: https://svn.eduke32.com/eduke32@2671 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 21:40:20 +00:00
helixhorned b40ec07d36 Fix cheats giving inventory items and their events.
git-svn-id: https://svn.eduke32.com/eduke32@2670 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 12:46:25 +00:00
helixhorned f5fb70250a Lunatic: actions prototype, not enabled even in the dev build.
For Lunatic, we'll want to get rid of the t_data --> script indirections, since
the latter will be no more.  Thus, all parameters are saved in t_data directly.

For the normal build, there are no changes, only stylistic tweaks.

git-svn-id: https://svn.eduke32.com/eduke32@2669 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 12:46:10 +00:00
helixhorned 165c569cbe Lunatic: v7 engine support, event updates
git-svn-id: https://svn.eduke32.com/eduke32@2668 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 12:45:52 +00:00
helixhorned 2963e2874d Fix A_CheckEnemyTile() returning 1 for "fixed" sprites (see r1913).
Those sprites are usually decorative, and certainly not enemies!

git-svn-id: https://svn.eduke32.com/eduke32@2667 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 12:45:29 +00:00
terminx 83aa5d2c18 Fix building xdelta3.o
git-svn-id: https://svn.eduke32.com/eduke32@2666 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 02:49:03 +00:00
terminx 893649a31f Add xdelta3 source and headers to VS2010 project
git-svn-id: https://svn.eduke32.com/eduke32@2665 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 00:07:40 +00:00
terminx 1c1da97378 WIP multiplayer changes, still completely broken.
git-svn-id: https://svn.eduke32.com/eduke32@2664 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 23:54:43 +00:00
terminx 5941bf013c Update ENet with changes from the newest version from CVS (yes, they still use CVS)
git-svn-id: https://svn.eduke32.com/eduke32@2663 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 21:42:53 +00:00
terminx ad2f6a6560 Update QuickLZ to 1.5.1 beta 7
git-svn-id: https://svn.eduke32.com/eduke32@2662 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 21:36:50 +00:00
terminx 265ff9dbfd Add xdelta3, required for some broken multiplayer updates I plan on committing later
git-svn-id: https://svn.eduke32.com/eduke32@2661 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 21:27:19 +00:00
terminx 282036a048 Fix EVENT_CHECKTOUCHDAMAGE (the change to how events handle RETURN broke it)
git-svn-id: https://svn.eduke32.com/eduke32@2660 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 20:47:56 +00:00
terminx 763aceda83 Alternate implementation of EVENT_SOUND that better covers all hard coded sounds (menus, boss recognition sounds, etc)
git-svn-id: https://svn.eduke32.com/eduke32@2659 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 17:33:29 +00:00
terminx c0851da27b Fix breakage of EVENT_WEAPKEYx after r2656
git-svn-id: https://svn.eduke32.com/eduke32@2658 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 17:23:02 +00:00
terminx 778e463549 "Band-aid" fix for the issue with EDuke32 and Mapster32 visually locking up but continuing to run and play sounds after alt+tabbing away for a few seconds on Windows Vista/7. This may screw something else up, so please test thoroughly.
git-svn-id: https://svn.eduke32.com/eduke32@2657 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 17:19:52 +00:00
terminx 2ca8dc1c38 This should hopefully fix the disaster with events caused by my last couple of commits ;)
git-svn-id: https://svn.eduke32.com/eduke32@2656 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-16 00:45:10 +00:00
terminx 3548c50724 Fix a potential issue with nested event execution
git-svn-id: https://svn.eduke32.com/eduke32@2655 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-15 23:39:48 +00:00
terminx 245c8c1fef Another one line DynamicTileMap[x] -> DYNAMICTILEMAP(x) change from Helix that got obliterated during svn change merging. Fixing this changes nothing in builds with DYNTILEREMAP_ENABLE defined, so this change isn't meaningful to anyone who isn't recompiling the game to work on a low memory device or something of that nature.
git-svn-id: https://svn.eduke32.com/eduke32@2654 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-15 14:12:24 +00:00
terminx 298e4f9716 1 line fix for a change that accidentally got reverted when merging newer svn updates into an older local branch
git-svn-id: https://svn.eduke32.com/eduke32@2653 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-14 22:45:40 +00:00
terminx 4ba6da5007 Addition of 3 events:
EVENT_SOUND: triggered upon playback of any sound, this allows the "hard coded" sounds to be altered in a context-aware fashion instead of having to resort to clunky hacks like replacing them with a blank sound effect.  RETURN var
iable is set to the sound effect # of the sound to be played, or -1 to cancel playback.

EVENT_CHECKTOUCHDAMAGE: triggered in P_CheckTouchDamage() whenever the player collides with anything.  Value of RET
URN is set to the result provided by clipmove() and so can be decoded in the same way.  Value of RETURN when the event is over can also be manipulated to control some of the hard coded damage effects.

EVENT_CHECKFLOORDAMAGE: triggered in P_CheckFloorDamage(), RETURN is simply the picnum of the floor of the sector t
he player is in.  Can be used to cancel hard coded floor damage effects or to make other tiles exhibit the same eff
ects

Other misc fixes and cleanups, including a possible workaround for Duke Plus SECTOREFFECTOR light issues wherein all SE49 and SE50 that have a statnum of STAT_EFFECTOR are simply changed to STAT_LIGHT during the STAT_EFFECTOR loop
 now.


git-svn-id: https://svn.eduke32.com/eduke32@2652 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-14 18:12:27 +00:00
helixhorned 0b055de591 Add tilenum bound check to CON *actor blocks when parsing, fix the other ones.
The remaining checks now "continue;" when an oob tilenum is found where
an oob access would ensue else.  Also, it's now checked for negative
numbers (the message remains the same though).

git-svn-id: https://svn.eduke32.com/eduke32@2651 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-13 16:05:34 +00:00
helixhorned 88ca3a913a Lunatic: embed lpeg and the translator into the binary
git-svn-id: https://svn.eduke32.com/eduke32@2650 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-13 16:05:16 +00:00