Build 5498
SVN-
General
Polymer lighting tweaks, mostly internal.
SVN handles and Git names are merged into one person.
Polymer lighting tweaks, mostly internal.
Don't restrict setgamepalette to the range [0, 3].
Make voxels take on the current basepalette, like they should.
Fix voxels so palette colors are treated as 8-bit, not 6-bit. Overlooked in r5349.
Add vm_player, vm_sprite and vm_distance to get/setuserdef. This controls the sprite and player referenced by things like "THISACTOR", all of the "ifp" conditionals, per-actor gamevar access, etc. This is intended to be used to un-gimp things like EVENT_WORLD.
Fix cstat 1024 in classic and Polymer
Increase Polymost depth fighting mitigation offset, plus some other minor changes that shouldn't affect anything.
Add support for sector/wall/sprite struct trackers to Polymer
Split Polymer artmap setup into polymer_setupartmap()
In gloadtile_art, (1) get the current texel's index, (2) apply alpha if index == 255, (3) get the index by indexing into the specified palookup table, and then (4) apply fullbright considerations. Previously these tasks were performed in order 1432.
Add test cases for previous commit: transhacktest.map and .m32
Add a new pthtyp flag to mark textures that should not be processed by the fixtransparency() hack (which avoids the transparent color blending into a sprite when texture filtering is enabled), such as non-(T)ROR-masking floors and ceilings, white- and mask-walls, paper-skies, and rotatesprite with orientation flag 64. This commit makes sure the flag's status always fits the situation.
This fixes the remaining issue with WWII GI's LOGO.ANM: Color index #255 is used as the dominant white color (not as a transparent index) and fixtransparency() was mangling the image as a result.
Enumify the lower bits of the method/dameth argument to various functions.
Factor out common handling of the end-of-level between sectors tagged 65535 and 65534, switches tagged 65535, and nukebuttons.
This fixes the bug with user maps ending in 65534-tagged sectors, reported by FistMarine: https://forums.duke4.net/topic/8367-end-of-level-bug/ It also eliminates dead code belonging to the nukebutton.
Fix orientation bit 64 when applied to a tile with fullbrights in OpenGL with r_fullbrights enabled.
This fixes (the most glaringly wrong problem) with WWII GI's LOGO.ANM in OpenGL, exposed by r5437.
Don't test (!usemodels || md_tilehasmodel(picnum, pal) < 0) in eligible_for_tileshades (called only from getshadefactor) because getshadefactor is only called when a model is *not* being drawn, and therefore results in incorrect shading when drawing a tile with a model defined and models enabled to the screen or as a skybox.
Bookend the recursive call to polymost_drawpoly as part of the fullbright pass with bglDepthFunc(GL_EQUAL) and bglDepthFunc(GL_LEQUAL) to ensure that the fullbright overlay is always visible and never fights with the sprite itself.
Remove "indrawroomsandmasks" variable and its only use in polymost_drawpoly as a condition for the fullbright pass.
Connect spriteext[].x/ypanning to model UVs (range 0-255).
in drawspritelabel(), use fixed background color.
Make it always one of the colors that the 2D color cycles to (base color + offset in [0 .. 4]) instead of <base color>-3, as that one might be in a different color ramp.
add byte array editorcolors[256] to m32script variables.
This makes it possible to set up editor colors at startup (from m32_autoexec.cfg). For example: script_expertmode 1 do for i range 256 ifge i 33 { set editorcolors[i] i } script_expertmode 0 Use this method in the description of how to get old-style 2D colors in tiles.cfg and suggest an alternative color index pair.
make 'script_expertmode' require an argument (0 or 1) to toggle.
Without an argument, it prints the current state.
changes to aid getting the old color scheme (by customizing).
- bump MAX_TILE_GROUP_ENTRIES to MAXUSERTILES - in loadtilegroups(), only assign a tile color if it wasn't already assigned - allow "hidden" tile groups by omitting the hotkey - Tweak the description added to tiles.cfg
honor "blocking color" declared with DEF 'spritecol' et al.
Meaning tilegroup's 'colors' directive. Also, to the packaged tiles.cfg, add a description of how to emulate the earlier Mapster32 sprite coloring for one tile group.
in a.m32, draw color info ("set showpal 1") more informatively.
- draw ticks above the palette "ruler" - draw all editor colors (colors in editorcolor[])
introduce DEF command "2dcolidxrange <col> <idx> <idxend>".
<col> is the editorcolor[] starting index <idx> is the actual color index start <idxend> is the actual color index end So, editor colors from <col> onward will be mapped to [<idx> .. min(<idxend>, 255)]. Takes precedence over '2dcol'.
in drawscreen_drawsprite(), "sprite[j]." -> "spr->".
Also a similar stylistic tweak in parsetilegroups().
fix variable that is used uninitialized.
premap.c: on prelevel(), clear bits 16 and 32 of effector sprites.
remove "Ludicrous Zoom!" message when reaching max 2D zoom.
The problem is that it stays a few seconds afterwards, obscuring information on the status line.
add var 'corruptcheck_game_duke3d' and enable by default.
Currently, this checks for effector sprites that are not face-aligned. See https://forums.duke4.net/topic/8324-icestation-colossus-map-broken
baselayer.c: Remove nested "#ifdef USE_OPENGL"s left over from the removal of the POLYMOST macro. DONT_BUILD.
in TROR-join sectors [Ctrl+J], print z difference hint.
At the very least, this makes it easier to decide for one option ("Connect yellow ceiling w/ blue floor (1) or (v)ice versa?") when one of the differences is zero, which might have occurred from temporarily breaking TROR links.
fix fillsector() calls before fade_editor_screen().
The latter allows one to specify a color to keep, but with r5302 the fillsector() highlights are drawn with transparency, thus making it ineffective. Add an argument to toggle transparency to fillsector() (now fillsector_maybetrans()) and two wrapper functions.
don't offer to "Insert outer loop and make red walls" w/ RAlt+RCtrl.
This feature only makes sense with the complete de-selection of a set of sectors, i.e. when pressing RAlt to do this, not adding or removing sectors to/from the set of already highlighted ones.
Menu options to control Polymer light and shadow counts
Fix cstat 1024 with Polymer
Check whether the sprite is a wall, floor, or face sprite when deciding whether to bump it ahead of another entry based on position and owner.
Disable Polymer lights attached to hidden switches.
Improve depth fighting mitigation for floor aligned sprites.
Fix errant use of tsprite extra field to check an enemy's health.
Sprite sorting changes:
-Sort by owner now occurs only when two sprites have matching x/y coordinates. -Cstat 1024 now activates a special drawing mode that indicates a sprite should be drawn without depth after all other sprites have been drawn. The previous cstat 1024 functionality, an internal hack for shadows cast by models in Polymost, has been moved to bit 1 of a new graphical effects bitfield stored in a tsprite's .extra member.
Tweak the amount that distance is factored in when mitigating depth fighting in Polymost.
Improve the behavior of the BLOODSPLAT family of sprites. This improves the effect so that the blood doesn't stutter when it moves, and no longer occasionally appears to climb back up the wall for a fraction of a second.
Additional depth fighting mitigation for face sprites
Sort tsprites by owner as a replacement for the sort by statnum removed by Helixhorned a while back. Seems sensible enough...
New attempt at fixing the depth fighting with wall and floor-aligned sprites.
Fix pathsearchmode in Mapster32 when using a .def which loads a .grp.
fix 2d3d mode input issue when sector is -1
Fix two unused function warnings in mdsprite.c when building with POLYMER=0.
OS X: Fix POLYMER=0 build.
Add globalgameflag DUKE3D_NO_HARDCODED_FOGPALS, which prevents the game from automatically defining white, red, green, and blue fogpals in the first four adjacent empty palookup slots it finds.
Add globalgameflags to Duke-Mapster32's game-side def parsing.
Move PaletteIndexFullbrights back into the engine and autodetect fullbrights instead of hardcoding them.
Before aliasing empty palookups to #0, check existing ones if they are identical to #0, and if so, also alias them. This saves memory in Polymost with tileshades enabled.
Add "undef" subtokens to and undef-range versions of basepalette, palookup, and blendtable.
Fix a bug with the tilefromtexture { texture } subtoken, where alphacut was interpreted in an inverse fashion, generally causing hightile textures defined this way to appear completely transparent.
Add basepalette, palookup, and blendtable tokens.
Restructure the basepaltable subsystem to support up to 256 palettes and use dynamic allocation like palookup and blendtable.