Commit Graph

381 Commits

Author SHA1 Message Date
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
terminx 9fbab31998 Support NVIDIA's adaptive vsync, you can enable it by setting r_swapinterval -1 in the console or by using the new third setting for the vsync menu option.
git-svn-id: https://svn.eduke32.com/eduke32@3638 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 16:41:12 +00:00
Plagman 5b6b3c97e3 Polymost: Fix ART offset and face sprite flipping interaction.
git-svn-id: https://svn.eduke32.com/eduke32@3634 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 23:29:56 +00:00
helixhorned fe69ee5476 Add rudimentary sanity checks when playing ANM files.
- Don't attempt to play an ANM file if it is empty (warn) or too short (error).
- If failing to read IVF file header or initializing VPX codec, don't play ANM.
- Return early from gltexapplyprops() if not in GL modes.

git-svn-id: https://svn.eduke32.com/eduke32@3628 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:57:59 +00:00
hendricks266 3d46bc1551 Implement alpha into rotatesprite (rotatesprite_) on the engine side.
git-svn-id: https://svn.eduke32.com/eduke32@3609 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:32:24 +00:00
hendricks266 b46d4460bc Process ART animations on tspr->picnum early in all three renderers.
This enables ART animations to take effect on voxels in classic, voxels and models in Polymost, and models in Polymer.

git-svn-id: https://svn.eduke32.com/eduke32@3580 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-19 06:23:38 +00:00
hendricks266 88313f7b50 Plug up alpha leaks in Polymost textures/rotatesprite.
git-svn-id: https://svn.eduke32.com/eduke32@3555 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-04 09:10:54 +00:00
hendricks266 cbe28f89e0 Connect spriteext.alpha to Polymost.
Ugh, global variable hacks. Excuse me while I wash my hands.

git-svn-id: https://svn.eduke32.com/eduke32@3543 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-04 01:23:29 +00:00
helixhorned ed2ebdb29a Engine cleanup continued, no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@3472 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:24:15 +00:00
helixhorned 6785195056 Make r_shadescale 1.0 by default.
git-svn-id: https://svn.eduke32.com/eduke32@3403 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:59:17 +00:00
helixhorned a147dbcfe3 polymost.c: factor out 2x dup'd code into get_projhack_ratio().
One use was in determining the ray vector for the mouse-aiming hitscan
in the editor. Unfortunately, the change doesn't make it any less broken
in Polymost, even if the two instances were out of sync.

git-svn-id: https://svn.eduke32.com/eduke32@3401 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:59:05 +00:00
helixhorned 222e92ef37 Make r_downsize 0 by default.
Also, rewrite comparison to the non-tint in astub.c to be even less hackish.

git-svn-id: https://svn.eduke32.com/eduke32@3387 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-08 23:12:59 +00:00
helixhorned 7872c0141f polymost.c: a couple of {tex,mem}cache cleanups / fixes.
- Stop using memcache on some other failure paths, particularly when
  failing to read from the on-disk texcache.
- Factor out cache reading code (3x).
- Fix endianness issues affecting big-enadian systems (one introduced by
  r3382, one existing before). Comment each B_LITTLE32 with whether we're
  converting from native to on-disk (little) endianness or back.

git-svn-id: https://svn.eduke32.com/eduke32@3386 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-08 23:12:56 +00:00
helixhorned b870b6bfa3 polymost.c: some meaning-preserving cleanups, make some vars file-local.
git-svn-id: https://svn.eduke32.com/eduke32@3384 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-08 23:12:51 +00:00
helixhorned 0f72135a04 polymost.c: factor out 2 x 3x dup'd I/O code for DXT filter functions.
git-svn-id: https://svn.eduke32.com/eduke32@3383 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-08 23:12:45 +00:00
hendricks266 8bb14fa13e Fix warnings that appear if big-endian || USE_OPENGL=0.
git-svn-id: https://svn.eduke32.com/eduke32@3382 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-08 06:17:10 +00:00
helixhorned 4ad4f9ebb7 Remove commented code using former engine variable "automapping".
git-svn-id: https://svn.eduke32.com/eduke32@3342 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:20 +00:00
helixhorned 518ac7b4df Mapster32: in 3D mode's tile info, highlight members of swapped bottom walls.
- If aiming at a swapped bottom wall, display "Wall <wallnum> -> <otherwallnum>"
- highlight pic, shade, pal, cstat in yellow then
- in printext256, accept at most 3 digits for the color format string (e.g. ^123)

git-svn-id: https://svn.eduke32.com/eduke32@3308 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-20 12:04:39 +00:00
helixhorned 55283e5ce6 In Polymost, make r_usenewaspect=2 fog independent of screen x size.
git-svn-id: https://svn.eduke32.com/eduke32@3307 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-20 12:04:34 +00:00
helixhorned 28695e1d97 Move fog calc routines into polymost.c, declare in engine_priv.h.
git-svn-id: https://svn.eduke32.com/eduke32@3303 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-16 19:18:18 +00:00
helixhorned 5bda3a6ebf Don't enable fog in polymost_printext256() and when drawing tile view in M32.
The new "r_usenewshading 2" mode could darken these otherwise.

git-svn-id: https://svn.eduke32.com/eduke32@3302 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-16 19:18:13 +00:00
helixhorned 922aa3ca8b Classic-like visibility/fog for OpenGL modes, r_usenewshading 2 (new default).
Implemented using GL_LINEAR fog. The only source of difference (besides the
obvious indexed vs. true color) should now be the distance constant, which
still had to be determined experimentally.  Polymer implements this mode in
its fog fragment program part.

Parallaxed skies are always drawn with full visibility, I'm not sure if there
are any maps that expect otherwise.

Also, accidentally committed: factor out initialization code from
polymost_printext256() into gen_font_glyph_tex(), small game.c changes.

git-svn-id: https://svn.eduke32.com/eduke32@3301 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-16 19:18:10 +00:00
helixhorned 4cc5c431ae Factor out fogcalc() issuing and application of the computed values.
git-svn-id: https://svn.eduke32.com/eduke32@3288 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:09 +00:00
helixhorned 92dabb3694 Rename global visibility to g_visibility, remove useless casts & old fog code.
git-svn-id: https://svn.eduke32.com/eduke32@3287 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:05 +00:00
helixhorned 884302bea1 OpenGL modes: factor out shade factor calculation.
This also means that the "r_shadescale_unbounded 0" option will work
in Polymer (except on models).

git-svn-id: https://svn.eduke32.com/eduke32@3286 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:01 +00:00
helixhorned 99f56fd295 Don't call setaspect_new() at end of rotatesprite.
This fixes 2nd and following rotatesprite calls drawing differently from
the first in a context with custom set-up aspect, as reported by Lezing here:
http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__143090

Also, back up and restore the aspect state across EVENT_DISPLAYREST.

git-svn-id: https://svn.eduke32.com/eduke32@3265 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:53 +00:00
helixhorned 44904b12be Clean up picanm[] by making its elements values of struct type picanm_t.
The size of that struct is currently 4, and its layout almost the same as
what is read in with loadpics().  The number of tiles in an animation is
bumped to 256, so that the max. tile difference in DEF's animtilerange is
255. (There's no way to have such animations from ART.)

git-svn-id: https://svn.eduke32.com/eduke32@3202 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:28 +00:00
helixhorned 826be655db picanm[]-cleanup pt1: hide code using animateoffs() behind macro DO_TILE_ANIM.
git-svn-id: https://svn.eduke32.com/eduke32@3186 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 21:09:53 +00:00
helixhorned 6144a2e18c Split r3159..r3161, part 13: Poly{mer,most}, engine changes.
git-svn-id: https://svn.eduke32.com/eduke32@3179 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:44 +00:00
helixhorned 61d038f217 Split r3159..r3161, part 11: Add explicit casts, pointer types.
git-svn-id: https://svn.eduke32.com/eduke32@3177 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:36 +00:00
helixhorned 5ad385c043 Split r3159..r3161, part 10: add explicit casts to *alloc return values.
NOTE: changes such as these are best viewed with something like
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]'

git-svn-id: https://svn.eduke32.com/eduke32@3176 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:29 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00
terminx 3ff46c02b2 Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!)


git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-14 23:32:43 +00:00
helixhorned 03454c8c3c Clean up texture loading code etc. in polymost.c, no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@3146 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:20 +00:00
helixhorned d85f529b74 Introduce a per-tile bit preventing fullbrights in GL modes, use for LOADSCREEN.
git-svn-id: https://svn.eduke32.com/eduke32@3145 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 14:11:17 +00:00
helixhorned 0bd8516806 Work around the transparent line with on-screen chaingun and linear filtering.
We do this by messing with the GL texture that gets uploaded for CHAINGUN.
Since this is implemented on the engine side, the static value for CHAINGUN
(2536) is used, and the tile dimensions are compared to 211x55 to have a
little confidence that the tile wasn't overridden by a mod.  Hack indeed.

git-svn-id: https://svn.eduke32.com/eduke32@3111 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-03 19:32:48 +00:00
terminx 521ee43173 Fix setting r_pr_maxlightpasses from .cfg at startup
git-svn-id: https://svn.eduke32.com/eduke32@3070 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 14:51:29 +00:00
helixhorned f10bfb6774 A bit stylistic Polymost code cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3041 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:25 +00:00
helixhorned b3daea46d6 Add compilation switch MODEL_OCCLUSION_CHECKING to polymost.h, leave it enabled.
git-svn-id: https://svn.eduke32.com/eduke32@3040 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:22 +00:00
helixhorned 8efcc81096 Remove some unneeded NULL checks.
Found by http://coccinelle.lip6.fr/rules/notnull.cocci

git-svn-id: https://svn.eduke32.com/eduke32@2978 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 13:57:39 +00:00
helixhorned 88eb1fac78 Clean up a couple of rotatesprite uses.
The black translucent background underneath the user map list will now
be drawn with a shade 32 tile 0 instead of tile BLANK, since I've seen
the latter being replaced in some mod. Also, it will look the same
regardless of screen aspect.

git-svn-id: https://svn.eduke32.com/eduke32@2928 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:56:51 +00:00
helixhorned 60a03c2fb3 Clean up handling of widescreen bits in dorotatesprite functions.
Don't call setaspect from them, because the only thing that's needed is
(in classic) yxaspect and xyaspect.  Pass these from the helper function
defined earlier instead.

git-svn-id: https://svn.eduke32.com/eduke32@2921 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:51:04 +00:00
helixhorned 020f261015 Clean up polymost_dorotatesprite a little (triv. changes only)
git-svn-id: https://svn.eduke32.com/eduke32@2919 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:49:37 +00:00
helixhorned aadfd49435 In polymost_dorotatesprite, don't set [xy]dimen to [xy]dim temporarily.
This fixes stuff like the HUD chaingun with widescreen and small "screen sizes"
(in-game viewport). It also makes rotatesprite behave more like classic overall.
I have no idea why it was there in the first place.

git-svn-id: https://svn.eduke32.com/eduke32@2918 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-19 12:48:31 +00:00
helixhorned ecf277c70e Factor out Polymost's widescreen bit handling code and use it in classic, too.
This means that classic and the GL modes now look the same as far as e.g.
hud_bgstretch or HUD weapons are concerned.

git-svn-id: https://svn.eduke32.com/eduke32@2911 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:50 +00:00
helixhorned 08260dbf25 polymost.c: rewite widescreen bit code, part 2.
Use integer math; both args to setaspect are constant.

git-svn-id: https://svn.eduke32.com/eduke32@2910 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:46 +00:00
helixhorned 20ccab9022 Clean up classic's and Polymost's dorotatesprite functions (triv. changes only)
git-svn-id: https://svn.eduke32.com/eduke32@2909 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:44 +00:00
helixhorned 8ac85eef54 polymost.c: rewrite dorotatesprite's widescreen bit handling (256,512,1024).
Instead of setting and resetting the [xy]dim globals, use them as locals
in a block (shadowing the globals).  Also, do some common subexpression
elimination for clarity.

git-svn-id: https://svn.eduke32.com/eduke32@2908 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-16 21:48:41 +00:00
helixhorned 4dca439d8f Text-repl.: hitinfo variables -> hit, hit{sprite,sect,wall} members -> no "hit"
This makes the code rather more readable in some places.  Unlike the two
preceding commits, this one is actually purely textual replacement.

git-svn-id: https://svn.eduke32.com/eduke32@2877 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:12:01 +00:00
Plagman 7e16357c68 Revert hightile factoring for now.
git-svn-id: https://svn.eduke32.com/eduke32@2825 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-11 04:39:01 +00:00
helixhorned fe1a5fe2a6 Polymer: bring the ypanning correction for non-pow2 walls closer to Pmost's, pt1
This makes the corrections conditional on where they appear in (under-, over-,
white or mask wall).

git-svn-id: https://svn.eduke32.com/eduke32@2821 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-09 19:00:14 +00:00
helixhorned f6c1c125ac Comment out printext256's GL mode fallback code.
This would only hit when polymost_printext256 erred out (mem alloc failure,
glGenTextures failure), i.e. "almost never".

Also, tweak a bound check in polymost_printext256.

git-svn-id: https://svn.eduke32.com/eduke32@2817 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:19 +00:00
helixhorned 20da833bdb Polymost: factor out y panning coefficient calculation code.
git-svn-id: https://svn.eduke32.com/eduke32@2815 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:14 +00:00
Plagman 4055e446c0 hightile: enable the texture factoring code for all palettes
git-svn-id: https://svn.eduke32.com/eduke32@2799 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-02 04:24:04 +00:00
helixhorned 2875a45b68 polymost.c: make polymost_checkcoordinates() static
git-svn-id: https://svn.eduke32.com/eduke32@2768 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:51 +00:00
helixhorned 41921e728c Polymost: don't attempt to draw sprite with void tile, preventing div-by-0s later
git-svn-id: https://svn.eduke32.com/eduke32@2760 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:36 +00:00
helixhorned 4353170b47 Fix a div by zero in polymost_internal_nonparallaxed.
git-svn-id: https://svn.eduke32.com/eduke32@2758 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:31 +00:00
helixhorned 84e5fcdad8 Accumulated trivia, mostly "the usual".
Among other things, comment out very seldomly (or not at all)
used sprite member macros: SV, ZV, RX, RY, CX, CY, CD, PL.

git-svn-id: https://svn.eduke32.com/eduke32@2639 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-05 22:23:44 +00:00
plagman 17d91781c5 Fix OpenGL screenshots with unaligned widths such as 1366
git-svn-id: https://svn.eduke32.com/eduke32@2579 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-01 04:24:57 +00:00
helixhorned 0e3adea64e Replace various occurences of "Bstrncpy(buf, src, sz); buf[sz-1]=0;" with Bstrncpyz
git-svn-id: https://svn.eduke32.com/eduke32@2559 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:43:21 +00:00
hendricks266 9f61e6e2d5 Superficial text changes:
- Help window text cleaned and made more consistent between game and editor
 - Added help entry for "-clipmap"
 - Log text for using CON, DEF, and RTS files has been made consistent
 - All instances of '%s' have been replaced with \"%s\" because ' is a valid filename character. (At least on Windows.)

git-svn-id: https://svn.eduke32.com/eduke32@2538 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:05:57 +00:00
helixhorned 51398ca749 Rename 'numpalookups' to 'numshades' internally.
git-svn-id: https://svn.eduke32.com/eduke32@2504 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-20 18:32:00 +00:00
helixhorned 07426ccc2a Polymost: fix mirror-related oob access analogous to r1872's fix for classic.
When drawing from inside the mirror, there may be no 'bunches' (BUILD lingo,
not TROR ones) collected, but following code used the first one unconditionally.

git-svn-id: https://svn.eduke32.com/eduke32@2427 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-08 19:15:03 +00:00
helixhorned d4577fccb5 Formatting; remove 'loop has empty body' warnings with clang.
I have to admit, I like its grumbling.

git-svn-id: https://svn.eduke32.com/eduke32@2416 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 20:15:22 +00:00
helixhorned cd8836227f Polymost: with r_parallaxskypanning=1, clamp the sky at a constant horizon.
See E4L1 for what this means.

git-svn-id: https://svn.eduke32.com/eduke32@2415 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 20:15:04 +00:00
helixhorned 2dca87b80a Make 'double ghoriz' static in polymost.c.
git-svn-id: https://svn.eduke32.com/eduke32@2409 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 20:13:34 +00:00
helixhorned 8b7a4dab9b Define Batoi/Batol to strtol(...) in compat.h and use these when necessary.
That is, everyplace a user input is to be converted.  The only remaining
instance of atoi() is now atoi(s_buildDate).

git-svn-id: https://svn.eduke32.com/eduke32@2374 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 21:17:39 +00:00
helixhorned 1ebdcf6443 polymost.c: More informative failure message for gloadtile_cached().
git-svn-id: https://svn.eduke32.com/eduke32@2371 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 19:53:23 +00:00
helixhorned c657588658 Fix a potential sector[-1] access when drawing a masked wall in Polymost.
git-svn-id: https://svn.eduke32.com/eduke32@2280 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:57:51 +00:00
helixhorned 7a893b8ec4 minor engine cleanup.
- enclose glbuild.h in #idndef ... sentinels
- engine.c: remove unused variable 'pageoffset', make 'lastx' static
- formatting

git-svn-id: https://svn.eduke32.com/eduke32@2272 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 13:24:15 +00:00
helixhorned 7e6f712ad1 more internal cleanup...
the only visible change is that polymost_trytexcache (formerly two
instances of nearly duplicate code) now prints a diagnostic after
a cache miss.  The one that one is most likely to encounter is
"r_downsize doesn't match", meaning that this setting likely differs
between Mapster and the game.

git-svn-id: https://svn.eduke32.com/eduke32@2248 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:47:41 +00:00
helixhorned e3150b2801 a couple more trivial tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2247 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:45:34 +00:00
helixhorned 3095b09773 trivial formatting / removing of old cruft / adding comments
git-svn-id: https://svn.eduke32.com/eduke32@2244 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:35 +00:00
helixhorned a86dfe661b maint: make the following static in polymost.c:
- texcacheindex *firstcacheindex, *curcacheindex
 - trytexcache(), gloadtile_cached()
- Factor out duplicated code into clear_cache_internal()

git-svn-id: https://svn.eduke32.com/eduke32@2240 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:18 +00:00
helixhorned c7aa4592c2 polymost_printext256: fix oob read when passing negative 'col' or 'backcol'
values;  check the color index that is potentially gotten from the string to
be printed.

git-svn-id: https://svn.eduke32.com/eduke32@2162 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:09:29 +00:00
helixhorned bbc6db465e Mapster32: new cfg var 'glusememcache', the same as r_memcache cvar.
git-svn-id: https://svn.eduke32.com/eduke32@2145 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-03 13:13:28 +00:00
helixhorned 59881f50e0 Revert r2141 functionality because it was a stupid-ass hack and breaks E3L5.
The texture warping mode will need to be set depending on whether we're
actually drawing a parallaxed sky or not.

git-svn-id: https://svn.eduke32.com/eduke32@2142 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-27 12:02:41 +00:00