Commit graph

2048 commits

Author SHA1 Message Date
helixhorned
64ead0a130 When X- or Y-flipping a selection of highlighted sectors, also handle setting
the nextwall pointers correctly;  Add some 'asksave=1' and 'make old-nextwalls
invalid'.

git-svn-id: https://svn.eduke32.com/eduke32@2048 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-30 13:52:02 +00:00
helixhorned
2603acd340 Makefile lines for building with libvpx from Macports on OSX
git-svn-id: https://svn.eduke32.com/eduke32@2047 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-28 20:31:59 +00:00
helixhorned
58fc90f77d Sanitize drawing sprites at different levels with TROR/classic. This should fix
most problems where sprites appear to be drawn through walls.

git-svn-id: https://svn.eduke32.com/eduke32@2046 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-28 20:30:41 +00:00
helixhorned
bb72f803c4 Two tweaks to make the precaching more efficient/less redundant in the game.
First, if we're in Polymer, don't precache tinted tiles that have a highpal
for that certain pal.  Second, don't precache tiles for palnum 251 (the last
non-reserved one, which is used as a crosshair pal). Assuming that there are
no other tints, this cuts the initial precache time and cache size on disk in
half.

git-svn-id: https://svn.eduke32.com/eduke32@2045 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-28 20:30:24 +00:00
helixhorned
c6f58c8dde lunatic bits and pieces
git-svn-id: https://svn.eduke32.com/eduke32@2044 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-25 15:11:47 +00:00
helixhorned
04d1ebb010 When inserting a new sprite and determining its picnum by frequency count
of the picnums of all sprites, omit the newly inserted sprite itself!

git-svn-id: https://svn.eduke32.com/eduke32@2043 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-25 15:11:28 +00:00
helixhorned
195ed466e3 VPX: in 3 planes -> packed format conversion code, group together the
three individual loops and compile the enclosing function at -O3 (-O1 for
debugging builds). Now, the time for this conversion ranges from 7 to 18
ms per frame across various tested machines, a clear improvement.

git-svn-id: https://svn.eduke32.com/eduke32@2042 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-25 15:11:11 +00:00
helixhorned
fb2f01911c synthesis: package ebacktrace1.dll, remove backtrace.dll and libi*.dll
Makefile: remove ebacktrace1.dll on 'veryclean' target

git-svn-id: https://svn.eduke32.com/eduke32@2041 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-22 16:53:10 +00:00
helixhorned
86345f2b00 backtrace.c: add flags to open() so that the log file is opened user-r/w.
This way, crashlogs will really be appended. Additionally, print a time
 at the end of each backtrace.

winlayer.c: load ebacktrace1.dll instead of the old one
Makefile.common: when building with DEBUGANYWAY=1, don't omit frame pointers
 This will let us get a stack trace for crashes with the release build code.

git-svn-id: https://svn.eduke32.com/eduke32@2040 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-22 16:52:55 +00:00
helixhorned
98ac0c2edc When searching a nextwall for a white wall after dragging a point,
exclude grayed out walls.

git-svn-id: https://svn.eduke32.com/eduke32@2039 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-22 16:52:32 +00:00
helixhorned
4dc5d792ae enable VPX support for Windows
git-svn-id: https://svn.eduke32.com/eduke32@2038 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-21 22:38:37 +00:00
helixhorned
e91c4dc15b Add backtrace.c (the same that was used to build backtrace.dll earlier) to tree
and build our own DLL, now called ebacktrace1.dll.  The change consists of
breaking the link to the libintl lib and its dependencies, so the backtrace dll
is now the only one required.

git-svn-id: https://svn.eduke32.com/eduke32@2037 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-21 22:38:24 +00:00
helixhorned
d4572c8957 Add statically linked libvpx to tree, built with gcc-4.5 mingw and
./configure --disable-vp8-encoder --disable-multithread
Also add VPX/VP8 headers for an easy build on Windows. Throw in the
necessary lines into the Makefile but do not enable VPX support yet.

git-svn-id: https://svn.eduke32.com/eduke32@2036 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-21 15:54:47 +00:00
helixhorned
1203b4b213 Fix
http://forums.duke4.net/topic/1348-mapster32-problems-and-bugs/page__st__480
(I think, didn't test it)

git-svn-id: https://svn.eduke32.com/eduke32@2035 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-20 19:12:42 +00:00
helixhorned
bcd0d80bb5 First Lunatic development bits.
git-svn-id: https://svn.eduke32.com/eduke32@2034 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-20 19:12:24 +00:00
helixhorned
2a6a2d590a - protect stat bit 2 when pasting to ceilings or floors
- when pasting to walls or maskwalls, the following user bits are kept now:
  4 (top/bottom alignment [O])
  1+64 (blocking, hitscan)
  8+256 (x/y-flip)
- print '(one-sided)' when pressing Shift + ([B] or [H]) on a wall

git-svn-id: https://svn.eduke32.com/eduke32@2033 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-18 11:55:31 +00:00
plagman
03429e8f2e Polymer: sanitize backface culling
Keep track of which side is getting culled, swap around mirrors, swap
around model drawing.

git-svn-id: https://svn.eduke32.com/eduke32@2032 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-18 07:18:50 +00:00
helixhorned
6f4fedb7fe fix picking
git-svn-id: https://svn.eduke32.com/eduke32@2031 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-17 15:26:52 +00:00
helixhorned
b486f3aa0d More natural mouse picking in software mode, closer to "what's under the cursor
is picked" but still not perfect. In particular, sometimes a wrong wall is
selected, and sprites don't get picked through portals. As a rule of thumb,
don't be too far away from the objects you're modifying in 3D mode.

git-svn-id: https://svn.eduke32.com/eduke32@2030 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-17 14:26:02 +00:00
helixhorned
19ebd8feb3 In the textured 2D mode of Mapster32, only texture non-grayed out sectors.
git-svn-id: https://svn.eduke32.com/eduke32@2029 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-17 14:25:42 +00:00
helixhorned
9b1d384723 Three-way clipping in Mapster32 (still toggled with 'N): on and off as
before, and additionally a mode that doesn't clip against masked walls
and sprites.

git-svn-id: https://svn.eduke32.com/eduke32@2028 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-16 19:17:48 +00:00
helixhorned
9b70a2efbf In the editor, when rescaling the texture after dragging a wall-point, also
traverse the TROR neighbors.

git-svn-id: https://svn.eduke32.com/eduke32@2027 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 19:31:44 +00:00
helixhorned
7582b86237 Add high-resolution timers C API for profiling. The functions are called
uint64_t gethiticks() and gethitickspersec().  For SDL 1.2, the timer
has the same resolution as getticks (1000 Hz). For Windows and SDL 1.3,
the resolution of the underlying perf-timers is used.  The only user of
these functions right now is some TROR on-screen debugging code.

Revert an earlier change regarding r_preview_mouseaim.  We can't do the
check because editstatus is set later.

git-svn-id: https://svn.eduke32.com/eduke32@2026 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:05:00 +00:00
helixhorned
cc7110c18f - Add new trueror1.map that showcases the functionality and limitations of
the additional rendering pass
- Remove r_preview_mouseaim cvar from the game, since it's only for Mapster
- sdlmusic.c: (Failed) attempt to fix a call of waitpid() with a non-existent
  process ID in the external MIDI playing code. I think there's a race there...

git-svn-id: https://svn.eduke32.com/eduke32@2025 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:04:37 +00:00
helixhorned
2415b03c79 Support for drawing 'island sectors' for TROR/classic (and with limited
functionality, Polymost).

The new feature can be enabled/disabled with the 'r_tror_nomaskpass' cvar.

The basic idea is that when drawing lower or upper levels, a first pass
is performed that ignores all red walls for which the TROR nextwall link
'towards' the viewer arrives at a red wall.  Thus, in the worst case, there
can be up to twice as many rendering passes now (when it is discovered that
the no-mask-pass isn't different that what would be drawn with the ordinary
one, the latter is skipped, since we've already drawn all needed geometry).

Hovever, this kind of multi-pass splitting is only suitable for simple scenes,
like the upper subway in the TROR test map.  In particular, multiple islands
shouldn't 'see' each other.

Two issues are worth mentioning: first, care needs to be taken for translucent
ceilings or floors, since drawing them twice isn't the same as drawing them
once. This is done for classic, but not for Polymost.  Second, sprites (which
are always drawn _after_ the geometry for a given pass) are still clipped to
the geometry of the ordinary pass, resulting in their disappearance from
certain angles.
--

Additionaly, a change made it into this commit that fixes redundant collection
of sprites in TROR:classic/Polymost.

git-svn-id: https://svn.eduke32.com/eduke32@2024 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:04:14 +00:00
helixhorned
701c69fecc misc. cleanup:
- remove 'imageSize' global which was always yres*bytesperline and only used once
- some clearbuf() -> Bmemset() because I find the latter easier to read
- remove some clearbufs to 0 of some global arrays on init

git-svn-id: https://svn.eduke32.com/eduke32@2023 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:03:50 +00:00
helixhorned
9fd471a56a Make uninitialization sequence more consistent across the editor code. It's
always like this now:
  ExtUninit -> (writesetup, misc.)
  uninitengine -> (uninitsystem -> (uninit timers, mouse, ...))
  exit()
Some paths still lead to a plain exit(), like failures in cache1d.c or mdsprite.c

git-svn-id: https://svn.eduke32.com/eduke32@2022 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:03:29 +00:00
helixhorned
25d64ceaca In camera viewscreen tiles, also draw upper and lower TROR levels. Works
in any renderer because it's drawn with the software one...
Also add a hack to make Polymer realize that viewscreen tiles can change
each tic so that they don't show a static image anymore.

git-svn-id: https://svn.eduke32.com/eduke32@2021 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:03:08 +00:00
helixhorned
96283fdf5e Make a couple of variables static in the engine; don't initialize umost/dmost
with other than base levels, since the y*most arrays are copied there later.

git-svn-id: https://svn.eduke32.com/eduke32@2020 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:02:52 +00:00
helixhorned
24cbd241d7 - In the editor, make bunch-equal-making [J] stricter, because the way it was
handled could lead to a bunch whose floors and ceilings covered different
  areas. A fix for the reduced functionality arising from this change is
  underway.
- Rewrite a small portion of code using yax_vnextsec() in game.c.

git-svn-id: https://svn.eduke32.com/eduke32@2019 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:02:35 +00:00
helixhorned
7f1133a493 Engine: add funtion 'yax_vnextsec(wall, cf)' to C API. It's often useful when
dealing with sectors on the two sides of a bunch.  Make yax_globallev and
yax_globalbunch variables non-static.
Rewrite a TROR-related bit in the engine code using the new function.

git-svn-id: https://svn.eduke32.com/eduke32@2018 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-15 17:02:12 +00:00
helixhorned
3b634f28ae fix a couple of editor issues:
- one reported by Micky:
http://forums.duke4.net/topic/3911-true-room-over-room/page__view__findpost__p__106610
- malloc(0) call when saving a map with no sprites
- update 'asksave' after Alt-S and corrupt-check on starting a new map

git-svn-id: https://svn.eduke32.com/eduke32@2017 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-12 15:03:51 +00:00
terminx
c698822a41 Add a couple of missed sanity checks for accessing player and sprite structure members as vars. Should fix crashes with stuff like "ifvare player[some value greater than MAXPLAYERS].kickback_pic blah"
git-svn-id: https://svn.eduke32.com/eduke32@2016 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-12 06:25:50 +00:00
helixhorned
e166895c90 engine: In setbrightness() and qsetmodeany(), call setpalette() only if the
palette changed from the last one (either globally or within the last call of
one of the function). This fixes the ugly OSD flickering in 8-bit mode when
a screen tint effect is in action (such as when being hurt or snotted on).

git-svn-id: https://svn.eduke32.com/eduke32@2015 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-10 15:45:11 +00:00
helixhorned
01676d7431 A couple of trivial/cleanup changes. setvgapalette() is removed from the
engine, since it had no users.

git-svn-id: https://svn.eduke32.com/eduke32@2014 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-10 15:44:53 +00:00
helixhorned
009d405803 Mapster32: when changing screen palettes, pass flag 2 to setbrightness().
This will prevent it from calling gltexinvalidateall() when e.g. submerging
and resurfacing, mimicking the behavior of the game, where only
gltexinvalidate8() is called in such situations.

git-svn-id: https://svn.eduke32.com/eduke32@2013 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-10 15:44:31 +00:00
helixhorned
85b65c26d3 Mapster32: make the heinum&2 and stat inconsistency be displayed only once
with 'corruptcheck now', but still print each corrected one on tryfix.

git-svn-id: https://svn.eduke32.com/eduke32@2012 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-10 15:44:16 +00:00
helixhorned
9c16dc7873 sdlayer.c: also SDL_WarpMouse() in debugging builds. This has at least three
effects:
1) Mouse turning works with SDL 1.3
2) The mouse pointer can't leave the window area with the console up, so that
   focus always stays with the application
3) Menu selection using the mouse doesn't work. Not dramatic IMO.

git-svn-id: https://svn.eduke32.com/eduke32@2011 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:46:50 +00:00
helixhorned
843689f8a0 polymer.c: Fix a potential zero-size calloc call when a two-walled sector
is present (like in E4L1).  Also sneak in a trivial change in cache1d.c

git-svn-id: https://svn.eduke32.com/eduke32@2010 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:46:34 +00:00
helixhorned
dc02ff5654 Using this dynamic checking tool: http://embed.cs.utah.edu/ubc/,
fix two issues with signed integer overflow. One is related to clipping
and the other to Polymost mouse-picking for overlong walls. Many more
remain especially in the 8-bit rendering code, but I expect many of
them to be intended.

git-svn-id: https://svn.eduke32.com/eduke32@2009 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:46:17 +00:00
helixhorned
727be94eb5 Tweak the source so that it can be built by clang. The only necessary change
is to remove a couple of 'inline's for functions with external linkage, which
seems to be a GCC convenience.

git-svn-id: https://svn.eduke32.com/eduke32@2008 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:46:00 +00:00
helixhorned
08f5290f4f mdsprite.c: prevent a couple of float divides by zero and save model file
name into m->head.nam after loading (but before preprocessing for Polymer)

git-svn-id: https://svn.eduke32.com/eduke32@2007 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:45:39 +00:00
helixhorned
a145cc93bc Make Polymer declare a callback function G_Polymer_UnInit() that is called
whenever we change to another renderer etc. and define it for the game and
editor.  The purpose of the function is to clean up references to Polymer
resources like lights.
This fixes 1) all lights becoming spot lights in the game and 2)
an issue with maphack lights in the editor (can't recall which exactly).

git-svn-id: https://svn.eduke32.com/eduke32@2006 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-06 17:45:21 +00:00
terminx
ea171d5230 Fix crashes on 64-bit due to unintended address truncation on ptr vars
git-svn-id: https://svn.eduke32.com/eduke32@2005 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 23:06:12 +00:00
helixhorned
b3d3fd9a39 Better handling of tsprites that are duplicated through TROR portals.
Specifically, now also consider the sprite tile's yoffset, and fix an
issue when a tsprite got duplicated 'toward' the viewer. Also add a
couple of tests in trueror1.map.

git-svn-id: https://svn.eduke32.com/eduke32@2004 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 19:44:51 +00:00
helixhorned
a3e83fbe0c Unbreak zip support as another means to group files. Using 16-bit integers to
hold file lengths is certainly very frownworthy.

git-svn-id: https://svn.eduke32.com/eduke32@2003 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 19:44:24 +00:00
helixhorned
a23504822d Prepare polymost.c for proper umost/dmost clipping of TROR passes. No real functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@2002 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 19:44:07 +00:00
helixhorned
962910ce32 Move the fixspritesectors call and the start sector updating into ExtPreSaveMap().
This makes the latter also correct when testing a map from the editor.

git-svn-id: https://svn.eduke32.com/eduke32@2001 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-04 19:43:48 +00:00
helixhorned
decb2a0db1 use updatesectorz instead of updatesector for the startsectnum updating when saving a map.
git-svn-id: https://svn.eduke32.com/eduke32@2000 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-02 22:15:43 +00:00
plagman
5bae16041d synthesis: require /bin/bash
synthesis.sh has bash-isms, so sh or dash won't cut it.



git-svn-id: https://svn.eduke32.com/eduke32@1999 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-01 20:11:22 +00:00