Commit Graph

657 Commits

Author SHA1 Message Date
helixhorned 3753d45601 a-c.c: prevent stray lines on bottom of sprites by saturating v. tex coords.
The functions mvlineasm1, mvlineasm4 and tvlineasm2 can now be set to clamp
the vertical texture coordinate (vplc), preventing the unsightly stray lines
on the bottom of non-y-flipped sprites. (The first part of this effort, r3483,
handled their top).

However, this is only enabled for the mvlineasm ones: the vectorized variants
suffered almost no slowdown (even though a PADDUSD SSE instruction would be a
nice thing to have), while it was pretty significant for the sequential
translucent ones.

Summarizing, this leaves two cases where stray lines may appear in the non-ASM
build (the saturation is NYI for a.nasm):
- at the bottom of y-flipped sprites
- at the bottom of translucent sprites (can be toggled by #define)

Another observation is that recent GCC generates much faster code for this
stuff than Clang from SVN.

git-svn-id: https://svn.eduke32.com/eduke32@4161 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:11 +00:00
helixhorned e19a271a86 OSD: retire OSD_GetFmt(), OSD_GetFmtPtr() and OSD_GetTextPtr() functions.
These were too much "looking into the implementation of a module" for my
taste, hence OSD_GetShadePal() earlier.

git-svn-id: https://svn.eduke32.com/eduke32@4138 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:10 +00:00
helixhorned 37d8cbedcc OSD: factor out getting sh/pal using format+text buffers into OSD_GetShadePal().
git-svn-id: https://svn.eduke32.com/eduke32@4136 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:08 +00:00
hendricks266 ccf7d2d470 Allow -g, -x, -h, -j, and for the game, -d, to take their file name after a space. This allows quotes to be used with them properly.
I updated the help windows to prefer these variants because they are superior to the -xSquished versions.
Also, factor out the command-line processing code for the above, plus con/def modules and clipmaps.

git-svn-id: https://svn.eduke32.com/eduke32@4128 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-03 04:02:23 +00:00
helixhorned c2797e4b11 Mapster32: take initial map file name from ExtPreInit()->G_CheckCommandLine().
Instead of directly in build.c:app_main(). Previously, it was possible that an
argument to an option, e.g. "WGR2" with "-game_dir WGR2", would get interpreted
as the initial map to load. This in turn would attempt to execute WGR2.cfg as
sequence of OSD commands -- where that file is an EDuke32 config file instead!

Now: maps are passed without any options, e.g. "mapster32 [opts...] debug.map".
The map file name is not added to the "additional parameters" for map testing.

git-svn-id: https://svn.eduke32.com/eduke32@4121 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:25 +00:00
helixhorned 70f0100ac2 SDL: factor out 2x repeated code into keyascfifo_{isfull,insert}.
git-svn-id: https://svn.eduke32.com/eduke32@4116 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:13 +00:00
helixhorned 7791f94073 Lunatic: make it possible to build with LuaJIT 2.1, add -Lopts=profile there.
git-svn-id: https://svn.eduke32.com/eduke32@4107 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:06 +00:00
hendricks266 401a73862a Wii: Fix build and add custom headers and libs to SVN. (It's helpful to set up a build system from scratch.)
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4102 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 09:08:31 +00:00
hendricks266 2ab39f2cca Clean up some GUI/WM minutiae. Should fix linking Mapster32 on *nix with HAVE_GTK=0.
git-svn-id: https://svn.eduke32.com/eduke32@4091 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-08 10:00:44 +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
hendricks266 333e0f26e2 Allow wm_msgbox() to use SDL_ShowSimpleMessageBox() under SDL2.
Unfortunately, SDL2 does not (yet?) provide a Yes/No box for wm_ynbox().

git-svn-id: https://svn.eduke32.com/eduke32@4085 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:24 +00:00
hendricks266 db69800fd0 Split the handling of audio based on RENDERTYPE into a new variable named MIXERTYPE, allowing Windows builds to use SDL for input and rendering (RENDERTYPE=SDL) while using DirectSound and Windows' MIDI interface (MIXERTYPE=WIN [current default]) so that EMIDI works.
git-svn-id: https://svn.eduke32.com/eduke32@4084 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:03 +00:00
hendricks266 e7c9a0be5d Iron out all errors and warnings when compiling with MinGW-w64, targeting either 32-bit or 64-bit.
git-svn-id: https://svn.eduke32.com/eduke32@4078 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:03:11 +00:00
hendricks266 612284cfea Improve SDL2 support as much as I can, for now. The game compiles, links, and starts, but all three renderers either don't display correctly or crash.
To build with SDL2: make RENDERTYPE=SDL SDL_TARGET=2

git-svn-id: https://svn.eduke32.com/eduke32@4074 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-06 07:49:53 +00:00
helixhorned 514a3bfd64 Prevent calling function pointers cast to an incompatible type.
Most often, this had happened when casting comparison functions for qsort()
like these: "int yax_cmpbunches(const int16_t *b1, const int16_t *b2)"
to a function pointer type expecting "const void *". Alas, this is undefined
behavior: see
http://blog.frama-c.com/index.php?post/2013/08/24/Function-pointers-in-C
and posts linked from it.

At least two cases have not been fixed:
- The savegame system maintains pointers which are either to data or a function in
  the generic "void *". This ought to be made into a union.
- Probably also:
  #define OSD_ALIAS     (int32_t (*)(const osdfuncparm_t*))0x1337

git-svn-id: https://svn.eduke32.com/eduke32@4068 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:38:44 +00:00
helixhorned 7543ba7226 premap.c: delete GPSPEED/CYCLERs only after the loop with EVENT_LOADACTOR events
git-svn-id: https://svn.eduke32.com/eduke32@4045 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:38 +00:00
terminx 7e63cac6a0 Remove unused SYSTEM_POOL_SIZE definition (was used with nedmalloc), change in3dmode() into macro similar to bkbhit()
git-svn-id: https://svn.eduke32.com/eduke32@4039 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-24 22:55:49 +00:00
terminx e8c2250d0a Rip out all traces of nedmalloc. Sorry, XP users--it's time to upgrade to something newer than an OS from 2001 if this affects you.
git-svn-id: https://svn.eduke32.com/eduke32@4027 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-20 21:49:44 +00:00
terminx 7ed85ce888 MSVC build fix. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4018 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-13 01:07:41 +00:00
helixhorned 7a9e9fada4 When issuing "setrendmode" OSD command with mismatched vidmode, auto-switch.
git-svn-id: https://svn.eduke32.com/eduke32@4015 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:19 +00:00
helixhorned 2aa55e5900 baselayer.c: remove baselayer_onvideomodechange, onvideomodechange.
git-svn-id: https://svn.eduke32.com/eduke32@4013 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:16 +00:00
helixhorned ff05fb9b5c Retire MultiPsky_TileToIdx() in favor of engine-side getpskyidx().
DONT_BUILD, because there have been no significant changes of the non-Lua build.

git-svn-id: https://svn.eduke32.com/eduke32@4006 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:51 +00:00
helixhorned e947f1fe87 Lunatic: prepare Makefiles for synthesis build.
- libs and headers are expected in platform/Windows/* (not there yet)
- prefix Lua #includes with luajit-2.0/
- build bytecode objects with absolute path name (used for debug info)

git-svn-id: https://svn.eduke32.com/eduke32@4000 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:42 +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
hendricks266 62cdb8a9e6 Patch from johnnyonflame to fix the GCW and Dingoo build process.
git-svn-id: https://svn.eduke32.com/eduke32@3972 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:54 +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 f506e0f570 Rename the external 'gethitickms()' to 'gethiticks()'.
git-svn-id: https://svn.eduke32.com/eduke32@3935 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:05 +00:00
helixhorned 76a04c4a3a In Windows and SDL layers, rename *hitick* to *u64tick*.
git-svn-id: https://svn.eduke32.com/eduke32@3934 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:00 +00:00
helixhorned 6e443944c3 Lunatic: partially fix LTO=1 build with GCC.
Having to tag these few variables and functions as ATTRIBUTE((used))
seems sensible, but what follows is just strange. OSD_Printf? headspritesect?

git-svn-id: https://svn.eduke32.com/eduke32@3932 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:53 +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
helixhorned dea960d350 Fix loading maps in Mapster32, introduced in r3911.
Also, get rid of the strange filename[len]=255 hack in loadboard()
and make its file name arg const char* at last.

git-svn-id: https://svn.eduke32.com/eduke32@3913 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-29 12:15:44 +00:00
helixhorned b2c5e2d807 Mapster32/Lunatic: ask when a <V10 map would be overwritten with a map-text one.
Also, clean up the saving/loading logic a bit:
- On load failure, display message with purple color.
- Take over the current file name ('boardfilename') only on success.
- Check SaveBoard() return values in various places.

git-svn-id: https://svn.eduke32.com/eduke32@3911 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:44 +00:00
terminx 2f883eaed1 Apparently VS2013 doesn't like redefining "inline" either
git-svn-id: https://svn.eduke32.com/eduke32@3905 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:05:24 +00:00
terminx b1dd4ffc6c MSVC build fix (looks like the compiler version shipped with VS2013 has nearbyintf now...)
git-svn-id: https://svn.eduke32.com/eduke32@3900 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:11 +00:00
helixhorned 51e021e810 Mapster32: fix construction of *_crash.map file name in crash handler.
git-svn-id: https://svn.eduke32.com/eduke32@3876 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:10:56 +00:00
hendricks266 e0a373893a Replace use of preprocessor macro WIN32 with _WIN32. (Blame clang.)
git-svn-id: https://svn.eduke32.com/eduke32@3839 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:57:00 +00:00
hendricks266 ced47cf9fc Add qstrdim and screentext, powerful new functions for HUD text.
git-svn-id: https://svn.eduke32.com/eduke32@3833 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:00 +00:00
helixhorned 593b82692e Mapster32: allow setting first walls of TROR sectors independently.
In 3D mode, Alt+F now only attempts to set the first wall of the aimed at
wall, not collecting upper/lower neighbors. For this, press Shift+Alt+F.
In 2D mode, they are always collected.

git-svn-id: https://svn.eduke32.com/eduke32@3825 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:45 +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
helixhorned d0f538b283 Engine: don't extern 'clipmovetraceboxnum', add a new func. clipmovex() instead.
The 'x' is for "extended", since its last arg is a switch of whether to disable
sliding. Use that from gameexec.c.

git-svn-id: https://svn.eduke32.com/eduke32@3811 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:36 +00:00
helixhorned 1ee43d5a6e LunaCON: Add -Wall option and sector[].*bunch, warn on some NYI gamevar flags.
git-svn-id: https://svn.eduke32.com/eduke32@3804 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:25 +00:00
helixhorned 0d79372216 Lunatic: prototypical gamevar serialization, currently very CON-centric.
git-svn-id: https://svn.eduke32.com/eduke32@3796 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-20 19:31:42 +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 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 b1f58387db Mapster32: when 3D-inserting sprite higher than z extent, position at floor...
... when aiming at the floor.

git-svn-id: https://svn.eduke32.com/eduke32@3780 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-16 21:54:59 +00:00
helixhorned 99d7f1e964 Polymer: rewrite sprite x/y flipping so that data flow is explicit.
Also, add some defines for sprite cstats to build.h (SPR_*) and use them.

git-svn-id: https://svn.eduke32.com/eduke32@3775 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-16 21:54:52 +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 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 6e61cfbe41 Remove md4 library, since we aren't using it anywhere anymore
git-svn-id: https://svn.eduke32.com/eduke32@3759 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-15 02:17:44 +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
Plagman 3d65b36ebe Revert to spherical shading; it's not like you could look up in classic anyway.
git-svn-id: https://svn.eduke32.com/eduke32@3739 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-08 05:03:36 +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
helixhorned 82d6c2d5f7 Factor out four instances of duplicate code into append_ext_UNSAFE().
git-svn-id: https://svn.eduke32.com/eduke32@3735 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:38 +00:00
helixhorned 258e28bafb Map-int VX: rearrange members so that ceiling* and floor* are contiguous.
git-svn-id: https://svn.eduke32.com/eduke32@3731 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:28 +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 bc78ff27ed Classic: clean up mirror drawing code.
No functional changes, but a (commented out) debug line for an oob read of the
frame buffer when the mirror covers the whole screen is inserted.

git-svn-id: https://svn.eduke32.com/eduke32@3719 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-01 17:41:59 +00:00
helixhorned a628cbdd13 Lunatic (map-int VX) build: implement loading <V7 maps.
git-svn-id: https://svn.eduke32.com/eduke32@3710 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-25 21:10:22 +00:00
helixhorned e2c05cbbae Fix A_MoveSprite() wrongly reporting sector hit without z change after r3678.
git-svn-id: https://svn.eduke32.com/eduke32@3686 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-16 20:08:45 +00:00
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
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 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 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
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 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 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 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
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
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
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 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 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
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 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 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 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 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 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