Build 2780
SVN-
General
Fix being unable to hit ENTER on VIDEO SETTINS -> RENDERER SETUP with classic.
SVN handles and Git names are merged into one person.
Fix being unable to hit ENTER on VIDEO SETTINS -> RENDERER SETUP with classic.
Fix tweaking TROR wall links when flipping sectors ([X], [Y]).
This was actually broken all the time except when ALL sectors were selected (which was what I tested incidentally when I wrote the first "fix"). D'oh!
polymost.c: make polymost_checkcoordinates() static
display zero-length walls as level-3 corruptions.
Integer Overflow Offensive, First Act: rintersect, hitscan, neartag.
It's time to replace some int32s with 64-bit ints in core engine functions. The problem is that for example, the dot product is taken between vectors that may be the difference between two arbitrary points in a sector, so even if one sticks to the "no blue walls" rule, that doesn't guarantee freedom from overflows.
don't attempt to draw sprite with void tile, preventing div-by-0s later
draw a wall blue if its squared length exceeds INT_MAX (not UINT_MAX)
fix a div by zero when drawing tile info for void tile in 3D mode.
This was exposed by Clang with -ftrapv, which apparently also traps those.
a.m32: new state "collect_ceilsky_sectors" collecting parallaxed ceilings.
don't attempt drawing sprites with (cstat&48) == 48 that aren't voxels.
Bang! One more invalid internals exposure squashed. Maybe one day we'll be able to call EDuke32 "stable"... Actually the offending sprite IS drawn as face sprite with shade 32 and xrepeat and yrepeat 255 for the convenience of the CON coder who will have to debug it.
engine.c: cleanup / readability tweaks
TROR/classic: fix a certain class of underdraw glitches.
Those were happening when wall drawing in an upper/lower layer "closed" too much of the "curtain" (umost/dmost) for subsequent drawing in that portal. Example: looking down the sewer manhole at the beginning of Retaliation will now render without HOM.
M32 auto-aligner: calculate panning for non-firstwall-aligned ceilings/floors.
Also, print failure messages on some occasions.
keep the temp sector on some more occasions that don't delete them.
Part 1 of ceiling/floor auto-alignment functionality.
Usage is from 3D mode only. When a sector (or wall) is committed to the clipboard, it (or the wall's sector) is saved, and is subsequently used when auto-aligning [;-ENTER] another sector's ceiling or floor against the reference one's. This temp. sector is reset on any structurally modifying operation except setting first walls; also, aligning extended ceilings or floors is impossible as they use .*xrepeat internally. The auto-alignment does not change picnums (this can be accomplished with the ['+ENTER] combination), but copies the orientation bits 2^{2..6} to the alignee. Afterwards, if the reference is relative-aligned, it tweaks them, so that every case where the two firstwalls are either parallel or perpendi- cular is handled correctly. It does not yet calculate the panning values.
in textured 2D mode, make floor flipping [F] work.
In textured 2D mode, allow setting floor relativity [R].
Also factor out the code (2x) setting the alignment bits for sprites.
Introduce two convenient sprite iteration macros in build.h, add a few uses.
Defines SPRITES_OF(Statnum, Iter) and SPRITES_OF_SECT(Sectnum, Iter) [The first is so that STAT_* can be substituted for Iter and it reads nicely.] Usage should be self-explanatory, but one thing to keep in mind is that the sprites that are iterated over MUST NOT be deleted.
engine.c: make horizlookup/horizlookup2 have int32_t elts instead of intptr_t.
Disallow high-quality (640x480) tilted screen if MAXYDIM is less than 640.
This fixes the crash on Wii when looking sidewards (e.g. when dying), but makes the tilted view look more pixelated. The problem was that an attempt was made to render onto a 640x640 tile for the rotated view, but the base engine arrays were too small for that.
With engine compiled for V7 limits, refuse loading maps exceeding them.
Also, correct the loadboard() return value checks in premap.c to be aware of a returned -2 ("wrong map version").
v7 engine support, event updates
Fix A_CheckEnemyTile() returning 1 for "fixed" sprites (see r1913).
Those sprites are usually decorative, and certainly not enemies!
Assign light SEs (lotags 49 and 50) to an exclusive status number. EXPERIMENTAL!
The primary reason for doing this is that handing of moving sectors is significantly simplified. Because moving sectors usually don't move containing SEs/effector-statnum sprites, no special handing code is needed to move light SEs with them. Thus, this commit sets light SEs to a new statnum when they're spawned *from premap*, and a new G_Move*-like function (called G_DoPolymerLights) is added to process every sprite in that status list. This should "fix" light SEs moving together with a variety of moving sectors, but CON programs expecting the old behavior may break, therefore this commit is marked as experimental. Additionally, a problem with the old implementation is identified: it seems like the correct functioning is dependent upon the order of processing between the sector movement effector and the light SE, so this makes it another good reason for the change. (A third one is that all lights can be processed with a per- statnum loop, but CON coders should not do this until the change is considered final).
A couple of misc. Wii changes.
- Make MAXXDIM and MAXYDIM macros be 860 and 490, respectively. tueidj says max. screen size is 848x480, but there are oob access bugs in the classic renderer when running with the maximum possible resolution - don't allocate additional sector/wall storage for Mapster (saves ~16k) - Add ud.config.UseJoystick = 1 in config.c, but make it conditional on Wii - remove one comment I no longer believe true, add one TODO comment
Prevent an (unlikely) integer overflow in neartag with huge switch sprites.
Accumulated trivia, mostly "the usual".
Among other things, comment out very seldomly (or not at all) used sprite member macros: SV, ZV, RX, RY, CX, CY, CD, PL.
Add bit 16 to the two main setbrightness() users, add bit 2 to one of them.
(I.e. also restore r2232 again.) The first one is the palette restore logic in G_DisplayRest, the second is CON setgamepalette, to which the "don't gltexinvalidateall()" bit is added to mimic the first. Hightile invalidations aren't really useful for anything other than reloading them after a video mode change, IMO. These changes mean that 1) active full screen tints should (almost) always be kept with a basepal change. The only exceptions to this are when tints really have to be cleared, e.g. when changing the player view in co-op play. 2) there should be no performance issues with simultaneously changing basepals while a tint is applied
Tweak the conditions under which setbrightness() invalidates GL textures.
Previously, we checked whether the faded palette has changed (by way of CRC) and invalidated the textures then unless the preserve flags were set. This however could lead to wrongly invalidating them under unfortunate circumstances, e.g. basepal change from CON + tints at the same time before r2620 which reverted r2232. Now, only invalidate them if the corresponding preserve flags are clear AND * the base palette has really changed OR * the palette CRC changed and we were running on software gamma The latter means that performance-killing invalidations may still happen on GL platforms lacking HW gamma (for ATI, it's currently only disabled in 8-bit fullscreen). Also have a new global 'basepalreset' to fake a basepal change for setbrightness(), currently used when changing renderers so that going from Polymer to Polymost and back again will invalidate the Polymer textures on the second change, potentially re-applying a basepal highpal. (Still with me?)
On Windows, determine if we're running on a ATI card at startup even in classic.
Previously, I knew no way of querying for graphics adapter vendors/names from anything other than OpenGL. Googling revealed a way to do this with the Windows API.
Patch adding Wii support by tueidj, part 9: build.h sector/wall/spr/... limits
On the Wii, V7 (i.e. original) map limits are used and the maximum screen size is 1600x1200.
Make two-way trains capable of carrying SE49 or SE50 sprites.
Fix a null pointer access in Polymer mouse picking.
Specifically, it was in the "determine searchwall when aiming at floor or ceiling" part. Now, if prsectors[]->ceil.plane (or ->floor.plane) is NULL, we set the searchwall to the sector's firstwall and return.
when drawing art sky, temporarily set texcoord s wrapping to clamping.
This properly fixes the unwanted vertical lines.
Mapster/classic: Make Ctrl-P toggle parallax rendering types in 3D mode again.
Of course, it's just for the heck of it, since this setting is not saved into MAP files. I kinda like the cylindrical projection...
Fix flipping masked walls in Mapster/classic.
This has been there since searchbottomwall introduction in r1466.
On Windows, don't allow map playtesting from Mapster when in fullscreen.
Because this doesn't even seem to work on XP, we're being spammed with DDERR_SURFACELOST messages...
Fix point deletion in Mapster32.
Previously, it was possible to leave a sector with less than three walls if a point got deleted transitively by a TROR link. Now, a proper check is done for all deletion candidates and a message stating which wall and sector is problematic is printed. Thanks for Diaz for pointing out the brokenness.