Build 4275
SVN-
when clearing bunch number of c/f with yax_setbunch(), don't reset xpanning.
Show details
In the non-Lunatic build naturally, since the Lunatic one uses its own member.
SVN handles and Git names are merged into one person.
when clearing bunch number of c/f with yax_setbunch(), don't reset xpanning.
In the non-Lunatic build naturally, since the Lunatic one uses its own member.
add codegen option -fbad-getactorvar-use-pli for C-CON compatibility.
Also, improve -Wnumber-conversion warning by printing the resulting number. BUILD_LUNATIC.
make wall texture alignment [.]/[,] work with bottom-swapped walls.
In simple cases, it should be added. Combinations of alignment across TROR boundaries and bottom-swapping will probably not work right.
Improve determination of when a sprite should be drawn before a masked wall.
Concretely, in the "behind, outside" case, draw the sprite early if any of its 2 or 4 corner points are behind the masked wall, and inside the cone or on the other outside.
don't attempt audio format auto-detection for less than 12 bytes.
document engine.*shadetab() functions. DONT_BUILD.
make gv.current{Level,Episode} one-based and document them.
Also, in LunaCON, make player .palette member read-only. BUILD_LUNATIC.
Per-map ART tiles: don't back up or restore reserved tiles.
This prevents a crash and maybe other badnesses when e.g. loading a map with ART tiles, doing something that allocates a reserved tile (such as looking into a viewscreen), then loading another map where the tilesiz* of TILE_VIEWSCR is restored to 0.
fix one error message, make -h/--help display usage.
Actually, right now, any first arg starting with '-' will show the usage.
Engine-side per-map ART file support.
When a map named <filename>.map is loaded (<filename> may also contain directory separators), the engine checks for existence of <filename>_XX.art in the virtual file system, where XX is a 0-padded number from 00 to 19. It loads a consecutive sequence of these ART files, i.e. aborts whenever a number in the sequence isn't found (in contrast to normal ART loading). Restrictions: - the per-map ART files must not reside in ZIP files - if a tile number is attempted to be overridden that has a dummytile or is cache1d-locked, per-map ART loading fails On failure, the map is still loaded, but a diagnostic message is output to the log/OSD. Loaded per-map ART data are cleared whenever the map is "left". In particular: - whenever another map is loaded - in the editor: when a new map is started - in the game: after the bonus ending screen of a finished level, after going to the title screen via the menu A final note: file names are supposed to be looked up and compared case-sensitively. That is, <filename> must match EXACTLY between the map's and per-map ART one; 'art' must be lowercase. Otherwise, the cookie monster will come and eat you! BUILD_LUNATIC.
for readgamevar, if ud.config.scripthandle < 0, keep value, don't err.
Stylistic/formatting tweaks in cache1d code.
remap16 method for engine.shadetab, 2nd attempt at recreating orig. one.
BUILD_LUNATIC.
Fix USE_OPENGL=0 build. DONT_BUILD.
document fundamentals of shade tables, but not 'engine' API yet.
Lunatic/m32: make Mapster23 actually start stand-alone, oops.
Lunatic/m32: include the Lua bytecode into the binary, exit if setup failed.
add 'engine' module, currently allowing to create custom shade tables.
Available in the game and editor. Provide test/shadexfog.lua, containing a function to creating a set of 32 shade tables corresponding to different shades of the same fog palookup table, together with some tests and convenience functions. Also, - Add gv.LUNATIC_CLIENT{,_EDUKE32,_MAPSTER32} - Add LUNATIC_FIRST_TIME in the global env for the game - defs_m32.lua: add reload() convenience function - Failed attempt at recreating the base shade table. It is NOT a linear ramp of the base palette colors to (0,0,0). That is, it's not created by build/util/transpal.exe!
build.lua: add a flag toggling multiplication of the color components by 4.
fix setup under Mapster32, remove a few obsolete lines in defs_common.lua.
In the no-netcode build, don't expose four internal engine functions.
Also don't compile three multiplayer related OSD commands there.
allow access to sprite[].yvel through set_yvel() member, document.
BUILD_LUNATIC.
Remaining sanitizing of .yvel usage plus minor cleanup.
Clean up legacy ROR code and introduce LEGACY_ROR define in game.h.
Also, bound-check two .yvel meant as sprite indices in actors.c.
Make a couple of player functions take player indices instead of DukePlayer_t *.
Guard retrieval of player index (.yvel) from APLAYER sprite.
It is unacceptable that yvel is on one hand modifiable without restriction from scripting, but can be used as an array index without prior bound check in the C code. Because that member has an overloaded meaning and is also used for innocuous purposes such as the green color intensity of an SE light, it's infeasible to restrict access from scripting. Consequently, we must add bound checks on the C side. This is the first part of the effort to make .yvel safe, adding two functions P_Get() and P_GetP(). There are a couple of other uses as some kind of index.
engine.c: clean up code related to ART loading. BUILD_LUNATIC.
Don't consider W_FORCEFIELD+2 (surgery instruments) a forcefield picnum.
Clean up code related to forcefield player damage etc.
Rename 'camsprite' to 'g_curViewscreen', other related cleanup.
Add helper utility lunatic/util/cmpart.lua.
Consolidate P_AddWeaponNoSwitch into an additional P_AddWeapon argument.
Minor stylistic tweaks of code related to weapon switching.
premap.c: stylistic cleanup in map loading code.
Factor some code in config.c into OSD_WriteAliases(), move symbol_t to osd.c.
Don't autoexec <mapname>.cfg files for clipshape maps.
don't allow starting demo recording, since gamevar diffing is NYI.
osd.c: patch up a possible oob access of osdtext[].
add ceiling-or-floor method set_picnum(). BUILD_LUNATIC.
Add EVENT_DAMAGEHPLANE and document it in Lunatic doc Appendix B.
Also add test/damagehplane.lua with these demonstrations: - custom breakable ceilings - breakable TROR glass
Generalize Sect_DamageCeiling to Sect_DamageCeilingOrFloor, use appropriately.
- in the function itself: for floor, currently, do nothing (but this commit is in preparation of the next one, again) - In Proj_MaybeDamageCF(), Proj_MaybeDamageCF2() and the A_RadiusDamage() use if the function, generalize to floors, but with the special case that parallaxed floors keep blocking projectiles, as before (in constrast to parallaxed ceilings). However, Sect_DamageCeilingOrFloor() is only called for non-parallaxed ceilings *and* floors.
Minor no-functionality-changing tweaks.
- factor out: G_WallSpriteDist() - factor out: Proj_MaybeDamageCF() and Proj_MaybeDamageCF2() in preparation for the next commit - Make PROJ_DECAYVELOCITY macro take an arg for readability's sake
sector.c: in ST9 handling code, prevent oob for improperly constructed doors.
Various stylistic cleanup.
- Move ARRAY_SIZE() macro to compat.h, add another one ARRAY_SSIZE() - In A_RadiusDamage(): note maybe-unaligned access issue, prevent unlikely oob - sector.c: use SPRITES_OF* macros where appropriate
add "for s, what in sectorsofbunch(bunchnum, gv.BOTH_CF)" iterator.
a.m32: don't clamp SE50 extra (=horiz) to [-500 500] with KP8/KP5.
fix parsing negated labels, getnumber* with neg. 'max'.
Exposed by this snippet from a.m32: getnumber256 .owner "OWNER (projection picnum): " -MAXTILES Now, Alt+KP2 works as expected in 3D mode.
statically check some member assignments with literal numbers.
And issue warnings whenever the assignment would fail (error) at game time.
add target 'print-compiler-options'.
May come in handy at times. BUILD_LUNATIC.
Really fix the Pause key on Windows/SDL2.
This requires enabling the same workaround as for Linux. Maybe it's not system-dependent at all.
invalidate a wall when its sector's visibility has changed.
Do not consider system gamearrays for updating from demos.
This generally fixes demo playback. Before, tilesizx[]/tilesizy[] were written into twice as many bytes as needed. Now, don't do that at all.
Fix mouse buttons 4 and 5 on SDL2/Windows.
in fs.listpath() use FIND_NOCURDIR. Also document that function.
add FIND_NOCURDIR option to klistpath().
Fix building stand-alone libcache1d.so.
defs.c: in check_tile(), pass 'tile' by value.
document a couple of player members, especially some 'bool' ones.
Important because in Lua, a value of zero yields true in a boolean context. BUILD_LUNATIC.
multivoc.c: use a local variable instead of a file-scope one used locally.
a-c.c: Make vector extensions also be compiled with Clang.
I was checking for GCC >= 4.7, while Clangs pretends to be GCC 4.2. Use a feature test macro instead. The comment I made in r4161 regarding GCC vs. Clang code was wrong. Now, Clang generates slightly faster code for these cases (solid and masked 4-pixel wide vlines).
In P_HandleSharedKeys(), clean up weapon index bound checking.
In particular, (int32_t)j != -1 is replaced by (uint32_t)j < MAX_WEAPONS to prevent a value >= MAX_WEAPONS to be assigned to p->wantweaponfire (it's used as a weapon index in P_CheckWeapon().
Don't assign result of A_PlaySound() to p->scream_voice if the former is >127.
Because p->scream_voice is an int8_t. This is an unlikely situation (126 voices ought to be playing simultaneously while starting the "scream" sound), but still...
In fullscreen_tint_gl() disable GL_FOG, preventing nasty flickering.
Which was especially noticeable in the Lunatic build. Also, use glPushAttrib/glPopAttrib there.
Give rotatesprite 'orientation' bits enum names, too.
Use named enum constants for the HUD flags instead of literal numbers.
bump the allowed range for 'r_pr_hudangadd' to [-1024 .. 1024].
handle HUD model 'fov' DEF token.
This "simply" requires an appropriate factor in the projection matrix. Also, get rid of a special-case factor for >=1.6 aspects (making HUD models wider then, I think).
a.m32: add [']+[F] menu function setting xvel=1 on all sel. wall/floor sprites.
For sanitizing underwater sections, see r4166. Also, don't print "Menu function executed successfully" when the function printed something itself.
Amend r4142: make e.g. 'include a' (names shorter 4 chars) append ".m32".
DONT_BUILD.
sdlmusic.c: disable FORK_EXEC_MIDI.
Also, if it were to be reenabled again, use execv() instead of execvp(), i.e. don't look up $PATH for the executable.
make underwater blocking floor sprites w/ xvel 1 NOT act like sprite bridge.
Likewise for blocking wall sprites. This makes it possible to construct underwater sections containing complex spritework without losing the "underwater-ness" when over such sprites, in a backward-compatible way. Actually, the check is for bit 1 being set, but all other bits should be considered reserved.
lunatic/util/foreachmap.lua: don't expand .xxx after ']'.
Add an example searching for all maps containing blocking floor-aligned sprites in underwater sectors.
show a message when setting the initial position with SCROLL LOCK.
fix Ctrl-F/Ctrl-G as "key FIFO" keys, used in Mapster32.
By detecting them in the SDL_KEYDOWN events. This list is getting a bit ridiculous...