Build 2849
SVN-
General
Make DukePlayer_t's transporter_hold an int16_t again.
Show details
This was narrowed to int8_t in r1625, breaking CON code that wanted to lock the player for a longer time than 127 game tics.
SVN handles and Git names are merged into one person.
Make DukePlayer_t's transporter_hold an int16_t again.
This was narrowed to int8_t in r1625, breaking CON code that wanted to lock the player for a longer time than 127 game tics.
EVENT_DRAW3DSCREEN, screenshot functonality.
The event is run after drawing the scene, but before the overlays. To make a screenshot from a script, set DOSCRSHOT to non-zero. It will then be scheduled to run once after the drawing but before the above-mentioned event. The screenshots will be called mcapXXXX.{png,tga}.
if printext256's <col> arg is negative, use editorcolors[-<col>].
The editor colors are the ones listed on page 9 of the Mapster32 built-in help.
Fix disabling EVENT_DISPLAYCROSSHAIR by setting RETURN to 1. SECTOREFFECTOR is not a useful crosshair.
ksqrt, with timing and value test.
The latter shows that "int32_t ksqrt(int32_t)" also copes with values in the range INT32_MIN..-1, effectively interpreting them as uint32_t (i.e. adding 2**32). However, this should not be relied on from CON.
Fix the overlooking of EDUKE.CON in the absence of DUKE3D.GRP caused by r2726. Also, tweak a few string literals' use of quotation marks.
warn on out-of-range hex literals and ignored redefines with different values
CON parser/runtime: two bound tweaks, defer setting insptr in (load)actor.
don't attempt drawing sprites with (cstat&48) == 48 that aren't voxels.
Bang! One more invalid internals exposure squashed. Maybe one day we'll be able to call EDuke32 "stable"... Actually the offending sprite IS drawn as face sprite with shade 32 and xrepeat and yrepeat 255 for the convenience of the CON coder who will have to debug it.
In CON showview, if drawing off-screen, clear the view with pal 0 and bail out.
This fixes the glitches/corruption whereever showview is used from EVENT_DISPLAYROOMS while the scene is actually rendered to a tile instead of the frame buffer, for example because we have a tilted view or "pixel doubling" enabled. Fixing it for real (i.e. so that the showview actually completes) will require more effort.
On Windows, check file name case with 'sound' and 'music' CON commands.
This is done by kopen4loadfrommod'ing and immediately closing the file (since the checker is still run from there when not ingame). On my system, times were like 0.12 ms, 0.2 ms and 0.5 ms for each openfrompath/findfrompath, openfrompath/Bopen and SHGetFileInfo respectively, so it shouldn't have a too noticable impact on initial loading times.
Add EVENT_LOADGAME and EVENT_SAVEGAME, self-explanatory. Also make EVENT_NEWGAME use myconnectindex for player ID instead of screenpeek.
Setting RETURN in EVENT_DISPLAYCROSSHAIR will now change the crosshair's picnum while allowing the game to position it, etc. As usual, setting RETURN to -1 disables hardcoded drawing of the crosshair completely.
Fix EVENT_CHECKTOUCHDAMAGE (the change to how events handle RETURN broke it)
Alternate implementation of EVENT_SOUND that better covers all hard coded sounds (menus, boss recognition sounds, etc)
Fix breakage of EVENT_WEAPKEYx after r2656
Addition of 3 events:
EVENT_SOUND: triggered upon playback of any sound, this allows the "hard coded" sounds to be altered in a context-aware fashion instead of having to resort to clunky hacks like replacing them with a blank sound effect. RETURN var iable is set to the sound effect # of the sound to be played, or -1 to cancel playback. EVENT_CHECKTOUCHDAMAGE: triggered in P_CheckTouchDamage() whenever the player collides with anything. Value of RET URN is set to the result provided by clipmove() and so can be decoded in the same way. Value of RETURN when the event is over can also be manipulated to control some of the hard coded damage effects. EVENT_CHECKFLOORDAMAGE: triggered in P_CheckFloorDamage(), RETURN is simply the picnum of the floor of the sector t he player is in. Can be used to cancel hard coded floor damage effects or to make other tiles exhibit the same eff ects Other misc fixes and cleanups, including a possible workaround for Duke Plus SECTOREFFECTOR light issues wherein all SE49 and SE50 that have a statnum of STAT_EFFECTOR are simply changed to STAT_LIGHT during the STAT_EFFECTOR loop now.
Add tilenum bound check to CON *actor blocks when parsing, fix the other ones.
The remaining checks now "continue;" when an oob tilenum is found where an oob access would ensue else. Also, it's now checked for negative numbers (the message remains the same though).
Assign light SEs (lotags 49 and 50) to an exclusive status number. EXPERIMENTAL!
The primary reason for doing this is that handing of moving sectors is significantly simplified. Because moving sectors usually don't move containing SEs/effector-statnum sprites, no special handing code is needed to move light SEs with them. Thus, this commit sets light SEs to a new statnum when they're spawned *from premap*, and a new G_Move*-like function (called G_DoPolymerLights) is added to process every sprite in that status list. This should "fix" light SEs moving together with a variety of moving sectors, but CON programs expecting the old behavior may break, therefore this commit is marked as experimental. Additionally, a problem with the old implementation is identified: it seems like the correct functioning is dependent upon the order of processing between the sector movement effector and the light SE, so this makes it another good reason for the change. (A third one is that all lights can be processed with a per- statnum loop, but CON coders should not do this until the change is considered final).
Factor out almost all instances of setting ...->pals.[rgbf] into P_PalFrom.
This is so that it may be intercepted in the future. The only code that's not replaced by the function call is with the CON interface to g_player[].ps->pals via player[].pals X and .pals_time. Also, comment out one instance because it's overwritten by a succeeding one.
Add bit 16 to the two main setbrightness() users, add bit 2 to one of them.
(I.e. also restore r2232 again.) The first one is the palette restore logic in G_DisplayRest, the second is CON setgamepalette, to which the "don't gltexinvalidateall()" bit is added to mimic the first. Hightile invalidations aren't really useful for anything other than reloading them after a video mode change, IMO. These changes mean that 1) active full screen tints should (almost) always be kept with a basepal change. The only exceptions to this are when tints really have to be cleared, e.g. when changing the player view in co-op play. 2) there should be no performance issues with simultaneously changing basepals while a tint is applied
Tweak the conditions under which setbrightness() invalidates GL textures.
Previously, we checked whether the faded palette has changed (by way of CRC) and invalidated the textures then unless the preserve flags were set. This however could lead to wrongly invalidating them under unfortunate circumstances, e.g. basepal change from CON + tints at the same time before r2620 which reverted r2232. Now, only invalidate them if the corresponding preserve flags are clear AND * the base palette has really changed OR * the palette CRC changed and we were running on software gamma The latter means that performance-killing invalidations may still happen on GL platforms lacking HW gamma (for ATI, it's currently only disabled in 8-bit fullscreen). Also have a new global 'basepalreset' to fake a basepal change for setbrightness(), currently used when changing renderers so that going from Polymer to Polymost and back again will invalidate the Polymer textures on the second change, potentially re-applying a basepal highpal. (Still with me?)
Revert r2232, "don't reset full-screen tint on basepal change" in CON setgamepalette.
Because gltexinvalidate*() could be called too often when setgamepalette is used while having a tint overlaid else. Pending thorough analysis/reworking of the 32-bit mode base palette handling / texture invalidation.
CON palfrom: sanity-check current player and maybe print error message.
Fix CON parser accepting defines and numbers where writable var expected (4 cmds)
fix some commands breaking too early in case of a failed validation.
If one next instruction happened to be interpreted, madness would ensue, because the pointer wouldn't be aligned on the "opcode" part anymore. Also, with "seti", set current sprite index only after a successful validation.
New M32Script command "getspritelinktype" <spritenum> <<linktypevar>>.
This get into the writable variable the "linking type" of the sprite with index <spritenum>. The result is a bit field of ORed values: 1: lotag has linking semantics 2: hitag 4: extra, 8: xvel, 16: yvel, 32: zvel, 64: owner (custom only) Custom setting about which sprites have what kind of linking can be programmed via EVENT_LINKTAGS: it receives a sprite index as the 'current sprite' and is supposed to return the bit field in RETURN. An example which lists sprites and their linking hi- and lotags is provided in the state 'listusedtags' in a.m32.