Commit Graph

2864 Commits

Author SHA1 Message Date
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