Build 3533
SVN-
General
Lunatic t.: {read,save}gamevar, fix break in nested while, fix rotatesprite16.
SVN handles and Git names are merged into one person.
Lunatic t.: {read,save}gamevar, fix break in nested while, fix rotatesprite16.
Lunatic translator: fix codegen for "break" inside while loops.
Note: usually, languages call this "continue". Jeez, CON...
CON parser: don't allow read-only gamevars to 'readgamevar' command.
export C functions that may call into CON events using the Lua C API.
We must not call these functions using the FFI, since the Lua state is considered locked across such calls.
Lunatic translator: nearing a workable state...
- some more outer commands - gamearray persistence - faster 'mod': use math.modf instead of math.fmod (the former is JIT-compiled) - checkavail* - THISACTOR special handling - Fix building in Windows (export A_ShootWithZvel instead of A_Shoot).
CON qstrcpy: don't call strcpy() with identical source and destination quotes.
Thus making the identical source and destination quote number case into the expected no-op instead of being undefined behavior.
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").
CON qsprintf: fix specifying more than one "%s" conversion.
Also, slightly better, though still inadequate checking.
don't accept read-only vars for first arg of qstrlen.
Lunatic translator: gamearrays.
Fix derailing CON instruction pointer when gametextz is passed null quote.
CON digitalnumber*: move orientation &= (ROTATESPRITE_MAX-1) to G_DrawTXDigiNumZ
Refactor C code related to gettimedate and sect*interpolation CON commands.
No functional changes.
CON myosx*: move masking orientation with user-bits-mask to G_DrawTileGeneric().
Rework how the z velocity is passed from *zshoot to A_Shoot().
Previously, actor[].shootzvel (implementation detail, not available to CON) was checked, and if it was !=0, that was the overridden velocity. The value 0 meant "hardcoded, projectile-dependent velocity". But that neccesiated a hack where if zvel 0 was passed and really meant, it needed to be set to 1 instead. Now we have A_ShootWithZvel() taking an additional last argument plus a macro SHOOT_HARDCODED_ZVEL permissible for that argument.
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.
CON parser: don't accept read-only gamevars for 1st arg of *sprite{sect,stat}.
CON/m32script: remove GAMEVAR_DEFAULT uses, since they had no effect.
In CON, the bit is still always cleared for user-defined gamevars.
gamevars.c: implement Gv_Clear() in terms of Gv_Free() + own code.
Also, some commenting.
Simplify HUD scale and viewport size logic and clean up related code.
* Make the "classic status bar fullscreen viewport" mode accessible in classic too. * Make range of status bar scale 36..100 * Update ud.statusbarmode when executing OSD command r_size (ud.screen_size). NOTE: ud.statusbarmode is considered internal. Don't use from CON! * Make sure 1) loading any configuration and 2) menu bars work correctly. (The "classic status bar fullscreen viewport" mode will never be restored though because ud.statusbarmode isn't handled by the OSD var system).
Encapsulate aplWeapon* array accesses in a PWEAPON(Player, Weapon, Wmember) macro.
In the normal game, these arrays are conceptually [MAX_WEAPONS][MAXPLAYERS], allocated as CON per-player gamevars (e.g. WEAPONx_WORKSLIKE). For Lunatic, they are replaced with weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS].
Replace wall of dup'd code in Gv_AddSystemVars with something more readable.
Specifically, have a weapondata_t type mimicking the aplWeapon* arrays. Keep a list weapondefaults[] which undergoes some static->dynamic tweaks and then makes its way to the WEAPONx_XXX per-player gamevars.
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.
proper bound checks for {re,}definequote commands.
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.
Factor out some repeated code into G_{Load,Save}PlayerMaybeMulti.
This currently says that MP saving/loading isn't supported, but doesn't really work correctly. Also, properly bound-check the immediate argument to CON's 'save' command and one more ... -> G_HandleAsync().
Factor out snprintf'ing a maybe-modDir'd file name into macro G_ModDirSnprintf().
... and use it in three places. In two of these uses, 1) CON {read,write}arrayfromfile and 2) G_SavePlayer, display an error message if the file name such generated is too long. In the CON commands of 1), also error out if the file couldn't be opened.