Build 2041
SVN-
General
When searching a nextwall for a white wall after dragging a point,
Show details
exclude grayed out walls.
SVN handles and Git names are merged into one person.
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
sanitize backface culling
Keep track of which side is getting culled, swap around mirrors, swap around model drawing.
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
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.
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
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.
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'.
Don't draw back faces of sector masks.
We normally enable backface culling always, but turn it off for two-sided sprites; we need to make sure it's re-enabled after that as sector masks are drawn after.
add support for the include command to names.h loaded by Mapster32, and names.h no longer requires # in front of commands for CON compatibility
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.
propagate lights across vertical boundaries.
Check all the bunch siblings if we get a floor/ceiling hit and walk them if their own planes hit.
add preliminary support for sector masks.
When walking the sectors in displayrooms, detect floor/sector masks to place them in a mask queue. The queues are allocated on the heap, but a stack pointer is maintained by the displayrooms to allow it to play nice with mirror recursion. Right now the masks are drawn after all of drawmasks is finished; that means you can see sprites and wall masks through sector masks, but not the opposite. There is a slight attempt at blending far to near, but nothing too conclusive yet; that means that in some cases some sector masks won't be visible through other sector masks, but it should work for trivial cases. The next step would be to copy all the drawmasks logic into Polymer and have it (attempt to) properly interleave sector masks where they belong in the blending order.
Don't draw 1-way walls twice.
Previously they would get counted both as 1-way walls for immediate drawing and as mask walls for delayed drawing.
Don't bother fogcalc()ing invisible planes.
Doesn't actually matter that much.
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.