Build 2050
SVN-
General
fix a stupid copy&paste error that made sector[].ceilingbunch/floorbunch not functioning
SVN handles and Git names are merged into one person.
fix a stupid copy&paste error that made sector[].ceilingbunch/floorbunch not functioning
fix for the fix
When X- or Y-flipping a selection of highlighted sectors, also handle setting
the nextwall pointers correctly; Add some 'asksave=1' and 'make old-nextwalls invalid'.
Makefile lines for building with libvpx from Macports on OSX
Sanitize drawing sprites at different levels with TROR/classic. This should fix
most problems where sprites appear to be drawn through walls.
Two tweaks to make the precaching more efficient/less redundant in the game.
First, if we're in Polymer, don't precache tinted tiles that have a highpal for that certain pal. Second, don't precache tiles for palnum 251 (the last non-reserved one, which is used as a crosshair pal). Assuming that there are no other tints, this cuts the initial precache time and cache size on disk in half.
lunatic bits and pieces
When inserting a new sprite and determining its picnum by frequency count
of the picnums of all sprites, omit the newly inserted sprite itself!
in 3 planes -> packed format conversion code, group together the
three individual loops and compile the enclosing function at -O3 (-O1 for debugging builds). Now, the time for this conversion ranges from 7 to 18 ms per frame across various tested machines, a clear improvement.
package ebacktrace1.dll, remove backtrace.dll and libi*.dll
Makefile: remove ebacktrace1.dll on 'veryclean' target
backtrace.c: add flags to open() so that the log file is opened user-r/w.
This way, crashlogs will really be appended. Additionally, print a time at the end of each backtrace. winlayer.c: load ebacktrace1.dll instead of the old one Makefile.common: when building with DEBUGANYWAY=1, don't omit frame pointers This will let us get a stack trace for crashes with the release build code.
When searching a nextwall for a white wall after dragging a point,
exclude grayed out walls.
enable VPX support for Windows
Add backtrace.c (the same that was used to build backtrace.dll earlier) to tree
and build our own DLL, now called ebacktrace1.dll. The change consists of breaking the link to the libintl lib and its dependencies, so the backtrace dll is now the only one required.
Add statically linked libvpx to tree, built with gcc-4.5 mingw and
./configure --disable-vp8-encoder --disable-multithread Also add VPX/VP8 headers for an easy build on Windows. Throw in the necessary lines into the Makefile but do not enable VPX support yet.
Fix
http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__st__480 (I think, didn't test it)
First Lunatic development bits.
- protect stat bit 2 when pasting to ceilings or floors
- when pasting to walls or maskwalls, the following user bits are kept now: 4 (top/bottom alignment [O]) 1+64 (blocking, hitscan) 8+256 (x/y-flip) - print '(one-sided)' when pressing Shift + ([B] or [H]) on a wall
sanitize backface culling
Keep track of which side is getting culled, swap around mirrors, swap around model drawing.
fix picking
More natural mouse picking in software mode, closer to "what's under the cursor
is picked" but still not perfect. In particular, sometimes a wrong wall is selected, and sprites don't get picked through portals. As a rule of thumb, don't be too far away from the objects you're modifying in 3D mode.
In the textured 2D mode of Mapster32, only texture non-grayed out sectors.
Three-way clipping in Mapster32 (still toggled with 'N): on and off as
before, and additionally a mode that doesn't clip against masked walls and sprites.
In the editor, when rescaling the texture after dragging a wall-point, also
traverse the TROR neighbors.
Add high-resolution timers C API for profiling. The functions are called
uint64_t gethiticks() and gethitickspersec(). For SDL 1.2, the timer has the same resolution as getticks (1000 Hz). For Windows and SDL 1.3, the resolution of the underlying perf-timers is used. The only user of these functions right now is some TROR on-screen debugging code. Revert an earlier change regarding r_preview_mouseaim. We can't do the check because editstatus is set later.
- Add new trueror1.map that showcases the functionality and limitations of
the additional rendering pass - Remove r_preview_mouseaim cvar from the game, since it's only for Mapster - sdlmusic.c: (Failed) attempt to fix a call of waitpid() with a non-existent process ID in the external MIDI playing code. I think there's a race there...
Support for drawing 'island sectors' for TROR/classic (and with limited
functionality, Polymost). The new feature can be enabled/disabled with the 'r_tror_nomaskpass' cvar. The basic idea is that when drawing lower or upper levels, a first pass is performed that ignores all red walls for which the TROR nextwall link 'towards' the viewer arrives at a red wall. Thus, in the worst case, there can be up to twice as many rendering passes now (when it is discovered that the no-mask-pass isn't different that what would be drawn with the ordinary one, the latter is skipped, since we've already drawn all needed geometry). Hovever, this kind of multi-pass splitting is only suitable for simple scenes, like the upper subway in the TROR test map. In particular, multiple islands shouldn't 'see' each other. Two issues are worth mentioning: first, care needs to be taken for translucent ceilings or floors, since drawing them twice isn't the same as drawing them once. This is done for classic, but not for Polymost. Second, sprites (which are always drawn _after_ the geometry for a given pass) are still clipped to the geometry of the ordinary pass, resulting in their disappearance from certain angles. -- Additionaly, a change made it into this commit that fixes redundant collection of sprites in TROR:classic/Polymost.
misc. cleanup:
- remove 'imageSize' global which was always yres*bytesperline and only used once - some clearbuf() -> Bmemset() because I find the latter easier to read - remove some clearbufs to 0 of some global arrays on init
Make uninitialization sequence more consistent across the editor code. It's
always like this now: ExtUninit -> (writesetup, misc.) uninitengine -> (uninitsystem -> (uninit timers, mouse, ...)) exit() Some paths still lead to a plain exit(), like failures in cache1d.c or mdsprite.c
fix a couple of editor issues:
- one reported by Micky: http://forums.duke4.net/topic/3911-true-room-over-room/page__view__findpost__p__106610 - malloc(0) call when saving a map with no sprites - update 'asksave' after Alt-S and corrupt-check on starting a new map
Add a couple of missed sanity checks for accessing player and sprite structure members as vars. Should fix crashes with stuff like "ifvare player[some value greater than MAXPLAYERS].kickback_pic blah"
In setbrightness() and qsetmodeany(), call setpalette() only if the
palette changed from the last one (either globally or within the last call of one of the function). This fixes the ugly OSD flickering in 8-bit mode when a screen tint effect is in action (such as when being hurt or snotted on).
A couple of trivial/cleanup changes. setvgapalette() is removed from the
engine, since it had no users.
when changing screen palettes, pass flag 2 to setbrightness().
This will prevent it from calling gltexinvalidateall() when e.g. submerging and resurfacing, mimicking the behavior of the game, where only gltexinvalidate8() is called in such situations.
make the heinum&2 and stat inconsistency be displayed only once
with 'corruptcheck now', but still print each corrected one on tryfix.
sdlayer.c: also SDL_WarpMouse() in debugging builds. This has at least three
effects: 1) Mouse turning works with SDL 1.3 2) The mouse pointer can't leave the window area with the console up, so that focus always stays with the application 3) Menu selection using the mouse doesn't work. Not dramatic IMO.
polymer.c: Fix a potential zero-size calloc call when a two-walled sector
is present (like in E4L1). Also sneak in a trivial change in cache1d.c
Using this dynamic checking tool: http://embed.cs.utah.edu/ubc/,
fix two issues with signed integer overflow. One is related to clipping and the other to Polymost mouse-picking for overlong walls. Many more remain especially in the 8-bit rendering code, but I expect many of them to be intended.
Tweak the source so that it can be built by clang. The only necessary change
is to remove a couple of 'inline's for functions with external linkage, which seems to be a GCC convenience.
mdsprite.c: prevent a couple of float divides by zero and save model file
name into m->head.nam after loading (but before preprocessing for Polymer)