Build 3280
SVN-
fix LAlt (carry over xrepeat) option for auto-alignment [.].
SVN handles and Git names are merged into one person.
fix LAlt (carry over xrepeat) option for auto-alignment [.].
Don't call setaspect_new() at end of rotatesprite.
This fixes 2nd and following rotatesprite calls drawing differently from the first in a context with custom set-up aspect, as reported by Lezing here: http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__143090 Also, back up and restore the aspect state across EVENT_DISPLAYREST.
Initialize BADGUY sprite flags for hardcoded enemies.
... instead of switch/case-ing them in A_CheckEnemyTile(). Because this requires bumping BYTEVERSION, we also get rid of the excess trailing bytes in the save game's "rest" data. (See r3052.)
Makefile tweaks, protect sprite[].picnum.
Misc. engine cleanups, no functional changes.
engine.c: factor out 2 pract. ident. pieces of code into try_facespr_intersect.
The two uses are from hitscan and neartag. The functionality is reproduced exactly (assuming I made no mistake), down to different distance checking (<= vs. <).
Remove many redundant (int16_t) casts and one now incorrect one.
The redundant ones are in code like this: s->cstat = (int16_t)32768; Because the value is eventually converted to the type of "s->cstat", any casts to integral types having at least as many bits are no-ops, signedness being irrelevant due to (probably any two's complement arch targeting compiler's) bit-pattern preserving semantics of these conversions. The now incorrect one is: if (lotag == (int16_t) 65535), "int32_t lotag" being read from a wall or sprite struct directly earlier. Now, with these members being unsigned, and (int16_t)65535 equalling -1, the check always fails. The correction fixes normal switches having such a lotag ending the level immediately. In short: integer casts before assignments are unnecessary, those in reads highly relevant!
Engine cleanup: factor out code getting bounds of sprites.
Clean up base engine functions: tighten scope of locals declarations.
Clean up engine code by factoring repeated 3-liners into spriteheightofs().
This function also changed: it doesn't handle floor-aligned sprites now, and the z offset is returned instead of set by pointer.
fix cycling picnum in 3D mode.
Using non-keypad [-]/[+] or LMB + mousewheel, it was broken when a void tile was in between.
make lotag/hitag getters return signed values, as per agreement on IRC.
This means that the internal change done to these sprite members in r3159 is hidden from CON for backward-compatibility purposes. Note that .cstat and .{ceiling,floor}stat aren't touched, and will return unsigned values to CON.
Probably fix the zoom crash encountered with Mapster32 and CBP8.
Fix clipboard tile display in 3D mode.
set first walls more conveniently on split in one special case.
Specifically, if the first wall of the sector-to-split is to the left or right of the *start* of the splitting line AND the sector has no TROR extensions, make these two the new nextwalls of the respective split sectors.
Lunatic reorganization part 2: split into engine and editor/game parts.
On the engine side (functions starting with L_), there are now the basic parts like state creation and running code from strings and files. The game and editor can add to that by e.g. loading whatever they please into the state. Their functions start with El_ and Em_, respectively. The Lua scripts still reside in source/lunatic, even for the common ones. This is because they will be embedded into the binaries as bytecode or compressed source eventually, so their location on disk will be irrelevant.
Clean up texture loading code etc. in polymost.c, no functional changes.
fix rotatesprite with no screen scaling and non-widescreen aspects.
Also, enable showing sprites in Mapster32's overhead view again, since that was one (the only?) use of that code path. The uninitialized read was introduced in r2927.
When found a camera sprite for viewscreen, set position etc. immediately.
Instead of later in P_ProcessInput(). This fixes one drawrooms() call in between where the sectnum is the camera's, but the position the player's, which can lead to a slow "outer view" render in Polymer.
engine.c: add bound-check assert failing for sprites in m32's textured 2D mode.
Also, disable drawing sprites in that mode for now.
functionality to rotate or scale RShift-highlighted stuff smoothly.
This is done by pressing LShift and - holding down the left mouse button for scaling, or - the right mouse button for rotating the highlighted walls/sprites with respect to a pivot point determined as the center of the bounding box of all highlighted points. Note that scaling sectors isn't that easy and the current functionality is very rudimentary: there's no z scaling, no xrepeat correction, and sprites aren't touched expect for their position. The user is responsible to maintain map consistency, for example to prevent wall-lines of the same sector crossing each other.
when looking for matching wall in 2nd pt. ins., don't skip gray nextwalls.
This fixes a bug where it's not possible to split a sector under certain circumstances, reported by Micky C here: http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__view__findpost__p__138380 Also, don't allow zero in various 'F functions: Resize selection and Global {shade, visibility} divide.
Work around the transparent line with on-screen chaingun and linear filtering.
We do this by messing with the GL texture that gets uploaded for CHAINGUN. Since this is implemented on the engine side, the static value for CHAINGUN (2536) is used, and the tile dimensions are compared to 211x55 to have a little confidence that the tile wasn't overridden by a mod. Hack indeed.
draw lines to linking sprites with LShift, jump to them with +[ or +]
When LShift is pressed and the mouse is over a linking sprite (as determined by the tag labeling system), lines are drawn to all other sprites, and pressing [ or ] will cycle these then. False positives and missed sprites are possible. Additional changes: - consider SE 31 and 32's lotag to NOT be linking, since the ACTIVATOR is what matters. The original maps are inconsistent there. - When pressing Alt+[ or Alt+] and there are no corruptions, say so instead of doing [ or ].
when punching loop, fade screen; tweak two messages.
Texel-granular hitscan() for wall-aligned sprites.
The attribute is set per tile from DEF: either texhitscanrange <begintile> <endtile> or tilefromtexture <tile> { ... texhitscan ... } (As a special case, the list may only contain "texhitscan", in which case the texture is not changed.) In passing, do some cleanup for "tilefromtexture" DEF parsing: the list tokens should now be accepted in any order, and errors don't appear in the middle of the list parsing.
Prototypical no-SE7 water submersion/emersion.
Submersion only happens when the upper sector has lotag 1 and its vertical neighbor has lotag 2 (this can be useful to create non-submergible above-water sectors). Currently, only the player is handled. On the implementation side, the water handling code is split into P_Submerge() and P_Emerge() preparing the "teleportation", and P_FinishWaterChange() for the finalization.
save command input history.
take over load path.
add an OSD command to be able to interface with stuff.
In savegames, store dummy constant-length block instead of a _prlight array.
sizeof(_prlight) differs across compilers, and besides, Polymer lights were not loaded anyway (they're restored live in-game later). The savegame version was not bumped, but only savegames made with builds where sizeof(_prlight)==261 (like synthesis) will stay compatible! Report and helpful debugging information by LeoD.
make 'corruptcheck_noalreadyrefd' a separate OSD command.
Instead of having 'noalreadyrefd' as a 'corruptcheck' subcommand. This way, TAB completion can be had.
factor out some code (3x) into GetSaveBoardFilename().
Factor out prepare/finish parts from load{old,}board(), misc. cleanup.
This means that loadoldboard() now should also initialize Polymer map info after loading a v5/v6 map. Make the variables holding a file descriptor an int32_t instead of int16_t.
A bit stylistic Polymost code cleanup.
Add compilation switch MODEL_OCCLUSION_CHECKING to polymost.h, leave it enabled.
engine.c: Split CLASSIC_NONPOW2_YSIZE into _WALLS and _SPRITES, enable the second
engine.c: add compilation switches for non-pow2 ysize functions, disable for now.
Previously, we used them in our builds for sprites, but MSVC builds don't have the ASM ported to MASM, and thus the workaround of ignoring the linking errors was not safe.
foreachmap.lua: add option of only printing matching file names (like grep -l)
Also, add convenience wrapper script findmaps.sh for quickly searching for sprites/walls/sectors satisfying a certain condition in all map files under a given directory.
add check for sprites being out of the maximal grid range (+-524288).
Requested auto-correction will place such sprites at their sector's first point.