Build 3686
SVN-
General
Fix A_MoveSprite() wrongly reporting sector hit without z change after r3678.
SVN handles and Git names are merged into one person.
Fix A_MoveSprite() wrongly reporting sector hit without z change after r3678.
TROR no-SE7 water: spawn splash, reuse calculated other sector number.
Improve on the code that handles changing sectors of projectiles.
- In the A_MoveSprite() code that transports projectiles due to an SE7 (introduced in r1450 / legacy ROR), only report "success" if the transportation succeeded. - Clear newly introduced internal SPRITE_DIDNOSE7WATER flag after checking it.
Clean up of mostly actors.c, but some other files along the way too.
- Rewrite some sprites-of-{stat,sector} loops using the SPRITES_OF, SPRITES_OF_SECT and new SPRITES_OF_SECT_SAFE macros. - In passing, identify some problems and mark them with 'XXX', but don't attempt to fix them yet. - The usual readability improvements...
TROR no-SE7 water: handle projectiles.
Actually, the tweaked code in VM_Move() is not specific to projectiles, so other sprites now may pass no-SE7 water boundaries too, but it's most noticeable with projectiles.
TROR no-SE7 water: allow boundary change only if other-side lotag is other one.
That is, if submerging, the lower sector MUST have lotag 2. If emerging, the upper sector MUST have lotag 1. (Previously, emersion happened from ST 2 sectors unconditionally.) This means that the area where submersion or emersion can happen is now the same for the top and bottom parts.
Mostly engine and some gameexec.c stylistic changes.
in hitscan and getzrange, skip sprites if sprite part of clipmask is 0.
... like was done with clipmove() previously. Also, do some code clean up. There are no changes of functionality.
print the "Saved board" message more persistently.
new-generation map format, in-memory representation ("map-int VX").
The Lunatic build compiles with new structures for sector and wall types. They have separate members for TROR {up,down}{bunch,nextwall}, so there are no conflicts with other uses of members into which they were previously shoehorned. Also, the maximum bunch limit is bumped to 512 in that build. Currently, loading from V7/8/9 and saving to V7 and V8 are supported.
replace DukePlayer_t set-member methods with metatable magic.
So that members needing it are checked when they're assigned to using the usual syntax. What kind of check to perform (sector, player, ... x whether negative values are allowed) is written in a declarative fashion inside the C declaration. Also, make Lunatic's MAXQUOTES be C's OBITQUOTEINDEX and bound-check an access of sprite[p->wackedbyplayer] in the C code.
a.m32: Don't reposition head light if in void space, fixing crash.
a.m32: Implement a Polymer "head light" emanating from your position in 3D mode.
Toggled with Ctrl+Shift+[KP-]. Variable 'headlight_range' controls its range. For the implementation, a new event EVENT_PREDRAW3DSCREEN was added.
custom integer types treated as bitfields.
Used for engine struct's (c)stat and actor[].flags members.
factor out 3x computing "alwaysshowgray", but don't change anything.
fix assertion failure with overlong walls in rintersect().
return early with 0 from cansee() if either sector is >= MAXSECTORS.
Previously, only the <0 condition was checked. However, the passed sectnums could be >= MAXSECTORS (at least in C-CON), for example when issuing 'canseespr' on a sprite not in the game world.
don't wrongly report PANIC corruption with MAXSPRITES sprites present.
Lunatic t.: don't error on changing stat/sect of sprite not in the game world.
in readgamearray support code, use engine file functions.
This is so that files residing in GRPs (or anywhere the engine looks for them) can be read, too.
give sprite cstat 1024 a marco name, CSTAT_SPRITE_MDHACK.
Lunatic t.: option for generating code caching sprite/actor/player structs...
...at the beginning of each function called back from C, and each case/default function. Called -fcache-sap. Disabled by default.
spritesof{stat,sect} iterators that allow deletion inside the loop.
Also, - an optimization for sprite[]:setpos(). Calls to get_sprite_index() seem to be pretty slow (at least when they're not compiled). - add getzrange to the dynsymlists
build.c: initialize g_doHardcodedMovement to 1.
Fixing movement when not loading a.m32.
engine.c: in setpolymost2dview(), set gloy=-1 unconditionally.
This fixes an update issue: start EDuke32 without warping to a map in Polymost, change to classic, and change to Polymost again. The OSD background will be displaced.
sector[]:zrangeat(), 'getzrange' command for the translator.
Also, fix quote commands there.
add "movement by one" debugging functionality via a.m32.
If m32script gamevar "move_by_one" is nonzero, the some keys move the "player arrow" by increments of 1: - Without SHIFT: LEFT/RIGHT absolute x, DOWN/UP absolute y, A/Z absolute z. - With SHIFT: DOWN/UP (unbounded!) horiz, LEFT/RIGHT angle. This can be useful to debug renderer bugs that show a high sensitivity to the exact location ("are transient in space").
Lunatic translator: text rendering and other niceties.
Lunatic translator: sprite list commands, findnear*, protect player[].ftq.
Classic renderer: high-precision sprite drawing, preventing stray lines on top.
Face- and wall-aligned sprites are drawn using the wall routines in BUILD. However, the per-x-screen-coordinate distance (swall[]) is calculated in a way that potentially incurs great precision loss (for example 5 bits for xdimen=1280, yxaspect=65536). This leads to the starting (top) vertical texture coordinate possibly wrapping to large values, leaving an unsightly "stray line" on top of the sprite from certain viewing angles/horiz values. The approach to fix it has two parts: first, the distance is calculated using float values, preventing the precision loss. Because this doesn't fully prevent the unwanted lines, the texture coords are clamped to the mininum and maximum (0 and UINT32_MAX respectively) when calculating them for sprites. Note that stray lines may still appear at the *bottom* of sprites under certain circumstances, for example when viewing at a y-flipped sprite from above. These should be less noticable in real-world usage though. The feature is guarded by a macro HIGH_PRECISION_SPRITE in case using floating point or 64-bit integers is undesirable/impossible on some platforms.
engine.c: factor out calculation of texture coords / addresses in wall drawing.
engine.c: don't pass [udls]wal to maskwallscan(), use *wall globals instead.
sprite.change{sect,stat}, access to more members, member read test.
engine.c: in changesprite{sect,stat}, swap second and third early-out tests.
That is, first check if the sprite is in the game world and then if it already has the desired sector or status number. This doesn't change anything in our codebase, since the return values of these functions are never examined.
Engine cleanup continued, no functional changes.
engine/Polymer: factor out setting {cos,sin}*globalang into set_globalang().
engine.c: clean up drawsprite()
The usual: declare locals more tightly, const-qualify them where it helps readability, remove dead code...
Fix POLYMER=0 build, cleaning up #include discipline on the way.
Also taking care that the USE_OPENGL=0 build builds.
for VM_Fall and VM_ResetPlayer, pass VM sprite/player etc. as args.
Simplifying VM_FallSprite and VM_ResetPlayer2 used from Lunatic.
Lunatic translator: codegen for actor-tsprite accesses, sync some RO members.
provide access to actor-tsprite.
NULL spriteext[].tpsr after each running EVENT_ANIMATESPRITES for a tsprite.
Meaning that only *ettsprite[THISACTOR] makes sense from CON. It did before too, because .tspr was set before each event run (and not before all runs), only that it was never nulled, which was kind of untidy.
remove unused tsprite access via spriteext[].tspr.
Don't set spriteext[].tspr when creating tsprites from the engine.
Its only use is to have a actor -> tsprite mapping for the EVENT_ANIMATESPRITE event and .tspr will be set before it is run.
RESPAWN-preview coded in M32-script.
The m32script variable 'showrespawn_always' toggles whether the respawned picnum is shown unconditionally instead of only when aimed at (and locked onto the RESPAWN sprite) in 3D mode. Cool idea by Micky C. NOTE: sometimes doesn't work because of a bug in the m32script interpreter.