Commit Graph

2007 Commits

Author SHA1 Message Date
helixhorned 7f34c33bbc animvpx loop: do at least on input device poll each frame (i.e. even if we're
lagging) to be able to cancel the movie in any case.

git-svn-id: https://svn.eduke32.com/eduke32@2186 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:41:03 +00:00
helixhorned 8e54a3febf Preliminary commoning of actor[].t_data[10] to an array of int32's on both
32- and 64-bit platforms. Also, make struct type actor_t also have a common
size of 128 bytes. New code currently disabled and #ifdef'd for comparison.

This requires certain t_data[] entries ([1]: move ptr, [4]: action ptr and
[5]: ai ptr with actors) to be converted to script offsets instead of pointers,
breaking savegame and net packet compatibility (we could in theory try hard not
to, but it would be too much trouble).

git-svn-id: https://svn.eduke32.com/eduke32@2185 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:40:47 +00:00
helixhorned 9b0ea0366e Add new actor[].flags flag 2048 (SPRITE_NOCLIP), for 'spriteflags' CON usage.
Actors are always moved such that _they_ clip against blocking sprites, even
if their blocking bit is clear. Setting the new bit make them not clip against
anything.  The promary use of this is for decorative moving sprites that are
spawned in masses, such as rain or snow.

git-svn-id: https://svn.eduke32.com/eduke32@2184 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-17 18:51:50 +00:00
helixhorned 60bb16693b engine.c, in engine_addtsprite: if we can't add more tsprites because we
already have MAXSPRITESONSCREEN of them, return 1 to signal that the caller
should break out of the loop.

git-svn-id: https://svn.eduke32.com/eduke32@2183 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-17 18:51:29 +00:00
helixhorned 8f92cb024d Tweaks to compile the release build with clang. Now if it only would not
generate curious code like this one (Ubuntu 11.10's clang 2.9 on i386):

   0x080a57ea <+538>:   xor    %al,%al
   0x080a57ec <+540>:   test   %al,%al
   0x080a57ee <+542>:   jnz    0x80a57f2 <initgroupfile+546>
=> 0x080a57f0 <+544>:   jmp    0x80a57f0 <initgroupfile+544>
   0x080a57f2 <+546>:   shl    $0x4,%edi

git-svn-id: https://svn.eduke32.com/eduke32@2182 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-15 22:43:01 +00:00
helixhorned df94c55eab Patch up out-of-bounds access in some voxel drawing code.
git-svn-id: https://svn.eduke32.com/eduke32@2181 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-15 22:42:42 +00:00
helixhorned 46ed3313e7 Don't spawn weapon tiles (WEAPONx_SPAWN) if any such value has been set
to negative numbers.  Previously, only checks for being zero were performed,
but CON code in the wild also has WEAPONx_SPAWN -1, which would propagate to
the sprite picnum...

git-svn-id: https://svn.eduke32.com/eduke32@2180 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-15 22:42:25 +00:00
helixhorned b73b9cb732 a.m32: new state 'print_parallel_midpts'
git-svn-id: https://svn.eduke32.com/eduke32@2179 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-12 23:18:53 +00:00
helixhorned 84867ee620 Mapster32: Rudimentary support for auto-aligning along TROR nextwalls.
Usage: press the ['] (quote) modifier together with the PERIOD key.
Aligns only the immediate upper and lower neighbors of each wall that got
aligned by following point2s or nextwalls.  Doesn't play well with Alt
(carry over xrepeat) yet, might need two subsequent alignment passes.

git-svn-id: https://svn.eduke32.com/eduke32@2178 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-12 23:18:35 +00:00
helixhorned 4989c173bd Fix out-of-bounds access in tile selector code in astub.c
git-svn-id: https://svn.eduke32.com/eduke32@2177 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-12 23:18:15 +00:00
helixhorned 2f14c6dbed checkdefs.sh script: hackish support for CON files, only 'include *.con' and
'definesound ... *.(voc|wav|ogg)' commands (missing: 'music', something else?).

git-svn-id: https://svn.eduke32.com/eduke32@2176 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-12 23:18:00 +00:00
helixhorned 44e29613f1 Fix two yax_drawrooms() calls with too large sectnums (copy&paste error).
git-svn-id: https://svn.eduke32.com/eduke32@2175 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-11 13:26:54 +00:00
helixhorned ba858b3858 Fix a number of oob accesses with "switch switches".
Various code checked for switch tiles in the following manner,
  for (ii=0; ii<2; ii++)
      switch (DynamicTileMap[sprite[i].picnum-1+ii]) { case SOME_SWITCH: ... }
which blows for picnum 0.  Now, we simply disallow it.

git-svn-id: https://svn.eduke32.com/eduke32@2174 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-11 13:26:39 +00:00
helixhorned 44d002c354 Makefile: Remove {eduke32,mapster32}.memmap files on clean/veryclean targets
(bioman request).

git-svn-id: https://svn.eduke32.com/eduke32@2173 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-11 13:26:22 +00:00
helixhorned 65e0e75a8c Fix negative array access in premap.c
git-svn-id: https://svn.eduke32.com/eduke32@2172 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:12:15 +00:00
helixhorned cd6e846fac Fix potential out-of-bounds array access in P_DisplayTip (happened with
WGR2 SVN, so not sure where there's a tipping animation there).

git-svn-id: https://svn.eduke32.com/eduke32@2171 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:12:01 +00:00
helixhorned 3ca41992dd Fix sintable[] access with out-of-bounds values in core engine functions
(getzrange, hitscan, clipmove, drawmapview).
They're reproducible with DNE1.3D;  Since these angle values most likely come
from CON code, my suggestion would be to bit-and all values representing angles
with 2047 when setting the from CON, but I'd have to think about potential
side-effects of doing this.

git-svn-id: https://svn.eduke32.com/eduke32@2170 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:11:47 +00:00
helixhorned 151287168c - Fix invalid polymer light array access originating from game's cleanup
callback 'G_Polymer_UnInit'.
- In astub.c, reset spritelightid to -1 when nulling the spritelightptr of
  a sprite  (no crashes observed, just precaution)
- In sdlayer.c, catch SIGILLs with our signal handler too, since illegal
  instructions are what the instrumented debug builds will execute when
  attempting to carry out an undefined (per C) operation.

git-svn-id: https://svn.eduke32.com/eduke32@2169 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:11:31 +00:00
helixhorned 20d303ed15 engine.c: fix shift by negative value in parascan().
git-svn-id: https://svn.eduke32.com/eduke32@2168 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:11:08 +00:00
helixhorned b85b4d7b7c polymer.c: fix out-of-bounds picanm[] read.
git-svn-id: https://svn.eduke32.com/eduke32@2167 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:10:51 +00:00
helixhorned eb764b3b75 gameexec.c: fix calculation of a pointer value outside the bounds of an array
and an invalid derived pointer value.

git-svn-id: https://svn.eduke32.com/eduke32@2166 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:10:35 +00:00
helixhorned b7aacd242a Fix shift by values greater than 31 in some voxel loading code.
git-svn-id: https://svn.eduke32.com/eduke32@2165 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:10:21 +00:00
helixhorned f39429fa96 kplib.c: patch up negative array access, dunno how to really fix this at
the root.

git-svn-id: https://svn.eduke32.com/eduke32@2164 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:10:03 +00:00
helixhorned a950232046 Mapster32: fix AWFUL out-of-bounds WRITE with sector highlighting.
How in the name of hell this could pass undetected for so long is a
mystery to me.

git-svn-id: https://svn.eduke32.com/eduke32@2163 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:09:45 +00:00
helixhorned c7aa4592c2 polymost_printext256: fix oob read when passing negative 'col' or 'backcol'
values;  check the color index that is potentially gotten from the string to
be printed.

git-svn-id: https://svn.eduke32.com/eduke32@2162 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:09:29 +00:00
helixhorned c112cdde89 Fix a potential out-of-bounds read and write when loading the help file
in Mapster32.

git-svn-id: https://svn.eduke32.com/eduke32@2161 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:09:14 +00:00
helixhorned d806bc9fea When compiling debugging builds with clang, enable -fcatch-undefined-behavior.
git-svn-id: https://svn.eduke32.com/eduke32@2160 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:09:00 +00:00
helixhorned 6dc17eec1b Makefiles: disable a few warning categories and other switches when compiling
with clang to prevent spamming the output.

git-svn-id: https://svn.eduke32.com/eduke32@2159 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:08:47 +00:00
helixhorned 6fc7e5b683 Remove some warnings with clang, code-side changes.
git-svn-id: https://svn.eduke32.com/eduke32@2158 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:08:29 +00:00
helixhorned a7bce8814a Fix a warning with 64-bit builds.
git-svn-id: https://svn.eduke32.com/eduke32@2157 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-09 19:08:05 +00:00
terminx 81b5ed0025 Simple one-liner from Robin Green to fix a problem where the menu background tint would sometimes draw over the menu contents
git-svn-id: https://svn.eduke32.com/eduke32@2156 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-08 03:56:38 +00:00
helixhorned e6d1c9bd6a a.m32: New function save_restore_hlsectors, also accessible from the Quote-F
menu.  If some sectors are highlighted, save their indices.  The highlighting
of those particular sectors can then be restored at a later time (but careful
across structural modifications that tweak sector indices) by running the same
function.  Shares a 'gamearray' with function 'collect_teleporting_sectors',
so the latter will reset this one when run.

git-svn-id: https://svn.eduke32.com/eduke32@2155 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 21:21:01 +00:00
helixhorned 3aac0c1bd4 M32Script: when failing to compile a state with a menu name, don't keep the
menu entry.

git-svn-id: https://svn.eduke32.com/eduke32@2154 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 21:20:48 +00:00
helixhorned 086dcf383d Mapster32: fix filling all sectors of a bunch with Ctrl-U. Previously, only
one sector was filled and the 'clear bunch' message was displayed even if the
operation was canceled.

git-svn-id: https://svn.eduke32.com/eduke32@2153 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 21:20:31 +00:00
helixhorned 03000a52b9 CON parser cleanup: make labelcode save offsets to CON code instead of
pointers and make it into an int32_t*.

git-svn-id: https://svn.eduke32.com/eduke32@2152 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 21:20:17 +00:00
helixhorned 0b7c08ce0e CON parser cleanup: make labeltype be an int32_t* instead of an intptr_t*.
git-svn-id: https://svn.eduke32.com/eduke32@2151 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 21:19:57 +00:00
helixhorned fabbcdcf56 CON parser cleanup: when getting a value from labelcode[], assume that it
represents a pointer into the script for label types other than LABEL_DEFINE
instead of checking inclusion of the value in the script bounds. This
assertion was tested with WGR2 SVN.

git-svn-id: https://svn.eduke32.com/eduke32@2150 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 21:19:41 +00:00
helixhorned 3285cfef8c CON: Add the following commands to those which shouldn't be optimized away
with empty branches: ifcanseetarget, ifpdistl, ifpdistg, ifgotweapononce.

git-svn-id: https://svn.eduke32.com/eduke32@2149 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 18:10:06 +00:00
helixhorned 775d652d7d Lunatic: more Makefile tweaks; spriteext
git-svn-id: https://svn.eduke32.com/eduke32@2148 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 18:09:50 +00:00
terminx 8ac88ab4da Fix issue reported at http://forums.duke4.net/topic/5068-bug-introduced-in-old-versions-of-eduke32
git-svn-id: https://svn.eduke32.com/eduke32@2147 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-04 00:31:20 +00:00
helixhorned c0b86bae3a Mapster32: When failing to extend a collection of sectors because one of
them has a different height, print the sectnums of two differing sectors
to so that the mapper can find and examine them with Ctrl-J.

git-svn-id: https://svn.eduke32.com/eduke32@2146 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-03 13:13:44 +00:00
helixhorned bbc6db465e Mapster32: new cfg var 'glusememcache', the same as r_memcache cvar.
git-svn-id: https://svn.eduke32.com/eduke32@2145 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-03 13:13:28 +00:00
helixhorned 324510f40d Mapster32: when having some sectors highlighted, also show how many walls
they contain in total.

git-svn-id: https://svn.eduke32.com/eduke32@2144 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-03 13:13:08 +00:00
helixhorned c38d4f46f7 Lunatic: Makefile bits for Windows.
git-svn-id: https://svn.eduke32.com/eduke32@2143 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-03 13:12:51 +00:00
helixhorned 59881f50e0 Revert r2141 functionality because it was a stupid-ass hack and breaks E3L5.
The texture warping mode will need to be set depending on whether we're
actually drawing a parallaxed sky or not.

git-svn-id: https://svn.eduke32.com/eduke32@2142 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-27 12:02:41 +00:00
helixhorned 2a73b7fc9b Upload sky textures with s wrapping set to GL_CLAMP{_TO_EDGE}.
This fixes the vertical (~1 texel wide) stripes that are especially
noticable with tiled art skies and Polymost with r_parallaxskyclamp=1
or Polymer (which always uploads skies with repeating s and t coords).
What constitutes a sky tile is currently hardcoded to be >=78 and <=99.

git-svn-id: https://svn.eduke32.com/eduke32@2141 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 22:41:09 +00:00
helixhorned c4b243ba4e Fix moving cloud panning like in E4L1.
git-svn-id: https://svn.eduke32.com/eduke32@2140 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 22:40:54 +00:00
helixhorned 0414072838 Remove old duplicate_selected_sectors() function and copysector(), which
was only used there, from the source.

git-svn-id: https://svn.eduke32.com/eduke32@2139 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 22:40:39 +00:00
helixhorned 2ce07bdcd2 Rewrite sector duplication (Insert or C) in terms of backup_highlighted_sector
and restore_highlighted_sector functions. What this means is that TROR bunches
are now correctly duplicated too (only if all sectors of a given bunch are
highlighted).

git-svn-id: https://svn.eduke32.com/eduke32@2138 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 22:40:23 +00:00
helixhorned 54c109168d New modifier for RAlt. When RShift is depressed while highlighting sectors
(i.e. first press RAlt, then hold RShift to make it active), consider all
sectors, even the grayed out ones.
This makes 6 modifier keys in 4 categories for RAlt. Can you name them all?

Also spell out the labels that get drawn near the reticle when applying
some of the modifiers and make them not show when not actually selecting
(e.g. pressed RShift alone, but have highlighted sectors)

git-svn-id: https://svn.eduke32.com/eduke32@2137 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 22:40:07 +00:00
helixhorned 2675334a60 In backing up highlighted sectors code: also back up TROR information so
that bunches and nextwall links are restores, too.  Now, to coalesce two
TROR maps (e.g. for a CBP), one could
  do for i allsectors, sethighlightsector i 1
on the console, and then load the 'other' map to copy over the contents
of the first, including all TROR stuff. Note that neither selecting
all sectors with RAlt, nor duplicating them with Insert would lead to
the desired effect (yet).

Internally,
 - yax_setbunch() now has different behavior for bunchnums -1, -2 and -3
   (it either clears the nextwalls or not)
 - build.c has a helper function free_n_ptrs(). This could be handy in
   other situations where many blocks of memory must be allocated
   consecutively and freed in case of failure

git-svn-id: https://svn.eduke32.com/eduke32@2136 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 22:39:50 +00:00
helixhorned b461dc5fb9 When restoring temporarily backed up map, clear all TROR bunches. This is
suboptimal, but at least 'correct' and won't produce the aforementioned
corruptions anymore.

git-svn-id: https://svn.eduke32.com/eduke32@2135 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 14:12:59 +00:00
helixhorned f4703a596d Auto-correct the just mentioned inconsistency by clearing the respective TROR
nextwalls. (i.e. setting them to -1 on 'corruptcheck tryfix')

git-svn-id: https://svn.eduke32.com/eduke32@2134 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 14:12:44 +00:00
helixhorned 1402a6d70b corruption checker: catch TROR-nextwalls in non-extended sectors. These
can be caused by copying map parts from one map to another (or a new one).
The copying system is slightly broken right now....

git-svn-id: https://svn.eduke32.com/eduke32@2133 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 14:12:30 +00:00
helixhorned e76341f4f3 Backing up and restoring highlighted portion of map: calculate new
next{wall,sector} indices instead of using checksectorpointer() so
that the nextwalls will be restored exactly as they were (provided
that they are copied).  Also fix tweaking the sectnums of sprites.

git-svn-id: https://svn.eduke32.com/eduke32@2132 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-26 14:12:15 +00:00
helixhorned 235a82f13d Fix two bugs with the loop punching code that made it practically useless.
git-svn-id: https://svn.eduke32.com/eduke32@2131 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 13:46:48 +00:00
helixhorned ee30112c38 Ability to duplicate an inner loop in a neighboring TROR sector.
Called 'loop punching'. In addition to duplicating the loop, the inner
portions of the original and cloned loop are made into a new bunch, and
the loop walls are made to be neighbors, linking their movement to each
other. This gives a way to create island sectors with a differing
bunchnum in the midst of an already extended area.

Usage:
For an extended sector containing a CCW inner loop, select its points
using Ctrl+Shift. Press Ctrl-E to be queried whether to duplicate the
points into the upper or lower extension (even if it's unambiguous).
A number of conditions must be met for a successful 'punch', which
should hopefully be more or less obvious. Among them:
 - loop walls should all be red
 - the starting wall is only considered among the non-grayed-out ones
 - the neighboring sector must not contain points inside or at the loop

git-svn-id: https://svn.eduke32.com/eduke32@2130 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:53:07 +00:00
helixhorned f4d81d7975 "Sloped extended sectors cannot be split", oops. Also fix a glitch that
would break out of the 2D mode loop when splitting a sector would exceed
limits.

git-svn-id: https://svn.eduke32.com/eduke32@2129 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:52:52 +00:00
helixhorned 98ad4d7132 Factor out high-level 'add loop to sector' code into own function.
git-svn-id: https://svn.eduke32.com/eduke32@2128 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:52:37 +00:00
helixhorned c196e27ee9 in 'adding new loop to sector': use local 'firstwall' instead of ovh.suckwall
git-svn-id: https://svn.eduke32.com/eduke32@2127 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:52:22 +00:00
helixhorned 53bbb48675 Three Mapster32 changes (2 wall-drawing related, 1 crash fix)
- Don't crash when sector joining fails under certain circumstances.
- Increase the point lock (Manhattan) distance from 1/16th to 1/8th
  of the grid square length, making it easier to snap to vertices not
  lying at the grid points with grid lock on
- When drawing walls, don't snap to any of them except the first drawn

git-svn-id: https://svn.eduke32.com/eduke32@2126 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:52:08 +00:00
helixhorned 45bcc11f46 Batch-insertion of many points at once using line drawing and ENTER.
When having drawn N new points (and having one 'free') and pressing
ENTER, the N line segments between the new points are checked one by
one for intersection with every non-grayed-out wall and a wall vertex
is inserted at every intersecting point.  This may be viewed as a
prerequisite for a 'cutter' style tool.

git-svn-id: https://svn.eduke32.com/eduke32@2125 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:51:53 +00:00
helixhorned 24edef5c63 Warn user if pressing Ctrl+Shift+ENTER (check all wall pointers) in TROR map.
git-svn-id: https://svn.eduke32.com/eduke32@2124 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:51:36 +00:00
helixhorned 2d308625ff Factor out high-level point inserting code into M32_InsertPoint().
This function only handles the actual insertion, also taking care of
constrained TROR walls. Anything around the inserting such as backing up
drawn walls or snapping the x/y position to the grid is handled outside.

git-svn-id: https://svn.eduke32.com/eduke32@2123 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:51:21 +00:00
helixhorned 39314586ac Somewhat largish commit with various keyboard tinkering for Mapster.
The main change consist of adding a key press (and release) callback
whose only purpose is to be used from m32script as EVENT_KEYPRESS.
When entering that event, the RETURN variable will be set to the
keystatus code of the key, and whether it was pressed or released can
be checked by looking at keystatus[] at that code (ifholdkey and
ifhitkey do this). The purpose of this, then, is to be able to remap
keys in a more general (and complicated) fashion than is possible with
the mapster32.cfg 'remap' option. Various other additions build around
this central one:

- add an example EVENT_KEYPRESS to a.m32, among other things emulating
  the keypad arrows with Alt-<normal arrows> for notebook convenience;
  disabled initially
- a.m32: set 'owner' with Alt-KP2: now Alt-Shift-KP2, because of
  collision with the above
- new m32script command: setkey <keycode>, setting keystatus[<keycode>]
  to 1 (note: may be restricted to use in EVENT_KEYPRESS only in the
  future)
- fix indexing an m32script array with a defined label, there used to
  be a 'not a gamevar' error instead
- add the following constant labels for some key codes:
  KEY_SCROLL, KEY_F1 .. KEY_F12

git-svn-id: https://svn.eduke32.com/eduke32@2122 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:51:06 +00:00
helixhorned 9a8603d01e - Make old-nextwalls invalid on the following two occasions: ovh_whiteoutgrab
with no highlighted sectors; and when entering 3D mode, even if there are
  highlighted sectors. This should have almost no effect, but I find it cleaner
  that way.
- Check map for corruption every time an editing change is done. This was
  accidentally disabled when commenting out the undo code (which I've yet
  to debug).

git-svn-id: https://svn.eduke32.com/eduke32@2121 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:50:40 +00:00
helixhorned a1864b6a2e Make it impossible to start drawing walls when having a circle-wall
selected. (There was a corner case where this was possible.)

git-svn-id: https://svn.eduke32.com/eduke32@2120 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:50:21 +00:00
helixhorned 57e132a044 Remove after_handleevents_hook and its only user, the keystatus-level clearing
of SPACE and C when in side-view mode. Now, this is accomplished by checking
directly in the overheadeditor code.

git-svn-id: https://svn.eduke32.com/eduke32@2119 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:50:07 +00:00
helixhorned 568a7e1243 Eliminate potential malloc(0) calls when loading (converting) md2 models
with no skins or no GL comands.

git-svn-id: https://svn.eduke32.com/eduke32@2118 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:49:40 +00:00
helixhorned ac12a06de4 Fix calling glEnable() without checking for the rendering mode in the tile
selector. This could lead to a crash when OpenGL wasn't initialized before.

git-svn-id: https://svn.eduke32.com/eduke32@2117 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:49:22 +00:00
helixhorned 5efac3a09a Fix the Makefile on OSX. Their linker has a different syntax for requesting the
memory map.

git-svn-id: https://svn.eduke32.com/eduke32@2116 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-17 21:10:18 +00:00
helixhorned 21274b317f Fix the flickering in the tile selector with lazy hightile loading on
(lazy_tileselector=1 in mapster32.cfg). We're drawing tiles one by one,
so glDrawBuffer(GL_FRONT_AND_BACK) is our friend.

git-svn-id: https://svn.eduke32.com/eduke32@2115 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-17 21:10:04 +00:00
helixhorned 997b3426b5 Remove the -nopause switch of r2108, since it didn't help at all.
git-svn-id: https://svn.eduke32.com/eduke32@2114 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-17 21:09:49 +00:00
helixhorned 53ddc89516 triv: comment out FX_PlayLoopedAuto debug message to stdout
git-svn-id: https://svn.eduke32.com/eduke32@2113 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-17 21:09:26 +00:00
helixhorned 5623334283 Correct thinko with the ceiling/floor movement code. When moving more than one
sector c/f and moving one of them would go beyond the other side (ceilingz >
floorz), don't move any sector c/f at all. When moving only one sector in that
case, move so that ceilingz == floorz.

git-svn-id: https://svn.eduke32.com/eduke32@2112 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-11 22:39:56 +00:00
helixhorned b7834f21dd Tweak raising/lowering (groups of) ceilings or floors.
Now, if more than one sectors are affected, always move them by the same
amount. That is, if one of them would be sticking against the other side,
don't move the rest.  Another change consists of determining the z delta
first, and only then moving the sprites by that amount. This fixes the
problem where you'd e.g. raise a 'floor door' against the ceiling, and the
effector sprites would be raised one time too much, preventing them from
being lowered the next time.

git-svn-id: https://svn.eduke32.com/eduke32@2111 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-11 20:05:44 +00:00
helixhorned b2d789731a A couple of Mapster changes related to saving.
- new mapster32.cfg and OSD variable 'fixmaponsave_sprites', telling the
  editor whether to 'fix' the sprite sectnums on saving and entering 3D
  mode. Note that a) sprite sectnums are never fixed when 'script_expertmode'
  is enabled, as before, and b) sprites that have out-of-bounds sectnums
  are still fixed if a proper sector is found
- if saving and some sprite sectnums have thus been tweaked, inform the
  mapper on the status line and print the changes in the OSD
- fix update issue similar to an earlier one: when 'saving as', the astub.c-
  based file name is now updated too, so saving with Ctrl-S now saves into
  the one save with 'save as' (and not the old one)
- don't attempt to recheck wall pointers from scratch (when saving and running
  with -check) if it's a TROR map

git-svn-id: https://svn.eduke32.com/eduke32@2110 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-11 20:05:29 +00:00
helixhorned e18ef2ccc8 Oops. Revert the *alloc wrapping to catch them being called with bad values.
This was meant for debugging only.

git-svn-id: https://svn.eduke32.com/eduke32@2109 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-10 21:47:42 +00:00
helixhorned a67af55153 On Windows, add command-line switch -nopause, disabling the pause key.
Hopefully this fixes the periodic pausing/unpausing that a few people
have been experiencing.
Also fix build with GCC 3.

git-svn-id: https://svn.eduke32.com/eduke32@2108 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-10 21:47:26 +00:00
helixhorned 63805a025b Fix building with both LTO and VPX support enabled. Specifically, don't use
the 'optimize' function attribute if LTO is enabled.

git-svn-id: https://svn.eduke32.com/eduke32@2107 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-10 21:47:03 +00:00
helixhorned e1e09cd978 Also print file name of cache file in case of failure to open it.
git-svn-id: https://svn.eduke32.com/eduke32@2106 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-08 16:50:10 +00:00
helixhorned 3690f25944 Fix the 'displayrandvar{var}' CON and m32script commands for environments
with RAND_MAX > 32767 (everything except Windows?). The 'displayrand' command
now returns values from 0 to 32767 inclusive, across all platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2105 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-05 12:13:50 +00:00
helixhorned e94243d7db New CON command
setactorsoundpitch <actor#> <sound#> <pitchoffset>
which can be used to change the pitch of a playing sound.

The pitch offset has the same meaning as the definesound pitch range endpoints,
i.e. the units are 1/100th of a seminote.  Note that just like the random pitch
offset, increasing the pitch makes the sound duration shorter (and vice versa).

git-svn-id: https://svn.eduke32.com/eduke32@2104 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-03 23:08:54 +00:00
helixhorned 59670ed45e m32: Make a couple of often-used operations not spam messages to the log.
git-svn-id: https://svn.eduke32.com/eduke32@2103 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-03 23:08:35 +00:00
helixhorned b9a4b92bc8 Eliminate one uinitialized mem access related to projectiles (it's the filler
member, so maybe not *that* bad) and an invalid memory access when trying to
access a per-player gamevar in a player-less context (e.g. WGR2 SVN r25
WGR2GAME.CON line 10448).

git-svn-id: https://svn.eduke32.com/eduke32@2102 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:03:09 +00:00
helixhorned a4ba86ee31 Explicitly initialize voice->Playing and voice->Paused members in some sound
playback functions. Without these, there would be an uninitialized access
in line 444 of multivoc.c (if the memory in question was allocated with malloc,
but still...)

git-svn-id: https://svn.eduke32.com/eduke32@2101 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:02:54 +00:00
helixhorned fdd84d1870 More beauty tinkering: decorate the 'start' pointer of the mixing functions
and some VoiceNode struct members with a const, commit forgotten vorbis.c
changes.

git-svn-id: https://svn.eduke32.com/eduke32@2100 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:02:37 +00:00
helixhorned a9278e1977 trivial stylistic changes continued: upcase all macro constants and make
MV_MaxVolume into one again.

git-svn-id: https://svn.eduke32.com/eduke32@2099 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:02:14 +00:00
helixhorned 2da13064c1 multivoc.c: trivial stylistic changes, make some functions static
git-svn-id: https://svn.eduke32.com/eduke32@2098 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:01:54 +00:00
helixhorned 3713e3db9b Fix another dragpoint() bug that was wrongly omitting walls.
This one could have only happened with TROR maps, I think.

git-svn-id: https://svn.eduke32.com/eduke32@2097 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-01 22:01:35 +00:00
helixhorned 4322bae14c Oops. That last one wasn't supposed to be committed. Here's the log for the
last one + this one:

A couple of tweaks against accidental overwriting of maps.
- first, fix a bug where the map name wasn't reset to 'newboard.map' when starting a
  new map
- When saving with Ctrl-S, query the user for confirmation and also show the file name
  where the map will be written
- when going into the ESC-menu, print the file name where the map will be written
  on pressing 'S' above the '(S)ave' text

git-svn-id: https://svn.eduke32.com/eduke32@2096 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-31 19:50:06 +00:00
helixhorned 004b98e2b3 A couple of tweaks against accidental overwriting of maps.
- first, fix a bug where

git-svn-id: https://svn.eduke32.com/eduke32@2095 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-31 19:49:43 +00:00
helixhorned 3dd39c118d Fix an init issue with the earlier ATI workaround.
git-svn-id: https://svn.eduke32.com/eduke32@2094 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 21:48:57 +00:00
helixhorned 3a089f894c Increase MAXSOUNDS to 4096, making the maximum valid sound ID be 4093.
Keep in mind that MUSICANDSFXs with ambient sounds must still have lotags
less than 999 because values >=1000 are used for the amount of reverb.
(999 can't be used because the original code reads '< 999' and I'm not
sure whether it has any special significance... probably not though)

git-svn-id: https://svn.eduke32.com/eduke32@2093 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:48:46 +00:00
helixhorned 4d40d32014 When joining sectors and there's more than one non-grayed-out sector under the
cursor, query the mapper to pick one. The joining can still fail afterwards,
which makes it only a semi-automatic helper feature.

git-svn-id: https://svn.eduke32.com/eduke32@2092 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:48:29 +00:00
helixhorned 51b31c5445 This fixes the aforementioned TROR corruption. It happened because Mapster32
allowed circle-walls started on the unconstrained _other_ side of a constrained
wall. Also fix a potential invalid wall access when inserting a point (pretty
serious, that!)

git-svn-id: https://svn.eduke32.com/eduke32@2091 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:48:13 +00:00
helixhorned 78cf620036 (Almost) correct insertion of points in the midst of having some walls drawn,
also for make-circle (C, SPACE). There's still a TROR corruption happening
probably when inserting on constrained walls, but I've yet to get behind the
real cause.

git-svn-id: https://svn.eduke32.com/eduke32@2090 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:47:58 +00:00
helixhorned cd8fc5328e Make deleting points correct while having some walls drawn. For that,
some wall drawing state is ripped out from overheadeditor() into a
a file-scope struct (even if we don't yet need it there). If the deleting
touches the first drawn point, the walls drawn so far are cleared.

git-svn-id: https://svn.eduke32.com/eduke32@2089 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:47:42 +00:00
helixhorned 48ac042ca4 Eliminate one malloc(0) when corrupt-checking an empty map, clean up
overheadeditor() by allocating temp variables in the blocks where they
are needed.

git-svn-id: https://svn.eduke32.com/eduke32@2088 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:47:26 +00:00
helixhorned 5b48cb1bd6 Fix the bug where many kick sounds were started when pressing
HOME or END in the user map selector. Now it's only one.

git-svn-id: https://svn.eduke32.com/eduke32@2087 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:47:07 +00:00