Build 2044
SVN-
General
When inserting a new sprite and determining its picnum by frequency count
Show details
of the picnums of all sprites, omit the newly inserted sprite itself!
SVN handles and Git names are merged into one person.
When inserting a new sprite and determining its picnum by frequency count
of the picnums of all sprites, omit the newly inserted sprite itself!
When searching a nextwall for a white wall after dragging a point,
exclude grayed out walls.
Fix
http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__st__480 (I think, didn't test it)
- 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
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 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 camera viewscreen tiles, also draw upper and lower TROR levels. Works
in any renderer because it's drawn with the software one... Also add a hack to make Polymer realize that viewscreen tiles can change each tic so that they don't show a static image anymore.
Make a couple of variables static in the engine; don't initialize umost/dmost
with other than base levels, since the y*most arrays are copied there later.
add funtion 'yax_vnextsec(wall, cf)' to C API. It's often useful when
dealing with sectors on the two sides of a bunch. Make yax_globallev and yax_globalbunch variables non-static. Rewrite a TROR-related bit in the engine code using the new function.
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
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.
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.
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)
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).
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.
Prepare polymost.c for proper umost/dmost clipping of TROR passes. No real functional changes.
Move the fixspritesectors call and the start sector updating into ExtPreSaveMap().
This makes the latter also correct when testing a map from the editor.
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.
polymost.c: remove the rest of the rendmode 1 and 2 code from the build
disable undo/redo editor feature until I can debug the disappearing sprites
slight tweak for software renderer sprite picking: don't pick them if they're behind a TROR portal from the current position.
Make Ctrl-Alt-A also remove gray walls in the side-view mode. This makes TROR-heavy maps look much less cramped when used in conjunction with Ctrl-A.
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
Take a stab at hidden model switch handling. There are at least two ways by
which switches have been hidden in the original and user maps. One is to make it face a wall, and another is to 'embed' it in e.g. the floor, like the monitor with the burning fuse in E4L1. Both kinds show up when the switches are rendered as models, revealing the secrets that the mapper sought to hide. My proposal, implemented in this commit, is to apply a heuristic for such switches at premap and make them invisible (set cstat bit 32768). The conditions are re-checked during the game in case there is a switch coming out of the floor, for example. A new spriteext bit is used for this feature.
* "Fix" two bugs introduced by r1450. In quotation marks, because I merely tracked down the offending changes without understanding them. Mild breakage of TX's ROR is expected.
The two bugs are: - RPG projectiles don't pass through water - can't emerge from slime in bobsp2 * Coalesce Polymer lights that are at the same position for FIRE-like sprites so that only one light is actually generated. This is good for usermaps that have multi-sprite fires, like bobsp2 again.
fix sector updating between TROR bunches, leading to 'being stuck' glitches. Difference: one character.
* fix screen warping with r_usenewaspect: now you have a larger FOV when being shrunk
* fix 'squishing' when taking off shrunk (the reason was TROR game code using updatesectorz) and a potential sector[-1] access
don't crash wall alignment with void-tiled walls