Build 2227
SVN-
Generale
a.m32 light hotkeys: clamp hitag (range) to 0..32767 instead of 0..16000
Nickname SVN e nomi Git sono unificati per persona.
a.m32 light hotkeys: clamp hitag (range) to 0..32767 instead of 0..16000
Besides the performance issues, there's another reason why changing the palette
'frequently' isn't such a good idea. Assume an actor constantly changes the palette to some value and you're attacked by a newbeast at the same time. Then the pain tinting would be reset each time the actor's code is run. This commit adds a new flag 16 to setbrightness(), meaning "don't reset the fade tinting". Its only use right now is from CON's setgamepalette command (and there, always). The change is done in the engine and thus affects all platforms.
make smoststart[] (which saves starting "smostcnt"s) an array of int32's
instead of shorts. This fixes their values' overflow in AMC TC megabase and probably a couple of other large maps.
patch up another out-of-bounds access in the voxel drawing code, though
I'm not sure whether the increased array size is enough.
minor cosmetic tweaks in sector.[ch] and a off-by-one limit correction there
Fix out-of-bounds write when passing a map filename to Mapster32.
Add new actor[].flags flag 2048 (SPRITE_NOCLIP), for 'spriteflags' CON usage.
Actors are always moved such that _they_ clip against blocking sprites, even if their blocking bit is clear. Setting the new bit make them not clip against anything. The promary use of this is for decorative moving sprites that are spawned in masses, such as rain or snow.
engine.c, in engine_addtsprite: if we can't add more tsprites because we
already have MAXSPRITESONSCREEN of them, return 1 to signal that the caller should break out of the loop.
Patch up out-of-bounds access in some voxel drawing code.
Don't spawn weapon tiles (WEAPONx_SPAWN) if any such value has been set
to negative numbers. Previously, only checks for being zero were performed, but CON code in the wild also has WEAPONx_SPAWN -1, which would propagate to the sprite picnum...
a.m32: new state 'print_parallel_midpts'
Rudimentary support for auto-aligning along TROR nextwalls.
Usage: press the ['] (quote) modifier together with the PERIOD key. Aligns only the immediate upper and lower neighbors of each wall that got aligned by following point2s or nextwalls. Doesn't play well with Alt (carry over xrepeat) yet, might need two subsequent alignment passes.
Fix a number of oob accesses with "switch switches".
Various code checked for switch tiles in the following manner, for (ii=0; ii<2; ii++) switch (DynamicTileMap[sprite[i].picnum-1+ii]) { case SOME_SWITCH: ... } which blows for picnum 0. Now, we simply disallow it.
Remove {eduke32,mapster32}.memmap files on clean/veryclean targets
(bioman request).
Fix sintable[] access with out-of-bounds values in core engine functions
(getzrange, hitscan, clipmove, drawmapview). They're reproducible with DNE1.3D; Since these angle values most likely come from CON code, my suggestion would be to bit-and all values representing angles with 2047 when setting the from CON, but I'd have to think about potential side-effects of doing this.
- Fix invalid polymer light array access originating from game's cleanup
callback 'G_Polymer_UnInit'. - In astub.c, reset spritelightid to -1 when nulling the spritelightptr of a sprite (no crashes observed, just precaution) - In sdlayer.c, catch SIGILLs with our signal handler too, since illegal instructions are what the instrumented debug builds will execute when attempting to carry out an undefined (per C) operation.
engine.c: fix shift by negative value in parascan().
polymer.c: fix out-of-bounds picanm[] read.
Fix shift by values greater than 31 in some voxel loading code.
a.m32: New function save_restore_hlsectors, also accessible from the Quote-F
menu. If some sectors are highlighted, save their indices. The highlighting of those particular sectors can then be restored at a later time (but careful across structural modifications that tweak sector indices) by running the same function. Shares a 'gamearray' with function 'collect_teleporting_sectors', so the latter will reset this one when run.
fix filling all sectors of a bunch with Ctrl-U. Previously, only
one sector was filled and the 'clear bunch' message was displayed even if the operation was canceled.
When failing to extend a collection of sectors because one of
them has a different height, print the sectnums of two differing sectors to so that the mapper can find and examine them with Ctrl-J.
new cfg var 'glusememcache', the same as r_memcache cvar.
when having some sectors highlighted, also show how many walls
they contain in total.
Revert r2141 functionality because it was a stupid-ass hack and breaks E3L5.
The texture warping mode will need to be set depending on whether we're actually drawing a parallaxed sky or not.
Upload sky textures with s wrapping set to GL_CLAMP{_TO_EDGE}.
This fixes the vertical (~1 texel wide) stripes that are especially noticable with tiled art skies and Polymost with r_parallaxskyclamp=1 or Polymer (which always uploads skies with repeating s and t coords). What constitutes a sky tile is currently hardcoded to be >=78 and <=99.
Rewrite sector duplication (Insert or C) in terms of backup_highlighted_sector
and restore_highlighted_sector functions. What this means is that TROR bunches are now correctly duplicated too (only if all sectors of a given bunch are highlighted).
New modifier for RAlt. When RShift is depressed while highlighting sectors
(i.e. first press RAlt, then hold RShift to make it active), consider all sectors, even the grayed out ones. This makes 6 modifier keys in 4 categories for RAlt. Can you name them all? Also spell out the labels that get drawn near the reticle when applying some of the modifiers and make them not show when not actually selecting (e.g. pressed RShift alone, but have highlighted sectors)
In backing up highlighted sectors code: also back up TROR information so
that bunches and nextwall links are restores, too. Now, to coalesce two TROR maps (e.g. for a CBP), one could do for i allsectors, sethighlightsector i 1 on the console, and then load the 'other' map to copy over the contents of the first, including all TROR stuff. Note that neither selecting all sectors with RAlt, nor duplicating them with Insert would lead to the desired effect (yet). Internally, - yax_setbunch() now has different behavior for bunchnums -1, -2 and -3 (it either clears the nextwalls or not) - build.c has a helper function free_n_ptrs(). This could be handy in other situations where many blocks of memory must be allocated consecutively and freed in case of failure
corruption checker: catch TROR-nextwalls in non-extended sectors. These
can be caused by copying map parts from one map to another (or a new one). The copying system is slightly broken right now....
Backing up and restoring highlighted portion of map: calculate new
next{wall,sector} indices instead of using checksectorpointer() so that the nextwalls will be restored exactly as they were (provided that they are copied). Also fix tweaking the sectnums of sprites.
Ability to duplicate an inner loop in a neighboring TROR sector.
Called 'loop punching'. In addition to duplicating the loop, the inner portions of the original and cloned loop are made into a new bunch, and the loop walls are made to be neighbors, linking their movement to each other. This gives a way to create island sectors with a differing bunchnum in the midst of an already extended area. Usage: For an extended sector containing a CCW inner loop, select its points using Ctrl+Shift. Press Ctrl-E to be queried whether to duplicate the points into the upper or lower extension (even if it's unambiguous). A number of conditions must be met for a successful 'punch', which should hopefully be more or less obvious. Among them: - loop walls should all be red - the starting wall is only considered among the non-grayed-out ones - the neighboring sector must not contain points inside or at the loop
"Sloped extended sectors cannot be split", oops. Also fix a glitch that
would break out of the 2D mode loop when splitting a sector would exceed limits.
Factor out high-level 'add loop to sector' code into own function.
in 'adding new loop to sector': use local 'firstwall' instead of ovh.suckwall
Three Mapster32 changes (2 wall-drawing related, 1 crash fix)
- Don't crash when sector joining fails under certain circumstances. - Increase the point lock (Manhattan) distance from 1/16th to 1/8th of the grid square length, making it easier to snap to vertices not lying at the grid points with grid lock on - When drawing walls, don't snap to any of them except the first drawn
Fix the flickering in the tile selector with lazy hightile loading on
(lazy_tileselector=1 in mapster32.cfg). We're drawing tiles one by one, so glDrawBuffer(GL_FRONT_AND_BACK) is our friend.
Correct thinko with the ceiling/floor movement code. When moving more than one
sector c/f and moving one of them would go beyond the other side (ceilingz > floorz), don't move any sector c/f at all. When moving only one sector in that case, move so that ceilingz == floorz.
Tweak raising/lowering (groups of) ceilings or floors.
Now, if more than one sectors are affected, always move them by the same amount. That is, if one of them would be sticking against the other side, don't move the rest. Another change consists of determining the z delta first, and only then moving the sprites by that amount. This fixes the problem where you'd e.g. raise a 'floor door' against the ceiling, and the effector sprites would be raised one time too much, preventing them from being lowered the next time.
A couple of Mapster changes related to saving.
- new mapster32.cfg and OSD variable 'fixmaponsave_sprites', telling the editor whether to 'fix' the sprite sectnums on saving and entering 3D mode. Note that a) sprite sectnums are never fixed when 'script_expertmode' is enabled, as before, and b) sprites that have out-of-bounds sectnums are still fixed if a proper sector is found - if saving and some sprite sectnums have thus been tweaked, inform the mapper on the status line and print the changes in the OSD - fix update issue similar to an earlier one: when 'saving as', the astub.c- based file name is now updated too, so saving with Ctrl-S now saves into the one save with 'save as' (and not the old one) - don't attempt to recheck wall pointers from scratch (when saving and running with -check) if it's a TROR map