Commit graph

4333 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
ceebc8077c OSD: on non-Windows, make textmode=0 the default, just like in Windows.
This fixes some init and update anomalies: before,
 - init would always be the graphical mode (0), but writing
   merely "osdtextmode" would switch it
 - osdtextmode would not get saved to the cfg

git-svn-id: https://svn.eduke32.com/eduke32@4139 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:12 +00:00
helixhorned
e19a271a86 OSD: retire OSD_GetFmt(), OSD_GetFmtPtr() and OSD_GetTextPtr() functions.
These were too much "looking into the implementation of a module" for my
taste, hence OSD_GetShadePal() earlier.

git-svn-id: https://svn.eduke32.com/eduke32@4138 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:10 +00:00
helixhorned
d4c2749b94 OSD: make plain display (osdtextmode=1) colorized, too.
git-svn-id: https://svn.eduke32.com/eduke32@4137 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:09 +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
7014e94d99 textfont.c: make TAB character display blank.
This renders tweaks like r4122 unnecessary.
Also, note a "bug" with the program generating that C code.

git-svn-id: https://svn.eduke32.com/eduke32@4135 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:06 +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
9286456dd1 Everybody makes mistakes.
git-svn-id: https://svn.eduke32.com/eduke32@4131 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 04:32:28 +00:00
hendricks266
851e9fc8d1 Sweeping modifications to synthesis and the package directory structure so that every potential binary is in its own package.
While we're rearranging files, ensure all SVN mime-types are set correctly.

git-svn-id: https://svn.eduke32.com/eduke32@4130 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 03:59:26 +00:00
hendricks266
d52889e5db Synthesis now outputs .7z instead of .zip and .tar.xz instead of .tar.bz2. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4129 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 02:35:39 +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
hendricks266
975a329fcf Update SDL2 to 2.0.1.
git-svn-id: https://svn.eduke32.com/eduke32@4126 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-02 01:41:45 +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
0fdcc0a1d4 Mapster32: save r_usetileshades and r_pr_artmapping with mapster32.cfg.
git-svn-id: https://svn.eduke32.com/eduke32@4123 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:28 +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
94e3856b76 SDL2/non-Windows: Before showing "simple message box", replace tabs with spaces.
Because the one implemented on top of X shows a special mark for tabs instead of
whitespace.
Also, in wm_msgbox(), use vsnprintf.

git-svn-id: https://svn.eduke32.com/eduke32@4120 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12: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
65cdf97bfa SDL: Add SDL scancode -> ASCII value translation for the "key FIFO" for ESCAPE.
This fixes ESC in certain situations such as the editor map selection menu.

git-svn-id: https://svn.eduke32.com/eduke32@4117 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:16 +00:00
helixhorned
70f0100ac2 SDL: factor out 2x repeated code into keyascfifo_{isfull,insert}.
git-svn-id: https://svn.eduke32.com/eduke32@4116 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:13 +00:00
Plagman
e3157f6c5e Use gcc 4.8 specifically for synthesis builds.
git-svn-id: https://svn.eduke32.com/eduke32@4115 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 18:14:25 +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
terminx
bee968a535 Set the SDL window icon when changing video mode
git-svn-id: https://svn.eduke32.com/eduke32@4110 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-19 22:35:36 +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
3162a4cb46 SDL2: fix quote and pause keys.
- Add SDL scancode -> our key code map for SDL_SCANCODE_APOSTROPHE
- Remove duplicate map for SDL_SCANCODE_PAUSE

git-svn-id: https://svn.eduke32.com/eduke32@4108 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:07 +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
fddc700cd6 Wii: Fix wiibuild.bat so that revision numbers have the "r" prefix like they are supposed to.
git-svn-id: https://svn.eduke32.com/eduke32@4103 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 09:16:25 +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
hendricks266
9af453bb92 r4087, attempt #2: Fix "warning: iteration 1461 invokes undefined behavior [-Waggressive-loop-optimizations]" in initkpeg().
git-svn-id: https://svn.eduke32.com/eduke32@4101 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 06:17:41 +00:00
hendricks266
2cabe1ec54 Change the default SDL version to SDL2 and the default Windows RENDERTYPE to SDL.
git-svn-id: https://svn.eduke32.com/eduke32@4100 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 06:17:27 +00:00
hendricks266
1ac4c9b585 Windows: Add SDL2 headers and libraries to the repo for quick-and-easy building and static linking. (SDL2 uses the zlib license so we are in the clear.)
git-svn-id: https://svn.eduke32.com/eduke32@4099 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 06:17:07 +00:00
hendricks266
3c614fcafa Update synthesis to build and package 64-bit executables next to the 32-bit ones.
git-svn-id: https://svn.eduke32.com/eduke32@4098 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 06:16:27 +00:00
Plagman
17226ad870 Make synthesis use i686-w64-mingw32-gcc-dw2-4.8.0-linux64 + native NASM.
If you see any weird behavior in synthesis builds after this change, please
let Plagman know!

git-svn-id: https://svn.eduke32.com/eduke32@4097 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 03:13:53 +00:00
helixhorned
b427a5f941 Fix OpenGL texture cache "leak" and slightly tweak hash string construction.
The leak happened because a struct was hashed that had uninitialized
bytes in padding inserted by the compiler. The hash string in now constructed
as concatenation of three CRC32s as 8-byte hex strings, i.e. the individual
CRC32s are padded with leading zeros.

Note to users: because of the hash change, it's sensible to delete the
'textures' and 'textures.cache' files.

git-svn-id: https://svn.eduke32.com/eduke32@4096 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-11 22:20:46 +00:00
helixhorned
66064a33f3 Fix mouse grabbing in SDL debugging builds.
git-svn-id: https://svn.eduke32.com/eduke32@4095 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-11 22:20:45 +00:00
helixhorned
4d71ed75d2 Polymer: fix ANM playback.
References:
 - r3742
 - r4038 (fixing savegame screenshots, but introducing the now fixed bug)

git-svn-id: https://svn.eduke32.com/eduke32@4094 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-11 22:20:43 +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
4bc5f5cbc7 Merge a patch and suggestions from NY00123 improving SDL2 support. This fixes the flickering in OpenGL in SDL2 on Windows. It also provides a proper list of resolutions.
git-svn-id: https://svn.eduke32.com/eduke32@4089 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-08 09:59:59 +00:00
hendricks266
7b551ba4fb Fix OpenGL under SDL && Windows. (Almost. SDL 1.2 works fine, but SDL2 has an unresolved problem where OpenGL screen updates flicker over a black background.)
git-svn-id: https://svn.eduke32.com/eduke32@4088 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:06:09 +00:00
hendricks266
75b6e81a2a Fix "warning: iteration 1461 invokes undefined behavior [-Waggressive-loop-optimizations]" in initkpeg() by promoting the variables in question to int64_t.
NOTE TO TEAM MEMBERS: Please review this, as I am not sure what is actually intended here.

git-svn-id: https://svn.eduke32.com/eduke32@4087 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:54 +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
d781c4ad94 Fix the RETURN and KP_ENTER keys under SDL2.
git-svn-id: https://svn.eduke32.com/eduke32@4083 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:04:16 +00:00
hendricks266
22490587f0 Fix the Classic renderer under SDL2.
git-svn-id: https://svn.eduke32.com/eduke32@4082 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:04:02 +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
92b441cb11 Merge a patch from NY00123 that draws the screen to a temporary surface under the selected bit depth then blits it to a surface at the system desktop bit depth, under SDL. This allows 8-bit classic to run in fullscreen under certain *nix configurations and Windows 8.
git-svn-id: https://svn.eduke32.com/eduke32@4080 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:03:37 +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
e7c9a0be5d Iron out all errors and warnings when compiling with MinGW-w64, targeting either 32-bit or 64-bit.
git-svn-id: https://svn.eduke32.com/eduke32@4078 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:03:11 +00:00
hendricks266
37528be6fd Update prebuilt ebacktrace1 dlls. This allows r3625 to take effect. Rejoice as the 32-bit dll built by i686-MinGW-w64 works, resulting in a 1.0 MB file instead of MinGW32's 5 MB dll.
git-svn-id: https://svn.eduke32.com/eduke32@4077 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:02:50 +00:00
hendricks266
b40f0aba04 Fix ebacktrace1 under MinGW's GCC 4.8 and binutils 2.23.2.
We keep needing more and more hacks as libbfd keeps becoming dependent on additional libraries we don't need...

git-svn-id: https://svn.eduke32.com/eduke32@4076 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:02:33 +00:00
hendricks266
535394abde Build tools: Fix all compiler warnings and errors with MinGW/GCC 4.8 || SDL2.
git-svn-id: https://svn.eduke32.com/eduke32@4075 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-06 07:50:16 +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
84e61d03bf Work around a bug in MinGW 4.8 / mingwrt-4.0 where a function named main() in misc/src/libcrt/gdtoa/qnan.c takes precedence over the proper one in src/libcrt/crt/main.c.
git-svn-id: https://svn.eduke32.com/eduke32@4073 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-06 07:49:26 +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
helixhorned
eac9dd04bf Add WIP x86_64 assembly texture mapping routines.
- Currently: only tvlineasm1 and tvlineasm2, but incomplete (no reverse
  translucency, nonpow2 textures will crash)
- For System V AMD64 calling conventions; requires YASM

git-svn-id: https://svn.eduke32.com/eduke32@4066 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:37:31 +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
terminx
b16c929170 Clear GL depth buffer before drawing a frame in Polymost. This should fix the issue with skies in the Duke64 TC.
git-svn-id: https://svn.eduke32.com/eduke32@4063 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-14 17:59:01 +00:00
terminx
37265689cf Add support for "orig_sizex" and "orig_sizey" parameters to "texture" block in def files. This is the same as using "dummytile" before defining a texture. Needed for compatibility with the .def files from Megaton, not because I like arbitrarily adding extranneous shit. :p
git-svn-id: https://svn.eduke32.com/eduke32@4062 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-14 17:58:46 +00:00
helixhorned
c7f8dc6efd Revert "Prettify the DEF progress meter by relocating '\n' en masse."
This reverts commit c7e51147f1869d42fc8365f748bb8f6bd4c6fc2f. [r3835]

Conflicts:
	eduke32/build/src/defs.c
[Dunno what caused this, but I cleaned this out. Also, the change from
build.c was not reverted.]

git-svn-id: https://svn.eduke32.com/eduke32@4061 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-13 20:23:59 +00:00
helixhorned
161217a59a Polymer: in model preprocessing, implement cos/sin by table lookup.
This reduces the proportion of time the trig calculations take of the whole
preprocessing from 50% to about 13%.

git-svn-id: https://svn.eduke32.com/eduke32@4060 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-13 20:23:56 +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
helixhorned
6f4404860c a.m32: add 'moveselsects', moving them so that each sector's 1st pt is at (0,0).
git-svn-id: https://svn.eduke32.com/eduke32@4042 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:31 +00:00
terminx
8b30baa3da Update Windows application manifests to allow GetVersionEx() to return Windows 8.1 on systems running Windows 8.1. Microsoft is pretty stupid sometimes. :/
git-svn-id: https://svn.eduke32.com/eduke32@4041 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-31 04:58:07 +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
terminx
7e63cac6a0 Remove unused SYSTEM_POOL_SIZE definition (was used with nedmalloc), change in3dmode() into macro similar to bkbhit()
git-svn-id: https://svn.eduke32.com/eduke32@4039 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-24 22:55:49 +00:00
terminx
322888ce83 Fix "The latest builds show the same screenshot for every save game entry", reported at http://forums.duke4.net/topic/2961-paper-cuts-minor-bugs-and-annoyances/page__view__findpost__p__169847
git-svn-id: https://svn.eduke32.com/eduke32@4038 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-24 22:55:37 +00:00
terminx
313671d0ab Add Lunatic stuff to the Visual Studio project. This is just the file view in the IDE, not Lunatic compilation with MSVC! DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4037 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-24 22:55:23 +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
8d84706dc9 Mapster32: after auto-inserting inner sector, change sectnums for sprites now in it.
(Auto-insertion of an inner sector from a loop happens either because the loop
is created in an extended sector, or because it has been punched through a
ceiling/floor into the upper/lower neighbor sector.)

git-svn-id: https://svn.eduke32.com/eduke32@4033 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:13 +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
008334e7a9 Slightly tweak r_usetileshades 1 visibility weighting. It's still not right (and it's impossible to ever truly be right) but at least things aren't pitch black now. I considered changing r_usetileshades to default to 2, but there are some areas where mode 2 is also noticeably darker than it should be... the exit area of E1L1 is a prime example.
git-svn-id: https://svn.eduke32.com/eduke32@4028 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-20 21:49:59 +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
d09096b254 Mapster32: allow inserting point on wall line even if a sprite is highlighted.
Note: the wall line will not light up periodically, but point insertion will
be possible nontheless. A bit inconsistent, but I didn't want to do a full
analysis of which side effects allowing a sprite highlight and a line highlight
to coexist at the same time would have.

git-svn-id: https://svn.eduke32.com/eduke32@4026 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-19 19:27:02 +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
b1b043bfc7 synthesis.sh: remove 'psd' from 'not_src_packaged' (giving 'rm' error later).
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4024 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 21:54:48 +00:00
helixhorned
77dc57aee7 When building Lunatic from synthesis, tell LuaJIT to generate PE object files.
BUILD_LUNATIC, third attempt.

git-svn-id: https://svn.eduke32.com/eduke32@4023 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 21:14:37 +00:00
helixhorned
f2e92a7ea3 synthesis.sh: package some Lunatic test files when attempting to BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4022 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 19:24:27 +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
helixhorned
bac4265a0b For Clang debugging build, only pass selected UBSanitizer options.
This makes CLANG=1 RELEASE=0 DEBUGANYWAY=2 OPTLEVEL=1 builds definitely pretty
playable (only Polymost tested) while having a decent amount of sanitization.

git-svn-id: https://svn.eduke32.com/eduke32@4020 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 19:24:15 +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
terminx
7ed85ce888 MSVC build fix. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4018 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-13 01:07:41 +00:00
helixhorned
9f280bcaf2 polymer.c: remove redundant NULL pointer check in polymer_invalidateplanelights().
Redundant for the same reason as the preceding one: the pointer has already
been dereferenced at the point the check is made. Also, all 5 calls of that
function pass a valid pointer (provided the pointers from which the expressions
are derived are valid). Reported by Stack, too.

git-svn-id: https://svn.eduke32.com/eduke32@4017 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:22 +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
f7181722cc Mapster32/non-Lua: don't keep tags used for TROR nextwalls when c&p-ing sector.
Again, in case a bunch is discarded. The tags would appear as really tagging
the walls instead of being "hidden".

git-svn-id: https://svn.eduke32.com/eduke32@4012 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:15 +00:00
helixhorned
d87da2c836 Mapster32/Lunatic: clear bunchnum and TROR nextwalls when c&p-ing sectors.
That is, if a bunch is discarded when copying a sector to the clipboard.
(This happens if not all sectors that are part of the bunch are copied.)

git-svn-id: https://svn.eduke32.com/eduke32@4011 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:13 +00:00
helixhorned
47e9e0be3c Polymost: fix my r_usetileshades==2 sub-method.
Don't touch TerminX's r_usetileshades==1 or it being the default.

git-svn-id: https://svn.eduke32.com/eduke32@4010 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:12 +00:00
helixhorned
41793193f5 checkdefs.sh: check first and second args, handle definelevelname.
git-svn-id: https://svn.eduke32.com/eduke32@4009 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:11 +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
ae65ba0013 Mapster32: Clean up "show height indicators" mode.
- For setting 1, don't draw them for red walls whose sector floors have equal
  height.
- Make setting 1 the default, because I consider drawing them for such walls
  (and white walls) noise (as opposed to information). The "verbose" setting 2
  is still available.

git-svn-id: https://svn.eduke32.com/eduke32@4007 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:05 +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
aaf57051df synthesis.sh: keep executable extension in a variable.
So that the script can be tested in e.g. a native Linux environment.

git-svn-id: https://svn.eduke32.com/eduke32@4003 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:47 +00:00
helixhorned
662438c6a5 synthesis.sh: fix DONT_BUILD and BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4002 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:46 +00:00
helixhorned
ee61ede092 Lunatic: add LuaJIT's jit/bcsave.lua and headers for synthesis build preparation.
git-svn-id: https://svn.eduke32.com/eduke32@4001 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:45 +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
helixhorned
5f19fe63c0 synthesis.sh: replace '-r' option by '-f' in "rm -r $lockfile".
Strictly speaking, forcing the delete should be unnecessary too, but it
can't harm in case the lock file is deleted from outside while the script
is running.

git-svn-id: https://svn.eduke32.com/eduke32@3999 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:40 +00:00
terminx
bf2c96c9a2 Fix keyboard layout issue reported at http://forums.duke4.net/topic/6683-eduke32-forces-my-keyboard-to-us-layout-rather-than-uk
git-svn-id: https://svn.eduke32.com/eduke32@3998 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-10 23:09:14 +00:00
terminx
f2e5b77104 Enable ATI FBO color attachment workaround for Intel as well. Fixes some HD4000 issues.
git-svn-id: https://svn.eduke32.com/eduke32@3997 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-07 14:29:22 +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
af287cf452 Revert "Silence FBO initialization failure message on Intel HD 4000 by moving the glCheckFramebufferStatusEXT() call to below the glBindFramebufferEXT() call. The error returned on HD 4000 previously was something to do with the framebuffer being incomplete, and this seems to fix it, so hopefully it's right."
This reverts commit 9a2617eb263e53a348e10c82bf1ba58feed65afc.

git-svn-id: https://svn.eduke32.com/eduke32@3995 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-07 00:56:37 +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
43414456a4 Add support for listing symbols of a specified prefix to the "listsymbols" console command
git-svn-id: https://svn.eduke32.com/eduke32@3990 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:12 +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
4a02ec7e9b Update win_printversion() to handle Windows 8.1/Server 2012 R2.
git-svn-id: https://svn.eduke32.com/eduke32@3987 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:39 +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
f368bc1a03 Silence FBO initialization failure message on Intel HD 4000 by moving the glCheckFramebufferStatusEXT() call to below the glBindFramebufferEXT() call. The error returned on HD 4000 previously was something to do with the framebuffer being incomplete, and this seems to fix it, so hopefully it's right.
git-svn-id: https://svn.eduke32.com/eduke32@3985 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:16 +00:00
terminx
b6ee86a8f3 Bump MAXSYMBOLS to 512. This was probably the cause for the savestate and restorestate debug commands not being registered with the OSD at startup.
git-svn-id: https://svn.eduke32.com/eduke32@3984 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:04 +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
a97c8c1bfd Revert "Polymost "use tile shades": don't confound shade and visibility." Temporarily add a r_usetileshades 2 to switch between Helixhorned and myself's ideas of how this should work.
git-svn-id: https://svn.eduke32.com/eduke32@3982 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:38 +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
terminx
17ba063736 Fix a weird problem where the arrow keys would sometimes send a shift keypress on Windows, manifesting in odd things like inconsistent turning speeds when using the keyboard, the grid helper lines showing up in Mapster32 when they weren't supposed to, etc. For some reason, an extra raw input keyboard event is generated with an out of bounds VKey value (0xFF) which must be filtered for proper operation. I wasn't able to find any official documentation regarding this but I did find it mentioned in a couple of random newsgroup/forum postings.
git-svn-id: https://svn.eduke32.com/eduke32@3980 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:10 +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
eb6899d062 synthesis.sh: add two options specified by magic strings in the HEAD commit msg.
- If the message of the HEAD commit contains DONT_BUILD, building is entirely
  skipped.
- If it contains BUILD_LUNATIC, a Lunatic preview release EDuke32 is built (the
  editor is not built) and named leduke_PREVIEW.exe.

git-svn-id: https://svn.eduke32.com/eduke32@3978 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:50 +00:00
helixhorned
57822a2481 Polymer: slightly more complete handling of (multi-tile) ART skies.
- Use the proper tile sequence when multiple pskies are present in a map.
  However, there's still only *one* psky chosen at map load time.
- Handle three horizfrac cases:
 * 0, psky always at same level wrt screen
 * 65536, psky horiz follows camera horiz (e.g. E4L9)
 * otherwise, fall back to default hard-coded parallax implemented as an
   angle fraction

git-svn-id: https://svn.eduke32.com/eduke32@3977 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:49 +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
af9a451f02 Updates to the processing of the tilefromtexture def command:
- Allow xoffset and yoffset to modified independently of a tile definition, much like texhitscan and nofullbright.
(Both still default to zero when a tile is specified, to keep current behavior, and because it makes sense.)
- Add actual detection of the "nofullbright" keyword, which appears to have been overlooked in r3230.
- Internal: Eliminate the need for one int32_t by condensing two variables into "flags".

git-svn-id: https://svn.eduke32.com/eduke32@3973 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:37:10 +00:00
hendricks266
62cdb8a9e6 Patch from johnnyonflame to fix the GCW and Dingoo build process.
git-svn-id: https://svn.eduke32.com/eduke32@3972 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:54 +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
4872adb3c8 Makefile.common: disable -Wstrict-overflow.
It didn't turn out that useful and was giving a warning with one of the
preceding changes.

git-svn-id: https://svn.eduke32.com/eduke32@3963 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:16 +00:00
helixhorned
2945a966e1 Polymer/ART mapping: fix formula for globalvisibility.
Also, very slightly tweak a factor toward a "brighter" (farther visible)
scene overall to account for the "circular" nature of the fragment distance
(as opposed to an "ortho" distance in Build).

git-svn-id: https://svn.eduke32.com/eduke32@3962 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:15 +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
66d126e9ff Polymodes: properly calc start/end fog dist for r_usenewshading=2, vis=0, shade>0
So there's no "jump" from vis!=0 to vis=0 making the texture appear brighter.

git-svn-id: https://svn.eduke32.com/eduke32@3959 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:10 +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
8c9f0b740d Makefile.common: make LUNATIC be set to 0 if not set from env ("?=0").
Also override LTO to 0 in Lunatic builds.

git-svn-id: https://svn.eduke32.com/eduke32@3957 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:05 +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
3a0f2de877 Polymost "use tile shades": don't confound shade and visibility.
That is, for shade of objects, use shade tables. For visibility, use GL fog.
Mixing these two does not produce satisfactory results in areas where both
shade and visibility darkening are high, such as around the E1L1 restroom.

git-svn-id: https://svn.eduke32.com/eduke32@3941 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:44 +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
76a04c4a3a In Windows and SDL layers, rename *hitick* to *u64tick*.
git-svn-id: https://svn.eduke32.com/eduke32@3934 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:00 +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
184a7322de Polymodes/Lunatic: don't do y panning "correction" for nonpow2 ysize tiles.
git-svn-id: https://svn.eduke32.com/eduke32@3926 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:37 +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
dea960d350 Fix loading maps in Mapster32, introduced in r3911.
Also, get rid of the strange filename[len]=255 hack in loadboard()
and make its file name arg const char* at last.

git-svn-id: https://svn.eduke32.com/eduke32@3913 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-29 12:15:44 +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
2f883eaed1 Apparently VS2013 doesn't like redefining "inline" either
git-svn-id: https://svn.eduke32.com/eduke32@3905 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:05:24 +00:00
terminx
6ed7562f10 Fix USE_OPENGL=0 build
git-svn-id: https://svn.eduke32.com/eduke32@3904 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:05:11 +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
terminx
b1dd4ffc6c MSVC build fix (looks like the compiler version shipped with VS2013 has nearbyintf now...)
git-svn-id: https://svn.eduke32.com/eduke32@3900 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:11 +00:00
terminx
767d123590 Default r_usetileshades to 1 :)
git-svn-id: https://svn.eduke32.com/eduke32@3899 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:03:55 +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