Commit Graph

3452 Commits

Author SHA1 Message Date
helixhorned 42f66ce9ca Lunatic: add 'fs' module containing 'listpath' function, 'd' in global env.
See the updated documentation for (ATM sparse) details.

git-svn-id: https://svn.eduke32.com/eduke32@4147 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-11 16:48:23 +00:00
helixhorned 8029aceaa4 CON: add sprite pseudo-member 'isvalid', getting 1 if the sprite is valid.
And 0 otherwise. Before accessing a sprite that is not not known to be
definitely valid (e.g. a loop over all sprites from 0 to MAXSPRITES-1),
one should check for validity before accessing it in any other fashion.

git-svn-id: https://svn.eduke32.com/eduke32@4146 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-11 16:48:17 +00:00
helixhorned 92594f09c8 Lunatic: add two names forgotten for dynsymlist.
Let's BUILD_LUNATIC to see whether it still works...

git-svn-id: https://svn.eduke32.com/eduke32@4145 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:49 +00:00
helixhorned f63510cc33 In C_SetCfgName, don't use unsafe string functions with unknown-length input.
git-svn-id: https://svn.eduke32.com/eduke32@4144 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:47 +00:00
helixhorned b67c76f814 LunaCON: implement 'setcfgname'.
Factor out a block of code into C_SetCfgName() and use that from lunacon.lua.

git-svn-id: https://svn.eduke32.com/eduke32@4143 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:45 +00:00
helixhorned f620a28d74 LunaCON: on 'starttrack' with null music, issue a 'soft' error.
That is, one that doesn't break the control flow.

git-svn-id: https://svn.eduke32.com/eduke32@4142 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:42 +00:00
helixhorned 84357152eb Lunatic: fix ported A_FurthestVisiblePoint().
git-svn-id: https://svn.eduke32.com/eduke32@4141 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:40 +00:00
helixhorned 77574e30b9 LunaCON: implement NORESET flag for gamevars.
git-svn-id: https://svn.eduke32.com/eduke32@4140 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:37 +00:00
helixhorned 37d8cbedcc OSD: factor out getting sh/pal using format+text buffers into OSD_GetShadePal().
git-svn-id: https://svn.eduke32.com/eduke32@4136 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:08 +00:00
helixhorned 794edf18ff Lunatic: add 'lua' OSD command, permitting to execute arbitrary code.
That is, everything that would be possible via scripting.

git-svn-id: https://svn.eduke32.com/eduke32@4134 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:03 +00:00
helixhorned e132073640 For demos, make savehead.savename[] carry the SVN revision number.
Also, shorten "FAILED STARTING DEMO RECORDING." message so that it fits on
the screen. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4133 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 18:21:09 +00:00
helixhorned 4cb24de24e In exprs like "Bmemcpy(&p->pos.x, &sprite[i].x, sizeof(vec3_t))", drop the ".x".
git-svn-id: https://svn.eduke32.com/eduke32@4132 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 18:21:07 +00:00
hendricks266 ccf7d2d470 Allow -g, -x, -h, -j, and for the game, -d, to take their file name after a space. This allows quotes to be used with them properly.
I updated the help windows to prefer these variants because they are superior to the -xSquished versions.
Also, factor out the command-line processing code for the above, plus con/def modules and clipmaps.

git-svn-id: https://svn.eduke32.com/eduke32@4128 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-03 04:02:23 +00:00
hendricks266 837c5c6b84 RegCloseKey when we are done with RegOpenKeyEx.
git-svn-id: https://svn.eduke32.com/eduke32@4127 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-03 04:02:01 +00:00
helixhorned b6475100d7 In G_SaveMapState, fix 1024-byte write beyond array bound on 64-bit platforms.
This was caused by mismatched for types mapstate_t's animateptr[] and the global
one (int32_t vs. int32_t *).

Bump BYTEVERSION.

git-svn-id: https://svn.eduke32.com/eduke32@4125 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:32 +00:00
helixhorned 8beb990640 m32script: when failing to load file, don't append '.m32' if already there.
So that there are no error messages like "M32 file `a.m32.m32' not found."

Also, in build.c's 'save as' code, add a bound check that would probably
always pass in practice, but looks a bit safer and may fail in very cornerly
cases.

git-svn-id: https://svn.eduke32.com/eduke32@4124 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:30 +00:00
helixhorned 491e67c1cc m32script: when printing error line, replace tabs with spaces.
git-svn-id: https://svn.eduke32.com/eduke32@4122 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:27 +00:00
helixhorned c2797e4b11 Mapster32: take initial map file name from ExtPreInit()->G_CheckCommandLine().
Instead of directly in build.c:app_main(). Previously, it was possible that an
argument to an option, e.g. "WGR2" with "-game_dir WGR2", would get interpreted
as the initial map to load. This in turn would attempt to execute WGR2.cfg as
sequence of OSD commands -- where that file is an EDuke32 config file instead!

Now: maps are passed without any options, e.g. "mapster32 [opts...] debug.map".
The map file name is not added to the "additional parameters" for map testing.

git-svn-id: https://svn.eduke32.com/eduke32@4121 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:25 +00:00
helixhorned 25edec9c0a LunaCON: very primitive gamevar handling logic for {save,load}mapstate.
git-svn-id: https://svn.eduke32.com/eduke32@4119 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:22 +00:00
helixhorned 6c88824792 LunaCON: in {save,load}mapstate, warn that saving/restoring gamevars is NYI.
git-svn-id: https://svn.eduke32.com/eduke32@4118 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:20 +00:00
helixhorned ab7d3679df At end of G_RestoreMapState(), update g_player[].ps->i from STAT_PLAYER sprites.
This fixes a potential crash caused by violating the expected invariant
 sprite[g_player[player_index].ps->i].yvel == player_index
otherwise.

git-svn-id: https://svn.eduke32.com/eduke32@4114 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-25 21:57:09 +00:00
helixhorned 335957800b Lunatic doc: add Lua source code highlighting using GNU Source-highlight.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4113 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-24 17:48:19 +00:00
helixhorned d9b94c772d LunaCON: implement NODEFAULT flag (1024) as session variables.
This is in contrast to C-CON, where the implications are not clearly obvious.
See this discussion/monologue:
http://forums.duke4.net/topic/955-eduke32-scripting/page__view__findpost__p__159613

Currently not implemented for session gamevars:
 - per-player, will be made a global one instead
 - per-actor, will be made a plain per-actor one instead

DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4112 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-20 12:35:06 +00:00
helixhorned 937958afef LunaCON: add necessary identifier-is-not-gamevar check.
git-svn-id: https://svn.eduke32.com/eduke32@4111 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-20 12:35:03 +00:00
helixhorned 8248ef8446 CON: Add LOGO_FLAGS bits 4096-32768 to disable E1-E4 bonus scenes, respectively.
Each scene is disabled in its entirety, there's no way to disable only a
particular part. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4109 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-17 16:44:28 +00:00
helixhorned 7791f94073 Lunatic: make it possible to build with LuaJIT 2.1, add -Lopts=profile there.
git-svn-id: https://svn.eduke32.com/eduke32@4107 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:06 +00:00
helixhorned 1b29ac6db7 build.lua: add read_basepal().
git-svn-id: https://svn.eduke32.com/eduke32@4106 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:03 +00:00
helixhorned 4cb9ab1d7c foreachmap.lua: remove the need for a space for certain '.' accesses.
That is, now it's not necessary to write e.g. "io. write" -- .xxx is
translated to <what>[i].xxx only if it's a matching member name.

git-svn-id: https://svn.eduke32.com/eduke32@4105 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:01 +00:00
helixhorned 78e8f476e1 build.lua: add "artfile" class, allowing to open and get pics from an ART file.
git-svn-id: https://svn.eduke32.com/eduke32@4104 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:42:59 +00:00
hendricks266 401a73862a Wii: Fix build and add custom headers and libs to SVN. (It's helpful to set up a build system from scratch.)
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4102 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 09:08:31 +00:00
helixhorned 1181121729 Revert "Move CONTROL_ProcessBinds() to CONTROL_GetInput()." [r3981]
That change confounded character-based input with e.g. HUD control
under certain circumstances, see
http://forums.duke4.net/topic/6845-eduke32-savegame-annoyances/

Also, BUILD_LUNATIC ... just for the hit.sect -> hit.sector change.

git-svn-id: https://svn.eduke32.com/eduke32@4093 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-11 13:43:39 +00:00
helixhorned f9d597f237 Lunatic: add forgotten g_argv to dynsymlist_m32.
git-svn-id: https://svn.eduke32.com/eduke32@4092 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-11 13:43:37 +00:00
hendricks266 2ab39f2cca Clean up some GUI/WM minutiae. Should fix linking Mapster32 on *nix with HAVE_GTK=0.
git-svn-id: https://svn.eduke32.com/eduke32@4091 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-08 10:00:44 +00:00
hendricks266 d738fb7ad5 Fix the vsync menu option so that it actually works.
Variables at global scope which share a name tend to actually be the same variable. Not good when you pass such a variable to function that immediately returns if the passed parameter (the variable) equals said variable (itself).

git-svn-id: https://svn.eduke32.com/eduke32@4090 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-08 10:00:25 +00:00
hendricks266 6bf0bd0c60 Windows startup window tweaks:
- Don't print osd.szCSDVersion when it is empty, preventing an extra space between the OS name and version number. (An example of what this field holds is "Service Pack 1".)
- Under SDL, allow the "console" edit field to repaint after "OK" is clicked. Important when a long def file is loading.

git-svn-id: https://svn.eduke32.com/eduke32@4086 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:41 +00:00
hendricks266 333e0f26e2 Allow wm_msgbox() to use SDL_ShowSimpleMessageBox() under SDL2.
Unfortunately, SDL2 does not (yet?) provide a Yes/No box for wm_ynbox().

git-svn-id: https://svn.eduke32.com/eduke32@4085 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:24 +00:00
hendricks266 db69800fd0 Split the handling of audio based on RENDERTYPE into a new variable named MIXERTYPE, allowing Windows builds to use SDL for input and rendering (RENDERTYPE=SDL) while using DirectSound and Windows' MIDI interface (MIXERTYPE=WIN [current default]) so that EMIDI works.
git-svn-id: https://svn.eduke32.com/eduke32@4084 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:03 +00:00
hendricks266 4f2bc62dc2 Fix USE_OPENGL=0 build.
git-svn-id: https://svn.eduke32.com/eduke32@4081 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:03:49 +00:00
hendricks266 c1bbf25700 Fix the long-standing trivial warnings in net.c.
Cognitively, so much time has passed that these unused variables would offer little help indicating the roadmap for networking. In any case, I have taken care only to comment rather than remove anything that is more than just a throwaway loop counter.

If this commit inconveniences anyone in any way, please contact me personally and I will make it right.

git-svn-id: https://svn.eduke32.com/eduke32@4079 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:03:23 +00:00
hendricks266 612284cfea Improve SDL2 support as much as I can, for now. The game compiles, links, and starts, but all three renderers either don't display correctly or crash.
To build with SDL2: make RENDERTYPE=SDL SDL_TARGET=2

git-svn-id: https://svn.eduke32.com/eduke32@4074 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-06 07:49:53 +00:00
hendricks266 a831f408e4 Fix building of astub.c with MinGW 4.8.
We have to work around namespace pollution in <sys/stat.h>.

git-svn-id: https://svn.eduke32.com/eduke32@4072 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-06 07:49:10 +00:00
helixhorned b2503da051 Lunatic: rename hitdata_t member 'sect' to 'sector' for consistency. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4071 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-22 12:42:06 +00:00
helixhorned 9d21cff5d3 Lunatic: document xmath.kangvec() and hitscan().
git-svn-id: https://svn.eduke32.com/eduke32@4070 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-22 12:42:00 +00:00
helixhorned f30cc01a7a In C++ build, fix "narrowing conversion inside { } is ill-formed" warning.
This also exposes an actual issue. The sound definitions may be dynamically
remapped, in which case they are not necessarily <=255 any more.

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4069 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:38:56 +00:00
helixhorned 514a3bfd64 Prevent calling function pointers cast to an incompatible type.
Most often, this had happened when casting comparison functions for qsort()
like these: "int yax_cmpbunches(const int16_t *b1, const int16_t *b2)"
to a function pointer type expecting "const void *". Alas, this is undefined
behavior: see
http://blog.frama-c.com/index.php?post/2013/08/24/Function-pointers-in-C
and posts linked from it.

At least two cases have not been fixed:
- The savegame system maintains pointers which are either to data or a function in
  the generic "void *". This ought to be made into a union.
- Probably also:
  #define OSD_ALIAS     (int32_t (*)(const osdfuncparm_t*))0x1337

git-svn-id: https://svn.eduke32.com/eduke32@4068 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:38:44 +00:00
helixhorned d2cd8af510 Minor changes for Lunatic utils, replace missed sound flag literals with macros.
git-svn-id: https://svn.eduke32.com/eduke32@4067 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:38:07 +00:00
terminx d5b6496ddb Additional fix for the shareware version
git-svn-id: https://svn.eduke32.com/eduke32@4065 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-15 17:59:21 +00:00
terminx 95cf4ec90b Fix shareware version breakage introduced in r3913
git-svn-id: https://svn.eduke32.com/eduke32@4064 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-15 16:00:55 +00:00
helixhorned e94fa7f70f Lunatic: make hitscan accept ray as vector, add xmath.kangvec.
Also, add hitscan test to test.lua -- a crosshair-like sprite is spawned
and continuously updated to the position of where the player aims at.

git-svn-id: https://svn.eduke32.com/eduke32@4059 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-13 20:23:54 +00:00
helixhorned 694975b2f5 Polymost: make spriteext[].{x,y,z}off independent of xdimen/viewingrange/aspect.
The offsets (that will translate the axes for .pitch/.roll rotation) were
calculated improperly with screen sizes other than 1280 x 1024 and were
dependent on other related variables. The fix proceeded empirically, i.e. mostly
trial, error, and some educated guesswork. (It's telling that the magic constant
1280 is needed.)  A test for Lunatic is added to test.lua that will rotate
SEENINES.
Bug pointed out by Mblackwell.

git-svn-id: https://svn.eduke32.com/eduke32@4058 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-13 20:23:45 +00:00
terminx 1baf9fa275 Add -usecwd parameter on Windows, to disable searching for Megaton Edition or GOG.com game data
git-svn-id: https://svn.eduke32.com/eduke32@4057 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-10 22:41:19 +00:00
helixhorned f64fdf3384 Add foreachmap.lua module 'colenemy', allow passing module name to findmaps.sh.
The 'colenemy' module searches for colored enemies in maps, excluding pal-21
liztroops. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4056 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-10 19:17:06 +00:00
helixhorned 14467dec24 Replace literal g_sounds[].m bits with enum constants. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4055 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-08 20:18:56 +00:00
helixhorned 28d99e9658 Lunatic doc: add some text and examples for using require()/module().
git-svn-id: https://svn.eduke32.com/eduke32@4054 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-08 20:18:51 +00:00
helixhorned 2065cc911f Lunatic: document gv.getangle(), -Lopts=strict, sec:zrangeat(). DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4053 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-06 14:43:21 +00:00
helixhorned 7f37ac1303 Lunatic: r/w gamearrays in binary mode, checks for mapdiff.sh, add test/gamearray.con.
git-svn-id: https://svn.eduke32.com/eduke32@4052 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-06 14:43:20 +00:00
helixhorned eef1977662 Lunatic/util: fixes for Windows.
- Need to open some files in binary mode.
- MinGW's "find" doesn't provide -L option, detect that.

git-svn-id: https://svn.eduke32.com/eduke32@4051 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-06 14:43:17 +00:00
helixhorned 85aa90d82c Lunatic: make -Lopts=strict also error on some table reads w/ nonexistent keys.
Specifically, for the tables returned with require"DEFS" etc. This allows to
check if maybe parts of a bundle of files is missing (because comparisons like
"spr.picnum == D.NONEXISTENT_NAME" do not yield errors normally).

git-svn-id: https://svn.eduke32.com/eduke32@4050 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:47 +00:00
helixhorned 1328c66f9c Lunatic: add option -Lopts=... from command line.
Permitting to enable various debugging options. See "eduke32 -debughelp"
for which ones those are: they were previously settable from defs_common.lua,
and a new option 'strict' has been added that makes accesses to void sprites
error. (That is, already "sprite[i]", not "sprite[i].some_member".)

git-svn-id: https://svn.eduke32.com/eduke32@4049 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:46 +00:00
helixhorned d48383d2f7 A couple of minor changes.
- engine.c: comment out some unused decls with RELEASE=0 DEBUGANYWAY=1
- Lunatic: update dump.lua and v.lua
- Lunatic: test/test_geom.lua: note a perf regression (wrt older LuaJIT,
  or I mis-configured / built something wrong)

git-svn-id: https://svn.eduke32.com/eduke32@4048 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:44 +00:00
helixhorned 1b7c622f31 Lunatic: fix _digitalnumber, remove player._INPUT_BITS, add sprite.all().
git-svn-id: https://svn.eduke32.com/eduke32@4047 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:42 +00:00
helixhorned 3b69417792 util/build.lua: lose packing, use fread(), make bound-check nan-safe.
git-svn-id: https://svn.eduke32.com/eduke32@4046 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:40 +00:00
helixhorned 7543ba7226 premap.c: delete GPSPEED/CYCLERs only after the loop with EVENT_LOADACTOR events
git-svn-id: https://svn.eduke32.com/eduke32@4045 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:38 +00:00
helixhorned e402467676 Lunatic: gv.getangle() vs. analogous Lua function test, add some anchors to doc.
Also, in listglobals.sh, check for file existence.

git-svn-id: https://svn.eduke32.com/eduke32@4044 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:36 +00:00
helixhorned 40a2e1da24 Lunatic: in control.lua, use C's fwrite() to write gamearray to disk, fix typo.
git-svn-id: https://svn.eduke32.com/eduke32@4043 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:35 +00:00
terminx 603fbf7cb5 Update the info displayed in the "details" tab of the application properties dialog in Windows--change copyright date to 2013, update Duke Nukem trademark ownership from Apogee Software, Ltd to Gearbox Software, LLC
git-svn-id: https://svn.eduke32.com/eduke32@4040 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-31 04:57:46 +00:00
helixhorned 6ac486c9ee Lunatic doc: move icons to doc/ root, as they were not showing up properly online.
That is, here: http://lunatic.eduke32.com/ or more specifically in lunatic.html.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4036 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:19 +00:00
helixhorned ddea95c31b Lunatic doc: add appendix with hints on how to read Programming in Lua, 1st ed.
git-svn-id: https://svn.eduke32.com/eduke32@4035 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:16 +00:00
helixhorned e0e3973b47 Bounds-check the tile number gotten from EVENT_GETMENUTILE.
git-svn-id: https://svn.eduke32.com/eduke32@4034 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:14 +00:00
helixhorned 4f699a2f21 Lunatic: update documentation a bit.
- add gv.GET, gv.WEAPON, gv.RETURN
- specify that sprite[].x/y/z and wall[].x/y are 32-bit ints
- add an example for con.longjmp()
- add an appendix listing the RETURN usage of various events

git-svn-id: https://svn.eduke32.com/eduke32@4032 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:12 +00:00
helixhorned 15bcfe3f34 Lunatic: on the Lua side, rename gv.g_RETURN to the prettier gv.RETURN.
On the C side, keep the name g_RETURN. I'm still superstitious about
dropping the "g_".

git-svn-id: https://svn.eduke32.com/eduke32@4031 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:10 +00:00
helixhorned 55a3cda9e1 Lunatic: retire gv.*_WEAPON and gv.GET_* for gv.WEAPON.* and gv.GET.*.
git-svn-id: https://svn.eduke32.com/eduke32@4030 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:09 +00:00
helixhorned 0a06ca29f2 Lunatic: fix passing some string members to con.action(), rewrite conststruct().
... by creating a struct with 'static const int' members, as recommended on
http://www.freelists.org/post/luajit/Performance-implications-of-large-FFI-constants,4

git-svn-id: https://svn.eduke32.com/eduke32@4029 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:04 +00:00
terminx e8c2250d0a Rip out all traces of nedmalloc. Sorry, XP users--it's time to upgrade to something newer than an OS from 2001 if this affects you.
git-svn-id: https://svn.eduke32.com/eduke32@4027 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-20 21:49:44 +00:00
helixhorned e53c50e6aa LunaCON: allow a certain type error present in 1.3D GAME.CON to pass.
git-svn-id: https://svn.eduke32.com/eduke32@4025 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-19 19:26:58 +00:00
helixhorned 9acb219721 Lunatic: a couple of trivial changes.
git-svn-id: https://svn.eduke32.com/eduke32@4021 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 19:24:25 +00:00
terminx ba4cfe704c Fix issue with PIPEBOMB_CONTROL mode 2, reported at http://forums.duke4.net/topic/6721-grenade-lifetime
git-svn-id: https://svn.eduke32.com/eduke32@4019 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-17 22:48:31 +00:00
helixhorned 171226c7ac game.c: remove dead bounds check for cheatbuf[], add assertion.
The check is dead because it is made after the fact (oob access), but the
cheat string matching logic below actually assures that
cheatbuflen < sizeof(cheatbuf) at all times.
Exposed using the Stack tool from http://css.csail.mit.edu/stack/ .
Also, in gamedef.c's definecheat handling, print the string length (19), not
the buffer length (20) if the cheat was truncated.

git-svn-id: https://svn.eduke32.com/eduke32@4016 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:20 +00:00
helixhorned 7a9e9fada4 When issuing "setrendmode" OSD command with mismatched vidmode, auto-switch.
git-svn-id: https://svn.eduke32.com/eduke32@4015 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:19 +00:00
helixhorned 4b44063853 Fix taking address out of bounds of stack'd array, introduced in r3983.
Clang's UBSan reports this as undefined behavior. I think that the reason
is as follows: C99 6.5.3.2#1 (Constraints) says:

 The operand of the unary & operator shall be either a function designator, the
 result of a [] or unary * operator, or an lvalue that designates an object that
 is not a bit-field and is not declared with the register storage-class specifier.

But in case of an expression like "&array[-1]", the operand ("array[-1]") does
not designate a valid object.

Moral: check first -- assure that an expression is valid for a particular
operation before carrying it out. Keep in mind that otherwise, the compiler
is absolutely free to optimize out the *check*.

git-svn-id: https://svn.eduke32.com/eduke32@4014 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:18 +00:00
helixhorned 2aa55e5900 baselayer.c: remove baselayer_onvideomodechange, onvideomodechange.
git-svn-id: https://svn.eduke32.com/eduke32@4013 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:16 +00:00
helixhorned d095ebf9b2 net.c: move a necessary bound check to BEFORE the oob access happening.
Fixes the undefined behavior discussed here:
http://forums.duke4.net/topic/3857-the-crash-thread/page__view__findpost__p__152612

git-svn-id: https://svn.eduke32.com/eduke32@4008 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:10 +00:00
helixhorned ff05fb9b5c Retire MultiPsky_TileToIdx() in favor of engine-side getpskyidx().
DONT_BUILD, because there have been no significant changes of the non-Lua build.

git-svn-id: https://svn.eduke32.com/eduke32@4006 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:51 +00:00
helixhorned af243f1cd6 Lunatic util: add foreachmap module 'plax', looking for maps w/ multiple psky tiles.
In foreachmap.lua, make init() be able to return a start index for cmdline args,
for the case where the run worker script wants to handle options, for example.

git-svn-id: https://svn.eduke32.com/eduke32@4005 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:50 +00:00
helixhorned b6ea2a5c53 Lunatic: sync defs.ilua's user_defs with r3993, adding member MasterVolume.
git-svn-id: https://svn.eduke32.com/eduke32@4004 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:48 +00:00
helixhorned e947f1fe87 Lunatic: prepare Makefiles for synthesis build.
- libs and headers are expected in platform/Windows/* (not there yet)
- prefix Lua #includes with luajit-2.0/
- build bytecode objects with absolute path name (used for debug info)

git-svn-id: https://svn.eduke32.com/eduke32@4000 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:42 +00:00
terminx c9f43383a7 Fix net.h, dunno why MSVC accepts functions that don't match their prototypes without complaining... :p
git-svn-id: https://svn.eduke32.com/eduke32@3996 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-07 14:29:10 +00:00
terminx 67d786f48f Factor some duplicate code into Net_SpawnPlayer(), adjust Net_ExtractPlayerUpdate() a bit.
git-svn-id: https://svn.eduke32.com/eduke32@3994 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:54:09 +00:00
terminx 3391de39be Implement a master volume control that functions separately from the sound effect and music volume controls. This is important because it allows waveform based music (like the SC-55 music pack, etc.) to play back at a louder volume than the sound effects if the end user so desires.
git-svn-id: https://svn.eduke32.com/eduke32@3993 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:55 +00:00
terminx e83927c2f8 Refactor projectiles a bit. Tested with all of the original weapons and with the weapons in the Duke 64 mod.
git-svn-id: https://svn.eduke32.com/eduke32@3992 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:34 +00:00
terminx 1d2a6bc9df Silence a MSVC warning
git-svn-id: https://svn.eduke32.com/eduke32@3991 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:21 +00:00
terminx c41efa2a09 Bring GROWSPARK a bit more in line with the other hard-coded hitscan projectiles, and give it the same sort of accuracy adjustment as the pistol gets when autoaim is disabled.
git-svn-id: https://svn.eduke32.com/eduke32@3989 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:00 +00:00
terminx af2e9e8cf1 Update ud.config.LastUpdateCheck even when G_GetVersionFromWebsite() fails. SourceForge was down today and it irritated me.
git-svn-id: https://svn.eduke32.com/eduke32@3988 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:49 +00:00
terminx 6ae675347b Fix http://forums.duke4.net/topic/2961-paper-cuts-minor-bugs-and-annoyances/page__view__findpost__p__164747 (mikesnd error)
git-svn-id: https://svn.eduke32.com/eduke32@3986 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:27 +00:00
terminx c34410b7ed Fix up a couple of functions to adhere better to unwritten code formatting standards. Should be zero functional changes in terms of what the functions actually do.
git-svn-id: https://svn.eduke32.com/eduke32@3983 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:51 +00:00
terminx c06e4262da Move CONTROL_ProcessBinds() to CONTROL_GetInput(). I don't think this breaks anything; if it does, revert it!
git-svn-id: https://svn.eduke32.com/eduke32@3981 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:25 +00:00
helixhorned b5c5513924 Lunatic: disable printing debug messages for the preview build. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@3979 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:51 +00:00
helixhorned a374a401be Clean up parallaxed sky functionality, part 2.
- Rename sky_t members: yscale -> horizfrac, bits -> lognumtiles.
- Add default sky (8 tiles, horizfrac=32768 (i.e. 1/2 the scene horiz), offsets
  all zero) and CLOUDYOCEAN sky (8 tiles, horizfrac=65536, offsets all zero)
  to multipsky[].
- Get rid of "psky_t g_psky", merely maintaining a g_pskyidx instead. Set it up
  at map load time so as to keep the behavior of the legacy per-map psky:
  the last sector index with a matching psky ceiling wins.
- In mapstate_t, save g_pskyidx too, not (former) pskybits and pskyoffs[].
- Make on-map-load global psky setup consistent for the game and editor by
  factoring it out into common.c: G_SetupGlobalPsky().
- Remove a couple of useless initializations, add some static assertions.

This commit is more likely to introduce subtle differences in behavior.
Specifically, getpsky() now always returns the default sky properties instead of
the global sky ones (but with all-zero offsets) when no match for a suiting
multi-psky is found. This is only likely to affect the yscale/horizfrac of
non-multi-pskies when a global non-default multi-psky has been set up.
Bump BYTEVERSION again.

git-svn-id: https://svn.eduke32.com/eduke32@3976 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:48 +00:00
helixhorned 46e8549b5e Clean up parallaxed sky functionality, part 1.
- Consolidate psky* arrays into a "typedef struct psky_t" "g_psky" and
  "multipsky[]".
- Factor out getting parallaxed sky properties into getpsky().
- Condense initial multi-psky setup by memcpy'ing from multipsky[].
- New function: MultiPsky_TileToIdx().
- Add new define PSKYOFF_MAX and related consistency-checking assertions.
- Lower MAXPSKYTILES to 8 to reflect current usage (was 256).
- Game: make multi-pskies consider dynamically-remapped MOONSKY1, BIGORBIT1
  and LA. (Not very useful as the editor will still only act for the static
  values -- 80, 84 and 89, respectively.)

An attempt has been made to preserve behavior even in strange cases, so this
commit is unlikely to introduce regressions. Because of point 6, BYTEVERSION
had to be bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3975 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:45 +00:00
helixhorned 97dce0fe63 Lunatic: sanity-check some arguments passed to con.action().
git-svn-id: https://svn.eduke32.com/eduke32@3974 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:40 +00:00
hendricks266 e58035b51c Force orientation bit 2 for screentext in addition to qstrdim, to match all other screen drawing commands.
git-svn-id: https://svn.eduke32.com/eduke32@3971 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:28 +00:00
helixhorned 262acc7ab3 Lunatic: Add pre-compiled LPeg 0.12 for 32-bit Windows (MinGW).
git-svn-id: https://svn.eduke32.com/eduke32@3970 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:13 +00:00
helixhorned 9bbc5c52de Lunatic: rename test.elua to test.lua.
The old extension is an artifact from when I was thought that extensions
should label whether a Lunatic module is to be used in internal/external
contexts.
Also, change test.lua slightly and commit a little updated documentation.

git-svn-id: https://svn.eduke32.com/eduke32@3969 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:10 +00:00
helixhorned f4d74e4df8 Lose the 'packed' attribute on actor_t.
Its members are already laid out on the natural alignment boundaries.
Compilation tested with {32-bit, 64-bit} x {Lunatic, non-Lua} builds.

git-svn-id: https://svn.eduke32.com/eduke32@3968 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:08 +00:00
helixhorned a942a8f660 Lunatic: protect global environment.
git-svn-id: https://svn.eduke32.com/eduke32@3967 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:07 +00:00
helixhorned 7860fb8c01 Lunatic: remove DBG_ variable for _DEBUG_LUNATIC=0.
git-svn-id: https://svn.eduke32.com/eduke32@3966 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:06 +00:00
helixhorned ac3a6a1bd2 Lunatic: fix some must-fail tests and module()s without require'end_gamevars'.
git-svn-id: https://svn.eduke32.com/eduke32@3965 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:05 +00:00
helixhorned 3835019c70 Lunatic: replace 'idx >= BOUND+0ULL' idiom with 'not (idx >= 0 and idx < BOUND)'
git-svn-id: https://svn.eduke32.com/eduke32@3964 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:02 +00:00
helixhorned 4f88aaf4d2 Retire global 'lastvisinc'.
It was only ever used as upper bound to the time that a visibility change
decays, but since it does that in an exponential fashion, there's really
no point.

git-svn-id: https://svn.eduke32.com/eduke32@3961 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:13 +00:00
helixhorned 19b85dc5ee Make vis decay with time independent of FPS, treat p->visibility<0 like 0.
Now, if p->visibility differs from the constant visibility, the former converges
toward the latter by three-quartering the difference each second totalclock
increment (1/60th second).
Negative player visibilities are not handled consistently throughout the
different renderers, so make it look the same as 0 (can view to infinity).

git-svn-id: https://svn.eduke32.com/eduke32@3960 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:11 +00:00
helixhorned ec2514a91d Apply patch by forum user "John Jendro" fixing OS X build.
git-svn-id: https://svn.eduke32.com/eduke32@3958 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:06 +00:00
helixhorned e7e8f00670 Lunatic: document previous additions and more of the existing stuff.
git-svn-id: https://svn.eduke32.com/eduke32@3956 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:04 +00:00
helixhorned d63939d820 Clean up some player.c code.
git-svn-id: https://svn.eduke32.com/eduke32@3955 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:01 +00:00
helixhorned 9ecbd633aa Lunatic: rework weapondata_t __newindex handling for the sound members.
Also, in test.elua, add a currently failing must-fail test (i.e. it wrongly
succeeds where it should not!).

git-svn-id: https://svn.eduke32.com/eduke32@3954 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:59 +00:00
helixhorned d7ad2c36d4 Lunatic: revamp sector changing/updating functions of sprites.
git-svn-id: https://svn.eduke32.com/eduke32@3953 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:57 +00:00
helixhorned b9dfcc902d game.c: read sprites-on-screen count for DNDEBUG at end of G_DoSpriteAnimations.
Because that function might have inserted tsprites itself, e.g. for the fake
floor shadow. Also add one "spritesortcnt < MAXSPRITESONSCREEN" bound check
in legacy ROR code.

git-svn-id: https://svn.eduke32.com/eduke32@3952 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:55 +00:00
helixhorned 36c03b8610 Lunatic: create game Lua state just before EVENT_NEWGAME, not in G_EnterLevel().
git-svn-id: https://svn.eduke32.com/eduke32@3951 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:53 +00:00
helixhorned d7e4d5afbf Factor out repeated few-liner into G_NewGame_EnterLevel(), misc. cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3950 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:52 +00:00
helixhorned adbd6394fc LunaCON: add -ftrapv, -fwrapv opts, providing trapping/wrapping arith semantics.
Currently only for multiplication.

git-svn-id: https://svn.eduke32.com/eduke32@3949 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:50 +00:00
helixhorned 75204d782a Lunatic: call G_ShowView() using the Lua C API and not through the FFI.
G_ShowView() may call events. Ouch!

git-svn-id: https://svn.eduke32.com/eduke32@3948 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:49 +00:00
helixhorned e76348cc4b In DNCOORDS display, show execution time in ms for all actors (G_MoveActors).
Smoothed using an exponential moving average... with a time constant of 1 sec
if I didn't miscalculate things. Also, split BYTEVERSION_JF into Lunatic and
non-Lua.

git-svn-id: https://svn.eduke32.com/eduke32@3947 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:47 +00:00
helixhorned b243264d6b Lunatic: output timing results to CSV file, don't time unreg'd events/actors.
The base name is taken from the environment variable LUNATIC_TIMING_BASEFN,
which is suffixed with .actors.csv and .events.csv.

git-svn-id: https://svn.eduke32.com/eduke32@3946 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:45 +00:00
helixhorned e13cae69ce LunaCON: add forgotted "screensound" to keyword list in con_lang.lua.
Also, fix 'spriteflags' directive.

git-svn-id: https://svn.eduke32.com/eduke32@3945 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:43 +00:00
helixhorned b70779ba6f CON: Add predefined labels MAXSPRITES, MAXSTATUS and MAX_WEAPONS.
git-svn-id: https://svn.eduke32.com/eduke32@3944 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:41 +00:00
helixhorned e4849af91f LunaCON: implement 'tossweapon'.
git-svn-id: https://svn.eduke32.com/eduke32@3943 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:38 +00:00
helixhorned d53b976acf Lunatic: document more stuff (not too carefully), add red DRAFT marker.
git-svn-id: https://svn.eduke32.com/eduke32@3942 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:46 +00:00
helixhorned 5e41c1604c LunaCON: handle system gamearrays for some array commands.
- 'copy' may have them as source, 'getarraysize' works fine
- 'setarray' and 'resizearray' are obviously forbidden
- 'readarrayfromfile' and 'writearrayfromfile' is not implemented for them
  (use case?)

Also, in the Makefile: don't use realpath on directories. It may give an empty
string.

git-svn-id: https://svn.eduke32.com/eduke32@3940 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:43 +00:00
helixhorned 1e26e640e4 Lunatic: swap first and second arg of con.spawn().
git-svn-id: https://svn.eduke32.com/eduke32@3939 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:41 +00:00
helixhorned 750fbb0a0e Lunatic: slight Makefile tweak for Windows preparation.
Add doc/how_to_build_lunatic.txt and doc/lpeg-lunatic.patch.

git-svn-id: https://svn.eduke32.com/eduke32@3938 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:14 +00:00
helixhorned 7f2175fcec Lunatic: retire per-sprite tsprite access for per-tile animation callback reg.
Don't yet make this official API though, since there are unresolved issues
with newly created tsprites potentially being fed back to the animation loop.
Add xmath.angvec(), xmath.bangvec(), tspr:set_sectnum(), tspr:setpos().

git-svn-id: https://svn.eduke32.com/eduke32@3937 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:10 +00:00
helixhorned c243bab0e7 Remove one instance of duplicate code lines and now unused TSPR_MIRROR.
git-svn-id: https://svn.eduke32.com/eduke32@3936 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:07 +00:00
helixhorned f506e0f570 Rename the external 'gethitickms()' to 'gethiticks()'.
git-svn-id: https://svn.eduke32.com/eduke32@3935 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:05 +00:00
helixhorned f37d845f02 Lunatic: various unrelated changes and more documentation.
- check map-text version on load
- LunaCON: don't allow (back)slash as identifier char
- LunaCON stand-alone: don't resort to default directory for root file names
- document non-local control flow functions and for LunaCON, ambigious lexical
  elements

git-svn-id: https://svn.eduke32.com/eduke32@3933 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:58:57 +00:00
helixhorned 6e443944c3 Lunatic: partially fix LTO=1 build with GCC.
Having to tag these few variables and functions as ATTRIBUTE((used))
seems sensible, but what follows is just strange. OSD_Printf? headspritesect?

git-svn-id: https://svn.eduke32.com/eduke32@3932 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:53 +00:00
helixhorned baebd63bac Lunatic: make g_playerWeapon an array of a corresponding bcarray type.
git-svn-id: https://svn.eduke32.com/eduke32@3931 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:50 +00:00
helixhorned 4c4cf5eecc Lunatic: document the additions of the preceding commits.
git-svn-id: https://svn.eduke32.com/eduke32@3930 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:48 +00:00
helixhorned 7c3f7909cc Lunatic: various changes.
- swap 2d and 3rd args in xmath.rotate() -- now rotate(point, ang, pivot)
- add vec3 method 'rotate', calling xmath.rotate
- store game tic count in savegames

git-svn-id: https://svn.eduke32.com/eduke32@3929 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:46 +00:00
helixhorned d580c1e998 Lunatic: many changes, motivated by writing test "helixspawner".
- some renames of functions/methods
- con.actorvar: explicitly allow (for now) boolean and number values
- added gv.gametic, player.holdskey(), player.all(), actor.check*()/hit*(),
  gv.rendmode, gv.REND, <bitint>:mask(), spr:getheightofs()
- make read of nil var in "finalized" (live) module produce error, too
- add test/helixspawner.lua

git-svn-id: https://svn.eduke32.com/eduke32@3928 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:42 +00:00
helixhorned 44f71d313f Lunatic: on palfrom from CON or C, set palsfade{speed,next} and regard prio.
git-svn-id: https://svn.eduke32.com/eduke32@3927 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:39 +00:00
helixhorned e771c7faf3 Lunatic: document con.action/move/ai and actor methods.
Also, in some movement functions, replace e.g. (vel*TICSPERFRAME)>>2 with vel.

git-svn-id: https://svn.eduke32.com/eduke32@3925 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:35 +00:00
helixhorned 253a13ed29 Lunatic: various tweaks and fixes.
- fix getv movflags handling in VM_Move()
- add actor.fall()
- LunaCON: sanity-check some action members

git-svn-id: https://svn.eduke32.com/eduke32@3924 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:32 +00:00
helixhorned cb2edcf45e Lunatic: in con.action and con.move, allow mixed number/string key tables.
E.g. con.action{0, 4, delay=20}; for convenience, viewtype and incval are
initialized to 1 (not 0) here.

git-svn-id: https://svn.eduke32.com/eduke32@3923 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:54 +00:00
helixhorned cad7d49bd1 Lunatic: retire an actor's sprite[].hitag/lotag for new actor[] members.
git-svn-id: https://svn.eduke32.com/eduke32@3922 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:52 +00:00
helixhorned 73b5d064da Retire actor[].shootzvel, as it was only ever used in local scope.
That is, its value was only referenced during the duration of a function call
that had previously set it. It was also never accessible from CON.

git-svn-id: https://svn.eduke32.com/eduke32@3921 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:50 +00:00
helixhorned e164bd7f1e Actor-related code cleanup part 2: give actor t_data[] indexes names.
Using macros like AC_COUNT(t). Clean up related code:
 - comment out the dead condition noted in the previous commit
 - Lunatic: use get_count() instead of get_t_data(0) in one place,
   rename to _get_t_data(), i.e. make that method internal

git-svn-id: https://svn.eduke32.com/eduke32@3920 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:48 +00:00
helixhorned 90ddee2296 Actor-related code cleanup part 1: rename some locals, expose one dead condition
... due to making hi/lotag unsigned in r3174. This commit keeps the compiler
warning, the next one will remove it.

git-svn-id: https://svn.eduke32.com/eduke32@3919 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:45 +00:00
helixhorned ebe0ecaded Lunatic: add actor methods allowing overriding action delay and move hvel/vvel.
Add testing code for an example actor 1275 (newspaper) to test.elua.

git-svn-id: https://svn.eduke32.com/eduke32@3918 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:44 +00:00
helixhorned 67db095bd3 Lunatic: require'CON.ACTION' etc. gets composites from CON; add actor.MOVFLAGS.
git-svn-id: https://svn.eduke32.com/eduke32@3917 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:41 +00:00
helixhorned 36f3a8e47c Lunatic: don't register con.action/move/ai by name, make these return a cdata.
git-svn-id: https://svn.eduke32.com/eduke32@3916 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:39 +00:00
helixhorned 16f2f4c475 lunatic/listglobals.sh: allow passing multiple file names.
git-svn-id: https://svn.eduke32.com/eduke32@3915 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:37 +00:00
helixhorned fb0c13f9f2 Lunatic: serialization for cdata types, currently xmath.vec3 and ivec3.
git-svn-id: https://svn.eduke32.com/eduke32@3914 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:35 +00:00
helixhorned 6a33c2eec1 CON: New command 'screensound', unconditionally playing a session-wide sound.
git-svn-id: https://svn.eduke32.com/eduke32@3912 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:46 +00:00
helixhorned b2c5e2d807 Mapster32/Lunatic: ask when a <V10 map would be overwritten with a map-text one.
Also, clean up the saving/loading logic a bit:
- On load failure, display message with purple color.
- Take over the current file name ('boardfilename') only on success.
- Check SaveBoard() return values in various places.

git-svn-id: https://svn.eduke32.com/eduke32@3911 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:44 +00:00
helixhorned 5ea2eee072 Lunatic: merge updatesector and ~breadth, making the former accept a flag.
git-svn-id: https://svn.eduke32.com/eduke32@3910 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:43 +00:00
helixhorned 885036a6a3 Lunatic: retire 'geom' module, putting vector types into xmath.
git-svn-id: https://svn.eduke32.com/eduke32@3909 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:41 +00:00
helixhorned 7cb94070e1 Lunatic: allow serialization of tables in more general cases.
git-svn-id: https://svn.eduke32.com/eduke32@3908 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:39 +00:00
helixhorned bb71052cb7 Lunatic: begin writing LunaCON documentation.
git-svn-id: https://svn.eduke32.com/eduke32@3907 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:37 +00:00
helixhorned 89d865b8b1 Lunatic: don't pass 0x80000000 to int32_t arg, document xmath functions.
git-svn-id: https://svn.eduke32.com/eduke32@3906 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:33 +00:00
terminx e9a773a588 Add a few defined constants for commonly used weapon_pos values
git-svn-id: https://svn.eduke32.com/eduke32@3903 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:57 +00:00
terminx 214baa9475 Rename getinput() to P_GetInput(), add bounds checking for a few arrays used for weapon drawing that use kickback_pic as an index.
git-svn-id: https://svn.eduke32.com/eduke32@3902 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:39 +00:00
terminx 6516a29778 Make P_PalFrom() static inline in player.h as the whole function is just 4 assignments
git-svn-id: https://svn.eduke32.com/eduke32@3901 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:24 +00:00
helixhorned db7f820404 engine: consider a point inside() a sector in all border cases (literally).
In other words, for a test rectangular sector, a sprite would be inside the
sector in on all 4 edges and all 4 corners. Previously, it would have been
the lower right portion only (*excluding* LL and UR corners), which led to
map editing issues.

git-svn-id: https://svn.eduke32.com/eduke32@3898 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:16 +00:00
helixhorned a3adf3508e Substitute some symbolic SE_x_* labels for literal SE numbers that were missed.
git-svn-id: https://svn.eduke32.com/eduke32@3896 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:13 +00:00
helixhorned bfd9feb5aa Lunatic: document vector types, add forgotten warning icon.
git-svn-id: https://svn.eduke32.com/eduke32@3895 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:12 +00:00
helixhorned 1febaae767 Lunatic: various minor tweaks and fixes.
- Pass original module name (dot=dirsep) to module via our require()
- geom.lua: fix some operations using the vector type constructor
- geom.lua: provide constructor for ivec3, useable like vec3

git-svn-id: https://svn.eduke32.com/eduke32@3894 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:09 +00:00
helixhorned 5db04f585e Lunatic: player method fadecol(), an improved palfrom.
Also, an external 'minitext' with optional shade and pal. args and
documentation for ps:padecol().

git-svn-id: https://svn.eduke32.com/eduke32@3893 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:50 +00:00
helixhorned e8c9bf044f Don't register "savestate" and "restorestate" OSD commands even in debug builds.
They don't get registered on Windows for some reason, and mapstate debugging is
best carried out using scripting code, anyway.

git-svn-id: https://svn.eduke32.com/eduke32@3892 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:48 +00:00
helixhorned b319ae5613 Lunatic: major overhaul of gamevar serialization for savegames.
- Handle local gamevars.
- Restore gamevars from require('end_gamevars').

git-svn-id: https://svn.eduke32.com/eduke32@3891 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:47 +00:00
helixhorned 10379910c1 Lunatic 'geom': retire tovec2 and tovec3, make vec2 and vec3 accept cdata, too.
git-svn-id: https://svn.eduke32.com/eduke32@3890 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:45 +00:00
helixhorned 4a4f90e5e7 Lunatic: fix random angle movflag, Windows build; write more documentation.
git-svn-id: https://svn.eduke32.com/eduke32@3889 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:42 +00:00
helixhorned e2859cd133 Lunatic: write more documentation, handle randomangle movflag in a:set_move().
git-svn-id: https://svn.eduke32.com/eduke32@3887 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-15 12:52:06 +00:00
terminx 40b117a23c Forgot a file for a previous commit
git-svn-id: https://svn.eduke32.com/eduke32@3886 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-14 21:29:14 +00:00
terminx 47745497b0 Fix 1.3D, sorry guys
git-svn-id: https://svn.eduke32.com/eduke32@3885 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 21:17:17 +00:00
terminx 8479e63b7c Fix up handling of the Duke shareware beta a little bit, and change the dialog that pops up after running the shareware version too many times to take you to Steam instead of GOG (the Steam version is a better deal)
git-svn-id: https://svn.eduke32.com/eduke32@3884 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 21:17:03 +00:00
helixhorned d43cfe6232 Lunatic savegames: store g_playerWeapon[][], fix 'require' with submodules.
git-svn-id: https://svn.eduke32.com/eduke32@3883 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:11:09 +00:00
helixhorned 4a49da94c1 LunaCON: check reserved bits for sound and ai movement flags.
git-svn-id: https://svn.eduke32.com/eduke32@3882 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:11:07 +00:00
helixhorned 878ba20af9 LunaCON: make mail, money, paper be affected by tile remapping, fix one printf.
git-svn-id: https://svn.eduke32.com/eduke32@3881 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:11:06 +00:00
helixhorned 51e021e810 Mapster32: fix construction of *_crash.map file name in crash handler.
git-svn-id: https://svn.eduke32.com/eduke32@3876 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:10:56 +00:00
helixhorned 9c1eeae751 Lunatic: clean up 'geom' module, make walls readable with pseudo-member 'z'.
git-svn-id: https://svn.eduke32.com/eduke32@3875 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:56 +00:00
helixhorned 9911e96fe8 Lunatic: rename spriteext[].*off->mdoff.*, actor[].actorstayput->stayputsect.
git-svn-id: https://svn.eduke32.com/eduke32@3874 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:55 +00:00
helixhorned f6065e227a Lunatic: make gameactor and gameevent be "table-called" functions.
git-svn-id: https://svn.eduke32.com/eduke32@3873 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:53 +00:00
helixhorned bbcf6d6353 LunaCON: implement qgetsysstr/STR_VOLUMENAME.
git-svn-id: https://svn.eduke32.com/eduke32@3872 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:51 +00:00
helixhorned 570d35dbaa Lunatic: Propagate potentially remapped CON defines to the control module.
(This is the module that implements much of the "hard-coded" functionality
formerly on the C side.)

git-svn-id: https://svn.eduke32.com/eduke32@3871 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:49 +00:00
helixhorned 2f29a89368 Lunatic: provide CON-defined labels in read-only table require("CON.DEFS").
git-svn-id: https://svn.eduke32.com/eduke32@3870 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:47 +00:00
helixhorned e955860950 Lunatic: commit preliminary, unfinished documentation written in AsciiDoc.
Don't (yet?) commit the generated HTML.

git-svn-id: https://svn.eduke32.com/eduke32@3868 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:22 +00:00
helixhorned 224702b619 Lunatic: make require() translate dots to dir separators, make those illegal.
However, from the command line, reverse the situation: dirseps must be passed
as '/', dots are forbidden (except in the trailing ".lua").

git-svn-id: https://svn.eduke32.com/eduke32@3867 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:19 +00:00
helixhorned 2003954492 CON: add projectile member .userdata and predefined label PROJ_USERDATA.
It is a 32-bit signed integer. No version bump necessary, although CON code
accessing this new member will not work with earlier revisions (obviously).

git-svn-id: https://svn.eduke32.com/eduke32@3866 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:18 +00:00
helixhorned 0d951f0256 LunaCON: bound-check defineprojectile tile/sound members.
Also from Lunatic, make these members read-only and provide methods that
allow setting them to either -1 or a number in [0..MAX{TILES,SOUNDS}-1].

git-svn-id: https://svn.eduke32.com/eduke32@3865 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:16 +00:00
helixhorned dee8dbe092 Lunatic: rename bitint members to *bits instead of *x.
git-svn-id: https://svn.eduke32.com/eduke32@3864 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:13 +00:00
helixhorned 01770ec720 Fix accessing the wrong animation indices with negative viewtypes.
(I think; untested.)

git-svn-id: https://svn.eduke32.com/eduke32@3863 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:35 +00:00
helixhorned bd49bc7bbd LunaCON: strip dir prefixes on file-not-found; _getpname, ud.m_player_skill.
git-svn-id: https://svn.eduke32.com/eduke32@3862 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:34 +00:00
helixhorned 16b3cb6a42 LunaCON: showview and showviewunbiased.
git-svn-id: https://svn.eduke32.com/eduke32@3861 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:32 +00:00
helixhorned 5e5f80d61b Lunatic: keep status number symbols in actor.STAT instead of gv.STAT_*.
git-svn-id: https://svn.eduke32.com/eduke32@3860 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:30 +00:00
helixhorned a57ce255e7 Allow negating an action's viewtype 5 or 7, meaning to x-flip the shown sprite.
git-svn-id: https://svn.eduke32.com/eduke32@3859 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:21 +00:00
helixhorned 528366da46 Lunatic: add preliminary helper code for local gamevar saving.
git-svn-id: https://svn.eduke32.com/eduke32@3858 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:20 +00:00
helixhorned 34138cdc96 Lunatic: fix current incarnation of gamevar saving/restoration.
git-svn-id: https://svn.eduke32.com/eduke32@3857 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:17 +00:00
helixhorned a0f00e28c3 Lunatic: prettify listglobals.sh output.
git-svn-id: https://svn.eduke32.com/eduke32@3856 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:16 +00:00
helixhorned ddb0d3f63d LunaCON: properly generate references to gamevars named like Lua keywords.
git-svn-id: https://svn.eduke32.com/eduke32@3855 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:15 +00:00
helixhorned 7725544ef1 LunaCON: free a couple of file-scope local slots by storing stuff in tables.
git-svn-id: https://svn.eduke32.com/eduke32@3854 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:12 +00:00
helixhorned 335fa81b18 game.c: fix out-of-bounds write in G_GetSubString().
git-svn-id: https://svn.eduke32.com/eduke32@3852 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-06 11:22:38 +00:00
helixhorned f8c04673b4 Lunatic: tweak sector.STAT.* and other names a little.
git-svn-id: https://svn.eduke32.com/eduke32@3851 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-06 11:22:35 +00:00
hendricks266 6cc62ea2bf Fix the display of numbers with TEXT_GAMETEXTNUMHACK and TEXT_XOFFSETZERO. (Fix level stats, part 2.)
The commit revises the definition of qstrdim when TEXT_[XY]OFFSETZERO are used. With these flags, the offsets the user specifies are now the only dimensions the function cares about in terms of tile placement, so depending on the difference between the offset(s) and the size of the final tile, it may be slightly more or less than the dimensions actually displayed on the screen because tile size is never taken into account. (For example, if your font is nominally 9x7 like the Duke bluefont and you use a TEXT_XOFFSETZERO of 5 with a string five characters long, the total x dimension will be 25 even though the last character will overhang that amount by four pixels. If you use a TEXT_XOFFSETZERO of 12 with the same string, the total x width will be 60 even though there will be three pixels of empty space on the right edge.) This change was made because assigning text an arbitrary constant width in general implies an intent to keep character positions constant even with a variable width font, but returning the visible span of pixels on the screen that the tiles cover would have caused the string to move when alignment options other than the top-left were used. In other words, you can now safely use TEXT_[XY]OFFSETZERO with the alignment options and the text won't jiggle.

Also, with TEXT_GAMETEXTNUMHACK, numerals are now effectively TEXT_XOFFSETZERO text that respect the above paragraph, so number count displays can look nice with alignment options too.

Having to modify the extent/offset code makes me realize that I'm not quite happy with its structure because it gets tangled juggling different concepts like character width, X offset, and spacing, and how they relate when the line wraps or in terms of the final size. Fortunately, it produces correct results as far as I know, and it's not necessarily ugly, just hard to understand. Handle with care.

git-svn-id: https://svn.eduke32.com/eduke32@3850 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-03 05:26:44 +00:00
hendricks266 e74ac19cd2 Fix display of level stats by fixing G_ScreenText() handling of (orientation & 2).
git-svn-id: https://svn.eduke32.com/eduke32@3849 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-03 05:26:24 +00:00
helixhorned 185597d3b3 LunaCON: proper handling of dynamic remappings with weapon defaults.
That is, the gamevars named WEAPONx_* in CON will now have the remapped value
if they were not overridden from CON ('gamevar' at file scope).
For C-CON, everything except signaling an override from the CON parser is in
place.

git-svn-id: https://svn.eduke32.com/eduke32@3848 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-02 14:07:56 +00:00
helixhorned 882eb4cb8b LunaCON: hook up dynamicsoundremap.
git-svn-id: https://svn.eduke32.com/eduke32@3847 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-02 14:07:52 +00:00
helixhorned 229a996d40 Make S_MenuSound() use stack'd array to get rid of S_StaticToDynamicMenuSound().
git-svn-id: https://svn.eduke32.com/eduke32@3846 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:46 +00:00
helixhorned 7fcb577f51 LunaCON: hook up qstrdim and screentext.
Also add some recent keywords to the list in con_lang.lua which I had
forgotten all along.

git-svn-id: https://svn.eduke32.com/eduke32@3845 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:45 +00:00
helixhorned 75313a78c8 Lunatic: sector[].ceiling/.floor gets a reference to a ceiling-or-floor struct.
Also, make sector[].*stat a bitint type.

Now, a piece of code could look like this:
local sec = sector[i]
local ceil = sec.ceiling
ceil.statx:flip(sector.STAT.SMOOSH)

git-svn-id: https://svn.eduke32.com/eduke32@3844 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:43 +00:00
helixhorned 51ad20eda5 Lunatic: fix a couple of oversights, tweak some stuff.
git-svn-id: https://svn.eduke32.com/eduke32@3843 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:42 +00:00
helixhorned e0433e66fb LunaCON: real user per-player vars.
The previous behavior was to translate them as global gamevars, since LunaCON
currently has no support for multiplayer. However, then some errors would be
missed where such gamevars are accessed in no-player context
(e.g. EVENT_ENTERLEVEL).
On by default, disabled with -fno-playervar.

git-svn-id: https://svn.eduke32.com/eduke32@3842 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:41 +00:00
helixhorned f0ed046a98 LunaCON: fix mistranslation of CON "else { if" to Lua "elseif".
When encountering a non-empty statement inside braces, emit "do" ... "end".

git-svn-id: https://svn.eduke32.com/eduke32@3840 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:37 +00:00
hendricks266 e0a373893a Replace use of preprocessor macro WIN32 with _WIN32. (Blame clang.)
git-svn-id: https://svn.eduke32.com/eduke32@3839 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:57:00 +00:00
hendricks266 899f19155d Make improvements utilizing G_ScreenText().
git-svn-id: https://svn.eduke32.com/eduke32@3838 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:56:28 +00:00
hendricks266 e483dbefcd For all HUD and text shadows that use pal 4, also use shade 127.
git-svn-id: https://svn.eduke32.com/eduke32@3837 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:56:13 +00:00
hendricks266 bf9b91352b Text wrapper conversion.
G_PrintGameText(), minitext_(), G_DrawTXDigiNumZ(), and menutext_() now wrap G_ScreenText().
G_GameTextLen() now wraps G_ScreenTextSize().
G_DrawDigiNum_() now wraps G_DrawTXDigiNumZ().

git-svn-id: https://svn.eduke32.com/eduke32@3836 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:56:00 +00:00
hendricks266 4297507c8f Dynamicsoundremap.
git-svn-id: https://svn.eduke32.com/eduke32@3834 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:30 +00:00
hendricks266 ced47cf9fc Add qstrdim and screentext, powerful new functions for HUD text.
git-svn-id: https://svn.eduke32.com/eduke32@3833 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:00 +00:00
hendricks266 4375a3c261 Remove an unused variable from startwin.game.c.
git-svn-id: https://svn.eduke32.com/eduke32@3832 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:54:29 +00:00
hendricks266 297dfcdfc7 Update credits.
git-svn-id: https://svn.eduke32.com/eduke32@3831 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-31 05:08:46 +00:00
helixhorned 5bfbfa3c5b Lunatic: also reset per-actor gamevars from spawns originating from C.
Take care not to do it twice. Still untested though.

git-svn-id: https://svn.eduke32.com/eduke32@3830 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:59 +00:00
helixhorned 97f857ec39 Lunatic: split 'replace' option for actor chaining flags into soft/hard.
Hard replacement reassigns the tile flags, while soft replacement bitwise
ORs them, as in CON (since some flags might already have been set using
commands like spritenoshade).

git-svn-id: https://svn.eduke32.com/eduke32@3829 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:54 +00:00
helixhorned 020be8d4b5 Lunatic: reset per-actor gamevars on actor spawn, untested.
git-svn-id: https://svn.eduke32.com/eduke32@3828 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:52 +00:00
helixhorned 640eda2194 LunaCON: implement 'definegametype', allow writing userdef.level_number.
Also, allow (implicit) actor index -1 to 'sound' like in C-CON and fix
MULTIMODE gamevar definition (was 0, not 1).

git-svn-id: https://svn.eduke32.com/eduke32@3826 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:49 +00:00
helixhorned 593b82692e Mapster32: allow setting first walls of TROR sectors independently.
In 3D mode, Alt+F now only attempts to set the first wall of the aimed at
wall, not collecting upper/lower neighbors. For this, press Shift+Alt+F.
In 2D mode, they are always collected.

git-svn-id: https://svn.eduke32.com/eduke32@3825 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:45 +00:00
helixhorned 4457a5fbca Fix potential oob access when flipping the floor [F] in 2D mode.
git-svn-id: https://svn.eduke32.com/eduke32@3824 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 09:13:34 +00:00
helixhorned 560f88b022 Replace inline "qsetmode==200" checks with in3dmode().
Analogously for the negation; remove a couple of redundant decls of "qsetmode".

git-svn-id: https://svn.eduke32.com/eduke32@3823 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 09:13:32 +00:00
helixhorned 1715b7631f Make deletion of an ambient sound MUSICANDSFX sprite stop its sound again.
Add a test case source/lunatic/test/delmusicsfx.lua.

git-svn-id: https://svn.eduke32.com/eduke32@3822 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-28 19:52:51 +00:00
helixhorned 360aae414f Lunatic: add actor.delete() and various 'length' methods to geom.vec3/ivec3.
git-svn-id: https://svn.eduke32.com/eduke32@3821 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-28 19:52:48 +00:00
helixhorned a52130a996 C-CON: remove "found `gettspr' outside of EVENT_ANIMATESPRITES" warning.
Because one may obviously use gettspr/settspr in states called from that
event.

git-svn-id: https://svn.eduke32.com/eduke32@3820 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-28 19:52:45 +00:00
helixhorned a02ab83319 With DNCOORDS display, print number of sprites currently on the screen.
Only in debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@3818 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-26 18:42:56 +00:00
helixhorned 13b69711ac LunaCON: add a couple of ud members, gamevars; handle 'dynamicremap' only once.
Also, allow MAXVOLUMES+1 to first arg of 'music'.

git-svn-id: https://svn.eduke32.com/eduke32@3817 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-26 18:42:53 +00:00
terminx 4e9cf9722a Well then, I sure fucked that last commit up didn't I
git-svn-id: https://svn.eduke32.com/eduke32@3816 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-25 22:50:46 +00:00
terminx e3dedb19ee Fixes a crash after killing the boss in Duke 0.99 and fixes the issue with WGR2 SVN being detected as 0.99 due to malformed definelevelname statements
git-svn-id: https://svn.eduke32.com/eduke32@3815 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-25 20:25:39 +00:00
terminx 06713baf8d Fix a reference to "RDR_POLYMER" that was missed in startgtk
git-svn-id: https://svn.eduke32.com/eduke32@3814 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-25 06:11:38 +00:00
helixhorned c366388a9e Lunatic: -Wchained-loadactor option for LunaCON, clear errors on restart.
The last only in release builds.

git-svn-id: https://svn.eduke32.com/eduke32@3813 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:39 +00:00
helixhorned 6f94af7399 LunaCON: implement dragpoint, clipmove*; fix gamearray serialization.
git-svn-id: https://svn.eduke32.com/eduke32@3812 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:37 +00:00
helixhorned d0f538b283 Engine: don't extern 'clipmovetraceboxnum', add a new func. clipmovex() instead.
The 'x' is for "extended", since its last arg is a switch of whether to disable
sliding. Use that from gameexec.c.

git-svn-id: https://svn.eduke32.com/eduke32@3811 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:36 +00:00
helixhorned f051e1e229 C-CON: fix 'copy' on 64-bit archs.
git-svn-id: https://svn.eduke32.com/eduke32@3810 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:34 +00:00
helixhorned f568f34636 LunaCON standalone: don't try default path on file-not-found for root names.
git-svn-id: https://svn.eduke32.com/eduke32@3809 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:33 +00:00
helixhorned 487d54793f For DNCOORDS display, add current sprite count and #inserted sprites / last sec.
Only in debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@3808 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:32 +00:00
helixhorned e3a85f4083 Lunatic: fix restoring of tables. Also add savegame.lua which I forgot!
git-svn-id: https://svn.eduke32.com/eduke32@3807 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:30 +00:00
helixhorned 4781eecdb4 LunaCON: partially sync with r3803, link with lpeg.a (update to LPeg 0.12).
For pre-1.3 CONs, determining the older script version with gamestartup and/or
definelevelname is not implemented.

git-svn-id: https://svn.eduke32.com/eduke32@3806 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:29 +00:00
helixhorned 8d74181ddf LunaCON: fix qsprintf, add test code for GAMEVAR_{NODEFAULT,NORESET} flags.
git-svn-id: https://svn.eduke32.com/eduke32@3805 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:27 +00:00
helixhorned 1ee43d5a6e LunaCON: Add -Wall option and sector[].*bunch, warn on some NYI gamevar flags.
git-svn-id: https://svn.eduke32.com/eduke32@3804 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:25 +00:00
terminx 85cf8de0f3 Add support for shareware 0.99/1.0/1.1, for shits and giggles.
git-svn-id: https://svn.eduke32.com/eduke32@3803 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-23 18:28:04 +00:00
terminx 6a2ffa9e47 MSVC build fix
git-svn-id: https://svn.eduke32.com/eduke32@3802 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-23 18:27:36 +00:00
terminx 9afde6e21b Support high DPI setups for the startup dialogs on Windows
git-svn-id: https://svn.eduke32.com/eduke32@3800 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-23 18:27:06 +00:00
helixhorned d966ed7de1 Lunatic: rename con.peractorvar to simply con.actorvar.
NOTE: I'm committing this from my git clone again. If this works OK,
everything is in good order again. If not, I hope that I won't damage
the SVN repo. *Runs away...*

git-svn-id: https://svn.eduke32.com/eduke32@3798 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-20 19:58:54 +00:00
helixhorned 0d79372216 Lunatic: prototypical gamevar serialization, currently very CON-centric.
git-svn-id: https://svn.eduke32.com/eduke32@3796 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-20 19:31:42 +00:00
helixhorned f6ea669613 Lunatic: initialize SPRITE_HARDCODED_BADGUY on Lua state recreation, too.
git-svn-id: https://svn.eduke32.com/eduke32@3795 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-20 19:31:37 +00:00
helixhorned 76299ca635 LunaCON: partially implement {save,load}mapstate CON commands.
What is missing is saving and restoring per-player and per-actor gamevars.
Also add a test CON mutator 'mapstate.con'.

git-svn-id: https://svn.eduke32.com/eduke32@3794 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-20 19:31:34 +00:00
helixhorned d1b1fe52d8 Make G_{Save,Restore}MapState() take no input arguments.
Instead, MapInfo[ud.volume_number*MAXLEVELS+ud.level_number] is accessed
inside these functions.

git-svn-id: https://svn.eduke32.com/eduke32@3792 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-19 19:29:26 +00:00
helixhorned 4a6fc2b94f Remove redundant checks for some map state function uses.
Also, prettify G_FreeMapState(), remove some duplicate function decls and
resurrect 'savestate' and 'restorestate' OSD commands for the debug build.

git-svn-id: https://svn.eduke32.com/eduke32@3791 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-19 19:29:23 +00:00
helixhorned 38d12b9441 LunaCON: fix Lua->CON line translation by recreating the line info, too.
git-svn-id: https://svn.eduke32.com/eduke32@3790 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-19 19:29:21 +00:00
helixhorned e1715a7683 Lunatic: conditionally compile out more code in savegame/gamevars.[ch].
Also, make the savegame major version 2 in the Lunatic build.

git-svn-id: https://svn.eduke32.com/eduke32@3789 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-19 19:29:18 +00:00
helixhorned 4ed1eaa520 Lunatic: accept any number of *.lua modules on the command line.
There's no option letter for loading them, and the extension is checked
case sensitively. Lua modules are loaded after CON translated to Lua.
Also remove -testlua option.

git-svn-id: https://svn.eduke32.com/eduke32@3788 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-19 19:29:16 +00:00
helixhorned 9d858b9883 Lunatic: back up generated LunaCON code, recreate Lua state on map entering.
git-svn-id: https://svn.eduke32.com/eduke32@3787 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-19 19:29:13 +00:00
helixhorned a082ec76dd Lunatic: fix randgen module after md4 removal, run DEFS_BC_SIZE cmd only once.
git-svn-id: https://svn.eduke32.com/eduke32@3785 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 10:41:57 +00:00
terminx f8cc394fa3 Sanitize hard coded render mode numbers... replace all references to rendmode 0, 3, 4, etc with proper REND_CLASSIC, REND_POLYMOST, REND_POLYMER labels.
git-svn-id: https://svn.eduke32.com/eduke32@3784 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 03:44:09 +00:00
terminx dc0b74e846 Alter cvar system to fill the cvar name into the description line automatically, and remove the cvar name from the descriptions for all cvars
git-svn-id: https://svn.eduke32.com/eduke32@3783 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 03:43:20 +00:00
helixhorned f72e571b18 Fix two possible signed left shift overflows.
git-svn-id: https://svn.eduke32.com/eduke32@3773 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 18:32:55 +00:00
helixhorned f95967fad7 Lunatic: remove old gamevar/serialization code.
git-svn-id: https://svn.eduke32.com/eduke32@3771 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 18:32:52 +00:00
helixhorned 3092fb20e7 Lunatic rotatesprite: disallow FULL16 coordinates since Lua numbers are FP.
git-svn-id: https://svn.eduke32.com/eduke32@3770 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 18:32:50 +00:00
terminx 81292c238a Make the menus look the same in all rendering modes, because the LOADSCREEN tile looks like shit when any kind of palette-based shading is involved. So, now everyone gets the ugly metal looking MENUSCREEN.
git-svn-id: https://svn.eduke32.com/eduke32@3767 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:20:49 +00:00
terminx 7e51e92a81 Properly handle shading models with traditional fog when r_usetileshades is also enabled.
git-svn-id: https://svn.eduke32.com/eduke32@3766 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:20:35 +00:00
terminx 68d49020b1 Fix issue with Polymer checkbox in startup window, as reported at http://forums.duke4.net/topic/2961-paper-cuts-minor-bugs-and-annoyances/page__view__findpost__p__158208
git-svn-id: https://svn.eduke32.com/eduke32@3760 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:17:58 +00:00
terminx 08444cb825 WIP texture cache refactoring
git-svn-id: https://svn.eduke32.com/eduke32@3758 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:17:17 +00:00
terminx 80f645c65e Add some new cvar flags to handle cvars that need to invalidate textures or reset the video mode after modifying
git-svn-id: https://svn.eduke32.com/eduke32@3757 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:16:19 +00:00
helixhorned f0ae68f061 m32script: sync rotatesprite* with CON.
git-svn-id: https://svn.eduke32.com/eduke32@3753 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-12 18:51:28 +00:00
helixhorned 1296f9ba55 map-text: don't save sector[].wallnum, signal last wall of sector in point2.
git-svn-id: https://svn.eduke32.com/eduke32@3751 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-12 18:51:23 +00:00
helixhorned efa74c9cb8 premap.c: remove a missed unused variable.
git-svn-id: https://svn.eduke32.com/eduke32@3748 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-10 12:31:40 +00:00
helixhorned fac799b782 Mapster32: make 'corruptcheck tryfix ?' (or '??') not require c. number range.
git-svn-id: https://svn.eduke32.com/eduke32@3747 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-10 12:31:39 +00:00
helixhorned 9f76b78496 Mapster32: for some nextwall/nextsector corruptions, suggest making wall white.
Selected by writing e.g. 'corruptcheck tryfix 1-14 ??' in the console.
Like with the first alternative, the corruption numbers / range (here, 1-14)
must be given.

git-svn-id: https://svn.eduke32.com/eduke32@3746 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-10 12:31:38 +00:00
helixhorned 789e26b42f Mapster32 corruptcheck: on nextsector/nextwall oob, suggest making wall white.
... in the auto-correction. Also,
- make two similar corruptions level 5 (wallptr oob, wallptr+wallnum oob).
- in drawscreen_drawwall(), do a more strict bound check, not only >=0.

git-svn-id: https://svn.eduke32.com/eduke32@3745 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-10 12:31:37 +00:00
helixhorned c86bf550a5 Mapster32 corruptcheck: if some members out of MAX bounds, signal level 5.
git-svn-id: https://svn.eduke32.com/eduke32@3744 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-10 12:31:35 +00:00
helixhorned 8dd73d0fe8 Tweak r3681 to obtain the same behavior in the pre-r3681 undefined behavior case.
That is, assume that switch(DYNAMICTILEMAP(-1)) (which is an oob access and thus
undefined behavior) gets us to the 'default:' label.

git-svn-id: https://svn.eduke32.com/eduke32@3743 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-10 12:31:33 +00:00
helixhorned e9844d2e51 Lunatic: reading of map-text prototype.
Also fixes a couple of oversights (introduced) with the saving.

git-svn-id: https://svn.eduke32.com/eduke32@3736 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:42 +00:00
helixhorned 82d6c2d5f7 Factor out four instances of duplicate code into append_ext_UNSAFE().
git-svn-id: https://svn.eduke32.com/eduke32@3735 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:38 +00:00
helixhorned 34af7e6353 Lunatic: move readintostr() into defs_common.lua, fix an oversight.
git-svn-id: https://svn.eduke32.com/eduke32@3734 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:35 +00:00
helixhorned 3b65dc3a78 Lunatic: first prototype of map-text saving.
git-svn-id: https://svn.eduke32.com/eduke32@3733 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:34 +00:00
helixhorned 65a10afbc8 LunaCON: make on-disk gamearray footer contain non-printable chars.
Also, allow writing userdefs[].auto_run.

git-svn-id: https://svn.eduke32.com/eduke32@3732 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:30 +00:00
helixhorned 258e28bafb Map-int VX: rearrange members so that ceiling* and floor* are contiguous.
git-svn-id: https://svn.eduke32.com/eduke32@3731 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:28 +00:00
helixhorned d5a1f0a0d4 osd.c: Fix OSD_StripColors() with empty input string.
git-svn-id: https://svn.eduke32.com/eduke32@3727 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-04 16:36:13 +00:00
helixhorned 1ec058a47f Classic: fix oob read of frame buffer when leftmost vline has a mirror.
In the mirror reversing code, get rid of the padding. This may produce
seams, but they appear to be extremely transient and shouldn't be
noticeable.
In game.c, add a debugging compilation switch DEBUG_MIRRORS_ONLY.

git-svn-id: https://svn.eduke32.com/eduke32@3726 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-04 16:36:12 +00:00
helixhorned d56e5451d9 Fix one more 1<<31 calculation, remove one unneeded cast.
git-svn-id: https://svn.eduke32.com/eduke32@3724 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-04 16:36:08 +00:00
terminx 287f829e32 I am not a smart man. Fix startup window hangs with grpinfo files.
git-svn-id: https://svn.eduke32.com/eduke32@3723 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-01 18:49:03 +00:00
helixhorned bc78ff27ed Classic: clean up mirror drawing code.
No functional changes, but a (commented out) debug line for an oob read of the
frame buffer when the mirror covers the whole screen is inserted.

git-svn-id: https://svn.eduke32.com/eduke32@3719 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-01 17:41:59 +00:00
terminx 7864a559c8 Fix GTK build
git-svn-id: https://svn.eduke32.com/eduke32@3718 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-30 18:51:15 +00:00
helixhorned 74aaac70d2 Fix two bugs found by Clang's undefined behavior sanitizer.
- Return early from drawsprite_classic() if tspr->owner if oob.
  Commonize that check between renderers into bad_tspr().
- Make the BIT() macro a left-shift of the *unsigned* number 1,
  preventing expansion to (1<<31).

git-svn-id: https://svn.eduke32.com/eduke32@3717 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-29 19:24:19 +00:00
helixhorned c6d7c08d58 Generalize ZRANGE and ANGRANGE to accept any nonnegative number.
Numbers 0 and 1 mean 'no spread', but the latter does one krand() call.
Negative numbers are reserved for potential future use.

git-svn-id: https://svn.eduke32.com/eduke32@3715 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-29 19:24:12 +00:00
helixhorned 46ccf59c74 Fix TARGET sprites used as switches, introduced in r3679.
git-svn-id: https://svn.eduke32.com/eduke32@3713 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-28 16:45:29 +00:00
helixhorned 3910456d55 In G_LoadAddon(), remove inner 'struct grpfile *grp', fixing uninited access.
... four lines later.
I don't know if that is the intended semantics for this function, but
nasal demons is clearly not what we want. Please review!

git-svn-id: https://svn.eduke32.com/eduke32@3712 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-25 21:10:29 +00:00
helixhorned 3e9b1be6fb Fix two harmless warnings and reindent one switch block.
Also, make G_LoadAddon() local to game.c.

git-svn-id: https://svn.eduke32.com/eduke32@3711 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-25 21:10:25 +00:00
terminx a002290853 Support adding custom grps to the selector in the startup window. To use this feature, create a file with a ".grpinfo" extension in your EDuke32 directory, following this template:
grpinfo
{
    name "YourGameName"
    scriptname "yourgame.con"
    defname "yourgame.def"
    size yourgrpsize
    dependency DUKE15_CRC
    flags GAMEFLAG_ADDON
    crc yourgrpcrc
}

The "flags" field can also take the value "GAMEFLAG_DUKE" to define a new base game. Since this is the first commit of a new feature, certain semantics of the implementation and syntax are liable to change as necessary.

git-svn-id: https://svn.eduke32.com/eduke32@3708 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-25 17:49:10 +00:00
terminx 3af951db1b Don't write SelectedGRP to eduke32.cfg when using the Megaton compatibility "-addon" parameter.
git-svn-id: https://svn.eduke32.com/eduke32@3707 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-25 17:48:51 +00:00
terminx 15014234ab Fix startup problems stemming from SelectedGRP = "" ending up in eduke32.cfg
git-svn-id: https://svn.eduke32.com/eduke32@3705 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-22 16:30:39 +00:00
helixhorned 086ef3f901 Remove 'cl_angleinterpolation' cvar because it had no effect for a while.
Also remove the two instances of commented out code, but not the respective
CON structure access code.

git-svn-id: https://svn.eduke32.com/eduke32@3702 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-22 10:35:44 +00:00
helixhorned e1a9cadbce m32script: in tsprite access, fix checking min/max/RO; tweak RESPAWN preview.
This fixes RESPAWN preview wrongly clamping the previewed tsprite z coords to
[-524288 .. 524288] (x/y limits).
Also, make the previewed tsprites be 33% translucent with the option of 66%
translucency by setting 'showrespawn_fulltrans' to 1 in a.m32.

git-svn-id: https://svn.eduke32.com/eduke32@3699 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-21 19:55:32 +00:00
helixhorned 3792cc7312 Mapster32: in quick tile selection [G], if tile is nonexistent, revert it.
git-svn-id: https://svn.eduke32.com/eduke32@3698 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-21 19:55:26 +00:00
helixhorned 520b608094 Engine: stricter map load time checking for sprites with oob sectnums.
Sprites are now considered to have out of bounds sector numbers if it is
< 0 or >= numsectors (not merely >= MAXSECTORS). If such a sprite is now
encountered during post-load, an attempt is made first to assign it a sector
number (using updatesector()). If that fails, the sprite is removed from the
map.  The background is that a dozen of maps do come with such sprites and
could previously corrupt the sprite list when loaded.

git-svn-id: https://svn.eduke32.com/eduke32@3696 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-21 19:55:18 +00:00
helixhorned 08b10ca03c Draw the flat on-screen CHAINGUN in a way inspired by 3688, preventing seam.
Specifically, in GL modes, and if the CHAINGUN is not replaced by a model,
 - draw the upper part twice: first, two screen pixels * weapon scale lower,
   then at the original position
 - reverse the previous order: draw the upper part first, then the lower part

This is much preferable to the previous engine-side hack, and to my eye,
it looks perfect now.

git-svn-id: https://svn.eduke32.com/eduke32@3695 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-21 19:55:11 +00:00
helixhorned dac18a99e9 A couple of trivial stylistic changes.
git-svn-id: https://svn.eduke32.com/eduke32@3694 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-21 19:55:03 +00:00
helixhorned 34a965721b OS X: Write eduke32.log to ~/Library/Logs unless -usecwd is given.
git-svn-id: https://svn.eduke32.com/eduke32@3689 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-17 20:34:39 +00:00
terminx 3c5c8b44dc Mask the seam that shows up when drawing the scuba HUD overlay in OpenGL by drawing SCUBAMASK 3 times... once at the left position + 1, and then at the proper left and right positions. It's definitely a hack, but at least it lives on the game side of things.
git-svn-id: https://svn.eduke32.com/eduke32@3688 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-16 22:37:31 +00:00
helixhorned e2c05cbbae Fix A_MoveSprite() wrongly reporting sector hit without z change after r3678.
git-svn-id: https://svn.eduke32.com/eduke32@3686 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-16 20:08:45 +00:00
helixhorned 6be448c534 Fix SPRITES_OF_SECT_SAFE macro. Oops!
git-svn-id: https://svn.eduke32.com/eduke32@3685 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 18:50:21 +00:00
helixhorned bac1a3ff63 gameexec.c: in VM_Fall(), comment out dead code, small indentation change.
git-svn-id: https://svn.eduke32.com/eduke32@3684 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:22 +00:00
helixhorned 0db0587731 TROR no-SE7 water: spawn splash, reuse calculated other sector number.
git-svn-id: https://svn.eduke32.com/eduke32@3683 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:20 +00:00
helixhorned 73eb1c4def Improve on the code that handles changing sectors of projectiles.
- In the A_MoveSprite() code that transports projectiles due to an SE7
  (introduced in r1450 / legacy ROR), only report "success" if the
  transportation succeeded.
- Clear newly introduced internal SPRITE_DIDNOSE7WATER flag after
  checking it.

git-svn-id: https://svn.eduke32.com/eduke32@3682 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:18 +00:00
helixhorned 732a1ca33c In G_MoveStandables() CRACKx handling, fix oob access of DynamicTileMap[].
Also, in two cases, don't assign A_IncurDamage() result to a variable if
it's not needed.

git-svn-id: https://svn.eduke32.com/eduke32@3681 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:15 +00:00
helixhorned 3b39a87bd1 Fix a couple of issues identified in the preceding commit.
- In S_PlaySound(), move the sound index bound check above an indexing.
- For A_CheckHitSprite(), and A_FindPlayer(), allow NULL second arg.
- In A_ShootWithZvel(), make some one-letter vars be int32_t, making
  storing safeldist() results in them meaningful.
- In MaybeTrainKillEnemies(), remove two redundant checks and move another
  one further up.
- Comment that SIDEBOLT1 will never be translucent as was probably intended.
- In G_MoveFX(), fix an always-true comparison.

git-svn-id: https://svn.eduke32.com/eduke32@3680 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:13 +00:00
helixhorned 8064bd2f30 Clean up of mostly actors.c, but some other files along the way too.
- Rewrite some sprites-of-{stat,sector} loops using the SPRITES_OF,
  SPRITES_OF_SECT and new SPRITES_OF_SECT_SAFE macros.
- In passing, identify some problems and mark them with 'XXX', but don't
  attempt to fix them yet.
- The usual readability improvements...

git-svn-id: https://svn.eduke32.com/eduke32@3679 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:09 +00:00
helixhorned 52fc0bdfc5 TROR no-SE7 water: handle projectiles.
Actually, the tweaked code in VM_Move() is not specific to projectiles, so
other sprites now may pass no-SE7 water boundaries too, but it's most noticeable
with projectiles.

git-svn-id: https://svn.eduke32.com/eduke32@3678 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:05 +00:00
helixhorned 84e8ce6855 TROR no-SE7 water: allow boundary change only if other-side lotag is other one.
That is, if submerging, the lower sector MUST have lotag 2. If emerging, the
upper sector MUST have lotag 1. (Previously, emersion happened from ST 2 sectors
unconditionally.)  This means that the area where submersion or emersion can
happen is now the same for the top and bottom parts.

git-svn-id: https://svn.eduke32.com/eduke32@3677 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:00 +00:00
hendricks266 3cd85edac0 Fix the inventory icon selector's positioning to match v1.5 (reported by Fox [1]). While we're at it, move it according to ud.statusbarscale for aesthetic purposes.
[1] http://forums.duke4.net/topic/2961-paper-cuts-minor-bugs-and-annoyances/page__view__findpost__p__153060

git-svn-id: https://svn.eduke32.com/eduke32@3676 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-14 06:42:58 +00:00
hendricks266 eb4031fe8f Add cvars "hud_statusbarmode" and "r_rotatespritenowidescreen".
git-svn-id: https://svn.eduke32.com/eduke32@3675 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-14 06:42:36 +00:00
hendricks266 8055ec675b Center the x-position of BOTTOMSTATUSBAR displayed to the screen so an extra-wide one would display correctly.
Let me know if this breaks any mods that have #2462 with an x-dimension other than 320.

git-svn-id: https://svn.eduke32.com/eduke32@3674 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-14 06:42:09 +00:00
hendricks266 e2ab98261f Fix a signed/unsigned comparison.
git-svn-id: https://svn.eduke32.com/eduke32@3673 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:51:17 +00:00
hendricks266 670ede9f60 Fix reading the GOG and Steam paths for Win64 builds.
git-svn-id: https://svn.eduke32.com/eduke32@3671 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:50:37 +00:00
hendricks266 82b6414d92 Add newlines to some diagostic log messages that lack them and need them.
git-svn-id: https://svn.eduke32.com/eduke32@3668 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:49:35 +00:00
hendricks266 cbb003ba6e Fix the pause during display of TENSCREEN.
git-svn-id: https://svn.eduke32.com/eduke32@3667 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:49:05 +00:00
helixhorned a25cd24dd5 In upward moving enemy code of VM_Move(), consider TROR boundaries.
This fixes liztroops not passing TROR layers when on the jetpack, as well as
other enemies capable of moving upward, and also COMMANDER and DRONE (for which
the code is special-cased).

git-svn-id: https://svn.eduke32.com/eduke32@3666 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:35 +00:00
helixhorned 0dba35b207 build.lua: add .sectsperbunch to map table, useful for TROR stats w/ findmaps.sh
Also, sync MAXBUNCHES to new limit in lunatic/defs_common.lua.

git-svn-id: https://svn.eduke32.com/eduke32@3665 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:32 +00:00
helixhorned ec5cd930e0 Lunatic: fix test.elua after map-int VX and one rename, add one microbenchmark.
git-svn-id: https://svn.eduke32.com/eduke32@3664 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:29 +00:00
helixhorned 985c3d8428 Mostly engine and some gameexec.c stylistic changes.
git-svn-id: https://svn.eduke32.com/eduke32@3663 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:26 +00:00
terminx 9c7ab93e21 Fix something I fucked up with GRP scanning when I added support for the Megaton addon GRPs.
git-svn-id: https://svn.eduke32.com/eduke32@3661 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-10 23:47:14 +00:00
helixhorned 964e16a506 Silence "may be used uninitialized" warning, use Batoi() for user input.
Nag: The behavoir of atoi() is *undefined* if "the value of the result
cannot be represented" (C99 7.20.1).

Note: my nagging about undefined behaviors will *not* get less over time. :P

git-svn-id: https://svn.eduke32.com/eduke32@3660 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:17 +00:00
helixhorned 1773ac9276 Mapster32: print the "Saved board" message more persistently.
git-svn-id: https://svn.eduke32.com/eduke32@3659 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:14 +00:00
helixhorned 7b6bf4dda2 Lunatic: new-generation map format, in-memory representation ("map-int VX").
The Lunatic build compiles with new structures for sector and wall types.
They have separate members for TROR {up,down}{bunch,nextwall}, so there are
no conflicts with other uses of members into which they were previously
shoehorned.  Also, the maximum bunch limit is bumped to 512 in that build.

Currently, loading from V7/8/9 and saving to V7 and V8 are supported.

git-svn-id: https://svn.eduke32.com/eduke32@3658 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:11 +00:00
helixhorned a648522c68 Lunatic: move utility scripts to util/, bittest.lua -> test/test_bitar.lua.
git-svn-id: https://svn.eduke32.com/eduke32@3657 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:03 +00:00
helixhorned d1280de362 Lunatic: fix stuff after last commits; translator: clean up -f parsing code.
Also, implement 'cmenu' in LunaCON, make 'definequote' also allowed as inner
command.

git-svn-id: https://svn.eduke32.com/eduke32@3656 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:34:53 +00:00
terminx 6c7e835fb0 Fix changing the max refresh rate in EDuke32 (it was already working correctly in Mapster32).
git-svn-id: https://svn.eduke32.com/eduke32@3655 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-08 18:30:52 +00:00
terminx 606e7cce98 Add support for the versions of Duke it out in D.C., Duke Caribbean: Life's a Beach, and Duke: Nuclear Winter packaged with Duke Nukem 3D: Megaton Edition on Steam. This allows them to be launched directly from the startup window and also adds an "-addon" command line parameter that should allow the duke3d.exe included with Megaton Edition to be replaced with a copy of EDuke32.
git-svn-id: https://svn.eduke32.com/eduke32@3654 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-08 18:30:39 +00:00
helixhorned bbdc035335 Lunatic: replace DukePlayer_t set-member methods with metatable magic.
So that members needing it are checked when they're assigned to using the
usual syntax. What kind of check to perform (sector, player, ... x whether
negative values are allowed) is written in a declarative fashion inside the
C declaration.

Also, make Lunatic's MAXQUOTES be C's OBITQUOTEINDEX and bound-check an
access of sprite[p->wackedbyplayer] in the C code.

git-svn-id: https://svn.eduke32.com/eduke32@3653 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:41 +00:00
helixhorned fb41d91a50 Lunatic: get rid of some now unneeded set-member methods, add others.
git-svn-id: https://svn.eduke32.com/eduke32@3652 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:37 +00:00
helixhorned abcc98d5c1 Lunatic: access to show2dsector[], fix some permit-negative bound checks.
git-svn-id: https://svn.eduke32.com/eduke32@3650 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:28 +00:00
helixhorned c91363d7f9 Remove useless code setting show2dwall[] or show2dsprite[], as they're unused.
git-svn-id: https://svn.eduke32.com/eduke32@3649 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:24 +00:00
helixhorned f1f84beeda a.m32: Implement a Polymer "head light" emanating from your position in 3D mode.
Toggled with Ctrl+Shift+[KP-]. Variable 'headlight_range' controls its range.
For the implementation, a new event EVENT_PREDRAW3DSCREEN was added.

git-svn-id: https://svn.eduke32.com/eduke32@3648 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:31 +00:00
helixhorned 53b01f57c6 Factor out displaying episode ending cutscenes into G_BonusCutscenes().
Also,
 - retire IFWITHIN() macro, preferring expanding it
 - fix _endofgame() in control.lua

git-svn-id: https://svn.eduke32.com/eduke32@3647 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:25 +00:00
helixhorned e638c38c35 LunaCON: gen. cleaner code, make actor[].movflag internal, update listglobals.sh
git-svn-id: https://svn.eduke32.com/eduke32@3646 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:21 +00:00
helixhorned edcef5c3ec Define a macro LUNATIC_EXTERN that expands to 'static' in non-Lunatic builds.
git-svn-id: https://svn.eduke32.com/eduke32@3645 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:18 +00:00
helixhorned 203bd1e9e9 Take over and use static assertion macro found in LuaJIT sources.
git-svn-id: https://svn.eduke32.com/eduke32@3644 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:14 +00:00
helixhorned 6ebe2d4745 Lunatic: custom integer types treated as bitfields.
Used for engine struct's (c)stat and actor[].flags members.

git-svn-id: https://svn.eduke32.com/eduke32@3643 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:10 +00:00
helixhorned 023ff8f190 Lunatic: begin gamevar system. Not much there yet.
In Lunatic, gamevars (variables that are saved with savegames) are per-module.

git-svn-id: https://svn.eduke32.com/eduke32@3642 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:06 +00:00
helixhorned 49290a090c Lunatic: make palette_t a bcarray-generated type, various tweaks.
- Increase LuaJIT max. machine code limit to 10 MiB

git-svn-id: https://svn.eduke32.com/eduke32@3641 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:03 +00:00
helixhorned 512b9286fe LunaCON: ifsquished.
git-svn-id: https://svn.eduke32.com/eduke32@3640 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:52:59 +00:00
helixhorned 1e21ea3aae LunaCON: fix rotatesprite coordinate check, gen. events to chain at beginning.
git-svn-id: https://svn.eduke32.com/eduke32@3639 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:52:50 +00:00
terminx 9fbab31998 Support NVIDIA's adaptive vsync, you can enable it by setting r_swapinterval -1 in the console or by using the new third setting for the vsync menu option.
git-svn-id: https://svn.eduke32.com/eduke32@3638 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 16:41:12 +00:00
terminx e20b834ea8 Prevent loading anything except the GRP from the Steam or GOG Duke3D install directories. Loading DUKE.RTS from those paths will be resolved later.
git-svn-id: https://svn.eduke32.com/eduke32@3637 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 07:48:20 +00:00
terminx 73cb94b389 Fix savegamevar/readgamevar breakage from r3579
git-svn-id: https://svn.eduke32.com/eduke32@3636 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-03 17:26:49 +00:00
helixhorned 385c582efa Fix handling of SE31 pointing upward. A bug was introduced in r2607.
git-svn-id: https://svn.eduke32.com/eduke32@3635 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-01 18:35:44 +00:00
helixhorned e3ae81262e Fix activated MUSICANDSFX wrongly being looped, introduced in r3631.
git-svn-id: https://svn.eduke32.com/eduke32@3632 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 22:29:30 +00:00
helixhorned a6a4e30bbc Fix playing ambient sounds at max volume for split sec on entering their range.
This is done by always calling FX_PlayAuto3D() to play such sounds. It now
additionally takes a third argument 'loophow', permissible values being
FX_ONESHOT and FX_LOOP.

git-svn-id: https://svn.eduke32.com/eduke32@3631 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:58:17 +00:00
helixhorned cbfd2eb438 In 'tip' display code, extrapolate four more values of the y coord table.
Also, for tip_incs values greater or equal than the number of elements in
this table, return early reporting that the hand has been drawn, so that
the otherwise selected weapon is not drawn.

git-svn-id: https://svn.eduke32.com/eduke32@3630 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:58:09 +00:00
helixhorned e63874d011 Lunatic: chaining of actor callback functions.
For events and actors, a flag can be now passed whether to chain the new
function at the beginning or end of an already existing one, or to replace
it entirely.
Also, for the translator, add option -fno-error-nostate, disabled by default.

git-svn-id: https://svn.eduke32.com/eduke32@3629 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:58:04 +00:00
helixhorned fe69ee5476 Add rudimentary sanity checks when playing ANM files.
- Don't attempt to play an ANM file if it is empty (warn) or too short (error).
- If failing to read IVF file header or initializing VPX codec, don't play ANM.
- Return early from gltexapplyprops() if not in GL modes.

git-svn-id: https://svn.eduke32.com/eduke32@3628 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:57:59 +00:00
helixhorned 85d6526264 Add some test CON files to source/lunatic/test.
The code is mostly by other people, who are credited in the CON files.

git-svn-id: https://svn.eduke32.com/eduke32@3627 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-29 15:59:26 +00:00
helixhorned 53f6d749df Return early from A_IncurDamage() if actor[].picnum ("htpicnum" in CON) is < 0.
With this change, it is impossible for negative values to be used as array
indices inside this function, and I believe that it is also impossible that
they escape to somewhere they might be used as such.

For Lunatic, allow setting actor[].picnum to negative values and in the
translator, add (commented out) code to warn whenever it is set to a constant
negative value.  Also, fix a _sound call in _addphealth in control.lua.

git-svn-id: https://svn.eduke32.com/eduke32@3626 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-29 15:59:23 +00:00
helixhorned f291143bb8 Don't output an empty SelectedGRP entry into the cfg, fixing bare EDuke32 build.
git-svn-id: https://svn.eduke32.com/eduke32@3624 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-29 15:59:17 +00:00
terminx 1f490a6fc3 Tweak the code that adds the Steam and GOG Duke3D paths a little. This changes things so that we add the DOSBox version provided on Steam as a source for the GRP instead of their main content dir, bypassing loading their screwed up duke3d.def.
git-svn-id: https://svn.eduke32.com/eduke32@3622 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-28 23:35:52 +00:00
hendricks266 ae96d9a162 Correct the capitalization of NAPALM.
git-svn-id: https://svn.eduke32.com/eduke32@3618 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-28 09:05:18 +00:00
hendricks266 2bfb7736cb Fix loading of a user's previous "SelectedGRP" file.
git-svn-id: https://svn.eduke32.com/eduke32@3617 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-28 09:04:54 +00:00
terminx cd235d2ec2 Don't continue animating Ripper, Shrinker, Expander and Freezethrower when the game is paused or the menu is up.
git-svn-id: https://svn.eduke32.com/eduke32@3616 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-27 06:37:19 +00:00
terminx 7e22c6d81c Read GOG.com and Steam Duke3D install paths from the registry instead of hard-coding the default paths.
git-svn-id: https://svn.eduke32.com/eduke32@3615 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-27 01:39:18 +00:00
terminx f96788866c Fix shrunk player fist animation speed as requested on the forums. I didn't test this against the DOS version but it seems about right according to my memory. Let me know if it's still wrong and you care that much about it.
git-svn-id: https://svn.eduke32.com/eduke32@3614 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-27 01:38:42 +00:00
terminx 7f4185198c MSVC build fixes. The change to Makefile.deps is slightly questionable but it's not really an issue.
git-svn-id: https://svn.eduke32.com/eduke32@3613 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-27 01:38:21 +00:00
hendricks266 26fc1aa4f8 Fix a case in minitext_() overlooked by r3608.
(This should fix the inventory item box in the statusbar.)

git-svn-id: https://svn.eduke32.com/eduke32@3612 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 19:19:28 +00:00
hendricks266 9d3b96a636 LunaCON: Properly implement rotatesprite16 by adding ROTATESPRITE_FULL16 to orientation.
git-svn-id: https://svn.eduke32.com/eduke32@3611 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 19:19:05 +00:00
hendricks266 30f510d521 Add "rotatespritea" to CON and M32script.
I hope I didn't bruise Lunatic too much.

git-svn-id: https://svn.eduke32.com/eduke32@3610 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:33:03 +00:00
hendricks266 c5044b3ecd Add orientation bit 2048, enumerated as ROTATESPRITE_FULL16, which is a courtesy provided by the engine for the purpose of the game to internally force use of full 32-bit coordinates. With this bit set, all CON screen drawing commands can use rotatesprite16-like coordinates.
While the functionality was already internally in place for gametext as one of two hacks using ROTATESPRITE_MAX (the other still used by minitext_() to align with the statusbar) we must codify a bit in the engine for safe external use. (Otherwise, ROTATESPRITE_MAX could/would theoretically increase and leave modders high and dry.)

(Dev note: In G_DrawTXDigiNumZ(), ROTATESPRITE_MAX was used to bitshift the value used to calculate digit spacing for no reason I can ascertain other than to introduce rounding errors into the zoom/textscale calculations. It was never used anywhere, so I removed it.)

Bonus: The scaling code for digitalnumberz and gametextz has been modified so that the spacing is no longer affected by rounding errors. Try animating the zoom value and compare how the text used to jump but now does not.

git-svn-id: https://svn.eduke32.com/eduke32@3608 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:58 +00:00
hendricks266 d7e30a65dd Relax CAPITALIZATION restrictions.
git-svn-id: https://svn.eduke32.com/eduke32@3606 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:09 +00:00
helixhorned 8d2a60ff70 Lunatic translator: proper Lua->CON line mapping for actor/event/etc. headers.
git-svn-id: https://svn.eduke32.com/eduke32@3604 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:55:27 +00:00
helixhorned 3a1c590572 LunaCON: readarrayfromfile: fail silently if file can't be opened.
git-svn-id: https://svn.eduke32.com/eduke32@3602 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:55:05 +00:00
helixhorned c7d97d55ec Lunatic: simplify RETURN handling, make its behavior across events same as C-CON.
There's only one RETURN value on the C side (g_RETURN), which is also referenced
from Lua.  Upon entering an event, its value takes on the per-event default one,
and its value when the event code finishes is passed back to the game.
Independently of that, its value is always saved and restored across event calls.

git-svn-id: https://svn.eduke32.com/eduke32@3601 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:54:56 +00:00
helixhorned 57416c541a Lunatic: add LuaJIT's 'dump' module, printing traced bytecode, IR and mcode.
git-svn-id: https://svn.eduke32.com/eduke32@3600 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:54:14 +00:00
helixhorned ebb71cf4ab Mapster32: don't wrongly report PANIC corruption with MAXSPRITES sprites present.
git-svn-id: https://svn.eduke32.com/eduke32@3599 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:53:56 +00:00
helixhorned c5e76e73f3 Lunatic t.: don't error on changing stat/sect of sprite not in the game world.
git-svn-id: https://svn.eduke32.com/eduke32@3598 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:53:48 +00:00
helixhorned efbc4cec90 Lunatic: actor usertypes from CON, set SFLAGs as 2nd gameactor() arg in Lua.
In passing, fix a couple of omissions: gameactor() being passed nil's in the
middle, more than one moveflag to CON *actor.

git-svn-id: https://svn.eduke32.com/eduke32@3597 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:53:28 +00:00
helixhorned 290eb3a962 Lunatic: make some variables local, fix some bugs found using listglobals.sh.
git-svn-id: https://svn.eduke32.com/eduke32@3596 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:53:14 +00:00
helixhorned ea118fe436 Lunatic: fix weapondata_t read access, Lua->CON line mapping for if* commands.
git-svn-id: https://svn.eduke32.com/eduke32@3595 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:53:06 +00:00
helixhorned b7ea1cb205 Lunatic: in readgamearray support code, use engine file functions.
This is so that files residing in GRPs (or anywhere the engine looks for them)
can be read, too.

git-svn-id: https://svn.eduke32.com/eduke32@3594 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:52:52 +00:00
helixhorned 3e4a0dadf5 Lunatic: cancel logo on EVENT_LOGO error, fix CON mulscale and writable gv.
git-svn-id: https://svn.eduke32.com/eduke32@3593 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:52:41 +00:00
helixhorned 95b1a2a791 premap.c: fix oob access of tagbitmap[] with formerly negative lo-/hitags.
Also, allocate that array dynamically instead of on the stack.

git-svn-id: https://svn.eduke32.com/eduke32@3592 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:20:37 +00:00
helixhorned ad55e2d424 Lunatic: make ivec3 and dvec3 types share same metatable, orthogonalize API.
Specifically, remove ivec3's blen1() method and add from/to BUILD coordinate
(z scaled by 16) conversion methods.

git-svn-id: https://svn.eduke32.com/eduke32@3591 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:20:27 +00:00
helixhorned 700d9cef0c Lunatic: slightly cleaner weapondata_t access.
Also, for the embedded translator: don't warn on unrecognized command line opt.

git-svn-id: https://svn.eduke32.com/eduke32@3590 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:20:20 +00:00
helixhorned 904a26e045 Clean up mdsprite.c:voxdraw() a little.
git-svn-id: https://svn.eduke32.com/eduke32@3589 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:20:14 +00:00
helixhorned 271bb545ec Make -testlua accepted (but ignored) in non-Lunatic build.
So that it doesn't result in the -t (respawn on) command line switch.

git-svn-id: https://svn.eduke32.com/eduke32@3586 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:19:46 +00:00
helixhorned 182121a0aa engine: give sprite cstat 1024 a marco name, CSTAT_SPRITE_MDHACK.
git-svn-id: https://svn.eduke32.com/eduke32@3584 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:19:32 +00:00
hendricks266 ec1923b417 Wii: Fix Mapster32. It runs now.
git-svn-id: https://svn.eduke32.com/eduke32@3582 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 09:49:12 +00:00
hendricks266 bdc4f7cd68 Windows: Add the default installation paths for the GOG.com release of Duke Nukem 3D: Atomic Edition and the Steam release of Duke Nukem 3D: Megaton Edition (if they exist) to EDuke32's search path.
git-svn-id: https://svn.eduke32.com/eduke32@3581 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 09:48:21 +00:00
hendricks266 e7d8256fc3 Save the configuration files whenever a savegame is made.
git-svn-id: https://svn.eduke32.com/eduke32@3579 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-19 06:23:12 +00:00
hendricks266 72156dd4c1 Prevent the middle chaingun muzzleflash from animating its position when the player is frozen.
The unmodified behavior is completely wrong and I don't see how any mod could ever use it.

git-svn-id: https://svn.eduke32.com/eduke32@3578 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-19 06:22:52 +00:00
hendricks266 85f6a64deb Add to r3544.
git-svn-id: https://svn.eduke32.com/eduke32@3576 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-19 06:22:08 +00:00
helixhorned 90d71a5953 Classic screen tilting: fix it by passing bit 1024 to rotatesprite().
This now should look correct for both settings of r_usenewaspect.

git-svn-id: https://svn.eduke32.com/eduke32@3575 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-18 22:05:30 +00:00
helixhorned cec987631a Lunatic: properly protect weapondata_t members, fix Lua->CON line mapping.
Also, make -Werror-bad-getactorvar disabled by default.

git-svn-id: https://svn.eduke32.com/eduke32@3574 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-18 22:05:26 +00:00
helixhorned c397759217 Fix Lunatic build on Windows.
- Make _buildargv[_buildargc] NULL.
- With SDL layer, pass argv and argc directly and get rid of _build* ones.
- Add tilesiz* to dynsymlists.

git-svn-id: https://svn.eduke32.com/eduke32@3573 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-18 22:05:21 +00:00
helixhorned 38ee330c93 Lunatic translator embedded: handle command line arguments.
Also, fix an error() call in control.lua:gamearray_file_common().

git-svn-id: https://svn.eduke32.com/eduke32@3572 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:58 +00:00
helixhorned d909173065 Lunatic t.: allow hex literals with >9 digits if the high ones are all 'F's.
(Or '0's, but that case is handled automatically.) The resulting generated
number is taken by looking at the 8 lower nibbles and interpreting them as
a signed 32-bit integer.
Also add some number parsing tests to test/nlcf_break.con.

git-svn-id: https://svn.eduke32.com/eduke32@3571 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:53 +00:00
helixhorned 15d9165199 Lunatic translator: new switch -W(no-)error-bad-getactorvar.
Toggling whether a getactorvar for a global or per-player gamevar issues
a warning or a hard error, the latter being the default.
Also, make it possible to readgamevar/savegamevar per-actor gamevars and
add userdefs member "idplayers" (read-only).

git-svn-id: https://svn.eduke32.com/eduke32@3570 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:47 +00:00
helixhorned c7e90f2ed4 Lunatic translator: else if* -> elseif, fix codegen for "if {}".
The first transformation makes the "control structure too long" error appear
only with larger if/else cascades, though it's still possible.

git-svn-id: https://svn.eduke32.com/eduke32@3569 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:44 +00:00
helixhorned 56ea732ccd Lunatic translator: dynamic tile remapping.
Also, fix message when tiles get remapped in debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@3568 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:38 +00:00
helixhorned 92e85fa0d3 Lunatic translator: music 0, add two userdefs members.
git-svn-id: https://svn.eduke32.com/eduke32@3567 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:27 +00:00
helixhorned 4601b2d203 Add new LOGO_FLAGS bit 2048, preventing cutscene at E4 beginning if set.
git-svn-id: https://svn.eduke32.com/eduke32@3566 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:29 +00:00
helixhorned 90421f0e10 geom.lua: fix copy-paste bugs and clean up code. Remove __eq metamethod.
git-svn-id: https://svn.eduke32.com/eduke32@3565 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:24 +00:00
helixhorned ef464f2a1d Lunatic: allow indexing some weapon/inventory arrays with their names.
git-svn-id: https://svn.eduke32.com/eduke32@3564 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:19 +00:00
helixhorned 9285a9054b Lunatic translator: warn if setting reserved bits in some system gamevar redef.
git-svn-id: https://svn.eduke32.com/eduke32@3563 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:15 +00:00
helixhorned c02199be48 Lunatic: g_tile access, rudimentary system gamearray support for the translator.
The only operation for which proper code is generated is reading a single value
from a system gamearray.

git-svn-id: https://svn.eduke32.com/eduke32@3562 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:11 +00:00
helixhorned 7a58a818ca Lunatic t.: option for generating code caching sprite/actor/player structs...
...at the beginning of each function called back from C, and each case/default
function. Called -fcache-sap. Disabled by default.

git-svn-id: https://svn.eduke32.com/eduke32@3561 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:07 +00:00
helixhorned 0173c0908a Lunatic: spritesof{stat,sect} iterators that allow deletion inside the loop.
Also,
 - an optimization for sprite[]:setpos(). Calls to get_sprite_index()
   seem to be pretty slow (at least when they're not compiled).
 - add getzrange to the dynsymlists

git-svn-id: https://svn.eduke32.com/eduke32@3560 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:03 +00:00
helixhorned 83bc10791f Lunatic: correct SFLAG_* and actor_t definitions.
git-svn-id: https://svn.eduke32.com/eduke32@3559 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:55:59 +00:00
helixhorned f6d1af0532 Lunatic: replace some allocations by static data, some translator fixes.
Fix 'setsprite' and 'music'. A good timing test for actors performance is
the starfield of WGR2's E1L1 ("Nexus").

git-svn-id: https://svn.eduke32.com/eduke32@3558 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-13 10:48:23 +00:00
helixhorned 3b3bc6bc01 Lunatic: also save min, max actor times; fix release build.
git-svn-id: https://svn.eduke32.com/eduke32@3557 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-13 10:48:19 +00:00
helixhorned 6b1df7f1e9 Lunatic translator: handle LOGO_FLAGS.
This is the only gamevar of its kind that is handled for Lunatic, neither
PLR_MORALE nor LOGO_FLAGS are.

git-svn-id: https://svn.eduke32.com/eduke32@3556 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-13 10:48:14 +00:00
terminx 3e4ea93b20 Directory cleanup. Move the "Apple", "Windows", and "Wii" directories to a new "platform" dir, move the contents of "psd" to "rsrc/source", move eobj* and obj* directories so that they're under the "source" dir.
git-svn-id: https://svn.eduke32.com/eduke32@3551 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-04 04:14:19 +00:00
hendricks266 27fa5e72f7 Make stopping of all sounds after completion of LOGO.ANM conditional on the newly introduced (LOGO_FLAGS & LOGO_STOPANIMSOUNDS). Modifies r3217.
git-svn-id: https://svn.eduke32.com/eduke32@3545 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-04 01:24:17 +00:00
hendricks266 e2701c9a5a Patch up some broken hardcoded behavior with regard to the Sentry versions of the bosses (minibosses), as suggested by Fox.
This should have no adverse effects or side-effects. The changes only apply if a modder chose to use completely broken functionality in the first place.

git-svn-id: https://svn.eduke32.com/eduke32@3544 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-04 01:23:55 +00:00
helixhorned 2d01a81435 Fix starttrack crashing when a "null music" is selected.
Introduced with the refactoring in r3490.

git-svn-id: https://svn.eduke32.com/eduke32@3542 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:40 +00:00
helixhorned 0646e41fa4 Lunatic: make con.ai accept literal action/move, check for calling from top.
Also, fix con._setgamepalette.

git-svn-id: https://svn.eduke32.com/eduke32@3541 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:37 +00:00
helixhorned 596b3e6d6a Lunatic translator standalone: option specifying a directory for gen'd code.
The option is -fgendir=<directory>.

git-svn-id: https://svn.eduke32.com/eduke32@3540 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:32 +00:00
helixhorned aeeec9d2aa Lunatic translator standalone: allow specifying list files.
All non-option positional arguments after an @ sign are taken as list files:
hashes at the beginning of a line denote comments, truly empty lines are
ignored, all other lines should contain one root CON file name.

git-svn-id: https://svn.eduke32.com/eduke32@3539 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:28 +00:00
helixhorned deeb6306a9 Lunatic translator: fix some codegen and some commands.
git-svn-id: https://svn.eduke32.com/eduke32@3537 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:22 +00:00
helixhorned 07c7363d0f CON: Fix accessing gamearrays on 64-bit archs.
From the PM conversation "gamearrays in 64-bit". A test case is the breaking
glass at the beginning of the DukePlus map.

git-svn-id: https://svn.eduke32.com/eduke32@3536 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:18 +00:00
helixhorned bad2da3026 Lunatic translator: in error tracebacks, show line numbers of the source file.
Instead of those of the translated code. Also some codegen tweaks and fixes.

git-svn-id: https://svn.eduke32.com/eduke32@3535 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:16 +00:00
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