Commit Graph

357 Commits

Author SHA1 Message Date
hendricks266 75801f2e68 Defs: Add token "forcefilter" to textures, skyboxes, and model skins. It forces the use of GL filtering for the resource in question.
git-svn-id: https://svn.eduke32.com/eduke32@5108 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-28 09:49:37 +00:00
terminx e544488283 Fix Polymost issue reported at http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__220265
git-svn-id: https://svn.eduke32.com/eduke32@5095 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-26 21:42:19 +00:00
terminx a9c32b758d Build fix. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@5081 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 03:33:57 +00:00
terminx 9cb68410a0 Engine memory reductions/optimizations:
-faketilesiz[MAXTILES] removed in favor of simple faketile[(MAXTILES+7)>>3] bitfield
-h_xsize/h_ysize (tile size overrides from .def) are now uint16_t instead of int32_t
-hudmem[2][MAXTILES] removed in favor of adding a hudmem ptr to mdmodel_t
-tilefromtexture performance improvements
-more tsectortype/twalltype usage in various engine functions that read but never write
-continued Polymost cleanups and refactors. Please report any odd rendering errors.

git-svn-id: https://svn.eduke32.com/eduke32@5079 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 00:40:48 +00:00
terminx aa4d98982c Large batch of Polymost changes, including:
-lots of stylistic rewrites
-further improvements to anti-fighting code for wall and floor sprites (introduces three new cvars, r_wspr_offset, r_wspr_offset_variance, and r_fspr_offset)
-fixed brief HOM when traversing through a one-way masked wall
-seldomly used "alphahack" feature for hightile textures now represents alpha cutoff internally as a single byte instead of a float
-fixes a handful of issues where geometry failed to draw at certain coordinates from certain angles in certain resolutions
-renames a couple of cvars

git-svn-id: https://svn.eduke32.com/eduke32@5075 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-24 00:40:33 +00:00
hendricks266 97025d9fc7 Add "globalflags" def token. Flag 1 is a kill switch for the tileshades and artmapping features. Flag 2 is kill switch for the GL fullbright rendering pass.
git-svn-id: https://svn.eduke32.com/eduke32@5056 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-09 20:32:36 +00:00
hendricks266 74b264dcb1 Change HICTINT_USEONART so that it applies tints to pal 0 of 8-bit tiles instead of their palswapped selves. Add HICTINT_APPLYOVERPALSWAP which applies tints to palswapped 8-bit tiles. Add HICTINT_APPLYOVERALTPAL, which applies tints to alt-pals of hightile textures.
git-svn-id: https://svn.eduke32.com/eduke32@5055 1a8010ca-5511-0410-912e-c29ae57300e0
2015-03-09 20:32:11 +00:00
helixhorned b1347517ee Classic/Polymost: factor out update of starting sectnum, use updatesectorbreadth().
The latter means that running perpendicular thin sector is handled better
if there are e.g. TROR sectors in the same x/y space.

git-svn-id: https://svn.eduke32.com/eduke32@5024 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-22 12:43:02 +00:00
terminx 139276e6fe Polymost changes to better support running under GL ES. Still need to investigate GL_LINES and GL_QUADS... neither work under either GL -> GL ES wrapper we've tried, so we must be doing something wrong.
git-svn-id: https://svn.eduke32.com/eduke32@5001 1a8010ca-5511-0410-912e-c29ae57300e0
2015-02-11 05:23:04 +00:00
helixhorned 80da69f6a0 polymost.c: fix possible access of wallchanged[-1]. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4932 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-18 20:28:59 +00:00
helixhorned a05cc6ec20 polymost.c: fix C build. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4930 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-18 20:21:17 +00:00
terminx 19729fc766 Fix Mapster32 sector copying
git-svn-id: https://svn.eduke32.com/eduke32@4909 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-12 08:44:46 +00:00
terminx 41a62ba96b Fix undefined behavior in Polymost
git-svn-id: https://svn.eduke32.com/eduke32@4907 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-12 01:54:33 +00:00
terminx 419ea3ed40 Polymost: fix wall and floor sprites clipping into or z-fighting with surfaces (replaces glDepthRange() hacks for sprites), add r_nofog cvar for debugging, reduce the total number of OpenGL calls by only calling glFogi() to set the fog mode when initializing the renderer or changing r_usenewshading.
git-svn-id: https://svn.eduke32.com/eduke32@4904 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:56:58 +00:00
terminx 4911b9a949 Revise C++ structure trackers for performance and introduce "tspritetype", for temporary sprites or other usages where using the trackers would be invalid or undesired. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4898 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:55:07 +00:00
terminx 16b617114c Replace hightile grayscale method (usually combined with tints to produce
replacements for the first handful of palette lookups) w8th superior
"luma" method. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4889 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:51:41 +00:00
helixhorned 431941771d engine.c: prevent multiple collection of same sector in scansector().
Also for polymost_scansector(). These were likely of little consequence
because collection in scansector() is the exception than the rule (see
added comments), and because the redundant drawwalls() would find the
x range done the second and following times.

Also, add a bound check for sectorborder[] (the limit was probably rarely
hit in practice, but the check is mandatory nontheless) and add functions
printscans() and printbunches() in the DEBUGGINGAIDS=2 build.

git-svn-id: https://svn.eduke32.com/eduke32@4877 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-04 18:45:03 +00:00
helixhorned 51fe706907 Tweak the behavior of viewscreens to what is more logical IMO.
- At a given time, at most one viewscreen may display TILE_VIEWSCR, namely
  that one which is g_curViewscreen
- sync kinds of distance to compare against VIEWSCREEN_ACTIVE_DISTANCE (was
  Manhattan vs. dist(), now both the latter)
- fix resetting to VIEWSCREEN tile when player is greater from it than that
  distance. When the player is closer to it again, it is *not* reset to
  TILE_VIEWSCR.
- more sync'd g_curViewscreen and sprite[i].yvel (for 'i' being the viewscreen
  sprite)

Note: in a multiplayer context, this needs to be thought about once more.

git-svn-id: https://svn.eduke32.com/eduke32@4843 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:30:00 +00:00
helixhorned 01fa7eeabc Makefile.common: in non-release builds, explicitly pass -fno-omit-frame-pointer.
So that stack traces can be gotten with optimized DEBUGANYWAY builds, e.g. for
Linux's 'perf' --> flame graphs. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4817 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-15 19:50:52 +00:00
hendricks266 4e664fe878 Some minor fixes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4768 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-28 08:14:00 +00:00
terminx d73f7f113d Minor cleanups, mostly just formatting. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4752 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:34:29 +00:00
terminx aa7e3e0c25 Fix a couple warnings, and something I fucked up after reading a loop wrong. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4690 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:02:50 +00:00
terminx 8934226bb2 Another 5000 lines of pain and tears. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4680 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:36:34 +00:00
terminx 0e78bf1eb5 Minor engine optimizations, worth a couple fps
git-svn-id: https://svn.eduke32.com/eduke32@4675 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:34:25 +00:00
terminx 9ca0e4ccc4 vec2f_t drawpoly()
git-svn-id: https://svn.eduke32.com/eduke32@4671 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:33:26 +00:00
terminx c8ea7baf72 set_globalpos(), updates both integer (globalposx/y/z) and float (fglobalposx/y/z) representations of the current camera view position. Storing the float representation pre-converted saves us from the delay incurred on ARM when converting an integer and transferring it to the FPU, though this delay is mostly negated already by using the hardfp ABI.
git-svn-id: https://svn.eduke32.com/eduke32@4667 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:32:26 +00:00
terminx 6c6b68d534 Various additional optimizations: add CLASSIC_SLICE_BY_4 mode to unroll some of the loops in a-c, replace integer divisions by a divisor unknown at compile time with usage of libdivide, clean up pragmas further by removing more old stuff that wasn't used anywhere. This is another one of those nasty commits that make people cry. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4658 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:29:21 +00:00
terminx 020dc85fd0 Additional Polymost cleanup, attempt to fix enemy shadows (they are still not right)
git-svn-id: https://svn.eduke32.com/eduke32@4656 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:27:35 +00:00
terminx 73ecabaff9 Fix z fighting issues with wall and floor sprites. This isn't perfect, and somebody like Plgman or Helixhorned who better understands how the depth buffer positions are calculated will be able to do a much better determination of how much to offset the glDepthRange values based on distance to the sprite.
git-svn-id: https://svn.eduke32.com/eduke32@4652 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:26:31 +00:00
terminx 9a04065b5e I'm retarded. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4640 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 18:18:15 +00:00
terminx 4263626f97 Misc additional optimizations, mostly to polymost/mdsprite. Also separate voxmodel into its own source file and object. This commit is pretty large because I was hitting the limit of what could realistically be carved up into smaller patches. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4639 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:18:43 +00:00
terminx 144a4798ce More Polymost cleanup, also consolidate tilesizx and tilesizy into a single tilesiz vec2_t to ensure both x and y are always in the same cache line. I may add a new vec2_16t later. Still need to take care of emulating the old flat array for the sake of CON access.
git-svn-id: https://svn.eduke32.com/eduke32@4623 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:14:21 +00:00
terminx 105bc3f413 First commit for "Polymost.f", the single precision floating point conversion and optimization of Polymost. This work was primarily done for ARM but it also doubled the framerate on "Clear the Coast" on my i7.
git-svn-id: https://svn.eduke32.com/eduke32@4605 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:06:05 +00:00
hendricks266 94ccdb076d Fix a recently-introduced C++ error.
git-svn-id: https://svn.eduke32.com/eduke32@4501 1a8010ca-5511-0410-912e-c29ae57300e0
2014-06-13 09:01:58 +00:00
helixhorned 1e5549dc2f Polymost: r_npotwallmode, emulating 8-bit for walls w/ nonpow2 height textures.
When that mode is enabled (see below for caveats), wall textures that have a
non-power-of-two height (call it 'h') will be modified to look like in classic:
Let 'H' be the next power of two greater than 'h'. The texture will be uploaded
with height 'H', made up from 'h' hlines of the original texture, followed by
'H'-'h' first hlines of the same.
No panning "corrections" will take place. The mode is disabled by default.

Caveats/notes:
 * the mode requires that r_hightile is disabled
 * it is not implemented in Polymer
 * in the Lunatic build, it is ineffective when a VX map is loaded, as those
   display walls with NPOT height textures correctly

git-svn-id: https://svn.eduke32.com/eduke32@4498 1a8010ca-5511-0410-912e-c29ae57300e0
2014-06-01 11:55:19 +00:00
helixhorned 0900f4066c Bye, bye, B*alloc(), all hail X*alloc()! Replace large portion of the calls...
... and cull code that is dead with the X*alloc() versions since they never
return NULL on requesting memory.

Use something like
 git grep '[^Xx]\(m\|c\|re\)alloc *('
and
 git grep '[^Xx]strdup *('
to see places where I left the B*alloc() calls intact.

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4491 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-30 00:02:19 +00:00
helixhorned 95a6c01045 A couple of stylistic cleanups and missed DAMETH_* flags substitutions.
git-svn-id: https://svn.eduke32.com/eduke32@4489 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-30 00:02:14 +00:00
helixhorned 89bbfcbdea Miscellaneous cleanup, still with the same suspects...
- in mdloadskin() and gloadtile_hi(), use new function check_nonpow2()
  (bit-twiddling) instead of loop
- Replace a couple of missed literals with CACHEAD_* enum labels

git-svn-id: https://svn.eduke32.com/eduke32@4488 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-28 22:40:19 +00:00
helixhorned 6fb9929f44 Factor out commonly occuring hictinting[]-accessing code into three functions.
Note: in polymer.c, this was buggy (but harmless) because .r is a char:
  if ((uint32_t)hictinting[MAXPALOOKUPS-1].r & 0xFFFFFF00) != 0xFFFFFF00)

git-svn-id: https://svn.eduke32.com/eduke32@4487 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-28 22:40:17 +00:00
helixhorned 69c867b8e3 Replace various GL rendering related literal flags with enum labels.
- pthtyp pth->flags bits
- Flags of the <dameth> argument of various functions
- hictinting[].f / gloadtile_hi() and daskinloader() <effect> arg bits
- hicreplctyp hicr->flags bits
- texcacheheader cachead.flags bits

git-svn-id: https://svn.eduke32.com/eduke32@4486 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-28 22:40:16 +00:00
helixhorned 2c84d175ed polymost.c: stylistic cleanup in gloadtile_hi, uploadtexture, fixtransparency.
git-svn-id: https://svn.eduke32.com/eduke32@4485 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-28 22:40:15 +00:00
helixhorned dfa9daa5d3 Polymost: in NPOT wall ypanning "correction", behave like Polymer in one corner case.
Specifically, the handling of one-way walls ([1] in Mapster32) was slightly
different.

git-svn-id: https://svn.eduke32.com/eduke32@4484 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-28 22:40:14 +00:00
helixhorned 1c5da19874 In non-lookup GL modes, if fog is due to fogpal, make fog params indep. of shade.
git-svn-id: https://svn.eduke32.com/eduke32@4460 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-01 22:02:21 +00:00
helixhorned 521176d865 Polymost: make r_usetileshades 2 the default.
This mode does not take a sector's visibility values into account for uniform
darkening of a texture. It is more faithful to classic with respect to
fog/visibility *distances*, but may be less so as far as the "tint" of the
texture due to visibility attenuation is concerned.

git-svn-id: https://svn.eduke32.com/eduke32@4459 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-01 16:55:50 +00:00
helixhorned d23ca5bbc5 engine.c: clean up scansector().
git-svn-id: https://svn.eduke32.com/eduke32@4454 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-21 17:00:54 +00:00
helixhorned 8d9282bc24 Fix r_usenewshading 3 visibility/fog for shades >= Numshades-1 (usually 31).
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4452 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-19 22:42:23 +00:00
terminx 4815ebaa23 More Android. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4439 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-14 16:30:23 +00:00
helixhorned 7603f432df Rename sector[].filler member to '.fogpal'. From CON, keep the '.alignto' alias.
The overall situation is thus as follows:
 - in C and from Lua, that member is called 'fogpal'
 - In CON (both C-CON and LunaCON), it's 'fogpal' with 'alignto' being an alias;
   'filler' wasn't available before, either.
 - In m32script, it's 'fogpal' or 'alignto' ('filler' is not available any more)

git-svn-id: https://svn.eduke32.com/eduke32@4416 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-05 11:28:10 +00:00
helixhorned bd0febb846 In non-lookup OpenGL modes, make sector[].filler (rename pending) override fogpal.
That is, if that member has a nonzero value, that one is taken for the color of
the GL fog instead of (most of the time) sector[].floorpal. "Sky sectors", that
is, skyboxes or simply parallaxed floors/ceilings are *not* handled.

git-svn-id: https://svn.eduke32.com/eduke32@4415 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-05 11:28:08 +00:00
helixhorned 2fd4617412 Add a second DNCOORDS/cl_showcoords mode, showing some renderer settings.
Also, extend the documentation for r_usenewshading a little. Specifically,
note when the different modes were introduced. BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4410 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-30 20:36:00 +00:00
helixhorned 9ac075be1c Polymer: disable normal/parallax mapping in rotatesprite.
It was plainly noticeable in the editor's tile info display, for
example.

git-svn-id: https://svn.eduke32.com/eduke32@4409 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-30 20:35:59 +00:00
helixhorned 7da6380dcb Amend r4394: don't use full brightness (glColor() factor 1) with hightiles.
This is done by factoring out some polymer.c:polymer_getbuildmaterial() code
into polymer_eligible_for_artmapping() and using that. The one in polymer.c
can still determine to not use ART mapping on some ("rare"?) occasions, so
it's not 100% in sync.

git-svn-id: https://svn.eduke32.com/eduke32@4407 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-30 13:53:09 +00:00
helixhorned 2d889c74f7 Minor Polymost code cleanup.
- factor out eligible_for_tileshades()
- remove some rendmode 1 code
- move some auto vars further down

git-svn-id: https://svn.eduke32.com/eduke32@4406 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-30 13:53:08 +00:00
helixhorned e7d0c0abcb With r_usenewshade 3, do apply starting fog dist. eqn. for negative shade.
git-svn-id: https://svn.eduke32.com/eduke32@4403 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-30 13:53:03 +00:00
helixhorned e304f3a518 Really minor accumulated readability tweaks.
git-svn-id: https://svn.eduke32.com/eduke32@4395 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-25 21:04:33 +00:00
helixhorned 75baf37812 Polymer/rotatesprite: don't redundantly apply shade glColor() with ART mapping.
git-svn-id: https://svn.eduke32.com/eduke32@4394 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-23 23:14:50 +00:00
helixhorned 7a3776dfac Polymost: introduce r_usenewshading 3 and make it the default.
With this mode, the near distance of the linear fog is always 0, unlike being
negative with r_usenewshading 2.

git-svn-id: https://svn.eduke32.com/eduke32@4393 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-23 23:14:48 +00:00
terminx ba0c64971c Widespread use of ARRAY_SIZE macro.
git-svn-id: https://svn.eduke32.com/eduke32@4385 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-22 09:25:15 +00:00
hendricks266 8db0c9c729 Fix errors and warnings with LLVM/clang 3.4 Windows.
git-svn-id: https://svn.eduke32.com/eduke32@4315 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 10:55:13 +00:00
helixhorned 198ba2d697 Give rotatesprite 'orientation' bits enum names, too.
git-svn-id: https://svn.eduke32.com/eduke32@4175 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:52 +00:00
helixhorned 9aa8bc7c82 Use named enum constants for the HUD flags instead of literal numbers.
git-svn-id: https://svn.eduke32.com/eduke32@4174 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:50 +00:00
helixhorned 9209b946bb Polymodes: bump the allowed range for 'r_pr_hudangadd' to [-1024 .. 1024].
git-svn-id: https://svn.eduke32.com/eduke32@4173 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:48 +00:00
helixhorned 9e3e2baa4d Polymost: 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).

git-svn-id: https://svn.eduke32.com/eduke32@4172 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:46 +00:00
helixhorned 7182f0a7f2 A couple of trivial changes.
git-svn-id: https://svn.eduke32.com/eduke32@4171 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:44 +00:00
helixhorned b1d6a97db4 Mapster32: don't produce erratic behavior w/ crash when not in 3D mode.
Also, BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4148 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-11 20:33:55 +00:00
hendricks266 d738fb7ad5 Fix the vsync menu option so that it actually works.
Variables at global scope which share a name tend to actually be the same variable. Not good when you pass such a variable to function that immediately returns if the passed parameter (the variable) equals said variable (itself).

git-svn-id: https://svn.eduke32.com/eduke32@4090 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-08 10:00:25 +00:00
terminx b16c929170 Clear GL depth buffer before drawing a frame in Polymost. This should fix the issue with skies in the Duke64 TC.
git-svn-id: https://svn.eduke32.com/eduke32@4063 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-14 17:59:01 +00:00
terminx 008334e7a9 Slightly tweak r_usetileshades 1 visibility weighting. It's still not right (and it's impossible to ever truly be right) but at least things aren't pitch black now. I considered changing r_usetileshades to default to 2, but there are some areas where mode 2 is also noticeably darker than it should be... the exit area of E1L1 is a prime example.
git-svn-id: https://svn.eduke32.com/eduke32@4028 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-20 21:49:59 +00:00
helixhorned 47e9e0be3c Polymost: fix my r_usetileshades==2 sub-method.
Don't touch TerminX's r_usetileshades==1 or it being the default.

git-svn-id: https://svn.eduke32.com/eduke32@4010 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:12 +00:00
terminx a97c8c1bfd Revert "Polymost "use tile shades": don't confound shade and visibility." Temporarily add a r_usetileshades 2 to switch between Helixhorned and myself's ideas of how this should work.
git-svn-id: https://svn.eduke32.com/eduke32@3982 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:38 +00:00
helixhorned 57822a2481 Polymer: slightly more complete handling of (multi-tile) ART skies.
- Use the proper tile sequence when multiple pskies are present in a map.
  However, there's still only *one* psky chosen at map load time.
- Handle three horizfrac cases:
 * 0, psky always at same level wrt screen
 * 65536, psky horiz follows camera horiz (e.g. E4L9)
 * otherwise, fall back to default hard-coded parallax implemented as an
   angle fraction

git-svn-id: https://svn.eduke32.com/eduke32@3977 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:49 +00:00
helixhorned a374a401be Clean up parallaxed sky functionality, part 2.
- Rename sky_t members: yscale -> horizfrac, bits -> lognumtiles.
- Add default sky (8 tiles, horizfrac=32768 (i.e. 1/2 the scene horiz), offsets
  all zero) and CLOUDYOCEAN sky (8 tiles, horizfrac=65536, offsets all zero)
  to multipsky[].
- Get rid of "psky_t g_psky", merely maintaining a g_pskyidx instead. Set it up
  at map load time so as to keep the behavior of the legacy per-map psky:
  the last sector index with a matching psky ceiling wins.
- In mapstate_t, save g_pskyidx too, not (former) pskybits and pskyoffs[].
- Make on-map-load global psky setup consistent for the game and editor by
  factoring it out into common.c: G_SetupGlobalPsky().
- Remove a couple of useless initializations, add some static assertions.

This commit is more likely to introduce subtle differences in behavior.
Specifically, getpsky() now always returns the default sky properties instead of
the global sky ones (but with all-zero offsets) when no match for a suiting
multi-psky is found. This is only likely to affect the yscale/horizfrac of
non-multi-pskies when a global non-default multi-psky has been set up.
Bump BYTEVERSION again.

git-svn-id: https://svn.eduke32.com/eduke32@3976 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:48 +00:00
helixhorned 46e8549b5e Clean up parallaxed sky functionality, part 1.
- Consolidate psky* arrays into a "typedef struct psky_t" "g_psky" and
  "multipsky[]".
- Factor out getting parallaxed sky properties into getpsky().
- Condense initial multi-psky setup by memcpy'ing from multipsky[].
- New function: MultiPsky_TileToIdx().
- Add new define PSKYOFF_MAX and related consistency-checking assertions.
- Lower MAXPSKYTILES to 8 to reflect current usage (was 256).
- Game: make multi-pskies consider dynamically-remapped MOONSKY1, BIGORBIT1
  and LA. (Not very useful as the editor will still only act for the static
  values -- 80, 84 and 89, respectively.)

An attempt has been made to preserve behavior even in strange cases, so this
commit is unlikely to introduce regressions. Because of point 6, BYTEVERSION
had to be bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3975 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:45 +00:00
helixhorned 66d126e9ff Polymodes: properly calc start/end fog dist for r_usenewshading=2, vis=0, shade>0
So there's no "jump" from vis!=0 to vis=0 making the texture appear brighter.

git-svn-id: https://svn.eduke32.com/eduke32@3959 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:10 +00:00
helixhorned 3a0f2de877 Polymost "use tile shades": don't confound shade and visibility.
That is, for shade of objects, use shade tables. For visibility, use GL fog.
Mixing these two does not produce satisfactory results in areas where both
shade and visibility darkening are high, such as around the E1L1 restroom.

git-svn-id: https://svn.eduke32.com/eduke32@3941 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:44 +00:00
helixhorned c243bab0e7 Remove one instance of duplicate code lines and now unused TSPR_MIRROR.
git-svn-id: https://svn.eduke32.com/eduke32@3936 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:07 +00:00
helixhorned 184a7322de Polymodes/Lunatic: don't do y panning "correction" for nonpow2 ysize tiles.
git-svn-id: https://svn.eduke32.com/eduke32@3926 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:37 +00:00
terminx 767d123590 Default r_usetileshades to 1 :)
git-svn-id: https://svn.eduke32.com/eduke32@3899 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:03:55 +00:00
helixhorned 560f88b022 Replace inline "qsetmode==200" checks with in3dmode().
Analogously for the negation; remove a couple of redundant decls of "qsetmode".

git-svn-id: https://svn.eduke32.com/eduke32@3823 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 09:13:32 +00:00
terminx f8cc394fa3 Sanitize hard coded render mode numbers... replace all references to rendmode 0, 3, 4, etc with proper REND_CLASSIC, REND_POLYMOST, REND_POLYMER labels.
git-svn-id: https://svn.eduke32.com/eduke32@3784 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 03:44:09 +00:00
terminx dc0b74e846 Alter cvar system to fill the cvar name into the description line automatically, and remove the cvar name from the descriptions for all cvars
git-svn-id: https://svn.eduke32.com/eduke32@3783 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 03:43:20 +00:00
terminx 2e7803ab1d Unify glow and detail texture setup between polymost and mdsprite
git-svn-id: https://svn.eduke32.com/eduke32@3782 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 03:42:58 +00:00
terminx 68539eacee Some further texcache refactoring. Removes all of the texcache globals and shoves them into a struct for easy management.
git-svn-id: https://svn.eduke32.com/eduke32@3781 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-17 03:42:37 +00:00
helixhorned 946d207c56 Polymodes: make flipping closer to classic.
This fixes cases A and B in test_tileoffsets.map.

git-svn-id: https://svn.eduke32.com/eduke32@3778 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-16 21:54:56 +00:00
terminx 6cc4cfbf8a Promote pr_customaspect to double from float to match the array of predefined aspect ratios that's in the menu
git-svn-id: https://svn.eduke32.com/eduke32@3769 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 14:53:54 +00:00
terminx 1c6c023282 Fix a warning and uncomment something I accidentally left commented during testing
git-svn-id: https://svn.eduke32.com/eduke32@3768 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:21:05 +00:00
terminx 7e51e92a81 Properly handle shading models with traditional fog when r_usetileshades is also enabled.
git-svn-id: https://svn.eduke32.com/eduke32@3766 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:20:35 +00:00
terminx 872ea59160 Rename gltexinvalidateall to gltexinvalidatetype and add an enum for the two currently accepted values, INVALIDATE_ALL and INVALIDATE_ART
git-svn-id: https://svn.eduke32.com/eduke32@3765 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:20:08 +00:00
terminx c717f9a7b5 Get rid of that old model occlusion checking hack I wrote for Polymost years ago. I actually didn't know this was still in EDuke32... it's one of the worst things I've ever written. :p
git-svn-id: https://svn.eduke32.com/eduke32@3764 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:19:41 +00:00
terminx 20e5bfd821 A bit more work on the Polymost shade table mode (r_usetileshades)
git-svn-id: https://svn.eduke32.com/eduke32@3763 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:19:14 +00:00
terminx 5a4e7b651b Add an experimental shading mode to Polymost for .art tiles, in which extra textures are allocated for each shade level based on the classic mode shade tables. Enable with r_usetileshades 1 (disabled by default). This uses a lot of memory and is still very WIP (a lot of the shading is completely wrong at this point).
Also, further refactor texcache code.

git-svn-id: https://svn.eduke32.com/eduke32@3761 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:18:27 +00:00
terminx 08444cb825 WIP texture cache refactoring
git-svn-id: https://svn.eduke32.com/eduke32@3758 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:17:17 +00:00
terminx 80f645c65e Add some new cvar flags to handle cvars that need to invalidate textures or reset the video mode after modifying
git-svn-id: https://svn.eduke32.com/eduke32@3757 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:16:19 +00:00
terminx edb222ea4a Remove code disabled by #ifdef OBSOLETE_RENDMODES
git-svn-id: https://svn.eduke32.com/eduke32@3756 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:15:47 +00:00
Plagman c32401ba51 Polymer: Hook ART mapping to rotatesprite.
The visibility calculation relies on the distance, which might not be entirely
accurate in rotatesprite, so maybe it'll be too dark in some cases.

git-svn-id: https://svn.eduke32.com/eduke32@3741 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-08 06:53:38 +00:00
Plagman cd1b147dd3 Finish Polymer cancer mode and enable by default.
TODO: figure out wtf is wrong with rotatesprite, linear filtering.

git-svn-id: https://svn.eduke32.com/eduke32@3737 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-07 07:48:08 +00:00
Plagman 6dac6ac1c0 New Polymer feature: shitty mode.
git-svn-id: https://svn.eduke32.com/eduke32@3729 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 03:12:38 +00:00
helixhorned 9f313043bf Fix model HUD weapons not showing in Polymer, introduced in r3717.
git-svn-id: https://svn.eduke32.com/eduke32@3722 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-01 17:42:07 +00:00
helixhorned 74aaac70d2 Fix two bugs found by Clang's undefined behavior sanitizer.
- Return early from drawsprite_classic() if tspr->owner if oob.
  Commonize that check between renderers into bad_tspr().
- Make the BIT() macro a left-shift of the *unsigned* number 1,
  preventing expansion to (1<<31).

git-svn-id: https://svn.eduke32.com/eduke32@3717 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-29 19:24:19 +00:00
helixhorned 08b10ca03c Draw the flat on-screen CHAINGUN in a way inspired by 3688, preventing seam.
Specifically, in GL modes, and if the CHAINGUN is not replaced by a model,
 - draw the upper part twice: first, two screen pixels * weapon scale lower,
   then at the original position
 - reverse the previous order: draw the upper part first, then the lower part

This is much preferable to the previous engine-side hack, and to my eye,
it looks perfect now.

git-svn-id: https://svn.eduke32.com/eduke32@3695 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-21 19:55:11 +00:00