Build 2278
SVN-
Generale
Fix sprite[-1] access when aborting playing a sound in Mapster's Sound Index.
Mostra dettagli
Also a couple of other cleanup lines... might need more though, I'm not sure it's all good there.
Nickname SVN e nomi Git sono unificati per persona.
Fix sprite[-1] access when aborting playing a sound in Mapster's Sound Index.
Also a couple of other cleanup lines... might need more though, I'm not sure it's all good there.
Fix sprite[] access with indices > MAXSPRITES in Polymer model drawing code.
Internally, updateanimation() now takes a third parameter 'lpal'.
make sector flipping (X/Y) work properly with TROR.
always show highlighted sprites in 2D mode, even in a gray sector.
Fix a potential wall[-1] access in Mapster32.
minor engine cleanup.
- enclose glbuild.h in #idndef ... sentinels - engine.c: remove unused variable 'pageoffset', make 'lastx' static - formatting
Inreased debugging level for catching oob accesses to 'main' arrays.
If enabled, this makes the following arrays be allocated statically: spriteext, spritesmooth, sector, wall, sprite, tsprite, while necessarily disabling the clipshape feature (because it relies on setting sector/wall to different malloc'd block temporarily). To compile, pass DEBUGANYWAY=1 in addition to RELEASE=0 to 'make', and it's really only useful with CC=clang, of course.
cleanup:
- 'whitecol' was defined in the engine and in build.c, use only the engine one - make cachesize, artsize, artversion static in engine.c - undo some formatting havoc presumably done by astyle
Fix parallaxed sector display in Mapster32 on Polymer.
Fix the Polymer hitches first encountered with Parkade.
The cause was a combination of many factors. First, Polymer requires the start-drawing position to be inside the sector to draw (deviations lead to incorrect drawing). This was violated by the game, because it interpolated the current and next tic position without updating the sectnum, leading to inconsistencies especially when passing through narrow sectors. Polymer worked around it by doing an updatesector() each frame, however this works poorly for maps with overlapping geometry such as SoS or RoR. The solution to this is to add a new engine function, updatesector_onlynextwalls(), which searches the sectors (via nextsector) in breadth-first fashion instead of from 0 to numsectors-1, like updatesector does when it fails for the *immediate* nextwall neighbors. Internally, the breadt-first search helpers are moved into the engine.
polymer.c: "Compiling GPU program with bits (octal) %o" for easier reading.
Also, for debugging builds, show this message from verbosity level 1 on.
more internal cleanup...
the only visible change is that polymost_trytexcache (formerly two instances of nearly duplicate code) now prints a diagnostic after a cache miss. The one that one is most likely to encounter is "r_downsize doesn't match", meaning that this setting likely differs between Mapster and the game.
make the following static in polymost.c:
- texcacheindex *firstcacheindex, *curcacheindex - trytexcache(), gloadtile_cached() - Factor out duplicated code into clear_cache_internal()
- When saving game, clear all polymer lights before. Not doing this makes
the SE ones douple, triple, ... after each save. Maphack lights are reloaded with polymer_resetlights() (though I've had them disappearing after load, I couldn't reproduce it afterwards). - in debugging builds, print a message when polymer_resetlight is called on a nonexistent one. The problem is not so much the call itself (it's guarded), but the fact that resources on the caller side may not have been freed if it thinks that those lights do in fact exist. Right now, it's not the case though. - add 'loaded map hack' messages after some other successful loadmaphack calls
When loading a game, DON'T restore 'adult' TV tiles. This fixes the recent
crashes. Usually, after loading a game, some wall tiles are tweaked depending on whether adult mode is enabled or not. If it's not, those wall picnums are replaced with blank or broken screens. If it is, they are restored from the wall's .extra member. Apparently though, Mapster32 leaves some .extra members floating around even after deleting a TROR nextwall link (it's used as the 'lower wall index'). Because MAXWALLS is greater than MAXTILES, this may produce out-of-bounds accesses and corrupt memory (besides setting wall tilenums to nonsensical values) later in the game. Other than that, the change only affects loading savegames created with adult mode OFF. Kinky TV screenies simply won't be restored then.
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.