Commit graph

1903 commits

Author SHA1 Message Date
terminx
04527ad08e Support r_windowpositioning in 8-bit.
git-svn-id: https://svn.eduke32.com/eduke32@4896 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:53:59 +00:00
terminx
67d30a18da Minor cleanup and formatting changes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4894 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:53:30 +00:00
terminx
4bc18d631e Make FORCE_INLINE aware of DISABLE_INLINING. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4893 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:53:16 +00:00
terminx
70cd0d2425 Detect running under Wine. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4892 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:53:01 +00:00
terminx
16b9b19e53 Identify Windows 10 in the startup window/log. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4891 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:52:45 +00:00
terminx
c591711fe8 MSVC C++ build fixes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4890 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:52:15 +00:00
terminx
16b617114c Replace hightile grayscale method (usually combined with tints to produce
replacements for the first handful of palette lookups) w8th superior
"luma" method. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4889 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-11 04:51:41 +00:00
hendricks266
e3de98e2ae Clean up autodetected game install search paths on all platforms that use them.
This should prevent Lunar Apocalypse from becoming Nuclear Winter with Megaton on Linux and Mac.

git-svn-id: https://svn.eduke32.com/eduke32@4886 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-08 15:14:47 +00:00
hendricks266
589c993c39 Implement UserMapHacks.
git-svn-id: https://svn.eduke32.com/eduke32@4884 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-08 15:14:00 +00:00
hendricks266
3f846bdde3 Reinstate MD4.
git-svn-id: https://svn.eduke32.com/eduke32@4883 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-08 15:13:28 +00:00
helixhorned
26683d5bfe engine.c: fix clipmove() against upper part of wall-aligned sprites.
git-svn-id: https://svn.eduke32.com/eduke32@4882 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-06 20:54:49 +00:00
helixhorned
5c4f9b1f14 engine.c: on non-touch devices, roughly double maximum voxel drawing distance.
By setting DISTRECIPSIZ to 131072, as far as I can see the absolute maximum
that's possible with the integer scaling convention of the voxel drawing code.

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4881 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-06 19:56:44 +00:00
helixhorned
b5bb86b8e2 Mapster32: make sprite duplication examples in m32script_ex.map work again.
- Work around a sequencing issue (assignment of searchstat) in
  M32_DrawRoomsAndMasks()
- When having sprites highlighted and changing shade, since r1943 change
  every highlighted sprite's shade if one of them is aimed at. With this
  revision, if SHIFT is pressed while doing that, only change the aimed at
  sprite's shade
- a.m32: Use 'break' from a state instead of 'return'. The former may be
  "sticky" in a way that is not intended. Needs to be debugged later.
- Update instructions in m32script_ex.map

DONT_BUILD.

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

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

git-svn-id: https://svn.eduke32.com/eduke32@4877 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-04 18:45:03 +00:00
helixhorned
bc35a5c8d2 engine.c: in drawmasks(), remove sorting sprites by statnum.
There were various issues with that code.
 - It does not seem to be very meaningful to do so.
 - It was carried out on the same range as the sprites sorted by z coordinate
   (those with equal x/y) just a few lines away, effectively overriding it.
   The former is very meaningful, though.
 - It led to inconsistencies between editor and game, see
   http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__214873

git-svn-id: https://svn.eduke32.com/eduke32@4876 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-04 18:45:01 +00:00
helixhorned
17fab4d8ac Cleanup of various engine functions.
- factor out calculation of player-relative and screen+clipped-player-relative
  coordinates into get_rel_coords() and get_screen_coords(), respectively
- the usual beautification stuff, especially since we're now on C99

git-svn-id: https://svn.eduke32.com/eduke32@4875 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-04 18:45:00 +00:00
helixhorned
b0c48eec25 CON: always return non-negative values from 'clipmove' and related.
Previously, the C function clipmove() returned negative values when hit a
wall (32768+wallnum) or sprite (49152+spritenum) because internally,
these values were encoded into a *signed* 16-bit integer. This made no
difference to C code using it, since it always proceeded by bit checks,
but was inconsistent with documentation on CON 'clipmove' on the wiki.

The following commands are affected too, since they use the value returned
by clipmove(): 'clipmovenoslide', 'movesprite'. Also, the value of
actor[].movflag ('htmovflag' from CON).

Also, fix 'clipmove*' in LunaCON and add lunatic/test/checknearwall.con
as an example of how to implement a being-close-to-a-wall checker as
requested in
http://forums.duke4.net/topic/7869-determining-closeness-to-a-wall/

git-svn-id: https://svn.eduke32.com/eduke32@4874 1a8010ca-5511-0410-912e-c29ae57300e0
2015-01-04 18:44:58 +00:00
helixhorned
2daa44ca6a engine.c: fix clipmove() against floor-aligned sprites.
Introduced in r3207. Oops.

git-svn-id: https://svn.eduke32.com/eduke32@4873 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-30 20:05:22 +00:00
helixhorned
5f263f1358 engine.c: prevent an oob read of spriteext[] in drawsprite_classic().
git-svn-id: https://svn.eduke32.com/eduke32@4872 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-30 20:05:20 +00:00
helixhorned
7033205fcf Menus: disable mouse pointer if CROSSHAIR is void. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4862 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-28 19:48:20 +00:00
hendricks266
598e33319c Add the necessary plumbing to sdlayer to detect mousedown, mouseup, and dragging.
git-svn-id: https://svn.eduke32.com/eduke32@4853 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 18:36:43 +00:00
hendricks266
bfb3614b92 Introduce preprocessor token EDUKE32_TOUCH_DEVICES that covers both Android and iOS, and replace selected instances of __ANDROID__ with it.
git-svn-id: https://svn.eduke32.com/eduke32@4852 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 18:36:14 +00:00
helixhorned
33addad941 Minor cleanup, mostly in engine.c:drawalls().
git-svn-id: https://svn.eduke32.com/eduke32@4846 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-27 17:17:50 +00:00
helixhorned
51fe706907 Tweak the behavior of viewscreens to what is more logical IMO.
- At a given time, at most one viewscreen may display TILE_VIEWSCR, namely
  that one which is g_curViewscreen
- sync kinds of distance to compare against VIEWSCREEN_ACTIVE_DISTANCE (was
  Manhattan vs. dist(), now both the latter)
- fix resetting to VIEWSCREEN tile when player is greater from it than that
  distance. When the player is closer to it again, it is *not* reset to
  TILE_VIEWSCR.
- more sync'd g_curViewscreen and sprite[i].yvel (for 'i' being the viewscreen
  sprite)

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

git-svn-id: https://svn.eduke32.com/eduke32@4843 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:30:00 +00:00
helixhorned
843894dd57 engine.c: clamp all indices for distrecip[] access, as more OOBs were observed.
git-svn-id: https://svn.eduke32.com/eduke32@4842 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:29:59 +00:00
helixhorned
7da543e4f0 cache1d.c: Revert changes in r4665 unrelated to unrolling, fixing oob write.
Specifically, we must make sure that dasizeof <= LZWSIZE (or so) in
c1d_{read,write}_compressed() (what the assertion in the last commit was about,
and is now redundant). This fixes saving of e.g. large gamearrays with the C-CON
build. Bump BYTEVERSION.

An alternative for setting dasizeof to 1 would be to factor it and keep dividing
as long as it's > LZWSIZE.

git-svn-id: https://svn.eduke32.com/eduke32@4838 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:29:55 +00:00
helixhorned
b7805868f7 cache1d.c: in (de)compr. funcs, add an bound-checking assert that fails w/ AMC TC.
Also, formatting.

git-svn-id: https://svn.eduke32.com/eduke32@4837 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:29:54 +00:00
helixhorned
584ed7982a Convert voxels to models only when starting or changing to Polymost.
Analogously to the way models are processed in a deferred manner for Polymer.

git-svn-id: https://svn.eduke32.com/eduke32@4836 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:29:53 +00:00
helixhorned
bd93fd2aab A couple of miscellaneous cleanups.
defs.c: sync some dup'd code for 'definevoxel' and 'voxel' DEF tokens.
engine.c: factor out PolymerProcessModels().

git-svn-id: https://svn.eduke32.com/eduke32@4835 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:29:52 +00:00
helixhorned
3a6bcdc102 engine.c: style-cleanup drawvox(). Also clean up ALL of voxmodel.c.
No deliberate semantic changes here.

git-svn-id: https://svn.eduke32.com/eduke32@4834 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-26 17:29:48 +00:00
helixhorned
a20a7878bb Polymer: include wall[].ypanning in wall invalidation logic.
Fixes bug reported here:
http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__view__findpost__p__213759

git-svn-id: https://svn.eduke32.com/eduke32@4833 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-21 15:51:51 +00:00
helixhorned
b4472f60d1 Polymer: don't draw masked walls with void tile. DONT_BUILD.
This prevents displaying W_FORCEFIELD+1 masks (as e.g. in front of viewscreens)
completely black with ART mapping. The old behavior, which is inconsistent with
classic, is kept for one-sided masked walls, though.

git-svn-id: https://svn.eduke32.com/eduke32@4830 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-20 13:36:40 +00:00
helixhorned
b716534104 Lunatic: sync MAXJOYAXES, add lunatic/test/sprite_addtv.con. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4829 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-20 13:08:27 +00:00
hendricks266
989f182eb4 Wii: Bump MAXJOYAXES to 9 to avoid menu corruption, and fix _functio.h, CONFIG_FunctionNameToNum, CONFIG_AnalogNameToNum, so that this does not crash.
git-svn-id: https://svn.eduke32.com/eduke32@4827 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-18 18:16:16 +00:00
hendricks266
0869194b60 Wii: Add non-interactive cases to wm_msgbox and wm_ynbox.
git-svn-id: https://svn.eduke32.com/eduke32@4825 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-18 18:15:26 +00:00
hendricks266
c397841cda Wii: Add a custom exception handler that saves the crash information to the log and directs the user to submit it to us. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4821 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-17 13:02:21 +00:00
hendricks266
8d115df01e Wii: Add a console to display startup messages to the screen instead of showing the user a black screen while the game initializes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4820 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-17 13:01:58 +00:00
hendricks266
bd813831b0 Wii: Work around a performance regression caused by r4080. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4819 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-17 13:01:13 +00:00
hendricks266
8ec58a208d Wii: Tweaks.
*Move the FPS display down from the top of the screen, as we do for quotes.
*Don't show a non-functional mouse cursor in the center of the screen.
*Don't display the "Startup window" option in Game Settings.
*Display the IR pointer crosshair in addition to the aiming crosshair, not instead of it.
*Eliminate some assumptions from wiibuild.bat.
*DONT_BUILD.

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

git-svn-id: https://svn.eduke32.com/eduke32@4817 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-15 19:50:52 +00:00
helixhorned
d82ca91809 DEF: fix handling of 'remappal' attribute for 'makepalookup'.
git-svn-id: https://svn.eduke32.com/eduke32@4813 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-13 22:33:06 +00:00
helixhorned
50a5e38cb6 Pull setting g_noFloorPal[] further down, into makepalookup().
Now passed as last arg 'noFloorPal' to makepalookup(). Used as follows:
- from loadlookups(): *false*, i.e. do take over floor pal.
- from generatefogpals() [default fog pals] and fillemptylookups(): *true*,
  i.e. don't take over floor pal
- from DEF 'fogpal': true
- from DEF 'makepalookup': take over flag from pal from which we are remapping,
  or set to true if remapping from pal 0
- (CROSSHAIR_PAL: true)

This should make the issue reported in
 http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__197583
resolve in a natural manner.

git-svn-id: https://svn.eduke32.com/eduke32@4812 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-13 22:33:05 +00:00
helixhorned
70cbde87eb Move g_noFloorPal[] to the engine side and adapt other stuff accordingly.
- 'nofloorpalrange' DEF token: now handled for both game and editor (for the
  latter, it's effective only for "shade preview" mode, [']+[X]).
- in generatefogpals(), assign g_noFloorPal[] = 1 for every generated (default)
  fog pal; get rid of its return value / g_firstFogPal

git-svn-id: https://svn.eduke32.com/eduke32@4811 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-13 22:33:04 +00:00
helixhorned
c9943bcde0 engine.c: prevent an oob access of uwall[] in ceilspritescan().
git-svn-id: https://svn.eduke32.com/eduke32@4810 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-13 22:33:02 +00:00
helixhorned
be06b43347 engine.c: style tweaks (tighter var. declaration) in sprite drawing functions.
git-svn-id: https://svn.eduke32.com/eduke32@4809 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-13 22:32:57 +00:00
hendricks266
a1c0d58069 Wii: Fix build. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4808 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-09 23:56:54 +00:00
hendricks266
a8455d5caf Fix building the Build Tools. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4806 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-09 22:51:41 +00:00
hendricks266
9f52fb1d21 Fix a warning with Linux/GTK2. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4803 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-08 09:18:29 +00:00
hendricks266
735525758d Refine the previous commit a bit. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4802 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-08 07:32:58 +00:00
hendricks266
0b91499ee0 Mac OS X: Add detection of the Steam and GOG releases of Duke 3D and the Steam release of NAM. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4801 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-08 04:31:57 +00:00