Build 3067
SVN-
General
Fix the bug I caused with custom projectiles :p
SVN handles and Git names are merged into one person.
Fix the bug I caused with custom projectiles :p
The other half of the previous commit.
Fix issue with explosion sound cutoff in E1L2. This implements functionality to stop playback and free up the voice of a currently playing sound of the same ID when there are already MAXSOUNDINSTANCES (currently 8) of the same sound playing, determined by distance/volume and which sound is oldest.
Initial determination is based purely on distance/volume, and if two qualifying sounds have the same distance/volume the one which started playback first is the one that gets the axe. Feedback from other developers welcome.
expose updatesector*, add random walker as timing test for them.
various tweaks and API changes/additions.
save command input history.
Clean up redundant/local function declarations in build.c.
various tweaks.
Going to extremes to avoid code duplication like the plague, but at least it's great to learn about the whole function environment business.
Minor cleanups in actors.c, mostly relating to custom projectiles and the like. A bug causing custom projectiles to knock the player back twice as far as the hard-coded ones was also fixed. There should be no other functional changes for the end user.
In savegames, store dummy constant-length block instead of a _prlight array.
sizeof(_prlight) differs across compilers, and besides, Polymer lights were not loaded anyway (they're restored live in-game later). The savegame version was not bumped, but only savegames made with builds where sizeof(_prlight)==261 (like synthesis) will stay compatible! Report and helpful debugging information by LeoD.
In DNCOORDS display, add spritebridge and sbs.
On non-{Windows, OS X}, don't link to libpng when PNG support is not requested.
Add helper program profdemo.lua, running EDuke32's demo profiling N times.
... and displaying statistics afterwards. It was easier to do it this way than porting stat.lua to C and especially adding more logic to the already spaghetti-like demo playback code.
In Load Game menu, show 32- or 64-bitness of save game on mismatch.
make 'corruptcheck_noalreadyrefd' a separate OSD command.
Instead of having 'noalreadyrefd' as a 'corruptcheck' subcommand. This way, TAB completion can be had.
factor out some code (3x) into GetSaveBoardFilename().
In -d command line arg, allow specifying demo number in addition to file name.
Update ENet with the latest changes from github
Fix a.masm changes so MSVC builds work again. The relevant functionality seems to work (non-power of 2 textures drawn without error), even with CLASSIC_NONPOW2_YSIZE_WALLS defined in engine.c, but I'm not familiar with any corner or edge cases that need to be watched out for with this.
Note: CLASSIC_NONPOW2_YSIZE_WALLS is still not enabled in svn.
engine.c: Split CLASSIC_NONPOW2_YSIZE into _WALLS and _SPRITES, enable the second
Port non-pow2 ysize texture mapping routines to MASM, untested.
It's mostly taking over the NASM code, with a couple of changes: - declarations for externals and globals are slightly different - the masm seems to have e.g. "dword ptr [...]" where the nasm has only "dword [...]", though the masm also has a couple of the latter. The "ptr" modifier seems kinda redundant to me, but I added it to every indirection anyway.
a.nasm: add 'dword' to some stores in the nonpow2 routines for consistency.
engine.c: add compilation switches for non-pow2 ysize functions, disable for now.
Previously, we used them in our builds for sprites, but MSVC builds don't have the ASM ported to MASM, and thus the workaround of ignoring the linking errors was not safe.
foreachmap.lua: add option of only printing matching file names (like grep -l)
Also, add convenience wrapper script findmaps.sh for quickly searching for sprites/walls/sectors satisfying a certain condition in all map files under a given directory.
add check for sprites being out of the maximal grid range (+-524288).
Requested auto-correction will place such sprites at their sector's first point.
Revert "Abyss crash prevention code", but make the overflow explicit.
Disable spot lights on ATI cards, fixing the recent crashes with Catalyst 12.8.
Fix compilation on Debian 6.0 (Squeeze).
Revert r2223's removing of bit 1 making it to setbrightness(), now a noop.
Hendricks found a bug caused by that commit, so this one enables exprimentation with setbrightness() bit 1 behavior.
Add the option of starting demo profiling from the command line.
EDuke32 will exit afterwards.
foreachmap.lua: add shortcut for quickly finding certain sectors/walls/sprites.
With SDL 1.2 builds, make the profiling be cancelable by pressing any key.
Add a profiling option to the 'demo' OSD command.
See the comment in source/osdcmds.c for instructions on its usage.
Fix aspect determination from showview in fullscreen mode.
This makes the splitscreen mod not have a ridiculous view distortion. Such scenes will have no correction for non-square pixels, though.
Remove old backtrace DLLs. For some time they have been unused and supplanted by ebacktrace1.dll.
Add detection of Windows 8 and Server 2012 to win_printversion().
Fix three (probably harmless) maybe-uninitialized warnings.
patch from jfmact: "added c++ trimming to header" mathutil.h
Revise EVENT_CHANGEWEAPON so that RETURN has no effect except for two values. -1 will cancel the weapon switch. -2 will override the switch to whatever value p->curr_weapon is set in the course of the event.
While we're at it, factor out duplicate code into P_ChangeWeapon().
SE17 setup: when failing to find warp z height for lower level, use heuristic.
Specifically, use the elevator's own ceiling z height instead of searching nextsectors with nextsectorneighborz(). This makes maps like L9.map (Spaceport from N64) or DEMOUNT.MAP work. [Note well: work at all, since if it happened to work before, that was pure coincidence.]
__fastcall int32_t getangle -> int32_t fastcall getangle. Might fix MSVC build.
Replace some literal statnums with the corrensponding STAT_...
Replace some more literal SE numbers, rename a couple of functions.
STHELP.HLP/SEHELP.HLP: reference SE11 and ST23 from each other.
Replace most other literal SEs/STs by symbolic enumeration values.
Have fun researching Duke3D's hardcoded weirdness!!!
Clean up some timing-related code.
- duke3d.h: comment the timing marcos a bit more - factor out smoothratio calculation - (TICRATE/TICSPERFRAME) --> REALGAMETICSPERSEC
New OSD cmd: demo <demonum or demofile>, starting one instantly from the menu.
Also, correct some comments made in the demo source made earlier. Oops.
Move enum cheatindex_t from game.c to game.h and use its values in osdcmds.c.
Add macro CON_ERRPRINTF(Fmt, ...) and use that everywhere.
Factor out some repeated code into G_{Load,Save}PlayerMaybeMulti.
This currently says that MP saving/loading isn't supported, but doesn't really work correctly. Also, properly bound-check the immediate argument to CON's 'save' command and one more ... -> G_HandleAsync().
Use Bstrncpyz in 1 place; fix displaying err msg if write-opening savegame fails
Factor out snprintf'ing a maybe-modDir'd file name into macro G_ModDirSnprintf().
... and use it in three places. In two of these uses, 1) CON {read,write}arrayfromfile and 2) G_SavePlayer, display an error message if the file name such generated is too long. In the CON commands of 1), also error out if the file couldn't be opened.
Move G_HandleAsync() into game.h as 'static inline' and use everywhere else.
Rename a couple functions local to actors.c, remove IFHITSECT macro. This is mostly a test commit to make sure our CIA.vc script is properly updated now.
compat.h: tweak indentation of some preprocessing directives.
Make getangle() a __fastcall function instead of static inline.
This trims four 4k pages of code from the release EDuke32 build and one page from Mapster32.
In dosetaspect(), bail out calculating radarang2[] instead of failing assertion.
When this happens, parallaxmodes other than 0 will be unavailable and silently draw as parallaxmode 0. This usually happens with extremely wide resolutions.
Add lunatic/test/tables.lua, which was used to compare the calc'd sin/atan values.
Calculate sine and arctan tables, getting rid of TABLES.DAT dependency.
We're pulling stuff from math.h even in non-GL builds right now, so adding libc's sin() and atan() doesn't seem like a big deal. In the unlikely event that their accuracy is so bad that the calculated tables don't match the original ones, a warning is issued on little-endian platforms.
player.c: factor out inline checks for shootable switch picnums.
player.c: factor out multiple instances of a 3-liner into A_SetHitData().
Playing around with Coccinelle's semantic patches... be prepared for more.
Remove some unneeded NULL checks.