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
Sanitize drawing sprites at different levels with TROR/classic. This should fix
most problems where sprites appear to be drawn through walls.
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.
Fix
http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__st__480 (I think, didn't test it)
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.
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.
- In the editor, make bunch-equal-making [J] stricter, because the way it was
handled could lead to a bunch whose floors and ceilings covered different areas. A fix for the reduced functionality arising from this change is underway. - Rewrite a small portion of code using yax_vnextsec() in game.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).
make the heinum&2 and stat inconsistency be displayed only once
with 'corruptcheck now', but still print each corrected one on tryfix.
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.
Make Polymer declare a callback function G_Polymer_UnInit() that is called
whenever we change to another renderer etc. and define it for the game and editor. The purpose of the function is to clean up references to Polymer resources like lights. This fixes 1) all lights becoming spot lights in the game and 2) an issue with maphack lights in the editor (can't recall which exactly).
Fix crashes on 64-bit due to unintended address truncation on ptr vars
Better handling of tsprites that are duplicated through TROR portals.
Specifically, now also consider the sprite tile's yoffset, and fix an issue when a tsprite got duplicated 'toward' the viewer. Also add a couple of tests in trueror1.map.
Oops...
BACKSPACE key in 3D mode now deletes a red-wall link when aimed at a wall or mask.
With script_expertmode enabled, SHIFT-BACKSPACE clears the upwall link and CTRL- BACKSPACE the downwall link. These functions are useful because the automatic nextwall determination code sometimes gets it wrong (not corrupting anything) or if you want to vertically displace a sector attached to a higher or lower level. Also add the exploding ceiling example to the TROR test map.
Much more elegant solution to updating the player's sectnum when passing through
TROR portals that works with a little help from updatesectorz() (change not visible from CON code). Relies only on the presence of an extension whose portal isn't blocked and also plays nicely with corner cases like being shrunk and enabling the jetpack. This should fix the upward moving platforms in WGR2.
* game and editor: emit a warning when a search-path directory specified
on the command-line isn't found (instead of saying nothing) * editor: Move inconsistent (stat&2)/heinum detection into the corruption checker. This makes a lot of original maps spew countless 'errors', but it's preferable for new maps since such floors and ceilings could behave strangely with TROR.
fix leak of GL query objects
In cases where performing occlusion queries for multiple red walls leading to the same sector, we would sometimes leak a number of query objects. This was apparently harmless on NVIDIA drivers, but would leak tons of memory on ATI.
weapons.con.sample: fix a potential bug modders may encounter: use the special G_Draw temp variables in G_DrawWeaponTile(_crystal) instead of the ones intended for individual drawing states
fix sector masks translucency.
The code was using the Polymer-cached version of the sector cstat to determine the translucency of its diffuse material, meaning it would never get it right on the first try; that's what you get for having completely different variables named 's' and 'sec'.
fix external view.
Some of the ROR code was operating under the assumption that drawasks always correspond to one call of polymer_displarooms(), but that's not necessarily the case; external view draws all sectors from the top polymer_drawrooms(), which was causing crashes. Just ignore the sector mask queues in external view mode, we already don't draw masked walls.
Various cleanup work:
- fix an earlier 'oops': make highpals load correctly again - maphack lights shouldn't be double-loaded now - slight tweak to the loading screen fadein/out timing - two bound checks - make some variables static in engine.c