Commit Graph

2679 Commits

Author SHA1 Message Date
helixhorned ba0970cede Lunatic translator: dangling else for the 1000th time: not dangling any more.
Also update test/dangling_else.con. See there for how if* cascades are handled
in CON. It's actually kind of pretty. Also, take care to handle code deferred
to after the if/if-else properly (ifpdistl, ifpdistg, ifcanseetartet).

git-svn-id: https://svn.eduke32.com/eduke32@3534 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:12 +00:00
helixhorned 8955316bba Lunatic t.: {read,save}gamevar, fix break in nested while, fix rotatesprite16.
git-svn-id: https://svn.eduke32.com/eduke32@3533 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:30:15 +00:00
helixhorned 5a5368a567 scriplib: attach const qualifiers to appropriate function input arguments.
git-svn-id: https://svn.eduke32.com/eduke32@3531 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:30:08 +00:00
helixhorned 1606c17a77 Lunatic: fixups and debugging helpers.
- add LuaJIT's 'v' module printing trace info
- translator: fix game function name definitions
- revert math.fmod -> math.modf, they are different!
- disable JIT compilation for a function we're getting strange crashes with
- Make some of DukePlayer_t's members 'bool' on the Lua side. It's way
  too easy to write something like "ps.jetpack_on" where "ps.jetpack_on~=0"
  was meant. [Background: Kyle873 observed that Duke was always floating.]
- Error out if looping in our_module(). I find this behavior more logical
  than returning true.
- fix a couple of missed FORBID variables

git-svn-id: https://svn.eduke32.com/eduke32@3530 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:30:04 +00:00
helixhorned 677c585b72 Lunatic translator: fix codegen for "break" inside while loops.
Note: usually, languages call this "continue". Jeez, CON...

git-svn-id: https://svn.eduke32.com/eduke32@3529 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:29:58 +00:00
helixhorned d747e26fd0 Lunatic: initialize test Lua state earlier so that 'setdefname' has an effect.
git-svn-id: https://svn.eduke32.com/eduke32@3528 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:24 +00:00
helixhorned e576224bb9 Remove some duplicate or unused control layer defines.
Notes:
 - MAXJOYBUTTONS is out of sync between the two definitions
 - In menus.c, NUMMOUSEFUNCTIONS must equal MAXMOUSEBUTTONS,
   fail to compile if this becomes false.

git-svn-id: https://svn.eduke32.com/eduke32@3527 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:22 +00:00
helixhorned c5c1aa2331 Lunatic translator: handle RETURN across events.
git-svn-id: https://svn.eduke32.com/eduke32@3526 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:19 +00:00
helixhorned f791b5af20 Lunatic: sector[]:zrangeat(), 'getzrange' command for the translator.
Also, fix quote commands there.

git-svn-id: https://svn.eduke32.com/eduke32@3524 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:13 +00:00
helixhorned b92c487c6f Lunatic translator: codegen fixes, setgamepalette, -fno=onlycheck option.
git-svn-id: https://svn.eduke32.com/eduke32@3523 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:09 +00:00
helixhorned 0354e38843 CON parser: don't allow read-only gamevars to 'readgamevar' command.
git-svn-id: https://svn.eduke32.com/eduke32@3522 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:05 +00:00
helixhorned c66b891a38 Lunatic: export C functions that may call into CON events using the Lua C API.
We must not call these functions using the FFI, since the Lua state is
considered locked across such calls.

git-svn-id: https://svn.eduke32.com/eduke32@3520 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:47 +00:00
helixhorned b1320d0ab5 Lunatic: begin fixing up the code because it's now actually live!
git-svn-id: https://svn.eduke32.com/eduke32@3519 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:42 +00:00
helixhorned f730e1242a Lunatic translator: keep states, game{vars, arrays} in tables instead of locals.
Since it's too easy to hit the 200 locals limit.

git-svn-id: https://svn.eduke32.com/eduke32@3518 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:37 +00:00
helixhorned 1685228ab7 Lunatic: compile defs.ilua as bytecode and load it from the executable.
git-svn-id: https://svn.eduke32.com/eduke32@3517 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:31 +00:00
helixhorned acddac64be Lunatic translator: nearing a workable state...
- some more outer commands
- gamearray persistence
- faster 'mod': use math.modf instead of math.fmod (the former is JIT-compiled)
- checkavail*
- THISACTOR special handling
- Fix building in Windows (export A_ShootWithZvel instead of A_Shoot).

git-svn-id: https://svn.eduke32.com/eduke32@3516 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:22 +00:00
helixhorned b0a8a381c8 Lunatic translator: eventloadactor.
git-svn-id: https://svn.eduke32.com/eduke32@3515 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:54:13 +00:00
helixhorned 6682313e87 gameexec.c: factor out 2x used code into VM_KillIt.
Also, for Lunatic, handle killit from events.

git-svn-id: https://svn.eduke32.com/eduke32@3514 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:54:07 +00:00
helixhorned a83b2fee95 Lunatic translator: switch statement.
git-svn-id: https://svn.eduke32.com/eduke32@3513 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:54:02 +00:00
helixhorned e6fd95dde8 Lunatic translator: qgetsysstr.
git-svn-id: https://svn.eduke32.com/eduke32@3512 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:53:57 +00:00
helixhorned db2c24b7ef Lunatic translator: fix quote commands, taking care of corner cases. Add test.
git-svn-id: https://svn.eduke32.com/eduke32@3511 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:53:49 +00:00
helixhorned 9f843fb445 CON qstrcpy: don't call strcpy() with identical source and destination quotes.
Thus making the identical source and destination quote number case into the
expected no-op instead of being undefined behavior.

git-svn-id: https://svn.eduke32.com/eduke32@3510 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-21 18:53:42 +00:00
helixhorned f6a577ff68 Mapster32: add "movement by one" debugging functionality via a.m32.
If m32script gamevar "move_by_one" is nonzero, the some keys move the
"player arrow" by increments of 1:
- Without SHIFT: LEFT/RIGHT absolute x, DOWN/UP absolute y, A/Z absolute z.
- With SHIFT: DOWN/UP (unbounded!) horiz, LEFT/RIGHT angle.

This can be useful to debug renderer bugs that show a high sensitivity to the
exact location ("are transient in space").

git-svn-id: https://svn.eduke32.com/eduke32@3509 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-19 20:35:14 +00:00
helixhorned b4ae8c4238 Disable playing RTS sounds until a crash can be resolved.
See comments in the source for details.

git-svn-id: https://svn.eduke32.com/eduke32@3508 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:08:02 +00:00
helixhorned d1442ac88e Lunatic translator: qsprintf.
git-svn-id: https://svn.eduke32.com/eduke32@3507 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:59 +00:00
helixhorned 740c8d021b CON qsprintf: fix specifying more than one "%s" conversion.
Also, slightly better, though still inadequate checking.

git-svn-id: https://svn.eduke32.com/eduke32@3506 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:56 +00:00
helixhorned 5dfb4dc48b CON: don't accept read-only vars for first arg of qstrlen.
git-svn-id: https://svn.eduke32.com/eduke32@3505 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:54 +00:00
helixhorned 8637a7aa22 Lunatic translator: a couple of quote commands, while*n.
git-svn-id: https://svn.eduke32.com/eduke32@3504 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:51 +00:00
helixhorned fd2790da82 Lunatic translator: gamearrays.
git-svn-id: https://svn.eduke32.com/eduke32@3503 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:48 +00:00
helixhorned 2264331daf Game -v and -l cmdline opts: cast the numbers to unsigned first for paranoia.
git-svn-id: https://svn.eduke32.com/eduke32@3502 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:45 +00:00
helixhorned 185f0a8cc4 Lunatic translator: text rendering and other niceties.
git-svn-id: https://svn.eduke32.com/eduke32@3501 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:42 +00:00
helixhorned 4c57413da6 Fix derailing CON instruction pointer when gametextz is passed null quote.
git-svn-id: https://svn.eduke32.com/eduke32@3500 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:38 +00:00
helixhorned 9617861b8a CON digitalnumber*: move orientation &= (ROTATESPRITE_MAX-1) to G_DrawTXDigiNumZ
git-svn-id: https://svn.eduke32.com/eduke32@3499 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:36 +00:00
helixhorned 2d61216758 Lunatic translator: sprite list commands, findnear*, protect player[].ftq.
git-svn-id: https://svn.eduke32.com/eduke32@3498 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:32 +00:00
hendricks266 719efefbf0 Wii: Take advantage of libogc features: PNG screenshots (libpng/zlib), Ogg Vorbis audio (libtremor), and high-resolution profiling timers.
FLAC and VPX remain out in the cold.

git-svn-id: https://svn.eduke32.com/eduke32@3497 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:42 +00:00
hendricks266 624841257c Wii: Fix most warnings. Three remain: two are labeled with FIXMEs; the third consists of signed/unsigned comparisons involving LSWAPIB() in kplib.c.
git-svn-id: https://svn.eduke32.com/eduke32@3496 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:08 +00:00
hendricks266 75e5cebfff Wii: Fix build.
git-svn-id: https://svn.eduke32.com/eduke32@3494 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:48:18 +00:00
helixhorned 75d20d02c5 Reduce volume number modulo MAXVOLUMES for -v command line option.
git-svn-id: https://svn.eduke32.com/eduke32@3492 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:30 +00:00
helixhorned 3665fde85b Lunatic: more commands...
git-svn-id: https://svn.eduke32.com/eduke32@3491 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:24 +00:00
helixhorned 801662c3e7 gameexec.c: refactor 'starttrack' for proper bound checking.
git-svn-id: https://svn.eduke32.com/eduke32@3490 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:18 +00:00
helixhorned a3b3804a08 Lunatic: more commands, timing test for xmath's sine functions.
git-svn-id: https://svn.eduke32.com/eduke32@3489 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:15 +00:00
helixhorned 6cd3b9f4fc Lunatic: xmath module + timing test for distance functions.
git-svn-id: https://svn.eduke32.com/eduke32@3488 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:09 +00:00
helixhorned b489a62a93 Lunatic (translator): more commands, add some "length" methods to vec* types.
git-svn-id: https://svn.eduke32.com/eduke32@3487 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:04 +00:00
helixhorned 6816afe07e Refactor C code related to gettimedate and sect*interpolation CON commands.
No functional changes.

git-svn-id: https://svn.eduke32.com/eduke32@3486 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:00 +00:00
helixhorned 5e84185d6e Factor out setting baslayer timer from game into G_InitTimer().
git-svn-id: https://svn.eduke32.com/eduke32@3485 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:52:56 +00:00
helixhorned 126b7257c0 Lunatic translator: more of everything...
git-svn-id: https://svn.eduke32.com/eduke32@3480 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-11 17:16:58 +00:00
helixhorned cba053bbcf CON myosx*: move masking orientation with user-bits-mask to G_DrawTileGeneric().
git-svn-id: https://svn.eduke32.com/eduke32@3479 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-11 17:16:54 +00:00
helixhorned 200cd75275 Make g_earthquakeTime into a uint16_t, remove DukePlayer_t's name[] member.
Bump BYTEVERSION.

git-svn-id: https://svn.eduke32.com/eduke32@3478 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-11 17:16:50 +00:00
helixhorned 605de9f6d1 Lunatic: input access.
git-svn-id: https://svn.eduke32.com/eduke32@3477 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:24:44 +00:00
helixhorned b6fafd8d13 Factor out player[].* allocation into G_MaybeAllocPlayer(), rename 2 functions.
git-svn-id: https://svn.eduke32.com/eduke32@3476 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:24:38 +00:00
helixhorned fab00b4750 Lunatic: sprite.change{sect,stat}, access to more members, member read test.
git-svn-id: https://svn.eduke32.com/eduke32@3475 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:24:32 +00:00
helixhorned 4f3b139479 Lunatic translator: userdef access.
git-svn-id: https://svn.eduke32.com/eduke32@3473 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:24:20 +00:00
helixhorned 35802d7e41 Lunatic: [gs]et{player,actor}var, access to protected projectile members.
git-svn-id: https://svn.eduke32.com/eduke32@3469 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:23:59 +00:00
helixhorned 90793f6a67 Lunatic: working tsprite methods, static members, struct array timing test.
git-svn-id: https://svn.eduke32.com/eduke32@3468 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:23:54 +00:00
helixhorned 1dd52a4d6e Fix POLYMER=0 build, cleaning up #include discipline on the way.
Also taking care that the USE_OPENGL=0 build builds.

git-svn-id: https://svn.eduke32.com/eduke32@3467 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:24 +00:00
helixhorned 5e4edcaaa8 Lunatic (translator): thisprojectile, *shoot.
git-svn-id: https://svn.eduke32.com/eduke32@3466 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:18 +00:00
helixhorned 7c861cac42 Rework how the z velocity is passed from *zshoot to A_Shoot().
Previously, actor[].shootzvel (implementation detail, not available to CON)
was checked, and if it was !=0, that was the overridden velocity. The value
0 meant "hardcoded, projectile-dependent velocity". But that neccesiated a
hack where if zvel 0 was passed and really meant, it needed to be set to
1 instead.  Now we have A_ShootWithZvel() taking an additional last argument
plus a macro SHOOT_HARDCODED_ZVEL permissible for that argument.

git-svn-id: https://svn.eduke32.com/eduke32@3465 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:12 +00:00
helixhorned 24e6aca5f7 player.c: factor out more identical code into Proj_DoHitscan().
Also, simplify a couple of other lines.

git-svn-id: https://svn.eduke32.com/eduke32@3464 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:06 +00:00
helixhorned b92edcc798 Lunatic: projectiles...
git-svn-id: https://svn.eduke32.com/eduke32@3463 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:03 +00:00
helixhorned 9bf6115d1f player.c: factor out a repeated 3-liner into safeldist(), remove some commented code.
git-svn-id: https://svn.eduke32.com/eduke32@3462 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:00:58 +00:00
helixhorned 2c3ffa291c actors.c: factor out 6x identical code into Proj_BounceOffWall().
git-svn-id: https://svn.eduke32.com/eduke32@3461 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:00:55 +00:00
helixhorned 46fc753f6a gameexec: for VM_Fall and VM_ResetPlayer, pass VM sprite/player etc. as args.
Simplifying VM_FallSprite and VM_ResetPlayer2 used from Lunatic.

git-svn-id: https://svn.eduke32.com/eduke32@3460 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:00:52 +00:00
helixhorned 8e0c7b133e Move around some #ifdef LUNATIC to compile out more code, minor cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3459 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:00:48 +00:00
helixhorned 728ae2bb76 Lose the packed attribute on / rearrange some game struct types.
actors.h: remove 'packed' from projectile_t, tiledata_t. In tiledata_t,
 make .cacherange member an int32_t so that the following member
 "projectile_t defproj" is aligned on a 4-byte boundary.
player.h: remove 'packed' from playerspawn_t, DukeStatus_t, input_t.
In Lunatic, correct packing attribute of the base type of the unrestricted
actor_t and DukePlayer_t pointer types (the declaration was used without

Bump BYTEVERSION.

git-svn-id: https://svn.eduke32.com/eduke32@3458 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:25 +00:00
helixhorned b5aa49953e player.c: remove a couple of unnecessary casts.
git-svn-id: https://svn.eduke32.com/eduke32@3457 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:20 +00:00
helixhorned d82b198799 Lunatic: conditionally compile out more legacy code, remove old mixed mode code.
git-svn-id: https://svn.eduke32.com/eduke32@3456 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:17 +00:00
helixhorned 4e5cdba646 Lose the 'packed' attribute for types declared in build.h.
Most of them are already aligned to their natural boundaries, so lowering
the alignment to 1 byte can only worsen things by making the C compiler
generate poorer (unaligned access) code for some platforms.

The layout of structures is not specified by the C Standard, but is rather
given by a particular platform + toolchain's ABI (application binary interface).
Most ABIs follow the expected pattern "alignment of scalars is their size,
alignment of arrays is that of its element type, alignment of structs is the
maximum alignment of its members". A couple of links to particular ABIs are
given in build.h.

Problems are expected with archs that care about unaligned access when a pointer
to a non-packed struct is taken that resides in a packed aggregate, but these
uses should be weeded out (I'm not sure if there are any in our codebase).

The following types are affected, only hitdata_t changes its size:
sectortype, walltype, spritetype, spriteext_t, spritesmooth_t,
struct validmode_t, picanm_t, palette_t, vec2_t, vec3_t, hitdata_t.

git-svn-id: https://svn.eduke32.com/eduke32@3455 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:11 +00:00
helixhorned d5c62b7de3 Lunatic translator: codegen for actor-tsprite accesses, sync some RO members.
git-svn-id: https://svn.eduke32.com/eduke32@3454 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:06 +00:00
helixhorned 77ecaa900a Fix all hitscan weapons (not only pistol) wrongly fire without spread at enemies.
Introduced in r3358, where I missed a condition inside an 'if'.

git-svn-id: https://svn.eduke32.com/eduke32@3453 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 19:56:26 +00:00
helixhorned 163c019209 Lunatic: provide access to actor-tsprite.
git-svn-id: https://svn.eduke32.com/eduke32@3452 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:20 +00:00
helixhorned f1ac4a63d0 game.c: In G_DoSpriteAnimations, put t, i and s locals into their blocks.
And const them appropriately. Also remove #if 0'ed code related to an MSVC
pragma.

git-svn-id: https://svn.eduke32.com/eduke32@3451 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:15 +00:00
helixhorned cef99818bb NULL spriteext[].tpsr after each running EVENT_ANIMATESPRITES for a tsprite.
Meaning that only *ettsprite[THISACTOR] makes sense from CON. It did before
too, because .tspr was set before each event run (and not before all runs),
only that it was never nulled, which was kind of untidy.

git-svn-id: https://svn.eduke32.com/eduke32@3450 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:13 +00:00
helixhorned 03e819a3cb m32script: remove unused tsprite access via spriteext[].tspr.
git-svn-id: https://svn.eduke32.com/eduke32@3449 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:10 +00:00
helixhorned 14e97b2a57 Don't set spriteext[].tspr when creating tsprites from the engine.
Its only use is to have a actor -> tsprite mapping for the EVENT_ANIMATESPRITE
event and .tspr will be set before it is run.

git-svn-id: https://svn.eduke32.com/eduke32@3448 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:08 +00:00
helixhorned 294f97a004 Mapster32: RESPAWN-preview coded in M32-script.
The m32script variable 'showrespawn_always' toggles whether the respawned picnum
is shown unconditionally instead of only when aimed at (and locked onto the
RESPAWN sprite) in 3D mode.
Cool idea by Micky C.
NOTE: sometimes doesn't work because of a bug in the m32script interpreter.

git-svn-id: https://svn.eduke32.com/eduke32@3447 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:05 +00:00
helixhorned 9230ec7ba7 Lunatic (translator): provide checked write access to a couple more members.
git-svn-id: https://svn.eduke32.com/eduke32@3446 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:00 +00:00
helixhorned 627c0625ae Lunatic: Centralize all bound-checking in bcheck.lua.
git-svn-id: https://svn.eduke32.com/eduke32@3445 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:04:56 +00:00
helixhorned f95b6fddb5 Lunatic translator: codegen for some "method-like" member write accesses.
git-svn-id: https://svn.eduke32.com/eduke32@3444 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:04:52 +00:00
terminx 8d64c001a0 Additional networking patch from Jasper Foreman, sadly sitting untested for almost a month because everyone here has been too sick to do anything with it. :(
git-svn-id: https://svn.eduke32.com/eduke32@3443 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-28 22:00:37 +00:00
terminx afd0005c28 Fix MinGW/GCC build. Oops!
git-svn-id: https://svn.eduke32.com/eduke32@3442 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-27 21:37:21 +00:00
terminx aac7d22f96 Use nearbyintf() to when calculating g_frameDelay (when r_maxfps is changed) to get closer to the target framerate by bypassing float -> int truncation
git-svn-id: https://svn.eduke32.com/eduke32@3441 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-27 17:06:53 +00:00
terminx 9bd041cb9d Fix knuckle cracking animation broken in r3436
git-svn-id: https://svn.eduke32.com/eduke32@3440 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-27 17:06:41 +00:00
helixhorned c0ebbbbb42 Lunatic translator: a couple of set-struct commands, "-I" option for default dir.
git-svn-id: https://svn.eduke32.com/eduke32@3439 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:08:02 +00:00
helixhorned 0796c0e66e Don't apply GL fogging to wall lines drawn in game's "light" overhead view.
git-svn-id: https://svn.eduke32.com/eduke32@3438 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:07:58 +00:00
helixhorned 385095be76 Lunatic: prefer to use ctype objects instead of C type strings.
Pass types via ffi.typeof() instead of declaring them in the
global namespace when possible.

git-svn-id: https://svn.eduke32.com/eduke32@3437 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:07:53 +00:00
helixhorned 9d7d58d678 player.c: return early from various P_Display*() if player's *incs are oob.
git-svn-id: https://svn.eduke32.com/eduke32@3436 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:07:48 +00:00
helixhorned ba8c6e487d Lunatic: use bcarray types to guard accesses to arrays inside structs.
git-svn-id: https://svn.eduke32.com/eduke32@3435 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:07:44 +00:00
helixhorned ddc2104065 Add bcarray.lua, implementing a factory for bound-checked array types.
git-svn-id: https://svn.eduke32.com/eduke32@3434 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:07:40 +00:00
helixhorned 91047d6d90 Lunatic translator: struct read access.
git-svn-id: https://svn.eduke32.com/eduke32@3433 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-24 20:03:10 +00:00
helixhorned faae812293 Lunatic translator: prototypical array/struct access, for reference only.
git-svn-id: https://svn.eduke32.com/eduke32@3432 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-24 20:03:06 +00:00
helixhorned 79384f0e79 Lunatic: a little bit of everything.
git-svn-id: https://svn.eduke32.com/eduke32@3431 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-24 20:03:02 +00:00
helixhorned 34c9bc8489 Lunatic: sync with preceding change, complete two commands.
git-svn-id: https://svn.eduke32.com/eduke32@3430 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-24 20:02:57 +00:00
helixhorned 92f5158a70 CON parser: don't accept read-only gamevars for 1st arg of *sprite{sect,stat}.
git-svn-id: https://svn.eduke32.com/eduke32@3429 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-24 20:02:52 +00:00
helixhorned ee9fc04c9a game.c: replace one missed instance of inline code with calc_smoothratio().
git-svn-id: https://svn.eduke32.com/eduke32@3428 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-23 19:36:52 +00:00
helixhorned f10063eec3 Lunatic: sync with preceding change, fix r3419.
git-svn-id: https://svn.eduke32.com/eduke32@3427 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-23 19:36:48 +00:00
helixhorned dec5445880 Rework hardcoded BADGUY sprite flag initialization (i.e. amend r3257).
Use a new flag to mark hard-coded enemies, not SPRITE_BADGUY.
This fixes an issue where in E1L4, a pigcop would appear in the area
you have to crawl under shrunk. Thanks to LLCoolDave1 for pinpointing
the range of relevant revisions.

git-svn-id: https://svn.eduke32.com/eduke32@3426 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-23 19:36:44 +00:00
helixhorned d73368daee Fix USE_OPENGL=0 build.
git-svn-id: https://svn.eduke32.com/eduke32@3425 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-23 19:36:40 +00:00
helixhorned f0bf345233 Mapster32: fix cycling to the next link sprite with LShift+"]", tweak message.
git-svn-id: https://svn.eduke32.com/eduke32@3424 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-23 19:36:36 +00:00
helixhorned cbb4d3c6eb Reimplement pixel doubling by drawing scene at 1/(2*2) resolution and expanding.
The pixel doubling now only applies to the area where the world scene is drawn,
i.e. it may be smaller than the physical screen / WM window size. The optimized
version is slightly faster than for non-doubled pixels for me (optimized build),
but see code for caveats. Some other minor issues:
- won't work when the world is drawn from demo cameras (and offscreen, but that
  matters less)
- will leave a few pixels empty when running with x resolutions not evenly
  divisible by 4

git-svn-id: https://svn.eduke32.com/eduke32@3421 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:31 +00:00
helixhorned f132c9230f game.c: pull out two G_DrawRooms blocks into G_OROR_DupSprite and G_ReadGLFrame.
... to have a little moew overview.

git-svn-id: https://svn.eduke32.com/eduke32@3420 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:28 +00:00
helixhorned c927de54b1 Lunatic translator: handle overriding system GVs.
git-svn-id: https://svn.eduke32.com/eduke32@3419 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:23 +00:00
helixhorned 671bd67aa8 player.c: make four functions file-local.
git-svn-id: https://svn.eduke32.com/eduke32@3418 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:19 +00:00
helixhorned 9103d4987c CON/m32script: remove GAMEVAR_DEFAULT uses, since they had no effect.
In CON, the bit is still always cleared for user-defined gamevars.

git-svn-id: https://svn.eduke32.com/eduke32@3417 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:15 +00:00
helixhorned 99fd67211d gamevars.c: implement Gv_Clear() in terms of Gv_Free() + own code.
Also, some commenting.

git-svn-id: https://svn.eduke32.com/eduke32@3416 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:10 +00:00
helixhorned 142e36d6f4 Lunatic: cmdline switch to run test script, compile out more code, 2 more GVs.
git-svn-id: https://svn.eduke32.com/eduke32@3415 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:06 +00:00
helixhorned b6ca618694 Lunatic: hook up PIPEBOMB_CONTROL etc. with the player members.
git-svn-id: https://svn.eduke32.com/eduke32@3414 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:16:58 +00:00
helixhorned cd1f3739d9 player.c: factor out repeated code into P_SetWeaponGamevars().
git-svn-id: https://svn.eduke32.com/eduke32@3413 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:16:54 +00:00
helixhorned fdd652fd1a demo.c: correct strange indentation.
git-svn-id: https://svn.eduke32.com/eduke32@3412 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:16:50 +00:00
helixhorned 2b0b8d34cc Remove mixed Lunatic/legacy build option.
git-svn-id: https://svn.eduke32.com/eduke32@3410 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:29:00 +00:00
helixhorned d63ddb6e39 Lunatic translator: more of the same.
- more predefined vars
- fix recursive states and ones with a stray "else" before the end

git-svn-id: https://svn.eduke32.com/eduke32@3409 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:55 +00:00
helixhorned fb1db25c4e Consolidate badly named HUD weapon globals ("g_looking_angSR1") into struct.
git-svn-id: https://svn.eduke32.com/eduke32@3408 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:48 +00:00
helixhorned 7acd1ad743 Lunatic: more convenient weapon data access.
git-svn-id: https://svn.eduke32.com/eduke32@3407 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:43 +00:00
helixhorned fbaa00665d Lunatic: various.
- Fix "gv" access.
- camera
- translator: comparison predicates, predefs...

git-svn-id: https://svn.eduke32.com/eduke32@3406 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:40 +00:00
helixhorned c9190e79ae Wrap some ud.camera* and g_camera{Distance,Clock} into CAMERA* macros.
In Lunatic, make it a struct type "camera_t" instead.

git-svn-id: https://svn.eduke32.com/eduke32@3405 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:32 +00:00
helixhorned 753278cd12 Simplify HUD scale and viewport size logic and clean up related code.
* Make the "classic status bar fullscreen viewport" mode accessible
  in classic too.
* Make range of status bar scale 36..100
* Update ud.statusbarmode when executing OSD command r_size (ud.screen_size).
  NOTE: ud.statusbarmode is considered internal. Don't use from CON!
* Make sure 1) loading any configuration and 2) menu bars work correctly.
  (The "classic status bar fullscreen viewport" mode will never be restored
   though because ud.statusbarmode isn't handled by the OSD var system).

git-svn-id: https://svn.eduke32.com/eduke32@3402 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:59:11 +00:00
helixhorned e9bd1b7582 Various cleanup of status bar drawing code, remove some old commented out code.
git-svn-id: https://svn.eduke32.com/eduke32@3400 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:59:01 +00:00
helixhorned a98ea13f1e game.c: replace a couple of sbarsc() inline code with calls to sbarsc().
git-svn-id: https://svn.eduke32.com/eduke32@3399 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:58:54 +00:00
helixhorned dc9f4eb360 Mapster32: add cvar/mapster32.cfg option "keeptexturestretch".
If enabled, dragging wall vertices will correct the xrepeat after the
mouse button is released, so that the pre-drag absolute stretching is
restored.

git-svn-id: https://svn.eduke32.com/eduke32@3398 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:56 +00:00
helixhorned 8bca521ef4 Mapster32: slightly rework code for setting/querying some cvars.
git-svn-id: https://svn.eduke32.com/eduke32@3397 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:52 +00:00
helixhorned 0648d25db1 Mapster32: more or less fix the auto wall-alignment feature ([.]/[,]).
- Run it twice, since the first one is wrong.
- Warn when attempting to align based on a top-oriented wall. When the
  sequence of walls to align has "windows", only the bottom parts will
  be correct.
- Make the modifiers actually useful:
  * Pressing SHIFT aligns at most one wall, remove the old CTRL modifier.
  * The rest is as before: ALT makes the walls have (approximately) equal
    texture stretching, ['] (quote) aligns the immediate TROR-nextwalls.

git-svn-id: https://svn.eduke32.com/eduke32@3396 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:50 +00:00
helixhorned 8fb886b14a Replace dragpoint()'s "dragpoint_noreset" global with a "flags" argument.
Also, add another flag, signifying that from the editor, also the
"lastwall"s (i.e. the CCW-linked points) should get collected. This is
to signal the editor that their wall lengths should be displayed, too.

git-svn-id: https://svn.eduke32.com/eduke32@3394 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:41 +00:00
helixhorned 898462152c Fix MUSICANDSFX ambient sounds (bit 2) playing only one instance.
This is done by introducing an additional internal bit, meaning
"play only one instance". It is set for all sounds which have bit 1
("repeat in the sound system") set at definesound time, but not those
that set bit 1 temporarily (see r3336).

git-svn-id: https://svn.eduke32.com/eduke32@3393 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:36 +00:00
helixhorned 39ce7aee62 Lunatic: codegen beyond milestone 1.
- weapon data
- changing ones... (locals for now)
- operators

git-svn-id: https://svn.eduke32.com/eduke32@3392 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:32 +00:00
helixhorned 417dc33769 Lunatic translator: slight code reorganization to prevent too many local vars.
git-svn-id: https://svn.eduke32.com/eduke32@3391 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:26 +00:00
helixhorned 8e5d5f9b89 Lunatic: begin changing ones...
git-svn-id: https://svn.eduke32.com/eduke32@3390 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:21 +00:00
helixhorned 7d2dd223bb Mapster32: don't apply GL fogging to crosshair.
git-svn-id: https://svn.eduke32.com/eduke32@3389 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:14 +00:00
helixhorned 56ef10c893 Lunatic translator: handle -mx.
git-svn-id: https://svn.eduke32.com/eduke32@3388 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:07 +00:00
helixhorned 222e92ef37 Make r_downsize 0 by default.
Also, rewrite comparison to the non-tint in astub.c to be even less hackish.

git-svn-id: https://svn.eduke32.com/eduke32@3387 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-08 23:12:59 +00:00
hendricks266 8bb14fa13e Fix warnings that appear if big-endian || USE_OPENGL=0.
git-svn-id: https://svn.eduke32.com/eduke32@3382 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-08 06:17:10 +00:00
helixhorned 51c5afaae6 Lunatic: a couple of small changes.
git-svn-id: https://svn.eduke32.com/eduke32@3380 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-06 18:56:45 +00:00
helixhorned 87bd2c762e Fix NETCODE=0 build.
git-svn-id: https://svn.eduke32.com/eduke32@3379 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-06 18:56:38 +00:00
helixhorned 28d05e3fdd Reimplement pixel doubling by taking the upper left pixel of each 2x2 block.
This obviously won't help performance as the scene has still to be drawn at
the original resolution, but it's better than the draw-to-tile hack.

git-svn-id: https://svn.eduke32.com/eduke32@3378 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-06 18:56:34 +00:00
helixhorned 8ed4667265 Lunatic: grabbag of different things.
- fix error handing with recursing events
- wallsofsect iterator, sector[]:contains()
- more codegen; mangle function names
- m32: compinside

git-svn-id: https://svn.eduke32.com/eduke32@3375 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:31 +00:00
helixhorned e72557d9d9 Lunatic translator: dangling else, hopefully for the last time!
git-svn-id: https://svn.eduke32.com/eduke32@3374 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:25 +00:00
helixhorned 50f5a2340f Lunatic: more commands, mostly of the define* variety.
git-svn-id: https://svn.eduke32.com/eduke32@3373 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:19 +00:00
hendricks266 05a550c08d Address some macro madness in jaudiolib. (Should fix PowerPC builds.)
git-svn-id: https://svn.eduke32.com/eduke32@3370 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-04 17:29:03 +00:00
hendricks266 5493583140 Amend r3328 so that NAM gets WEAPON_RELOAD_TIMING.
git-svn-id: https://svn.eduke32.com/eduke32@3367 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-04 17:27:43 +00:00
helixhorned 0c44056945 Lunatic: getting closer to the first milestone.
On the C side, zrange, angrange and autoaimang are represented as
DukePlayer_t members then.

git-svn-id: https://svn.eduke32.com/eduke32@3366 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-02 22:33:37 +00:00
helixhorned 67cdd9d883 gameexec.c: factor code for "ifnosounds" into sounds.c: A_CheckAnySoundPlaying.
git-svn-id: https://svn.eduke32.com/eduke32@3365 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-02 22:33:32 +00:00
helixhorned e4caa58cf2 Move DukePlayer_t's .palette down so that 2-byte-sized members are 2-byte-aligned.
Bump BYTEVERSION.

git-svn-id: https://svn.eduke32.com/eduke32@3363 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-02 22:33:22 +00:00
helixhorned 2528fd3bf5 player.c: factoring continued.
New local functions:
Proj_DoRandDecalSize, SectorContainsSE13, HandleHitWall, Proj_CheckBlood,
Proj_HandleKnee.

git-svn-id: https://svn.eduke32.com/eduke32@3362 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:42 +00:00
helixhorned 10feaeb5b4 player.c: cleanup. "ProjectileData[atwith]." --> "proj->", ...
The diff may look daunting, but it's clear what is changed with
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]' -b

git-svn-id: https://svn.eduke32.com/eduke32@3361 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:39 +00:00
helixhorned 552708103f player.c: finish hitscan projectile handling cleanup.
Factoring out 2x almost duplicated code into {P,A}_PostFireHitscan().

git-svn-id: https://svn.eduke32.com/eduke32@3360 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:36 +00:00
helixhorned f65f547fef player.c: hitscan projectile handling cleanup continued.
git-svn-id: https://svn.eduke32.com/eduke32@3359 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:33 +00:00
helixhorned 15b7444b46 player.c: factor out 2x almost dup'd code preparing hitscan weapon firing.
The code is duplicated with small changes for the hardcoded and custom
projectiles.
Adding local functions P_PreFireHitscan(), A_PreFireHitscan() and
Proj_MaybeAddSpread().

git-svn-id: https://svn.eduke32.com/eduke32@3358 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:31 +00:00
helixhorned eda5b22030 Lunatic: more code...
git-svn-id: https://svn.eduke32.com/eduke32@3357 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:28 +00:00
helixhorned a24ab8d4fa Factor out some code into C_AllocQuote() and C_InitQuotes().
In Lunatic-only build, also always allocate the first 128 quotes.

git-svn-id: https://svn.eduke32.com/eduke32@3356 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:25 +00:00
helixhorned 311967f425 Lunatic: definesound, more control.lua fixes.
git-svn-id: https://svn.eduke32.com/eduke32@3355 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:22 +00:00
helixhorned fd390efe2a Lunatic: compile out more code with LUNATIC_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3354 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:18 +00:00
helixhorned 37d8cda701 Clean up actors.c and player.c.
git-svn-id: https://svn.eduke32.com/eduke32@3353 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:14 +00:00
helixhorned 25f6255d28 Lunatic: fix stack discipline.
Preventing a continuously growing stack top and inevitable program termination.
Also, commonize the error handling to live on the engine side.

git-svn-id: https://svn.eduke32.com/eduke32@3352 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:11 +00:00
terminx 79e45c23d5 Add predefined REND_CLASSIC, REND_POLYMOST and REND_POLYMER constants and use them everywhere getrendermode() is called.
git-svn-id: https://svn.eduke32.com/eduke32@3346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-30 20:34:34 +00:00
helixhorned 5fc9bb9779 Lunatic: more glue, fixes, backtrace for code called back from C.
git-svn-id: https://svn.eduke32.com/eduke32@3345 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:32 +00:00
helixhorned 80f3e132b0 Replace "if (g_tile[..].execPtr)" -> "if (G_HaveActor(...))".
git-svn-id: https://svn.eduke32.com/eduke32@3344 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:28 +00:00
helixhorned 80ee967b8e Lunatic: beginning to glue things together. Introducing LUNATIC_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3343 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:24 +00:00
helixhorned 4ad4f9ebb7 Remove commented code using former engine variable "automapping".
git-svn-id: https://svn.eduke32.com/eduke32@3342 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:20 +00:00
helixhorned 7d1879b777 Fix LTO=1 RELEASE=1 Lunatic build.
git-svn-id: https://svn.eduke32.com/eduke32@3341 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:16 +00:00
hendricks266 bf566e10a8 Rectify.
git-svn-id: https://svn.eduke32.com/eduke32@3340 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 11:27:07 +00:00
hendricks266 be03f29484 Clean up and factor jaudiolib.
git-svn-id: https://svn.eduke32.com/eduke32@3338 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:59:21 +00:00
hendricks266 b6ddc6149e Replace initialize_globals() with global initialization.
git-svn-id: https://svn.eduke32.com/eduke32@3337 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:58:38 +00:00
hendricks266 11e0897def Fix the gap between loops of ambient MUSICANDSFX sounds like BAR_MUSIC.
git-svn-id: https://svn.eduke32.com/eduke32@3336 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:58:09 +00:00
hendricks266 3933471e4b All kneel, king FLAC is here.
FLAC source from git commit 0920bc1ffb07f038b317e7e8056509fe0e4b680e, patched by me.

Windows libFLAC.a built using i686-MinGW-w64 and x86_64-MinGW-w64.

HUGE thanks to rhoenie for building the Mac fat library (ppc, i686, x86_86).

git-svn-id: https://svn.eduke32.com/eduke32@3335 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:57:24 +00:00
hendricks266 95dd57154e Clean up some file and directory structure.
* Renamed source/jaudiolib/third-party/mingw32 to source/jaudiolib/third-party/Windows.
* Moved source/jaudiolib/third-party/Windows/include to source/jaudiolib/third-party/common/include to use both on Windows and Apple.
* Deleted Apple/lib/include/{ogg,vorbis}/, see previous point.
* Deleted Apple/lib/libvorbisenc.a, 6MB saved.
* Moved Apple/lib/lib{ogg,vorbis,vorbisfile}.a to source/jaudiolib/third-party/Apple/lib, where they belong.
* Moved source files in Apple/ to source/, where they belong. (SDLMain.[mh] stay.)
* Deleted source/jaudiolib/third-party/{ogg,vorbis}.framework, not used any more.
* Renamed "StartupWinController*" to "startosx*".

git-svn-id: https://svn.eduke32.com/eduke32@3334 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:54:35 +00:00
terminx 8e61bff6f1 Bump DirectSound version to 8. This shouldn't really affect anything as the API is the same for all of the bits we make use of, but certain sets of DirectX headers/libs seem to be lacking v7 support.
git-svn-id: https://svn.eduke32.com/eduke32@3333 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:23:28 +00:00
terminx feaf4a7988 Remove FX_ASSVersion and related code since it wasn't used anywhere
git-svn-id: https://svn.eduke32.com/eduke32@3332 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:23:14 +00:00
terminx 61a8eaf666 Throw a compiler warning when building with only the null sound driver
git-svn-id: https://svn.eduke32.com/eduke32@3331 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:22:55 +00:00
terminx 0ae2d9ad60 Fix DirectSound in MSVC builds and remove the dependency on the DirectX SDK
git-svn-id: https://svn.eduke32.com/eduke32@3330 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:22:39 +00:00
helixhorned 9c328bf0a5 Encapsulate aplWeapon* array accesses in a PWEAPON(Player, Weapon, Wmember) macro.
In the normal game, these arrays are conceptually [MAX_WEAPONS][MAXPLAYERS],
allocated as CON per-player gamevars (e.g. WEAPONx_WORKSLIKE).
For Lunatic, they are replaced with
weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS].

git-svn-id: https://svn.eduke32.com/eduke32@3328 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:16 +00:00
helixhorned f1b1ce2cc3 Replace wall of dup'd code in Gv_AddSystemVars with something more readable.
Specifically, have a weapondata_t type mimicking the aplWeapon* arrays.
Keep a list weapondefaults[] which undergoes some static->dynamic tweaks
and then makes its way to the WEAPONx_XXX per-player gamevars.

git-svn-id: https://svn.eduke32.com/eduke32@3327 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:12 +00:00
helixhorned 279a197e27 Lunatic translator: pack all translation units into one big blob.
git-svn-id: https://svn.eduke32.com/eduke32@3325 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:06 +00:00
helixhorned cc090a2ea8 Lunatic: sinking in code.
git-svn-id: https://svn.eduke32.com/eduke32@3324 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:02 +00:00
helixhorned 4f2639f4d7 Clean up spawning / actor initialization code.
git-svn-id: https://svn.eduke32.com/eduke32@3322 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:17:53 +00:00
helixhorned 0dd78fb029 Cleanup of console/on-screen-display (OSD) functionality.
- Rewrite the "clear background" routine in a no-brainer way instead of
  juggling around with rotatesprite(). Make it common to game+editor.
  Expose glRectd to glbuild.
- Don't stop OSD text line drawing when encountering a non-printable char.
  Instead, treat it as space.
- In OSD_SetTextMode(), don't use swaplong (which really swaps 32-bit ints)
  to swap pointers. Write an analogous "swapptr" instead.
- When changing from/to OSD, don't inject a pause key. This *might* have been
  the cause of the reported pausing problems.
- clean up the code...
(Yes, this commit throws together too much stuff. I suck sometimes. :P)

git-svn-id: https://svn.eduke32.com/eduke32@3321 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:50 +00:00
helixhorned fa2ac57674 Lunatic: event chaining.
git-svn-id: https://svn.eduke32.com/eduke32@3320 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:45 +00:00
helixhorned 41bfa1b841 Lunatic: print -> OSD_Printf, error reporting.
git-svn-id: https://svn.eduke32.com/eduke32@3319 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:41 +00:00
helixhorned 596b83aec1 Add a couple of test CONs: non-local control flow, rotation-fixed useractors.
git-svn-id: https://svn.eduke32.com/eduke32@3317 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 19:24:25 +00:00
helixhorned 6a4add81bd Fix rotation-fixed useractors (those having usertype bit 4 set).
Rotation-fixing happens for a couple of hard-coded statnums that presumably
never move (DEFAULT, STANDABLE, FX, FALLER, LIGHT), but for actors it wouldn't
make sense since the common case is that they do move. For this reason, bit 4
was introduced in r1934. The position of such useractors will not diverge
due to error roundoff accumulation in rotating sectors (SE0, train).

git-svn-id: https://svn.eduke32.com/eduke32@3316 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 19:24:21 +00:00
helixhorned 4ea9f799b1 Lunatic: more complete gameactor(), misc. translator tweaks.
git-svn-id: https://svn.eduke32.com/eduke32@3315 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 19:24:16 +00:00
helixhorned 48c47af5dc Pack actor_t's bposx/bposy/bposz members into a vec3_t named "bpos".
git-svn-id: https://svn.eduke32.com/eduke32@3314 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 14:00:08 +00:00
helixhorned d975a6a24f Fix build.lua's loadarts(), add bigytiles.lua.
git-svn-id: https://svn.eduke32.com/eduke32@3312 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 14:00:00 +00:00
helixhorned 518ac7b4df Mapster32: in 3D mode's tile info, highlight members of swapped bottom walls.
- If aiming at a swapped bottom wall, display "Wall <wallnum> -> <otherwallnum>"
- highlight pic, shade, pal, cstat in yellow then
- in printext256, accept at most 3 digits for the color format string (e.g. ^123)

git-svn-id: https://svn.eduke32.com/eduke32@3308 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-20 12:04:39 +00:00
helixhorned 192e863dd6 Mapster32: when pasting single wall, take over bits 4, 1+64 and 8+256.
That is, everything concerning orientation. Previously, it was wrongly
the bitwise NOT of these bits that got taken over. In particular, if bit
2 (swap bottom walls) would get pasted, ridiculousness could ensue.

git-svn-id: https://svn.eduke32.com/eduke32@3306 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-18 22:40:49 +00:00
helixhorned 5bda3a6ebf Don't enable fog in polymost_printext256() and when drawing tile view in M32.
The new "r_usenewshading 2" mode could darken these otherwise.

git-svn-id: https://svn.eduke32.com/eduke32@3302 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-16 19:18:13 +00:00
helixhorned 922aa3ca8b Classic-like visibility/fog for OpenGL modes, r_usenewshading 2 (new default).
Implemented using GL_LINEAR fog. The only source of difference (besides the
obvious indexed vs. true color) should now be the distance constant, which
still had to be determined experimentally.  Polymer implements this mode in
its fog fragment program part.

Parallaxed skies are always drawn with full visibility, I'm not sure if there
are any maps that expect otherwise.

Also, accidentally committed: factor out initialization code from
polymost_printext256() into gen_font_glyph_tex(), small game.c changes.

git-svn-id: https://svn.eduke32.com/eduke32@3301 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-16 19:18:10 +00:00
helixhorned 441e2ed220 Fix savegame loading. Bump BYTEVERSION.
git-svn-id: https://svn.eduke32.com/eduke32@3295 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-15 11:28:56 +00:00
hendricks266 54e0fc260c Replace the scrolling contributor credits with a static programmatic three-column layout.
git-svn-id: https://svn.eduke32.com/eduke32@3294 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 23:11:26 +00:00
helixhorned 243bea66dd Mapster32: correct message when changing shade by small steps ([+], [-], mwheel)
git-svn-id: https://svn.eduke32.com/eduke32@3289 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:11 +00:00
helixhorned 92dabb3694 Rename global visibility to g_visibility, remove useless casts & old fog code.
git-svn-id: https://svn.eduke32.com/eduke32@3287 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:05 +00:00
helixhorned 65e5ebcdbc Add command line option "-rotatesprite-no-widescreen".
This global option will set bit 1024 and clear bits 256 and 512 for all
rotatesprite calls, fixing complex HUD drawing code relying on precise
alignment of individual elements (widescreen rotatesprite is entirely
unsuitable for this purpose).

git-svn-id: https://svn.eduke32.com/eduke32@3284 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:27:55 +00:00
terminx ba8d1a5c1e Change a few paths in various MSVC Makefiles to better suit my current dev environment. This doesn't really affect anyone else since these paths need to be customized to fit whatever machine by anyone building with MSVC anyway.
git-svn-id: https://svn.eduke32.com/eduke32@3282 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 17:13:17 +00:00
helixhorned 049e63d7f3 Mapster32: In 3D mode, [,] auto-aligns walls to the left.
git-svn-id: https://svn.eduke32.com/eduke32@3281 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 22:21:22 +00:00
hendricks266 dac94ce284 Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)

To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.

All compiler and linker warnings when building in 64-bit mode have been fixed.

Remaining 64-bit to-do:
 - The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
 - RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
 - DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
 - Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)

This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.

In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.

git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
hendricks266 70aecb2e75 Fix declaration-after-statement warning in game.c after r3270.
git-svn-id: https://svn.eduke32.com/eduke32@3277 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:35:06 +00:00
hendricks266 2f8dbd94c3 Update credits.
git-svn-id: https://svn.eduke32.com/eduke32@3276 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:34:49 +00:00
hendricks266 9fcba228b1 Build tweaks:
Set up the use of {Windows,Apple}/{include,lib} regardless of feature toggles in Makefile.common using $(abspath ) in reference to the directory Makefile.common is in.
Add the three DirectX headers that are actually used to the repo. (from: http://alleg.sourceforge.net/files/dx9mgw.zip)
Since current MinGW versions include DirectX libs (for dynamic linking), remove "-L$(DXROOT)/lib".
The DirectX headers are no longer a separate dependency for building.
Add $(SDLROOT_OVERRIDE). $(SDLROOT) only functions for Windows and Mac OS X.
Factor handling of $(DXROOT_OVERRIDE) and $(SDLROOT_OVERRIDE) into Makefile.shared using $(abspath ).

git-svn-id: https://svn.eduke32.com/eduke32@3275 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:34:30 +00:00
hendricks266 6f2fa332dd Port system gamearray access from M32Script to CON. Expose tilesizx and tilesizy.
Also, fix deficient logic in Gv_Free and Gv_Clear (both M32 and CON) so that gamevar and gamearray erasure results are (closer to) correct, and so that the game does not crash when system arrays are accessed from CON because they all have been nulled.

git-svn-id: https://svn.eduke32.com/eduke32@3274 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:33:53 +00:00
hendricks266 a2f585fcfb jaudiolib: Modify OGG looping code to support the LOOP_LENGTH tag (where internally LOOP_START + LOOP_LENGTH = LOOP_END), and all three tags without the underscore.
As a note, libvorbis' vorbis_comment_query() checks for tags case-insensitively.

(This was done to support the output of vgmstream's "test.exe -g".)

git-svn-id: https://svn.eduke32.com/eduke32@3273 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:33:23 +00:00
terminx 977764e57a Fix building as C instead of C++
git-svn-id: https://svn.eduke32.com/eduke32@3271 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-12 02:53:15 +00:00
terminx fbdbca2952 Networking patch from Jasper Foreman
git-svn-id: https://svn.eduke32.com/eduke32@3270 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-12 02:53:13 +00:00
terminx 5c59f785a1 Recognize the .pk4 file extension when loading grps and zips for shits and giggles (.pk3 was already recognized).
git-svn-id: https://svn.eduke32.com/eduke32@3269 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-12 02:53:10 +00:00
terminx 1c3f31b099 Move the definitions like MAXGAMEVARS out of the enums used for the gamevar flags, because it didn't really make a whole lot of sense for them to be there.
git-svn-id: https://svn.eduke32.com/eduke32@3268 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-12 02:53:08 +00:00
terminx 5d031ec257 Replace the separate full Gv_AddVar/SubVar/etc functions with a macro that generates them since they were all the same anyway (other than the operator, obviously)
git-svn-id: https://svn.eduke32.com/eduke32@3267 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-12 02:53:05 +00:00
helixhorned 9d2260c3c8 Replace outer apScriptGameEvent[...] checks with G_HaveEvent().
git-svn-id: https://svn.eduke32.com/eduke32@3266 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:57 +00:00
helixhorned 99f56fd295 Don't call setaspect_new() at end of rotatesprite.
This fixes 2nd and following rotatesprite calls drawing differently from
the first in a context with custom set-up aspect, as reported by Lezing here:
http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__143090

Also, back up and restore the aspect state across EVENT_DISPLAYREST.

git-svn-id: https://svn.eduke32.com/eduke32@3265 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:53 +00:00
helixhorned 10ae7e342c CON: proper bound checks for {re,}definequote commands.
git-svn-id: https://svn.eduke32.com/eduke32@3262 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:42:38 +00:00
helixhorned f2a9af0bae Rearrange {net,}actor_t for 4-byte alignment of int32_t members.
Bump BYTEVERSION.

git-svn-id: https://svn.eduke32.com/eduke32@3261 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:46 +00:00
helixhorned fc048658dc Experimental NETCODE Makefile variable, enabled by default.
Disabling netcode compilation can be interesting on memory-constrained
systems, or those that have no means of accessing the network anyway.
Note: I'm OK with maintaining this myself, i.e. it's fine if netcode dev
breaks compilation with NETCODE=0.

git-svn-id: https://svn.eduke32.com/eduke32@3260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:44 +00:00
helixhorned 1588a80442 Lunatic: drowning in code.
git-svn-id: https://svn.eduke32.com/eduke32@3259 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:39 +00:00
helixhorned 5c06ef08bf Make EventNames[] an array of (const char *) instead of const tokenlist.
git-svn-id: https://svn.eduke32.com/eduke32@3258 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:36 +00:00
helixhorned 599d9232f1 Initialize BADGUY sprite flags for hardcoded enemies.
... instead of switch/case-ing them in A_CheckEnemyTile().
Because this requires bumping BYTEVERSION, we also get rid of the
excess trailing bytes in the save game's "rest" data. (See r3052.)

git-svn-id: https://svn.eduke32.com/eduke32@3257 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:32 +00:00
helixhorned 541fca6dac Lunatic: gasping for some air.
That is, fix some oversights introduced in the preceding runs.
listglobals.sh is a helper to find global accesses.
Translator: add "number-conversion" warning option, max. error limit.

git-svn-id: https://svn.eduke32.com/eduke32@3256 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:28 +00:00
helixhorned 2212e4e6f8 Lunatic translator: warning options, on_state_end, more bad-identifier chars.
git-svn-id: https://svn.eduke32.com/eduke32@3255 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-03 18:24:33 +00:00
helixhorned 99c67c0190 Lunatic: submerging in code.
git-svn-id: https://svn.eduke32.com/eduke32@3254 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-03 18:24:30 +00:00
helixhorned b062d5f572 Lunatic: knee-deep in code.
- more codegen
- make more members const, some char unsigned
- fix some "geom" metamethods
- '^' operator

git-svn-id: https://svn.eduke32.com/eduke32@3253 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-03 18:24:25 +00:00
helixhorned 2bcf8aa8ec gameexec.c: rip out some inline code into VM_Fall() and VM_ResetPlayer().
git-svn-id: https://svn.eduke32.com/eduke32@3252 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-03 18:24:20 +00:00
helixhorned 76b970e547 Lunatic: implement the non-local control flow needed for some commands.
git-svn-id: https://svn.eduke32.com/eduke32@3250 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-30 18:57:59 +00:00
helixhorned 5b07f67627 Lunatic: player stuff (protect some members etc.)
git-svn-id: https://svn.eduke32.com/eduke32@3249 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-30 18:57:55 +00:00
helixhorned b850d04f8d Lunatic: Makefile tweaks, protect sprite[].picnum.
git-svn-id: https://svn.eduke32.com/eduke32@3248 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-30 18:57:50 +00:00
helixhorned 354a1a70ef Lunatic: expose more stuff, more codegen (the easy ones).
git-svn-id: https://svn.eduke32.com/eduke32@3247 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-30 18:57:46 +00:00
helixhorned 16c596b31b Some Lunatic cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3246 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-30 18:57:40 +00:00
helixhorned c4abfc405a Windows: Fix potential crash in version checker.
1) see if we actually received anything
(if http://eduke32.sourceforge.net/VERSION is unavailable, this returns now
instead of continuing with nonsensical data)
2) check if we're getting a token from strtok()

git-svn-id: https://svn.eduke32.com/eduke32@3244 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-29 12:49:41 +00:00
helixhorned 7614a78cc5 Factor dist() and ldist() into common.c.
git-svn-id: https://svn.eduke32.com/eduke32@3243 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-29 12:49:38 +00:00
helixhorned 375d164138 Move enum vmflags_t to gameexec.c since it's an implementation detail.
git-svn-id: https://svn.eduke32.com/eduke32@3242 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-29 12:49:34 +00:00
hendricks266 890aba88eb Fix warnings involving printf() requiring explicit casts on tracked types.
git-svn-id: https://svn.eduke32.com/eduke32@3238 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:26:04 +00:00
helixhorned dacf2695ff Lunatic: better protection of array members inside structs.
git-svn-id: https://svn.eduke32.com/eduke32@3227 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:18:52 +00:00
helixhorned 8293e72a95 Lunatic translator: rework how composites are passed around.
git-svn-id: https://svn.eduke32.com/eduke32@3226 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:18:46 +00:00
helixhorned cff452d814 Lunatic translator: update default defines.
git-svn-id: https://svn.eduke32.com/eduke32@3225 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:18:41 +00:00
helixhorned 50b6e4acac Guard macros.h by #ifndef/#define, remove two decls of nonexistent functions.
In jmact/mathutil.h: FindDistance3D_HP() and ArcTangentAppx().

git-svn-id: https://svn.eduke32.com/eduke32@3224 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:18:36 +00:00
hendricks266 5e0ffb93b3 RENDERTYPE=SDL on Windows, part 2.
This introduces winbits.[ch] in the engine, containing layer-independent code migrated from winlayer, including nedmalloc, ebacktrace1, OS version detection, and high-resolution profiling timers.

sdlayer has been expanded to include the code from winbits under _WIN32.

All uses of RENDERTYPEWIN in the source have been examined and changed to _WIN32 (or removed) where the block in question is layer-independent.

git-svn-id: https://svn.eduke32.com/eduke32@3221 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 04:26:37 +00:00
hendricks266 9a75f0b88c Factor G_MultiPskyInit into common.c.
git-svn-id: https://svn.eduke32.com/eduke32@3220 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 04:25:31 +00:00
hendricks266 be899ba3af For novelty, add support for RENDERTYPE=SDL under Windows.
This needs improvements to bring it up to par with winlayer, but it is functional. In particular, a good amount of code from winlayer could be used for both layers, including the profiling timers, the version printing code, and the hInstance and hModule sharing.

Known problems: the mouse cursor is not trapped, and the game starts before the startup window shows options.

git-svn-id: https://svn.eduke32.com/eduke32@3219 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:13:29 +00:00
hendricks266 1f0693eca4 Implement OGG looping support; musicians rejoice!
Loops are controlled by two tags in the Vorbis Comment, both in PCM samples.

LOOP_START holds the beginning of the loop, the position to which playback returns at the end of the loop.

LOOP_END is optional; it holds the end of the loop, after which the game seeks to LOOP_START. If undefined, the end of the OGG is the end of the loop. The primary purpose of LOOP_END is if you want to give your file a proper ending for listening outside the game.

To preview a looped OGG you have assembled, give it a ".logg" extension and play it using the vgmstream plugin for Winamp or foobar2000.

git-svn-id: https://svn.eduke32.com/eduke32@3218 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:12:15 +00:00
hendricks266 6c59071155 Stop all sounds after completion of LOGO.ANM.
git-svn-id: https://svn.eduke32.com/eduke32@3217 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:11:50 +00:00
hendricks266 f8b2b9088c Allow CAMERA1 to have cstat 32768.
git-svn-id: https://svn.eduke32.com/eduke32@3216 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:11:30 +00:00
terminx 1fb8684bef Factor out duplicate code in CONTROL_BindKey/CONTROL_BindMouse/CONTROL_FreeKeyBind/CONTROL_FreeMouseBind
git-svn-id: https://svn.eduke32.com/eduke32@3214 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-20 01:33:25 +00:00
helixhorned d5fa8ade49 build.lua: provide simplistic "readdefs()", use in foreachmap.lua.
So that symbolic tile names can be used when searching maps.

git-svn-id: https://svn.eduke32.com/eduke32@3212 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 19:01:39 +00:00
helixhorned 1009e0f2ec Remove many redundant (int16_t) casts and one now incorrect one.
The redundant ones are in code like this: s->cstat = (int16_t)32768;
Because the value is eventually converted to the type of "s->cstat", any
casts to integral types having at least as many bits are no-ops, signedness
being irrelevant due to (probably any two's complement arch targeting
compiler's) bit-pattern preserving semantics of these conversions.

The now incorrect one is: if (lotag == (int16_t) 65535),
"int32_t lotag" being read from a wall or sprite struct directly earlier.
Now, with these members being unsigned, and (int16_t)65535 equalling -1,
the check always fails.  The correction fixes normal switches having such
a lotag ending the level immediately.

In short: integer casts before assignments are unnecessary, those in reads
highly relevant!

git-svn-id: https://svn.eduke32.com/eduke32@3211 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 19:01:34 +00:00
helixhorned 0153853024 Correct arithmetic comparisons of lo/hitags in actors.c.
Rewriting them in the obvious way, i.e. by casting the expression
to int16_t first.  (That is, this commit is the reverse of r3174,
but with casts applied.)  This fixes at least one regression: a
FIREEXT with a hitag of 0 should not be linked with same-
(that is, zero-) tagged SEENINEs or OOZFILTERs.
Mind the corner cases!

git-svn-id: https://svn.eduke32.com/eduke32@3210 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 19:01:29 +00:00
helixhorned d8cd41fa94 Fix bound keys' commands being truncated in settings.cfg, control* cleanup.
- provide functions instead of messing with CONTROL_*Binds directly
- comment out a few more unused functions
- make clear what memory (alloc'd or const char *) 'keybind' members use
- for keys with no name, use "<?>"

git-svn-id: https://svn.eduke32.com/eduke32@3209 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 15:44:18 +00:00
terminx 878e41c34b Fix a keyboard scancode oversight I introduced with my changes last night, apparently caused crashes
git-svn-id: https://svn.eduke32.com/eduke32@3208 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 00:07:44 +00:00
helixhorned 6abb63670c A couple of meaning-preserving rewrites of picanm[]-touching code.
git-svn-id: https://svn.eduke32.com/eduke32@3204 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:37 +00:00
helixhorned dd424fac70 Mapster32: fix cycling picnum in 3D mode.
Using non-keypad [-]/[+] or LMB + mousewheel, it was broken when a void
tile was in between.

git-svn-id: https://svn.eduke32.com/eduke32@3203 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:33 +00:00
helixhorned 44904b12be Clean up picanm[] by making its elements values of struct type picanm_t.
The size of that struct is currently 4, and its layout almost the same as
what is read in with loadpics().  The number of tiles in an animation is
bumped to 256, so that the max. tile difference in DEF's animtilerange is
255. (There's no way to have such animations from ART.)

git-svn-id: https://svn.eduke32.com/eduke32@3202 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:28 +00:00
helixhorned 29a8f245b8 Lunatic: update BUILD types with signed->unsigned changes of *stat.
git-svn-id: https://svn.eduke32.com/eduke32@3201 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:18 +00:00
terminx 83ae3a407a Further minor MACT cleanups
git-svn-id: https://svn.eduke32.com/eduke32@3200 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:48:11 +00:00
terminx bbbeefc6a1 Replace a few one line MACT mouse functions with macros that do the same thing
git-svn-id: https://svn.eduke32.com/eduke32@3199 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:48:05 +00:00
terminx f8a373cb70 Remove useless CONTROL_UserInputCleared. It was useless in the literal sense, e.g not actually used anywhere. :p
git-svn-id: https://svn.eduke32.com/eduke32@3198 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:48:02 +00:00
terminx 992de02101 Change key bindings to use dynamic allocation and remove the previous limit of 128 characters per key bind
git-svn-id: https://svn.eduke32.com/eduke32@3197 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:47:58 +00:00
terminx a5ee23215d Minor cleanups in MACT control.c
git-svn-id: https://svn.eduke32.com/eduke32@3196 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:47:53 +00:00
terminx 11a5000630 Rename a few variables we've added to MACT over the years to be more consistent with the rest of its naming conventions
git-svn-id: https://svn.eduke32.com/eduke32@3195 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:47:47 +00:00
terminx 2ab811cd9b Remove xdelta3 since it doesn't fit in with our current networking plans anymore
git-svn-id: https://svn.eduke32.com/eduke32@3193 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-16 15:40:28 +00:00
terminx ed464aaadc Add "ulotag" and "uhitag" to get/setactor/wall/sector, which exposes the tags unsigned, without the typecast to int16_t. This might be useful to someone.
git-svn-id: https://svn.eduke32.com/eduke32@3192 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-16 00:54:04 +00:00
helixhorned 3c651e0a53 CON: make lotag/hitag getters return signed values, as per agreement on IRC.
This means that the internal change done to these sprite members in r3159 is
hidden from CON for backward-compatibility purposes.  Note that .cstat and
.{ceiling,floor}stat aren't touched, and will return unsigned values to CON.

git-svn-id: https://svn.eduke32.com/eduke32@3189 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 21:10:02 +00:00
helixhorned b5cead500a foreachmap.lua: add possibility of running code per s/w/s match with ':' shortcut
Also, add a missing "pragma pack(pop)" to build.lua.

git-svn-id: https://svn.eduke32.com/eduke32@3185 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 21:09:48 +00:00
helixhorned 0a999d7a7e Mapster32: Fix clipboard tile display in 3D mode.
git-svn-id: https://svn.eduke32.com/eduke32@3183 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:55 +00:00
helixhorned 225294e8ce demo.c: time G_DoMoveThings() using a double instead of an int32_t.
I think this may fix some negative "non-profiled overhead" that I
have been seeing.

git-svn-id: https://svn.eduke32.com/eduke32@3182 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:53 +00:00
helixhorned 5f76f699b2 Bump BYTEVERSION.
git-svn-id: https://svn.eduke32.com/eduke32@3181 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:50 +00:00
helixhorned 6547495cac Split r3159..r3161, part 14: The rest.
git-svn-id: https://svn.eduke32.com/eduke32@3180 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:47 +00:00
helixhorned 107fa9cc39 Split r3159..r3161, part 12: Add explicit casts, non-pointer types.
Notes:
 - Atomic Edition (Censored) -> Plutonium Pak in grpscan.c
 - "scale" in astub.c:drawtileinfo() is incorrect, I think.
 - in demo.c, the gethitickms() value should be returned to a double.

git-svn-id: https://svn.eduke32.com/eduke32@3178 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:41 +00:00
helixhorned 61d038f217 Split r3159..r3161, part 11: Add explicit casts, pointer types.
git-svn-id: https://svn.eduke32.com/eduke32@3177 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:36 +00:00
helixhorned 5ad385c043 Split r3159..r3161, part 10: add explicit casts to *alloc return values.
NOTE: changes such as these are best viewed with something like
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]'

git-svn-id: https://svn.eduke32.com/eduke32@3176 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:29 +00:00
helixhorned 6b01b43713 Split r3159..r3161, part 9: make CON's 'respawnhitag' unconditional on hitag.
... in the 'default' case (non-FEM* tiles).

git-svn-id: https://svn.eduke32.com/eduke32@3175 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:21 +00:00
helixhorned 2cb3734f85 Split r3159..r3161, part 8: make some members of base types unsigned.
NOTE: This will need very thorough review.

git-svn-id: https://svn.eduke32.com/eduke32@3174 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:18 +00:00
helixhorned 7c07fee1b3 Split r3159..r3161, part 7: code touching networking.
git-svn-id: https://svn.eduke32.com/eduke32@3173 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:14 +00:00
helixhorned 6d5d415ea5 Split r3159..r3161, part 6: code conditional on __cplusplus.
Note the type change of vplce[] in engine.c: int32_t -> uint32_t.

git-svn-id: https://svn.eduke32.com/eduke32@3172 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:11 +00:00
helixhorned 5485206c03 Split r3159..r3161, part 3, addendum 1: add a forgotten "Bfstat".
git-svn-id: https://svn.eduke32.com/eduke32@3171 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:07 +00:00
helixhorned 274726be9b Split r3159..r3161, part 5: "nowarn" wrapping of printing functions.
git-svn-id: https://svn.eduke32.com/eduke32@3170 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:04 +00:00
helixhorned f7eb5adb40 Split r3159..r3161, part 4: Tweaks of tiledata_t's "cacherange" member.
REM: This will need a savegame version bump.

git-svn-id: https://svn.eduke32.com/eduke32@3169 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:00 +00:00
helixhorned 9dd3748b03 Split r3159..r3161, part 3: MSVC, nedmalloc, *layer, startup windows.
git-svn-id: https://svn.eduke32.com/eduke32@3168 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:57 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00
hendricks266 a418bec8c2 Tools updates:
- Eliminate use of the C++ standard library from arttool. I improved some of the program's workings but it continues to corrupt my art files in certain circumstances. (Note: Not a regression; it happens with previous revisions.)
- Construct "make utils" for the game side following the pattern of the engine.
- Move ivfrate to this new distinction.
- Minor Makefile cleanup and tweaks, mainly to facilitate CLANG=1 and to formalize text output in special cases.

git-svn-id: https://svn.eduke32.com/eduke32@3163 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 06:42:37 +00:00
terminx 3ff46c02b2 Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!)


git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-14 23:32:43 +00:00
terminx 2cea43f150 Fix r3155 fuckup :)
git-svn-id: https://svn.eduke32.com/eduke32@3158 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-13 15:08:10 +00:00
helixhorned 51c544f4da Rewrite old-version-savegame signaling in a cleaner fashion.
git-svn-id: https://svn.eduke32.com/eduke32@3156 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-13 10:50:06 +00:00
terminx 00084e9e22 Update Net_SendVersion() and Net_ReceiveVersion() to use a 16-bit representation of BYTEVERSION
git-svn-id: https://svn.eduke32.com/eduke32@3155 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-12 15:47:52 +00:00
terminx 39437b2fdc Fix useractor enemystayput breakage
git-svn-id: https://svn.eduke32.com/eduke32@3154 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 18:46:02 +00:00
helixhorned 4b66769bcb Couple of tweaks in player.c to match all ProjectileData[...].xxx with a regexp.
It would be something like "ProjectileData\[([^]]+)]\.([a-z_]+)".

git-svn-id: https://svn.eduke32.com/eduke32@3152 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:57:09 +00:00
helixhorned a76a796ebb Fix demo playback with diff application enabled.
This requires ripping out the .proj member of tiledata_t back into
ProjectileData[] again because it was the only one in g_tile[] that
changed during the course of a game.  The g_tile[] array is now also
correctly flagged as "constant throughout a game" (DS_NOCHK).
Savegame version bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3151 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:57:06 +00:00
helixhorned ed9fa753f1 Trivial G_Util_PtrToIdx*() tweaks.
git-svn-id: https://svn.eduke32.com/eduke32@3150 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:57:01 +00:00
helixhorned 3d74c8a9fd Fix viewing through moving cameras.
It's still not pretty though since there's no interpolation from G_DrawRooms().

git-svn-id: https://svn.eduke32.com/eduke32@3149 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:56:57 +00:00
helixhorned 3bcdc5acb8 Lunatic reorganization part 2: split into engine and editor/game parts.
On the engine side (functions starting with L_), there are now the basic
parts like state creation and running code from strings and files.
The game and editor can add to that by e.g. loading whatever they please
into the state. Their functions start with El_ and Em_, respectively.
The Lua scripts still reside in source/lunatic, even for the common ones.
This is because they will be embedded into the binaries as bytecode or
compressed source eventually, so their location on disk will be irrelevant.

git-svn-id: https://svn.eduke32.com/eduke32@3148 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 20:59:00 +00:00
helixhorned 550acb2b1a Lunatic reorganization part 1: two renames and one deletion.
See the next commit for details.

git-svn-id: https://svn.eduke32.com/eduke32@3147 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 20:58:54 +00:00
helixhorned d85f529b74 Introduce a per-tile bit preventing fullbrights in GL modes, use for LOADSCREEN.
git-svn-id: https://svn.eduke32.com/eduke32@3145 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:17 +00:00
helixhorned c71b3d529c Classic: fix rotatesprite with no screen scaling and non-widescreen aspects.
Also, enable showing sprites in Mapster32's overhead view again, since that
was one (the only?) use of that code path.  The uninitialized read was
introduced in r2927.

git-svn-id: https://svn.eduke32.com/eduke32@3144 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:13 +00:00
helixhorned 547b28b63e When looking through a camera, don't do third person view.
Also, reorganize some G_DrawRooms() code a little without changing anything.

git-svn-id: https://svn.eduke32.com/eduke32@3143 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:10 +00:00
helixhorned e7e777348b When found a camera sprite for viewscreen, set position etc. immediately.
Instead of later in P_ProcessInput(). This fixes one drawrooms() call in
between where the sectnum is the camera's, but the position the player's,
which can lead to a slow "outer view" render in Polymer.

git-svn-id: https://svn.eduke32.com/eduke32@3142 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:07 +00:00
Plagman be310c4d00 Fix warning in jaudiolib due to void ptr arith.
git-svn-id: https://svn.eduke32.com/eduke32@3140 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 01:53:54 +00:00
Plagman a0dd0c85a5 Add automatic tracking to the sector[], wall[], sprite[] and tsprite[]
arrays; any write access to them will run the corresponding hook and write
to the [sector/wall/sprite/tsprite]clean array.

Note: tsprite and sprite use the same hook and require running a few more
instructions per access in order to disambiguiate; this could be made more
optimal (like the other arrays) by clearly separating the types in the game
code.

Note #2: taking a member's address currently marks it dirty because of tons
of helper functions across the editor code. I don't know how many read-only
accesses we have after taking a member address, but it could also be fixed
with some finessing of the code.

git-svn-id: https://svn.eduke32.com/eduke32@3138 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-09 22:31:02 +00:00
terminx e0f519ddb0 Fix C90 compliance warning in sdlmusic
git-svn-id: https://svn.eduke32.com/eduke32@3134 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-08 22:09:30 +00:00
terminx a4311f5cb1 Fix warning from r3128
git-svn-id: https://svn.eduke32.com/eduke32@3133 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-08 22:09:00 +00:00
helixhorned 61f79336d6 Make ivfrate build standalone, Makefile tweaks.
git-svn-id: https://svn.eduke32.com/eduke32@3132 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-08 21:54:17 +00:00
helixhorned b2162f554d New utility ivfrate(.exe) and a couple of small VP8 changes.
The command-line utility can query and set the frame rate of IVF files, since
apparently encoders don't care too much about setting proper values in the IVF
header.  Also, add the utility to the synthesis build.

On the playback side in EDuke32, get rid of the 1/(2*fps) "correction" if the
FPS numerator is <1000 (presumably used in older encoders) and properly print
the frame rate's fractional part.

git-svn-id: https://svn.eduke32.com/eduke32@3131 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-08 20:17:23 +00:00
helixhorned 17bac8cb55 Lunatic: "fix" building.
git-svn-id: https://svn.eduke32.com/eduke32@3130 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-08 20:17:19 +00:00
terminx d37e1093f5 Fix console key changing breakage
git-svn-id: https://svn.eduke32.com/eduke32@3128 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-08 17:00:31 +00:00
helixhorned 0f35221820 Prettify some code where I felt was necessary.
git-svn-id: https://svn.eduke32.com/eduke32@3127 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 23:06:44 +00:00
helixhorned 935f3ec50d When binding a key, take care of processing one-to-many binds properly in menu.
This means that the "Keyboard Setup" should now properly reflect the bindings,
except in the theoretical case of one gamefunc being bound more than two keys.
(What was fixed is the one key to many gamefuncs case.)

git-svn-id: https://svn.eduke32.com/eduke32@3126 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 23:06:40 +00:00
helixhorned 27c0c9c342 Get rid of the code reading in [KeyDefinitions] section of eduke32.cfg.
That section was only ever read in for little profit and never written
out!  Keyboard input is actually dispatched as OSD commands for a good
while, so that old cruft has to go!

git-svn-id: https://svn.eduke32.com/eduke32@3125 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 23:06:38 +00:00
helixhorned c429f3fbc4 Clean up control.c.
- Remove everything using CONTROL_KeyMapping, which was only written to.
- Remove unused functions, make local ones static.
- Remove private function declarations in _control.h.

git-svn-id: https://svn.eduke32.com/eduke32@3124 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 23:06:34 +00:00
hendricks266 a0c6fb9805 Fix linking with CLANG=1 by separating $(INVOCATION) into $(COMPILER) and $(LINKER) and removing "-x" from clang as a linker in Makefile.common. Additionally, the Build tools are now affected by CPLUSPLUS=1, for which small corrections have been made.
git-svn-id: https://svn.eduke32.com/eduke32@3122 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 07:49:44 +00:00
Plagman b31d5c9d59 Fix build error after C++ conversion.
git-svn-id: https://svn.eduke32.com/eduke32@3121 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-06 05:07:11 +00:00
hendricks266 10c7206d1c Tweak r3116.
git-svn-id: https://svn.eduke32.com/eduke32@3118 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 03:48:03 +00:00
hendricks266 fcf9beae6a Work-in-progress adjustment to the C code to compile under C++. It builds for me without errors using Win32 MinGW-GCC, but it still generates warning soup. No guarantees about MSVC or anything using SDL. Enable C++ by building with CPLUSPLUS=1. C remains the default and should compile with no change in setup.
Credit to Plagman for the idea and doing the work on the game side, which is included in this commit.

(Building as C++ will give us features with which we can make improvements and optimizations on the multiplayer code and Polymer.)

git-svn-id: https://svn.eduke32.com/eduke32@3116 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 02:49:08 +00:00
terminx 5cca0d4ffe Add some compile time defined names for p->inven_icon values. Too bad these values aren't in the same order as the inventory items themselves... (dukeinv_t and dukeinvicon_t values do not match).
git-svn-id: https://svn.eduke32.com/eduke32@3115 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:41:05 +00:00
helixhorned 20f0f21986 engine.c: add bound-check assert failing for sprites in m32's textured 2D mode.
Also, disable drawing sprites in that mode for now.

git-svn-id: https://svn.eduke32.com/eduke32@3114 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:03:26 +00:00
helixhorned 65a7ed04f7 Mapster32: functionality to rotate or scale RShift-highlighted stuff smoothly.
This is done by pressing LShift and
 - holding down the left mouse button for scaling, or
 - the right mouse button for rotating the highlighted walls/sprites
with respect to a pivot point determined as the center of the bounding box of
all highlighted points.

Note that scaling sectors isn't that easy and the current functionality is very
rudimentary: there's no z scaling, no xrepeat correction, and sprites aren't
touched expect for their position.  The user is responsible to maintain map
consistency, for example to prevent wall-lines of the same sector crossing
each other.

git-svn-id: https://svn.eduke32.com/eduke32@3113 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:03:22 +00:00
helixhorned 737e6e6a17 Mapster32: when looking for matching wall in 2nd pt. ins., don't skip gray nextwalls.
This fixes a bug where it's not possible to split a sector under certain
circumstances, reported by Micky C here:
http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__view__findpost__p__138380

Also, don't allow zero in various 'F functions: Resize selection and
Global {shade, visibility} divide.

git-svn-id: https://svn.eduke32.com/eduke32@3112 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-04 23:03:16 +00:00
helixhorned c9558d5ab4 VPX: print determined frame rate to the log.
Currently, the FPS determination is based on libvpx's vpxdec.c code, which uses
the FPS provided in the IVF file in one case, and simply sets it to 30 FPS in
the other.  For the first case, a "correction" is carried out for something
which the comments suggest to originate from other (old?) VPX encoder versions.

git-svn-id: https://svn.eduke32.com/eduke32@3110 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:45 +00:00
helixhorned ed0e73c84a Lunatic: update structures, find maps case-insensitively in findmaps.sh.
git-svn-id: https://svn.eduke32.com/eduke32@3109 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:43 +00:00
helixhorned e6fdb25d6d Mapster32: draw lines to linking sprites with LShift, jump to them with +[ or +]
When LShift is pressed and the mouse is over a linking sprite (as determined by
the tag labeling system), lines are drawn to all other sprites, and pressing
[ or ] will cycle these then. False positives and missed sprites are possible.

Additional changes:
 - consider SE 31 and 32's lotag to NOT be linking, since the ACTIVATOR is what
   matters.  The original maps are inconsistent there.
 - When pressing Alt+[ or Alt+] and there are no corruptions, say so instead of
   doing [ or ].

git-svn-id: https://svn.eduke32.com/eduke32@3108 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:39 +00:00
helixhorned 2dfe3c3d93 Lunatic: make geom.lua work standalone, fix __eq metamethods for dvec[23]_t.
git-svn-id: https://svn.eduke32.com/eduke32@3107 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:35 +00:00
terminx 6f3f2eb1b8 Hopefully fix the projectile breakage, and add some predefined names for working with the built in statnums
git-svn-id: https://svn.eduke32.com/eduke32@3105 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-31 15:03:33 +00:00
terminx 88c95a18f7 Retire the actorscrptr[], actorLoadEventScrptr[], SpriteFlags[], ActorType[], SpriteCacheList[], ProjectileData[] and DefaultProjectile[] arrays in favor of a tile_t structure exposed as g_tile[]. This consolidates most of the MAXTILES sized arrays on the game side into one place.
git-svn-id: https://svn.eduke32.com/eduke32@3102 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-30 15:54:35 +00:00
hendricks266 f18ef269ed Add EVENT_CHANGEMENU and clean up menus.c a little more.
This event is useful in certain circumstances where you want to skip a menu/screen value and the design of the monster switch statement would require the M_ChangeMenu() call to be intercepted or the unwanted screen will flash for a split second.

git-svn-id: https://svn.eduke32.com/eduke32@3101 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:29:45 +00:00
hendricks266 2066656aed Two new player structure members: "autostep" and "autostep_sbw".
These control the maximum difference in height between two sectors that the player will automatically traverse without needing to jump.

The latter controls the special case when the player's sector's lotag is ST_1_ABOVE_WATER or p->spritebridge == 1.

BYTEVERSION bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3100 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:29:17 +00:00
hendricks266 3366df0dbd Remove unused variable "doretry" from S_PlaySound().
git-svn-id: https://svn.eduke32.com/eduke32@3099 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:28:50 +00:00
hendricks266 80e8b18c66 Revise grpfiles[] to include the censored South Korean GRP.
git-svn-id: https://svn.eduke32.com/eduke32@3098 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:28:31 +00:00
hendricks266 f51bdc2faa Slight makefile reorganization and cleanup.
* Centralize optimization strategies in Makefile.common. This required moving detection of $(PLATFORM), which makes sense if we work on the paradigm that Makefile.common is for generic compiler setup and Makefile.shared works with libraries and things closer to the engine and game code itself.
* New Makefile variables OPTOPT (Optimization Options) and CUSTOMOPT (Custom Optimizations). OPTOPT by default contains -march, -mtune, etc. Setting this variable from Make invocation will blank these. CUSTOMOPT (Custom Optimizations) works the same but in an additive fashion, overwriting nothing. Technically CUSTOMOPT could stand for (Custom Options) and include any additional parameters sent to both linker and compiler.
* Factor out literal names of the main executables.
* The build process now prints assembler (if NOASM=0) and linker settings in addition to compiler settings.

git-svn-id: https://svn.eduke32.com/eduke32@3096 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:26:25 +00:00
terminx a3fe057c0a WIP networking updates from Jasper Foreman
git-svn-id: https://svn.eduke32.com/eduke32@3095 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-28 22:27:53 +00:00
terminx 067baf626a Comment out the A_GetZLimits() call right before the Bassert() in A_MoveSprite(). This call is a problem because the assertion expects "dasectnum" and spr->sectnum to match, but A_GetZLimits() can itself call A_SetSprite() which results in another call to A_MoveSprite() and can potentially change the sectnum again.
This commit also adds the NOTELEPORT sprite flag, which of course prevents sprites from teleporting.


git-svn-id: https://svn.eduke32.com/eduke32@3094 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-24 13:21:02 +00:00
Plagman e726484ccc polymer: add support for negative lights
And hook them up to cstat 128 (half-submerged, 'c' in mapster).

git-svn-id: https://svn.eduke32.com/eduke32@3092 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-21 04:52:43 +00:00
Plagman 9d10b0b087 polymer: add a prlight flag to make shadow-less spotlights
And hook it up to SE cstat 64 ('1' in mapster32). This disables both lightmaps
and shadow maps for the spotlight; please let me know if you have a usecase
where you want lightmaps but no shadow maps for specific lights.

git-svn-id: https://svn.eduke32.com/eduke32@3091 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-21 03:41:13 +00:00
terminx fdef8a6b8c Remove a debug line I accidentally committed a few days ago.
git-svn-id: https://svn.eduke32.com/eduke32@3090 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-20 15:58:06 +00:00
terminx 2c00f53008 Add some CON defines for friendly names to pass to definegamefuncname. Now, instead of "definegamefuncname 36 something" you would "definegamefuncname GAMEFUNC_TURNAROUND something". It's just a little something to make CON files more readable.
git-svn-id: https://svn.eduke32.com/eduke32@3089 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-16 17:05:14 +00:00
terminx ef92094aa5 Update xdelta3 to 3.0.4. I haven't actually tested these changes yet but they're directly from upstream.
git-svn-id: https://svn.eduke32.com/eduke32@3088 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-15 16:13:13 +00:00
terminx 54ec3c7640 Minor menu cleanups, only half-finished (if that).
git-svn-id: https://svn.eduke32.com/eduke32@3084 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:16:07 +00:00
terminx 2fde79b4bc A potential fix for MUSICANDSFX problems after loading a savegame. I was never able to reproduce the issue myself, but something like this seems like a good idea anyway. Thoughts?
git-svn-id: https://svn.eduke32.com/eduke32@3083 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:13:49 +00:00
terminx 28fab0d06d actors.h updates needed for the networking changes I committed a few minutes ago
git-svn-id: https://svn.eduke32.com/eduke32@3082 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:11:09 +00:00
terminx f6a11eacc1 Clean up a couple of functions, namely P_IncurDamage()
git-svn-id: https://svn.eduke32.com/eduke32@3081 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:10:29 +00:00
terminx 7e248dcc49 Remove some outdated/incorrect code that was causing some issues when multiple copies of a single sound were playing and just one of them needed to be stopped.
git-svn-id: https://svn.eduke32.com/eduke32@3080 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:09:16 +00:00
terminx 901b1bff0f Networking updates. Don't bother testing this to see if things are any better, because they aren't. :p
git-svn-id: https://svn.eduke32.com/eduke32@3079 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 21:52:51 +00:00
helixhorned ce948c6ee4 Factor out 2x identical code into G_WeaponHitCeilingOrFloor().
git-svn-id: https://svn.eduke32.com/eduke32@3077 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:30 +00:00
helixhorned b03c95443b Clean up G_MoveWeapons(), among other things getting rid of weird indentation.
git-svn-id: https://svn.eduke32.com/eduke32@3076 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:28 +00:00
helixhorned abd8753e66 Clean up A_MoveSprite(), no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@3075 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:25 +00:00
helixhorned 8adb9d27af Rearrange G_MoveTransports() code a little to cut down on nested switches.
git-svn-id: https://svn.eduke32.com/eduke32@3074 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:23 +00:00
helixhorned a92d5486c4 Replace all/most literal SE lotags 1/2 with SE_1_ABOVE_WATER or SE_2_UNDERWATER.
Also catch some other literal SEs and statnums.

git-svn-id: https://svn.eduke32.com/eduke32@3073 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:21 +00:00
helixhorned e921346dac TROR: Prototypical no-SE7 water submersion/emersion.
Submersion only happens when the upper sector has lotag 1 and its vertical
neighbor has lotag 2 (this can be useful to create non-submergible above-water
sectors).  Currently, only the player is handled.  On the implementation side,
the water handling code is split into P_Submerge() and P_Emerge() preparing the
"teleportation", and P_FinishWaterChange() for the finalization.

git-svn-id: https://svn.eduke32.com/eduke32@3072 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:17 +00:00
terminx bc9a29b121 CON access to ud.runkey_mode through get/setuserdef
git-svn-id: https://svn.eduke32.com/eduke32@3071 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 18:18:30 +00:00
terminx 2d58801d8c Add cvar "cl_runmode" to control ud.runkey_mode. This should fix the "allow walk while running" preference not saving.
git-svn-id: https://svn.eduke32.com/eduke32@3069 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 14:43:37 +00:00
terminx 83dd447621 Fix the bug I caused with custom projectiles :p
git-svn-id: https://svn.eduke32.com/eduke32@3067 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-11 03:25:10 +00:00
terminx 084ec632ea The other half of the previous commit.
git-svn-id: https://svn.eduke32.com/eduke32@3066 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-08 07:07:59 +00:00
terminx 5010b17efe Fix issue with explosion sound cutoff in E1L2. This implements functionality to stop playback and free up the voice of a currently playing sound of the same ID when there are already MAXSOUNDINSTANCES (currently 8) of the same sound playing, determined by distance/volume and which sound is oldest.
Initial determination is based purely on distance/volume, and if two qualifying sounds have the same distance/volume the one which started playback first is the one that gets the axe.

Feedback from other developers welcome.


git-svn-id: https://svn.eduke32.com/eduke32@3065 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-08 07:07:17 +00:00
helixhorned a2ed3682ee Lunatic: expose updatesector*, add random walker as timing test for them.
git-svn-id: https://svn.eduke32.com/eduke32@3064 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:29 +00:00
helixhorned 8f89c89d86 Lunatic: various tweaks and API changes/additions.
git-svn-id: https://svn.eduke32.com/eduke32@3063 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:24 +00:00
helixhorned 3a7b697a32 Lunatic-m32: save command input history.
git-svn-id: https://svn.eduke32.com/eduke32@3062 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:20 +00:00
helixhorned 1682eae693 Lunatic: various tweaks.
Going to extremes to avoid code duplication like the plague, but at
least it's great to learn about the whole function environment business.

git-svn-id: https://svn.eduke32.com/eduke32@3060 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:13 +00:00
helixhorned 36687ab986 Lunatic-m32: take over load path.
git-svn-id: https://svn.eduke32.com/eduke32@3059 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:09 +00:00
helixhorned 2851f412d2 Lunatic-m32: add an OSD command to be able to interface with stuff.
git-svn-id: https://svn.eduke32.com/eduke32@3058 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:04 +00:00
helixhorned f9e61ce37e Lunatic: fix up Makefiles, split dynsymlists.
The Makefile now has separate {GAME,EDITOR}LDFLAGS, so the correct
dynamic symbol list can be specified.

git-svn-id: https://svn.eduke32.com/eduke32@3057 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:25:58 +00:00
helixhorned 851c6b081d Lunatic: prototypical editor binding.
git-svn-id: https://svn.eduke32.com/eduke32@3056 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:25:52 +00:00
terminx 9120696e86 Minor cleanups in actors.c, mostly relating to custom projectiles and the like. A bug causing custom projectiles to knock the player back twice as far as the hard-coded ones was also fixed. There should be no other functional changes for the end user.
git-svn-id: https://svn.eduke32.com/eduke32@3053 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-05 20:48:10 +00:00