Commit Graph

1462 Commits

Author SHA1 Message Date
helixhorned 6be448c534 Fix SPRITES_OF_SECT_SAFE macro. Oops!
git-svn-id: https://svn.eduke32.com/eduke32@3685 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 18:50:21 +00:00
helixhorned 8064bd2f30 Clean up of mostly actors.c, but some other files along the way too.
- Rewrite some sprites-of-{stat,sector} loops using the SPRITES_OF,
  SPRITES_OF_SECT and new SPRITES_OF_SECT_SAFE macros.
- In passing, identify some problems and mark them with 'XXX', but don't
  attempt to fix them yet.
- The usual readability improvements...

git-svn-id: https://svn.eduke32.com/eduke32@3679 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:09 +00:00
hendricks266 1e7283f982 Fix a "duplicate const" error.
git-svn-id: https://svn.eduke32.com/eduke32@3672 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:50:57 +00:00
hendricks266 33ab42e7b4 Fix "Error setting gamma ramp: DDERR_INVALIDPARAMS" on 64-bit.
git-svn-id: https://svn.eduke32.com/eduke32@3670 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:50:19 +00:00
hendricks266 2bbc1dd97a Fix Mapster32 crash caused by custom s_buildRev strings longer than five characters.
(Note: We are still vulnerable to crashes here (and likely in other places), but you have (4096-16) extra characters to work with. We should consider replacing many uses of Bsprintf with Bsnprintf.)

git-svn-id: https://svn.eduke32.com/eduke32@3669 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:49:58 +00:00
hendricks266 82b6414d92 Add newlines to some diagostic log messages that lack them and need them.
git-svn-id: https://svn.eduke32.com/eduke32@3668 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:49:35 +00:00
helixhorned a25cd24dd5 In upward moving enemy code of VM_Move(), consider TROR boundaries.
This fixes liztroops not passing TROR layers when on the jetpack, as well as
other enemies capable of moving upward, and also COMMANDER and DRONE (for which
the code is special-cased).

git-svn-id: https://svn.eduke32.com/eduke32@3666 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:35 +00:00
helixhorned 985c3d8428 Mostly engine and some gameexec.c stylistic changes.
git-svn-id: https://svn.eduke32.com/eduke32@3663 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:26 +00:00
helixhorned 03b09aabd0 Engine: in hitscan and getzrange, skip sprites if sprite part of clipmask is 0.
... like was done with clipmove() previously.
Also, do some code clean up. There are no changes of functionality.

git-svn-id: https://svn.eduke32.com/eduke32@3662 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:22 +00:00
helixhorned 1773ac9276 Mapster32: print the "Saved board" message more persistently.
git-svn-id: https://svn.eduke32.com/eduke32@3659 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:14 +00:00
helixhorned 7b6bf4dda2 Lunatic: new-generation map format, in-memory representation ("map-int VX").
The Lunatic build compiles with new structures for sector and wall types.
They have separate members for TROR {up,down}{bunch,nextwall}, so there are
no conflicts with other uses of members into which they were previously
shoehorned.  Also, the maximum bunch limit is bumped to 512 in that build.

Currently, loading from V7/8/9 and saving to V7 and V8 are supported.

git-svn-id: https://svn.eduke32.com/eduke32@3658 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:11 +00:00
helixhorned c91363d7f9 Remove useless code setting show2dwall[] or show2dsprite[], as they're unused.
git-svn-id: https://svn.eduke32.com/eduke32@3649 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:24 +00:00
helixhorned f1f84beeda a.m32: Implement a Polymer "head light" emanating from your position in 3D mode.
Toggled with Ctrl+Shift+[KP-]. Variable 'headlight_range' controls its range.
For the implementation, a new event EVENT_PREDRAW3DSCREEN was added.

git-svn-id: https://svn.eduke32.com/eduke32@3648 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:31 +00:00
helixhorned 203bd1e9e9 Take over and use static assertion macro found in LuaJIT sources.
git-svn-id: https://svn.eduke32.com/eduke32@3644 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:14 +00:00
helixhorned 1e21ea3aae LunaCON: fix rotatesprite coordinate check, gen. events to chain at beginning.
git-svn-id: https://svn.eduke32.com/eduke32@3639 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:52:50 +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
terminx e20b834ea8 Prevent loading anything except the GRP from the Steam or GOG Duke3D install directories. Loading DUKE.RTS from those paths will be resolved later.
git-svn-id: https://svn.eduke32.com/eduke32@3637 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 07:48:20 +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
Plagman 0abef3b8cd Polymer: Fix ART offset and sprite flipping interaction.
git-svn-id: https://svn.eduke32.com/eduke32@3633 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 23:26:40 +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
helixhorned 48406e744b Mapster32: factor out 3x computing "alwaysshowgray", but don't change anything.
git-svn-id: https://svn.eduke32.com/eduke32@3623 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-29 15:59:14 +00:00
hendricks266 ba1ac9d89a Load def modules even if no root def exists. Print a message to the log for each def module that is loaded.
git-svn-id: https://svn.eduke32.com/eduke32@3621 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-28 09:06:14 +00:00
hendricks266 bfeff6b0ab Fix a multi-line comment in cache1d.c.
git-svn-id: https://svn.eduke32.com/eduke32@3619 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-28 09:05:36 +00:00
terminx 7e22c6d81c Read GOG.com and Steam Duke3D install paths from the registry instead of hard-coding the default paths.
git-svn-id: https://svn.eduke32.com/eduke32@3615 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-27 01:39:18 +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 c5044b3ecd Add orientation bit 2048, enumerated as ROTATESPRITE_FULL16, which is a courtesy provided by the engine for the purpose of the game to internally force use of full 32-bit coordinates. With this bit set, all CON screen drawing commands can use rotatesprite16-like coordinates.
While the functionality was already internally in place for gametext as one of two hacks using ROTATESPRITE_MAX (the other still used by minitext_() to align with the statusbar) we must codify a bit in the engine for safe external use. (Otherwise, ROTATESPRITE_MAX could/would theoretically increase and leave modders high and dry.)

(Dev note: In G_DrawTXDigiNumZ(), ROTATESPRITE_MAX was used to bitshift the value used to calculate digit spacing for no reason I can ascertain other than to introduce rounding errors into the zoom/textscale calculations. It was never used anywhere, so I removed it.)

Bonus: The scaling code for digitalnumberz and gametextz has been modified so that the spacing is no longer affected by rounding errors. Try animating the zoom value and compare how the text used to jump but now does not.

git-svn-id: https://svn.eduke32.com/eduke32@3608 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:58 +00:00
hendricks266 4c5fd9d9e2 Hackily implement spriteext.alpha into Classic by internally attaching 33% and 66% to the cstat bits.
git-svn-id: https://svn.eduke32.com/eduke32@3607 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:31 +00:00
hendricks266 d7e30a65dd Relax CAPITALIZATION restrictions.
git-svn-id: https://svn.eduke32.com/eduke32@3606 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:09 +00:00
helixhorned a101698dfb engine: fix assertion failure with overlong walls in rintersect().
git-svn-id: https://svn.eduke32.com/eduke32@3605 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:55:40 +00:00
helixhorned 7faffdc674 engine: return early with 0 from cansee() if either sector is >= MAXSECTORS.
Previously, only the <0 condition was checked. However, the passed sectnums
could be >= MAXSECTORS (at least in C-CON), for example when issuing 'canseespr'
on a sprite not in the game world.

git-svn-id: https://svn.eduke32.com/eduke32@3603 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:55:18 +00:00
helixhorned 904a26e045 Clean up mdsprite.c:voxdraw() a little.
git-svn-id: https://svn.eduke32.com/eduke32@3589 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:20:14 +00:00
helixhorned 286cd692ec Clean up mdsprite.c:md3draw() by factoring out m->head.flags == 1337 check.
... into a macro MFLAGS_NOCONV(m). Since it currently expands to (0), some dead
code will be eliminated.
Introduce a "compilation option" macro DO_MD2_MD3_CONV in mdsprite.c.

git-svn-id: https://svn.eduke32.com/eduke32@3588 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:20:01 +00:00
helixhorned fdca2d232e Clean up mdsprite.c:md3draw() by factoring out spriteext[tspr->owner] access.
git-svn-id: https://svn.eduke32.com/eduke32@3587 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:19:55 +00:00
helixhorned 61f501c3fc Clean up mdsprite.c:md3draw() by tightening locals, factoring out 2x dup code.
git-svn-id: https://svn.eduke32.com/eduke32@3585 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:19:41 +00:00
helixhorned 182121a0aa engine: give sprite cstat 1024 a marco name, CSTAT_SPRITE_MDHACK.
git-svn-id: https://svn.eduke32.com/eduke32@3584 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:19:32 +00:00
helixhorned ba6ad362bc sdlayer.c: fix incompatible-pointer-type warning.
git-svn-id: https://svn.eduke32.com/eduke32@3583 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:19:25 +00:00
hendricks266 ec1923b417 Wii: Fix Mapster32. It runs now.
git-svn-id: https://svn.eduke32.com/eduke32@3582 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 09:49:12 +00:00
hendricks266 bdc4f7cd68 Windows: Add the default installation paths for the GOG.com release of Duke Nukem 3D: Atomic Edition and the Steam release of Duke Nukem 3D: Megaton Edition (if they exist) to EDuke32's search path.
git-svn-id: https://svn.eduke32.com/eduke32@3581 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 09:48:21 +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
helixhorned c397759217 Fix Lunatic build on Windows.
- Make _buildargv[_buildargc] NULL.
- With SDL layer, pass argv and argc directly and get rid of _build* ones.
- Add tilesiz* to dynsymlists.

git-svn-id: https://svn.eduke32.com/eduke32@3573 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-18 22:05:21 +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 7228700c87 Connect spriteext.alpha to models and voxels in Polymost.
This code is neat, tidy, organized, and sensical!

git-svn-id: https://svn.eduke32.com/eduke32@3553 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-04 07:49:27 +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 fe4090b9fd build.c: initialize g_doHardcodedMovement to 1.
Fixing movement when not loading a.m32.

git-svn-id: https://svn.eduke32.com/eduke32@3532 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:30:11 +00:00
helixhorned fa61fed75c engine.c: in setpolymost2dview(), set gloy=-1 unconditionally.
This fixes an update issue: start EDuke32 without warping to a map in Polymost,
change to classic, and change to Polymost again. The OSD background will be
displaced.

git-svn-id: https://svn.eduke32.com/eduke32@3525 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:16 +00:00
helixhorned 1685228ab7 Lunatic: compile defs.ilua as bytecode and load it from the executable.
git-svn-id: https://svn.eduke32.com/eduke32@3517 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:31 +00:00
helixhorned f6a577ff68 Mapster32: add "movement by one" debugging functionality via a.m32.
If m32script gamevar "move_by_one" is nonzero, the some keys move the
"player arrow" by increments of 1:
- Without SHIFT: LEFT/RIGHT absolute x, DOWN/UP absolute y, A/Z absolute z.
- With SHIFT: DOWN/UP (unbounded!) horiz, LEFT/RIGHT angle.

This can be useful to debug renderer bugs that show a high sensitivity to the
exact location ("are transient in space").

git-svn-id: https://svn.eduke32.com/eduke32@3509 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-19 20:35:14 +00:00
hendricks266 719efefbf0 Wii: Take advantage of libogc features: PNG screenshots (libpng/zlib), Ogg Vorbis audio (libtremor), and high-resolution profiling timers.
FLAC and VPX remain out in the cold.

git-svn-id: https://svn.eduke32.com/eduke32@3497 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:42 +00:00
hendricks266 624841257c Wii: Fix most warnings. Three remain: two are labeled with FIXMEs; the third consists of signed/unsigned comparisons involving LSWAPIB() in kplib.c.
git-svn-id: https://svn.eduke32.com/eduke32@3496 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:08 +00:00
hendricks266 75e5cebfff Wii: Fix build.
git-svn-id: https://svn.eduke32.com/eduke32@3494 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:48:18 +00:00
helixhorned a3b3804a08 Lunatic: more commands, timing test for xmath's sine functions.
git-svn-id: https://svn.eduke32.com/eduke32@3489 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-16 18:53:15 +00:00
helixhorned 1bdc416e5f Fix build without Ken's ZIP library (WITHKPLIB not #define'd in compat.h).
git-svn-id: https://svn.eduke32.com/eduke32@3484 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-14 16:02:16 +00:00
helixhorned 40874820f3 Classic renderer: high-precision sprite drawing, preventing stray lines on top.
Face- and wall-aligned sprites are drawn using the wall routines in BUILD.
However, the per-x-screen-coordinate distance (swall[]) is calculated in a way
that potentially incurs great precision loss (for example 5 bits for
xdimen=1280, yxaspect=65536). This leads to the starting (top) vertical texture
coordinate possibly wrapping to large values, leaving an unsightly "stray line"
on top of the sprite from certain viewing angles/horiz values.

The approach to fix it has two parts: first, the distance is calculated using
float values, preventing the precision loss. Because this doesn't fully prevent
the unwanted lines, the texture coords are clamped to the mininum and maximum
(0 and UINT32_MAX respectively) when calculating them for sprites.

Note that stray lines may still appear at the *bottom* of sprites under certain
circumstances, for example when viewing at a y-flipped sprite from above.
These should be less noticable in real-world usage though.

The feature is guarded by a macro HIGH_PRECISION_SPRITE in case using floating
point or 64-bit integers is undesirable/impossible on some platforms.

git-svn-id: https://svn.eduke32.com/eduke32@3483 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-14 16:02:12 +00:00
helixhorned 32b3c074d2 engine.c: factor out calculation of texture coords / addresses in wall drawing.
git-svn-id: https://svn.eduke32.com/eduke32@3482 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-14 16:02:06 +00:00
helixhorned 3b25bbed1b engine.c: don't pass [udls]wal to maskwallscan(), use *wall globals instead.
git-svn-id: https://svn.eduke32.com/eduke32@3481 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-14 16:01:59 +00:00
helixhorned f9c9e465d7 engine.c: in changesprite{sect,stat}, swap second and third early-out tests.
That is, first check if the sprite is in the game world and then if it
already has the desired sector or status number. This doesn't change anything
in our codebase, since the return values of these functions are never examined.

git-svn-id: https://svn.eduke32.com/eduke32@3474 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:24:27 +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 05c920cf92 engine/Polymer: factor out setting {cos,sin}*globalang into set_globalang().
git-svn-id: https://svn.eduke32.com/eduke32@3471 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:24:11 +00:00
helixhorned 157aa207e4 engine.c: clean up drawsprite()
The usual: declare locals more tightly, const-qualify them where it helps
readability, remove dead code...

git-svn-id: https://svn.eduke32.com/eduke32@3470 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-10 16:24:04 +00:00
helixhorned 1dd52a4d6e Fix POLYMER=0 build, cleaning up #include discipline on the way.
Also taking care that the USE_OPENGL=0 build builds.

git-svn-id: https://svn.eduke32.com/eduke32@3467 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:24 +00:00
helixhorned 4e5cdba646 Lose the 'packed' attribute for types declared in build.h.
Most of them are already aligned to their natural boundaries, so lowering
the alignment to 1 byte can only worsen things by making the C compiler
generate poorer (unaligned access) code for some platforms.

The layout of structures is not specified by the C Standard, but is rather
given by a particular platform + toolchain's ABI (application binary interface).
Most ABIs follow the expected pattern "alignment of scalars is their size,
alignment of arrays is that of its element type, alignment of structs is the
maximum alignment of its members". A couple of links to particular ABIs are
given in build.h.

Problems are expected with archs that care about unaligned access when a pointer
to a non-packed struct is taken that resides in a packed aggregate, but these
uses should be weeded out (I'm not sure if there are any in our codebase).

The following types are affected, only hitdata_t changes its size:
sectortype, walltype, spritetype, spriteext_t, spritesmooth_t,
struct validmode_t, picanm_t, palette_t, vec2_t, vec3_t, hitdata_t.

git-svn-id: https://svn.eduke32.com/eduke32@3455 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-03 12:48:11 +00:00
helixhorned 14e97b2a57 Don't set spriteext[].tspr when creating tsprites from the engine.
Its only use is to have a actor -> tsprite mapping for the EVENT_ANIMATESPRITE
event and .tspr will be set before it is run.

git-svn-id: https://svn.eduke32.com/eduke32@3448 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-01 13:05:08 +00:00
terminx 8d64c001a0 Additional networking patch from Jasper Foreman, sadly sitting untested for almost a month because everyone here has been too sick to do anything with it. :(
git-svn-id: https://svn.eduke32.com/eduke32@3443 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-28 22:00:37 +00:00
helixhorned 0796c0e66e Don't apply GL fogging to wall lines drawn in game's "light" overhead view.
git-svn-id: https://svn.eduke32.com/eduke32@3438 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-26 17:07:58 +00:00
helixhorned 9103d4987c CON/m32script: remove GAMEVAR_DEFAULT uses, since they had no effect.
In CON, the bit is still always cleared for user-defined gamevars.

git-svn-id: https://svn.eduke32.com/eduke32@3417 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:15 +00:00
terminx 2d4ec23b2b MSVC doesn't have ssize_t
git-svn-id: https://svn.eduke32.com/eduke32@3411 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 01:00:00 +00:00
helixhorned cb20ad6e90 engine: in texel-hitscan wall-aligned sprites, consider engine-side animation.
Whether a sprite is considered for texel-hitscan is determined on the base
tile number, not the individual animated tile numbers.

git-svn-id: https://svn.eduke32.com/eduke32@3404 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:59:20 +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 e9bd1b7582 Various cleanup of status bar drawing code, remove some old commented out code.
git-svn-id: https://svn.eduke32.com/eduke32@3400 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:59:01 +00:00
helixhorned dc9f4eb360 Mapster32: add cvar/mapster32.cfg option "keeptexturestretch".
If enabled, dragging wall vertices will correct the xrepeat after the
mouse button is released, so that the pre-drag absolute stretching is
restored.

git-svn-id: https://svn.eduke32.com/eduke32@3398 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:56 +00:00
helixhorned 0648d25db1 Mapster32: more or less fix the auto wall-alignment feature ([.]/[,]).
- Run it twice, since the first one is wrong.
- Warn when attempting to align based on a top-oriented wall. When the
  sequence of walls to align has "windows", only the bottom parts will
  be correct.
- Make the modifiers actually useful:
  * Pressing SHIFT aligns at most one wall, remove the old CTRL modifier.
  * The rest is as before: ALT makes the walls have (approximately) equal
    texture stretching, ['] (quote) aligns the immediate TROR-nextwalls.

git-svn-id: https://svn.eduke32.com/eduke32@3396 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:50 +00:00
helixhorned ac31e386ff Mapster32: don't show wall length of *line* highlight when dragging points.
Also, factor out 2x dup'd code of insertsprite() into do_insertsprite()
and add searchwall-displaying code into package/samples/a.m32.

git-svn-id: https://svn.eduke32.com/eduke32@3395 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:46 +00:00
helixhorned 8fb886b14a Replace dragpoint()'s "dragpoint_noreset" global with a "flags" argument.
Also, add another flag, signifying that from the editor, also the
"lastwall"s (i.e. the CCW-linked points) should get collected. This is
to signal the editor that their wall lengths should be displayed, too.

git-svn-id: https://svn.eduke32.com/eduke32@3394 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-16 20:38:41 +00:00
helixhorned 7d2dd223bb Mapster32: don't apply GL fogging to crosshair.
git-svn-id: https://svn.eduke32.com/eduke32@3389 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:14 +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 a4cdd62e25 On Windows, remove "SHGetFileInfo failed with error code ..." note.
git-svn-id: https://svn.eduke32.com/eduke32@3385 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-08 23:12:53 +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 05161ea4d8 Re-enable spotlights on ATI cards again because the crash from 12.8 seems gone.
git-svn-id: https://svn.eduke32.com/eduke32@3381 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-06 18:56:50 +00:00
helixhorned a959b998bd Factor "pipe standard outputs to files" code into baselayer.c.
The SDL and Windows layers had slightly different code: the latter would
dereference a NULL pointer if stdout.txt failed being write-opened.

git-svn-id: https://svn.eduke32.com/eduke32@3377 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-06 18:56:29 +00:00
helixhorned 1e91bf1800 Mapster32: allow creating circle walls from TROR-constrained walls.
When reaching wall limits, it is possible that only some circle points will
be inserted and the result is left unfinished.

git-svn-id: https://svn.eduke32.com/eduke32@3376 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:34 +00:00
helixhorned 8ed4667265 Lunatic: grabbag of different things.
- fix error handing with recursing events
- wallsofsect iterator, sector[]:contains()
- more codegen; mangle function names
- m32: compinside

git-svn-id: https://svn.eduke32.com/eduke32@3375 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:31 +00:00
hendricks266 a4bbf30c3a Add r_togglecomposition cvar on Windows for Roma Loom.
r_togglecomposition: enable/disable toggle of desktop composition when initializing screen modes

default value: 1

git-svn-id: https://svn.eduke32.com/eduke32@3371 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-04 23:42:43 +00:00
hendricks266 748e217a19 Bring the SDL.h include in SDLMain.m up to speed with driver_sdl.c in jaudiolib and sdl_inc.h in the engine. Also address some Apple macro problems.
git-svn-id: https://svn.eduke32.com/eduke32@3368 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-04 17:28:13 +00:00
helixhorned 4a6ded3f98 engine: fix a possible crash with texel-hitscan.
Reproduced as follows (assuming all tiles have texel-hitscan for simplicity):
In E2L5, shoot the opening switch with the shotgun, aiming for the border.
The crash occurs because the *other*, depressed switch tile isn't yet loaded
when we index into its tile storage. Dereferencing 0+small number == BAD!

git-svn-id: https://svn.eduke32.com/eduke32@3364 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-02 22:33:27 +00:00
helixhorned 2528fd3bf5 player.c: factoring continued.
New local functions:
Proj_DoRandDecalSize, SectorContainsSE13, HandleHitWall, Proj_CheckBlood,
Proj_HandleKnee.

git-svn-id: https://svn.eduke32.com/eduke32@3362 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:42 +00:00
helixhorned 25f6255d28 Lunatic: fix stack discipline.
Preventing a continuously growing stack top and inevitable program termination.
Also, commonize the error handling to live on the engine side.

git-svn-id: https://svn.eduke32.com/eduke32@3352 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:11 +00:00
terminx e0acee6356 Replace the osdcvar_t members that needed to be kept in sync with cvar_t with an actual cvar_t. If this is questionable for any reason I'm forgetting, feel free to revert!
git-svn-id: https://svn.eduke32.com/eduke32@3350 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-31 01:51:03 +00:00
terminx 5c74bc6f56 Surround "debug1" and "debug2" with #ifdef DEBUGGINGAIDS
git-svn-id: https://svn.eduke32.com/eduke32@3349 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-31 01:50:45 +00:00
terminx cbf9d2cff3 Clean up a couple of other getrendermode() related bits that the previous commit missed
git-svn-id: https://svn.eduke32.com/eduke32@3347 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-30 20:34:55 +00:00
terminx 79e45c23d5 Add predefined REND_CLASSIC, REND_POLYMOST and REND_POLYMER constants and use them everywhere getrendermode() is called.
git-svn-id: https://svn.eduke32.com/eduke32@3346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-30 20:34:34 +00:00
helixhorned 5fc9bb9779 Lunatic: more glue, fixes, backtrace for code called back from C.
git-svn-id: https://svn.eduke32.com/eduke32@3345 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:32 +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 7d1879b777 Fix LTO=1 RELEASE=1 Lunatic build.
git-svn-id: https://svn.eduke32.com/eduke32@3341 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:16 +00:00
hendricks266 95dd57154e Clean up some file and directory structure.
* Renamed source/jaudiolib/third-party/mingw32 to source/jaudiolib/third-party/Windows.
* Moved source/jaudiolib/third-party/Windows/include to source/jaudiolib/third-party/common/include to use both on Windows and Apple.
* Deleted Apple/lib/include/{ogg,vorbis}/, see previous point.
* Deleted Apple/lib/libvorbisenc.a, 6MB saved.
* Moved Apple/lib/lib{ogg,vorbis,vorbisfile}.a to source/jaudiolib/third-party/Apple/lib, where they belong.
* Moved source files in Apple/ to source/, where they belong. (SDLMain.[mh] stay.)
* Deleted source/jaudiolib/third-party/{ogg,vorbis}.framework, not used any more.
* Renamed "StartupWinController*" to "startosx*".

git-svn-id: https://svn.eduke32.com/eduke32@3334 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:54:35 +00:00
terminx 0ae2d9ad60 Fix DirectSound in MSVC builds and remove the dependency on the DirectX SDK
git-svn-id: https://svn.eduke32.com/eduke32@3330 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 05:22:39 +00:00
helixhorned d970283582 DEF "voxel": fix a tile range check failure message.
git-svn-id: https://svn.eduke32.com/eduke32@3329 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:18 +00:00
helixhorned b30d00dd91 Replace initialize_engine_globals() with array initialization.
git-svn-id: https://svn.eduke32.com/eduke32@3326 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:09 +00:00
helixhorned d7cfde9d3d Make get{zs,ceilz,florz}ofslope (now ...ptr) accept sectortype pointer.
And rewrite the original functions as wrappers around these.

git-svn-id: https://svn.eduke32.com/eduke32@3323 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:17:58 +00:00
helixhorned 0dd78fb029 Cleanup of console/on-screen-display (OSD) functionality.
- Rewrite the "clear background" routine in a no-brainer way instead of
  juggling around with rotatesprite(). Make it common to game+editor.
  Expose glRectd to glbuild.
- Don't stop OSD text line drawing when encountering a non-printable char.
  Instead, treat it as space.
- In OSD_SetTextMode(), don't use swaplong (which really swaps 32-bit ints)
  to swap pointers. Write an analogous "swapptr" instead.
- When changing from/to OSD, don't inject a pause key. This *might* have been
  the cause of the reported pausing problems.
- clean up the code...
(Yes, this commit throws together too much stuff. I suck sometimes. :P)

git-svn-id: https://svn.eduke32.com/eduke32@3321 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:50 +00:00
helixhorned 41bfa1b841 Lunatic: print -> OSD_Printf, error reporting.
git-svn-id: https://svn.eduke32.com/eduke32@3319 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:41 +00:00
helixhorned 255c84c5a2 Clip printext256() at xdim, don't crash OSD_Printf() with empty string.
git-svn-id: https://svn.eduke32.com/eduke32@3318 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:36 +00:00
helixhorned 6f1259b131 Mapster32: save r_usenewshading in configuration file.
git-svn-id: https://svn.eduke32.com/eduke32@3313 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 14:00:03 +00:00
helixhorned 9af1cf8368 engine.c: remove some old "#if 1"s, add compilation switch MULTI_COLUMN_VLINE.
Unconditionally enabled, but useful for comparing the behavior of the 1-column
vline functions against the 2- or 4-column ones.

git-svn-id: https://svn.eduke32.com/eduke32@3311 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 13:59:56 +00:00
helixhorned 9dc1d212a7 Classic: fix drawing tilesizy=512 walls, use non-pow2 routines with pskies.
The former is really only a workaround. Walls/vertical sprites/pskies with
ysize 512 (and presumably greater, but this was not tested) are rendered
with one shade higher at the borders (1 pixel vlines) because of a certain
assumption in the ASM (see comments there). With very dark shades, the
palookup[] buffer is accessed oob. We simply allocate 256 bytes more at the
end for each.

The latter is only for CLASSIC_NONPOW2_YSIZE_WALLS builds, which is not enabled
yet. It seems to matter only for the uncommon case where the such pskies repeat
in the height. A 1680x1050 window fully covered with such a sky is then rendered
at about 60/85 the FPS for me (mostly due to not using the 4 pixel vline
routines), so it may be leaning a bit too much on the side of correctness.

A compilation switch DEBUG_TILESIZY_512 is introduced in engine.c for
demonstration purposes.

git-svn-id: https://svn.eduke32.com/eduke32@3310 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 13:59:52 +00:00
hendricks266 0805060c74 Add "mapinfo" token to the def parser, pending implementation.
Sub-tokens: "mapfile", "maptitle", "mapmd4", "mhkfile"

http://forums.duke4.net/topic/6070-user-map-maphacks-eduke32-feature-request/

git-svn-id: https://svn.eduke32.com/eduke32@3309 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 03:12:50 +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
terminx 817bc98964 Revert "Implement fullscreen 8bpp mode as a borderless, desktop-sized window when running on Windows, and expose an 8bpp mode to the game with the same size as the desktop when no fullscreen 8bpp modes are exposed by Windows. This is required on Windows 8 if we want to have any operation of classic mode in fullscreen, because Windows 8 drops the ability to set any mode other than 32bpp (leaving us largely in the same position we are when running under X)."
This reverts commit 705cc72fed880e857a68c483fd3ff1ead3df044d.

git-svn-id: https://svn.eduke32.com/eduke32@3305 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-18 18:07:28 +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
hendricks266 bb46b57d89 Fix the DirectInput breakage on Win64.
It was caused by the definition of c_dfDIJoystick using literal 24 and 16 values in place of sizeof(DIDATAFORMAT) and sizeof(DIOBJECTDATAFORMAT), which include pointers. On 64-bit, the values end up being 32 and 24, causing a discrepancy in which DIERR_INVALIDPARAM was thrown.

1b1e05db06/diffs

git-svn-id: https://svn.eduke32.com/eduke32@3300 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-16 05:46:20 +00:00
terminx 9770b7ee39 Implement fullscreen 8bpp mode as a borderless, desktop-sized window when running on Windows, and expose an 8bpp mode to the game with the same size as the desktop when no fullscreen 8bpp modes are exposed by Windows. This is required on Windows 8 if we want to have any operation of classic mode in fullscreen, because Windows 8 drops the ability to set any mode other than 32bpp (leaving us largely in the same position we are when running under X).
git-svn-id: https://svn.eduke32.com/eduke32@3296 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-16 04:04:02 +00:00
hendricks266 54195d8135 kextract: Propagate the GRP file's modification time to all extracted files.
git-svn-id: https://svn.eduke32.com/eduke32@3293 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 23:10:10 +00:00
helixhorned d7132e587f Fix CLANG=1 NOASM=1 build.
git-svn-id: https://svn.eduke32.com/eduke32@3292 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:20 +00:00
helixhorned c93096e938 Factor out multiply repeated code into calc_ylookup().
git-svn-id: https://svn.eduke32.com/eduke32@3291 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:17 +00:00
helixhorned 1c06bcf14e Classic: effectively clamp drawn ceiling/floor tile sizes at 256.
This prevents computing a shift value outside of [0..31].

git-svn-id: https://svn.eduke32.com/eduke32@3290 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:14 +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 13bff37caa engine.c: factor a frequent getpalookup() use into getpalookupsh().
git-svn-id: https://svn.eduke32.com/eduke32@3285 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:27:58 +00:00
helixhorned 65e5ebcdbc Add command line option "-rotatesprite-no-widescreen".
This global option will set bit 1024 and clear bits 256 and 512 for all
rotatesprite calls, fixing complex HUD drawing code relying on precise
alignment of individual elements (widescreen rotatesprite is entirely
unsuitable for this purpose).

git-svn-id: https://svn.eduke32.com/eduke32@3284 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:27:55 +00:00
terminx 21aa93c168 Limit attempting to toggle DWM off when using OpenGL modes to Vista/7, because Windows 8 no longer supports disabling DWM. Apparently, Windows 8 contains a software DWM renderer, and all of the "Metro" bs is directly tied to DWM, so there is no longer a way for an app to disable it at will.
git-svn-id: https://svn.eduke32.com/eduke32@3283 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 17:13:25 +00:00
terminx ba8d1a5c1e Change a few paths in various MSVC Makefiles to better suit my current dev environment. This doesn't really affect anyone else since these paths need to be customized to fit whatever machine by anyone building with MSVC anyway.
git-svn-id: https://svn.eduke32.com/eduke32@3282 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 17:13:17 +00:00
helixhorned 049e63d7f3 Mapster32: In 3D mode, [,] auto-aligns walls to the left.
git-svn-id: https://svn.eduke32.com/eduke32@3281 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 22:21:22 +00:00
helixhorned a8b445355b Mapster32: fix LAlt (carry over xrepeat) option for auto-alignment [.].
git-svn-id: https://svn.eduke32.com/eduke32@3280 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 12:41:28 +00:00
helixhorned d429aad9f2 Fix building on Linux; fix WITHOUT_GTK=0 build.
git-svn-id: https://svn.eduke32.com/eduke32@3279 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 12:41:23 +00:00
hendricks266 dac94ce284 Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)

To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.

All compiler and linker warnings when building in 64-bit mode have been fixed.

Remaining 64-bit to-do:
 - The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
 - RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
 - DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
 - Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)

This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.

In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.

git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
hendricks266 9fcba228b1 Build tweaks:
Set up the use of {Windows,Apple}/{include,lib} regardless of feature toggles in Makefile.common using $(abspath ) in reference to the directory Makefile.common is in.
Add the three DirectX headers that are actually used to the repo. (from: http://alleg.sourceforge.net/files/dx9mgw.zip)
Since current MinGW versions include DirectX libs (for dynamic linking), remove "-L$(DXROOT)/lib".
The DirectX headers are no longer a separate dependency for building.
Add $(SDLROOT_OVERRIDE). $(SDLROOT) only functions for Windows and Mac OS X.
Factor handling of $(DXROOT_OVERRIDE) and $(SDLROOT_OVERRIDE) into Makefile.shared using $(abspath ).

git-svn-id: https://svn.eduke32.com/eduke32@3275 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:34:30 +00:00
hendricks266 6f2fa332dd Port system gamearray access from M32Script to CON. Expose tilesizx and tilesizy.
Also, fix deficient logic in Gv_Free and Gv_Clear (both M32 and CON) so that gamevar and gamearray erasure results are (closer to) correct, and so that the game does not crash when system arrays are accessed from CON because they all have been nulled.

git-svn-id: https://svn.eduke32.com/eduke32@3274 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:33:53 +00:00
hendricks266 ae59db2390 Makefiles: Replace all "ifeq ($(PLATFORM),LINUX)" with "ifeq ($(SUBPLATFORM),LINUX)" and set SUBPLATFORM=LINUX when PLATFORM equals LINUX, DINGOO, GCW, or CAANOO.
git-svn-id: https://svn.eduke32.com/eduke32@3272 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:32:59 +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 4caab915ec Implement fade_screen_black() using fullscreen_tint_gl() in GL modes.
git-svn-id: https://svn.eduke32.com/eduke32@3264 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:50 +00:00
helixhorned abb54958e1 Factor dup. code in SDL/Windows layers into baselayer.c:fullscreen_tint_gl().
git-svn-id: https://svn.eduke32.com/eduke32@3263 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:44 +00:00
helixhorned 4d40ca6159 Fix build. It was my fault after all since I forgot common.h in r3243.
git-svn-id: https://svn.eduke32.com/eduke32@3245 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-29 14:08:03 +00:00
hendricks266 6f21e0bdc9 Fix "undefined reference to `sampletimer()'" linking error using clang for a Win32 release build.
git-svn-id: https://svn.eduke32.com/eduke32@3240 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:37:18 +00:00
hendricks266 2007c4d233 Fix errors and warnings in nedmalloc.h using clang for a Win32 release build.
git-svn-id: https://svn.eduke32.com/eduke32@3239 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:36:57 +00:00
hendricks266 890aba88eb Fix warnings involving printf() requiring explicit casts on tracked types.
git-svn-id: https://svn.eduke32.com/eduke32@3238 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:26:04 +00:00
hendricks266 b6f41b6ae5 Add FORCEWARNINGS Makefile flag to prevent disabling compiler warnings within the source.
git-svn-id: https://svn.eduke32.com/eduke32@3237 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:25:26 +00:00
Plagman 36f80e9078 Move the tracking from a dirty state to a change count.
git-svn-id: https://svn.eduke32.com/eduke32@3234 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 16:24:41 +00:00
terminx 65104593e1 Revert "compat.h: slightly reformat the NOWARN-related preprocessor directives."
Commit breaks MSVC builds by failing to provide NOWARN macros to MSVC.

git-svn-id: https://svn.eduke32.com/eduke32@3232 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:54:33 +00:00
helixhorned befdb5d3d8 compat.h: slightly reformat the NOWARN-related preprocessor directives.
git-svn-id: https://svn.eduke32.com/eduke32@3231 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:19:12 +00:00
helixhorned 1bda7acca3 Expose per-tile nofullbright bit (GL modes only) to DEF.
The attribute is set per tile from DEF: either
    nofullbrightrange <begintile> <endtile>
or
    tilefromtexture <tile> { ... nofullbright ... }
As a special case, the list may only contain "nofullbright", in which case the
texture is not changed.  (This is analogous to "texhitscan".)

Example:
// make piggy's eyes fullbright red only when it fires the shotgun
nofullbrightrange 2000 2034
nofullbrightrange 2040 2049
nofullbrightrange 2055 2061

git-svn-id: https://svn.eduke32.com/eduke32@3230 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:19:06 +00:00
helixhorned 5c5c88a7ee Misc. engine cleanups, no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@3229 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:19:02 +00:00
helixhorned ca4ef47f0b engine.c: factor out 2 pract. ident. pieces of code into try_facespr_intersect.
The two uses are from hitscan and neartag.  The functionality is reproduced
exactly (assuming I made no mistake), down to different distance checking
(<= vs. <).

git-svn-id: https://svn.eduke32.com/eduke32@3228 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:18:57 +00:00
hendricks266 8d2599cba1 Fix r3221: move the nedmalloc.h include to winbits.c.
git-svn-id: https://svn.eduke32.com/eduke32@3223 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 08:50:16 +00:00