Build 2305
SVN-
Generale
Fix a sector[-1] access when starting to draw a wall in an empty map.
Nickname SVN e nomi Git sono unificati per persona.
Fix a sector[-1] access when starting to draw a wall in an empty map.
Fix demo progress bar in OpenGL modes by adding bit 1024 to rotatesprite calls.
The problems still remains that rotatesprite behaves differently in classic and OpenGL modes with clipping boundaries specified (and maybe in some other cases)
Fix and clean up dynamic-to-static tile remapping source.
A couple of Makefile tweaks for clang 3.1 from SVN, and a workaround
for an assertion failure with clang. Really ought to file a bug report instead.
fix for running with static main engine arrays.
Fix USE_OPENGL=0 build; squelch one warning.
Fix building with GCC 4.6 link-time optimization.
It looks like GCC doesn't honor the 'used' attribute with LTO. This is "fixed" by declaring the variables in question with external linkage (i.e. removing the 'static'). I consider such behavior a GCC bug, though.
Route the 5th mouse button to the game; bump savegame version.
The "double-click button4" had to make way for MOUSE5 in the button binds menu, but I don't think anyone cares. Savegame compatibility was actually silently broken with the MAXTILES update earlier, but I forgot updating the version...
Fix a potential sector[-1] access when drawing a masked wall in Polymost.
Fix the insert cicle wall-points bug reported by Norvak.
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'.
Fix a potential wall[-1] access in Mapster32.
Use ATTRIBUTE((used)) for symbols used only in inline asm.
This may fix compilation for optimized builds with GCC or clang where the compiler would otherwise decide that those symbols are unused.
Fix a problem in G_DrawRooms where an sectnum updated to -1 may be used as index.
Fix oob accesses when e.g. shooting tile -1. (can propagate via WEAPONx_SHOOTS)
Ideally, we would also warn when setting WEAPONx_SHOOTS to negative values, but we'd have to intercept CON's setvar's and it wouldn't be pretty.
less trivial stuff
- fix one bound-checking line - rewrite two lines in astub.c to potentially not overflow an int16 - make tiletovox[] an array of int16's
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.
winlayer.c: in WM_PALETTECHANGED handling code ("someone stole the palette
so try and steal it back"), prevent calling IDirectDrawSurface_SetPalette() with NULL arguments, causing a crash. It's happened for me on Vista, when initially changing from 8-bit to 32-bit mode.
Add Makefile option to use the DMALLOC (debug malloc) library.
I didn't have much success in finding bugs using it, but it works out-of-the-box on my setup, so it may be useful in the future.
Temporarily disable the 'model thinning-out' feature intended to save memory.
It turns out that with model interpolation, out-of-bounds frame numbers may be generated with thinned out models, so disable it until I can sort out what's wrong with it. Also, minor code cleanup.
Fix actor[].dispicnum becoming negative.
Since the original source code release of Duke3D, there was a potentially dangerous hack where actor[].dispicnum was set to -4 to signal "this actor should not have a floor shadow for this moment" (it doesn't really work, if you ask me). Now, use another bit of actor[].flags for that purpose because setting any picnum members to negative values asks for trouble.
animvpx sound: fix the 'may have many sounds per frame' requirement
E.g. this should work correctly now: // FLY_BY, PIPEBOMB_EXPLODE, OCTA_DYING animsounds logo { 1 244 64 14 64 144 }
Makefile.common: oops, -DNEBUG was in the debug build, not the release one
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.
- Format CON crash output in VM_ScriptInfo() much more nicely.
- Execute VM_ScriptInfo() when DNDEBUG is used.
The earlier changes introduced bugs when palettes were not set correctly in
certain situations (mostly cutscenes etc). This commit removes bit 1 from all flags that make it to setbrightness, the meaning of which is "don't actually update the palette". I have no idea what it was for and since the corresponding P_SetGamePalette() calls were from places like the mentioned cutscenes, I don't think it matters performance-wise.
SDL layer: don't call SDL_SetGammaRamp() if there would be no change.
This is in the similar vein as the set-palette deferring and it's this that fixes the low FPS in the radioactively contaminated area in AMC TC: Megabase (since setgamma() is called from setbrightness()). Again, update issues might be expected, but changing focus between EDuke32 and the desktop and back seems to restore the gamma settings properly on Kubuntu. Looks like X (or whatever above handles this stuff) maintains it on a per-application basis.
savegame.c: fix compilation warnings with release build, add timing for debug
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.
fix bug in Net_ParseServerPacket introduced with SAMESIZE_ACTOR_T.