Build 5857
SVN-
General
SVN handles and Git names are merged into one person.
Correct an oversight in r3580.
Revert part of r5481. We can't rely on the sprite trackers to tell us when tsprites change.
Fix the oversight in handling tspr->extra from r5400 by setting it to zero in polymer_scansprites.
A quick hack so that Mapster can load more pre-v7 PALETTE.DAT files.
Factor out the ETC block preparation by moving the ETC function decision from Polymost_SendTexToDriver into Polymost_PickETCFunction.
Allow compressed ART tiles (r_texcompr 2) to be cached.
Tweak the "don't upload textures with dimension > xdim" GL ES rule to limit to the power of two greater than xdim instead of less than it.
Clean up and rearrange some texcache code. No functional changes.
Call texcache_calcid once per texture instead of twice. Clean it up a little while we're at it.
Add "artquality" subtoken to textures, model skins, and skyboxes, which grants the texture HICR_ARTIMMUNITY. In effect, this implies "nodownsize" and signals that texture compression would be undesirable, but okay using r_texcompr mode 2 (aggressive).
Fix shading on ART tiles with fullbrights displayed without masking, such as on a whitewall.
Clean up texcache_enabled.
Add one-bit alpha detection for hightile and model skins.
Add r_texcompr 2, which compresses ART in addition to hightile.
Add HICR_ARTIMMUNITY and DAMETH_ARTIMMUNITY, which currently function identically to NOTEXCOMPRESS and NODOWNSIZE combined, and are only used when:
1. Using an ART tile 2. Using a hightile defined through the tilefromtexture "texture" subtoken 3. Using a hightile that, if downsized, will be smaller than the ART tile for that tilenum (tenuous)
Move daskinloader into mdloadskin and clean up it and gloadtile_hi against one another.
Refactor all GL internal texture format decision making into uploadtexture().
This directly achieves the following: * Eliminated codedup. * Recently introduced GL ES performance downsampling now applies to model skins. * Replaces the alpha/art format distinction with {RGB/no alpha, RGBA/one-bit alpha (ART transparency), RGBA/full alpha}. * Cleanly allows multiple fallback formats for each type. * Ready for further commits.
Rename HICR_NOCOMPRESS to HICR_NODOWNSIZE, CACHEAD_NOCOMPRESS to CACHEAD_NODOWNSIZE, DAMETH_NOCOMPRESS to DAMETH_NODOWNSIZE, and HICR_NOSAVE to HICR_NOTEXCOMPRESS.
Introduce USE_GLEXT macro and use it to conditionally compile out all GL ARB function calls when compiling for GL ES platforms.
This replaces the previous hack where we kept the dynamic pointers null and simply never tried calling any of them by a conspiracy of default runtime settings and disabled menu options. Code affected: VBO support for models, VPX GLSL decoding, texture compression (texture cache), and multitexturing (glow/detail maps). This commit also replaces EDUKE32_GLES conditionals with USE_GLEXT where appropriate. I didn't touch polymer.c because it depends too heavily on extensions for conditionally compiling them to make sense.
Fix POLYMER=0 warnings introduced in r5496.
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.
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).
baselayer.c: Remove nested "#ifdef USE_OPENGL"s left over from the removal of the POLYMOST macro. DONT_BUILD.
Clean up formatting of parallax sky code and comments, in part so that the floor and ceiling sections are line-for-line consistent. DONT_BUILD.
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.