Build 2229
SVN-
Generale
- Format CON crash output in VM_ScriptInfo() much more nicely.
Mostra dettagli
- Execute VM_ScriptInfo() when DNDEBUG is used.
Nickname SVN e nomi Git sono unificati per persona.
- Format CON crash output in VM_ScriptInfo() much more nicely.
- Execute VM_ScriptInfo() when DNDEBUG is used.
make the 'palette' player member actually return the player's palette ID
instead of -1. Setting is still only through 'setgamepalette'.
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.
SDL layer: in 8-bit mode, defer setting the palette until showing the next frame.
CON code sometimes uses 'setgamepalette' from withing actors, which is a bit too frequent. Deferring the actual palette updating means that multiple requests in between two screen redraws are coalesced into one, which is desirable for performance reasons and for the reduction of 'tearing' artefacts (but not prevention, since the drawing isn't synced to the screen refresh rate with vsync off). (Did-not-)update issues might be introduced. Windows isn't touched because - I expect it to be more brittle, especially in light of the ATI HW gamma problems. - I haven't tested whether the particular performance penalty that lead to this change ('gas' in AMC TC) exists there too
start CON code at script[3] instead of script[1]. The 'move' command permits
the constants 0 and 1, and moveptrs may reference the script up to index 2 then (though I'm not sure whether the code is reachable with moveofs either 0 or 1), so make sure it's nulled instead of whatever happened to compile at the first two positions. Move 1 is only used once in the original cons, when frozen and being shattered.
CON parser cleanup: In C_Compile, initially clear three arrays with
Bmemset(..., 0, sizeof(...)) instead of clearbuf(..., MAX..., 0), because the latter would clear only half of the data on 64-bit platforms.
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.
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...
checkdefs.sh script: hackish support for CON files, only 'include *.con' and
'definesound ... *.(voc|wav|ogg)' commands (missing: 'music', something else?).
Fix sintable[] access with out-of-bounds values in core engine functions
(getzrange, hitscan, clipmove, drawmapview). They're reproducible with DNE1.3D; Since these angle values most likely come from CON code, my suggestion would be to bit-and all values representing angles with 2047 when setting the from CON, but I'd have to think about potential side-effects of doing this.
a.m32: New function save_restore_hlsectors, also accessible from the Quote-F
menu. If some sectors are highlighted, save their indices. The highlighting of those particular sectors can then be restored at a later time (but careful across structural modifications that tweak sector indices) by running the same function. Shares a 'gamearray' with function 'collect_teleporting_sectors', so the latter will reset this one when run.
when failing to compile a state with a menu name, don't keep the
menu entry.
CON parser cleanup: make labelcode save offsets to CON code instead of
pointers and make it into an int32_t*.
CON parser cleanup: make labeltype be an int32_t* instead of an intptr_t*.
CON parser cleanup: when getting a value from labelcode[], assume that it
represents a pointer into the script for label types other than LABEL_DEFINE instead of checking inclusion of the value in the script bounds. This assertion was tested with WGR2 SVN.
Add the following commands to those which shouldn't be optimized away
with empty branches: ifcanseetarget, ifpdistl, ifpdistg, ifgotweapononce.
Somewhat largish commit with various keyboard tinkering for Mapster.
The main change consist of adding a key press (and release) callback whose only purpose is to be used from m32script as EVENT_KEYPRESS. When entering that event, the RETURN variable will be set to the keystatus code of the key, and whether it was pressed or released can be checked by looking at keystatus[] at that code (ifholdkey and ifhitkey do this). The purpose of this, then, is to be able to remap keys in a more general (and complicated) fashion than is possible with the mapster32.cfg 'remap' option. Various other additions build around this central one: - add an example EVENT_KEYPRESS to a.m32, among other things emulating the keypad arrows with Alt-<normal arrows> for notebook convenience; disabled initially - a.m32: set 'owner' with Alt-KP2: now Alt-Shift-KP2, because of collision with the above - new m32script command: setkey <keycode>, setting keystatus[<keycode>] to 1 (note: may be restricted to use in EVENT_KEYPRESS only in the future) - fix indexing an m32script array with a defined label, there used to be a 'not a gamevar' error instead - add the following constant labels for some key codes: KEY_SCROLL, KEY_F1 .. KEY_F12
Fix the 'displayrandvar{var}' CON and m32script commands for environments
with RAND_MAX > 32767 (everything except Windows?). The 'displayrand' command now returns values from 0 to 32767 inclusive, across all platforms.
New CON command
setactorsoundpitch <actor#> <sound#> <pitchoffset> which can be used to change the pitch of a playing sound. The pitch offset has the same meaning as the definesound pitch range endpoints, i.e. the units are 1/100th of a seminote. Note that just like the random pitch offset, increasing the pitch makes the sound duration shorter (and vice versa).
Eliminate one uinitialized mem access related to projectiles (it's the filler
member, so maybe not *that* bad) and an invalid memory access when trying to access a per-player gamevar in a player-less context (e.g. WGR2 SVN r25 WGR2GAME.CON line 10448).
A couple of small tweaks:
- fix arg checking in checkdefs.sh - some tilenum and quote ID validation in the CON interpreter - G_DrawDigiNum and friends: eliminate redundant strlen calls
Make Polymer's FOV depend viewingrange variable in a 'tangent-linear'
fashion. Among other things, this makes the FOV widening when shrunk work. User CON code should always check the initial viewingrange value when attempting to do FOV effects like zoom, because it is not guaranteed to be 65536 due to different screen aspect ratios etc.
Add a couple of missed sanity checks for accessing player and sprite structure members as vars. Should fix crashes with stuff like "ifvare player[some value greater than MAXPLAYERS].kickback_pic blah"
Much more elegant solution to updating the player's sectnum when passing through
TROR portals that works with a little help from updatesectorz() (change not visible from CON code). Relies only on the presence of an extension whose portal isn't blocked and also plays nicely with corner cases like being shrunk and enabling the jetpack. This should fix the upward moving platforms in WGR2.