Commit Graph

4096 Commits

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