Commit graph

2527 commits

Author SHA1 Message Date
helixhorned
6c405100ac Make sdlayer.c's timerticspersec an 'int32_t' to match the declaration.
git-svn-id: https://svn.eduke32.com/eduke32@2285 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-27 15:02:25 +00:00
helixhorned
d6530a862f Route the 5th mouse button to the game; bump savegame version.
The "double-click button4" had to make way for MOUSE5 in the button binds menu,
but I don't think anyone cares.  Savegame compatibility was actually silently
broken with the MAXTILES update earlier, but I forgot updating the version...

git-svn-id: https://svn.eduke32.com/eduke32@2284 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:55 +00:00
helixhorned
da218f7e65 small correction of a memory-clearing line in namesdyn.c
git-svn-id: https://svn.eduke32.com/eduke32@2283 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:39 +00:00
helixhorned
98ffd6f00c Rearrange 'struct hicreplc_t' members so that no padding is inserted on x64.
git-svn-id: https://svn.eduke32.com/eduke32@2282 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:25 +00:00
helixhorned
143ec24cb4 engine.c cleanup, making some variables static mostly
git-svn-id: https://svn.eduke32.com/eduke32@2281 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:58:08 +00:00
helixhorned
c657588658 Fix a potential sector[-1] access when drawing a masked wall in Polymost.
git-svn-id: https://svn.eduke32.com/eduke32@2280 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-26 21:57:51 +00:00
helixhorned
f96cc343a2 Fix the insert cicle wall-points bug reported by Norvak.
git-svn-id: https://svn.eduke32.com/eduke32@2279 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-24 18:07:36 +00:00
helixhorned
5f12ab7f53 Fix sprite[-1] access when aborting playing a sound in Mapster's Sound Index.
Also a couple of other cleanup lines... might need more though, I'm not sure
it's all good there.

git-svn-id: https://svn.eduke32.com/eduke32@2278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-23 19:13:00 +00:00
helixhorned
d95511ed1d Fix sprite[] access with indices > MAXSPRITES in Polymer model drawing code.
Internally, updateanimation() now takes a third parameter 'lpal'.

git-svn-id: https://svn.eduke32.com/eduke32@2277 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-22 17:18:49 +00:00
helixhorned
775eff0344 Mapster32: make sector flipping (X/Y) work properly with TROR.
git-svn-id: https://svn.eduke32.com/eduke32@2276 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 22:12:11 +00:00
helixhorned
7a4c9253c5 astub.c: remove some tabs in the code
git-svn-id: https://svn.eduke32.com/eduke32@2275 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 22:11:55 +00:00
helixhorned
661e85155b Mapster32: always show highlighted sprites in 2D mode, even in a gray sector.
git-svn-id: https://svn.eduke32.com/eduke32@2274 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 22:11:40 +00:00
helixhorned
bb1070b795 Fix a potential wall[-1] access in Mapster32.
git-svn-id: https://svn.eduke32.com/eduke32@2273 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 15:48:03 +00:00
helixhorned
7a893b8ec4 minor engine cleanup.
- enclose glbuild.h in #idndef ... sentinels
- engine.c: remove unused variable 'pageoffset', make 'lastx' static
- formatting

git-svn-id: https://svn.eduke32.com/eduke32@2272 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 13:24:15 +00:00
helixhorned
db94366657 Use ATTRIBUTE((used)) for symbols used only in inline asm.
This may fix compilation for optimized builds with GCC or clang where
the compiler would otherwise decide that those symbols are unused.

git-svn-id: https://svn.eduke32.com/eduke32@2271 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-20 13:23:53 +00:00
helixhorned
d0acd40ff8 Inreased debugging level for catching oob accesses to 'main' arrays.
If enabled, this makes the following arrays be allocated statically:
spriteext, spritesmooth, sector, wall, sprite, tsprite, while
necessarily disabling the clipshape feature (because it relies on
setting sector/wall to different malloc'd block temporarily).

To compile, pass DEBUGANYWAY=1 in addition to RELEASE=0 to 'make',
and it's really only useful with CC=clang, of course.

git-svn-id: https://svn.eduke32.com/eduke32@2270 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 23:17:34 +00:00
helixhorned
ba25d9a678 Fix a problem in G_DrawRooms where an sectnum updated to -1 may be used as index.
git-svn-id: https://svn.eduke32.com/eduke32@2269 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 23:17:03 +00:00
helixhorned
ca2d612976 Fix oob accesses when e.g. shooting tile -1. (can propagate via WEAPONx_SHOOTS)
Ideally, we would also warn when setting WEAPONx_SHOOTS to negative values, but
we'd have to intercept CON's setvar's and it wouldn't be pretty.

git-svn-id: https://svn.eduke32.com/eduke32@2268 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:58:23 +00:00
helixhorned
a61052f807 Double MAXTILES to 30720, reduce EXTRATILES (models w/ custom pal skin) to 3840
I'm decreasing EXTRATILES because I feel that it's way overcommitted. It's the
max number of model-tiles that have their own skin for a certain palette,
like the slimer egg in the HRP.

git-svn-id: https://svn.eduke32.com/eduke32@2267 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:58:06 +00:00
helixhorned
cd89fce9aa less trivial stuff
- fix one bound-checking line
- rewrite two lines in astub.c to potentially not overflow an int16
- make tiletovox[] an array of int16's

git-svn-id: https://svn.eduke32.com/eduke32@2266 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:57:46 +00:00
helixhorned
2e1e2345af trivial tweaks: make stuff static, remove unused stuff, formatting...
git-svn-id: https://svn.eduke32.com/eduke32@2265 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 21:57:22 +00:00
hendricks266
426ef1494e Add the 'yoffset' token to model definitions to allow models to compensate for ART tiles with large yoffsets, such as #603. Under normal circumstances the existing 'zadd' parameter should be used instead. Special thanks to Supertanker.
git-svn-id: https://svn.eduke32.com/eduke32@2264 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-17 04:31:59 +00:00
hendricks266
ff94311f13 weapons.con.sample:
- hud_orientation now uses proper bitwise operations
 - clean up whitespace

git-svn-id: https://svn.eduke32.com/eduke32@2263 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-17 04:31:23 +00:00
helixhorned
ebb3d0a378 gamedef.c: make some variables static and remove some #if 0'ed code.
git-svn-id: https://svn.eduke32.com/eduke32@2262 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:40:16 +00:00
helixhorned
031da6280d Remove the allocache() allocation type for 'intptr_t *lookups'.
Always malloc that buffer.  This allows us to remove suckcache() from
cache1d.c, which I believe to be buggy (see comments in the source).

git-svn-id: https://svn.eduke32.com/eduke32@2261 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:59 +00:00
helixhorned
260bbc1f92 cleanup:
- 'whitecol' was defined in the engine and in build.c, use only the engine one
 - make cachesize, artsize, artversion static in engine.c
 - undo some formatting havoc presumably done by astyle

git-svn-id: https://svn.eduke32.com/eduke32@2260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:38 +00:00
helixhorned
340b2f7647 Increase the number of maximum art files from 64 to 256 and tweak loadpics().
It is likely that this is the value it used to have at some point, because
the MAXTILEFILES macro equals 256 and is as old as the Duke3D source.
loadpics() now refuses to load an ART file with localtilestart or localtileend
out of bounds, or if localtileend<=localtilestart (i.e. no tiles in ART file, or
nonsense). Also, on 'invalid art file version', continue instead of returning.

Note: this does not increase the maximum number of tiles, which is still 15360,
it only gives a bit more freedom to arrange them (well, into more art files).
Also, I don't see what anyone keeps off from packing any number of tiles (from
1 to 15360) into an art file. Old EDITART limits?

git-svn-id: https://svn.eduke32.com/eduke32@2259 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:39:10 +00:00
helixhorned
6aec1d1f26 Add a hack to the animsounds DEF token parsing to not wrongly emit an error.
git-svn-id: https://svn.eduke32.com/eduke32@2258 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-15 22:38:54 +00:00
helixhorned
e30ed58aa0 Fix parallaxed sector display in Mapster32 on Polymer.
git-svn-id: https://svn.eduke32.com/eduke32@2257 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-14 14:48:45 +00:00
helixhorned
480690aa1d Fix the Polymer hitches first encountered with Parkade.
The cause was a combination of many factors. First, Polymer requires the
start-drawing position to be inside the sector to draw (deviations lead to
incorrect drawing).  This was violated by the game, because it interpolated
the current and next tic position without updating the sectnum, leading to
inconsistencies especially when passing through narrow sectors.  Polymer
worked around it by doing an updatesector() each frame, however this works
poorly for maps with overlapping geometry such as SoS or RoR.

The solution to this is to add a new engine function,
updatesector_onlynextwalls(), which searches the sectors (via nextsector)
in breadth-first fashion instead of from 0 to numsectors-1, like updatesector
does when it fails for the *immediate* nextwall neighbors.

Internally, the breadt-first search helpers are moved into the engine.

git-svn-id: https://svn.eduke32.com/eduke32@2256 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-14 14:48:30 +00:00
helixhorned
87ac6b8406 winlayer.c: in WM_PALETTECHANGED handling code ("someone stole the palette
so try and steal it back"), prevent calling IDirectDrawSurface_SetPalette()
with NULL arguments, causing a crash.  It's happened for me on Vista, when
initially changing from 8-bit to 32-bit mode.

git-svn-id: https://svn.eduke32.com/eduke32@2255 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:49:50 +00:00
helixhorned
a57b566c0b Add Makefile option to use the DMALLOC (debug malloc) library.
I didn't have much success in finding bugs using it, but it works
out-of-the-box on my setup, so it may be useful in the future.

git-svn-id: https://svn.eduke32.com/eduke32@2254 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:49:34 +00:00
helixhorned
300fee62da sdlayer.c: formatting of preprocessor lines
git-svn-id: https://svn.eduke32.com/eduke32@2253 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:49:15 +00:00
helixhorned
9617227a87 Support for the first "thumb" mouse button, called MOUSE4 in the menu.
The second one is passed to the 'mouseb' variable, but the game currently
can't map it since ud.config.MouseFunctions[] would have to be enlarged,
breaking savegame compatibility.
Works both for the Windows and SDL layers. For the latter, instead of using
the SDL_BUTTON_X1/X2 macro constants, I'm using 8 and 9, since that is what
SDL (and incidentally or not, xev) gives me for those buttons.

git-svn-id: https://svn.eduke32.com/eduke32@2252 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:57 +00:00
helixhorned
80949930bd Temporarily disable the 'model thinning-out' feature intended to save memory.
It turns out that with model interpolation, out-of-bounds frame numbers may
be generated with thinned out models, so disable it until I can sort out
what's wrong with it.
Also, minor code cleanup.

git-svn-id: https://svn.eduke32.com/eduke32@2251 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:38 +00:00
helixhorned
5f50c30ac2 polymer.c: "Compiling GPU program with bits (octal) %o" for easier reading.
Also, for debugging builds, show this message from verbosity level 1 on.

git-svn-id: https://svn.eduke32.com/eduke32@2250 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:17 +00:00
helixhorned
7a5a19a874 Fix actor[].dispicnum becoming negative.
Since the original source code release of Duke3D, there was a potentially
dangerous hack where actor[].dispicnum was set to -4 to signal "this actor
should not have a floor shadow for this moment" (it doesn't really work,
if you ask me).
Now, use another bit of actor[].flags for that purpose because setting
any picnum members to negative values asks for trouble.

git-svn-id: https://svn.eduke32.com/eduke32@2249 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:48:00 +00:00
helixhorned
7e6f712ad1 more internal cleanup...
the only visible change is that polymost_trytexcache (formerly two
instances of nearly duplicate code) now prints a diagnostic after
a cache miss.  The one that one is most likely to encounter is
"r_downsize doesn't match", meaning that this setting likely differs
between Mapster and the game.

git-svn-id: https://svn.eduke32.com/eduke32@2248 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-12 20:47:41 +00:00
helixhorned
e3150b2801 a couple more trivial tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2247 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:45:34 +00:00
helixhorned
fa6f2d9ca2 md4.c/h: add consts to appropriate arguments
git-svn-id: https://svn.eduke32.com/eduke32@2246 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:45:08 +00:00
helixhorned
d83ff63607 sounds.c: check the sound number before accessing arrays with it; always do
this in "(unsigned)i < bound" fashion.

git-svn-id: https://svn.eduke32.com/eduke32@2245 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:49 +00:00
helixhorned
3095b09773 trivial formatting / removing of old cruft / adding comments
git-svn-id: https://svn.eduke32.com/eduke32@2244 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:35 +00:00
helixhorned
a0d27ee702 animvpx sound: fix the 'may have many sounds per frame' requirement
E.g. this should work correctly now:
// FLY_BY, PIPEBOMB_EXPLODE, OCTA_DYING
animsounds logo { 1 244  64 14  64 144 }

git-svn-id: https://svn.eduke32.com/eduke32@2243 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:09 +00:00
helixhorned
6a37636bb0 Possibility of specifying sounds for a VPX anim-replacement via DEF.
The syntax is as follows:
  animsounds <anim> { frame1 sound1  frame2 sound2 ... }

<anim> has to be one of the tokens: cineov2, cineov3, RADLOGO, DUKETEAM,
logo, vol41a, vol42a, vol4e1, vol43a, vol4e2, or vol4e3, corresponding
to hard-coded Duke3D anims.

The frameN's (1-based frame numbers) have to be in ascending order (but not
necessarily strictly ascending, so that a frame may have more than one sound).

Example: for Duke3D's XBLA nuke logo animation (IVF extracted from nuke.webm),
the following definition overlays the video with a sound sequence similar
(identical save for timing) to the original nuke animation:

// frame 1: FLY_BY, frame 64: PIPEBOMB_EXPLODE
animsounds logo { 1 244  64 14 }

git-svn-id: https://svn.eduke32.com/eduke32@2242 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:54 +00:00
helixhorned
f826ffb4d0 In VPX 3 planed --> packed conversion code, pull constant expressions out of
the loop.  For the release build and the test animation, this lowers the time
to 3-4 ms per conversion of one frame on my desktop machine.

git-svn-id: https://svn.eduke32.com/eduke32@2241 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:33 +00:00
helixhorned
a86dfe661b maint: make the following static in polymost.c:
- texcacheindex *firstcacheindex, *curcacheindex
 - trytexcache(), gloadtile_cached()
- Factor out duplicated code into clear_cache_internal()

git-svn-id: https://svn.eduke32.com/eduke32@2240 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:43:18 +00:00
helixhorned
3e103e435a Makefile.common: oops, -DNEBUG was in the debug build, not the release one
git-svn-id: https://svn.eduke32.com/eduke32@2239 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-07 20:37:48 +00:00
helixhorned
a0f19e66be osxbuild.sh: don't build for ppc
git-svn-id: https://svn.eduke32.com/eduke32@2238 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-07 20:37:36 +00:00
helixhorned
114d8e4a36 When defining a model with the 'model' token and there were errors, don't
let it hang around causing trouble later on; delete it right now and inform
the user.
Add a couple of 'static's to some functions and file scope data in mdsprite.c

git-svn-id: https://svn.eduke32.com/eduke32@2237 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-07 17:48:55 +00:00
helixhorned
b926e2a496 - When saving game, clear all polymer lights before. Not doing this makes
the SE ones douple, triple, ... after each save.  Maphack lights are reloaded
with polymer_resetlights() (though I've had them disappearing after load, I
couldn't reproduce it afterwards).
- in debugging builds, print a message when polymer_resetlight is called on a
nonexistent one.  The problem is not so much the call itself (it's guarded),
but the fact that resources on the caller side may not have been freed if it
thinks that those lights do in fact exist. Right now, it's not the case though.
- add 'loaded map hack' messages after some other successful loadmaphack calls

git-svn-id: https://svn.eduke32.com/eduke32@2236 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-05 21:58:23 +00:00
helixhorned
146e1f1c09 When loading a game, DON'T restore 'adult' TV tiles. This fixes the recent
crashes.

Usually, after loading a game, some wall tiles are tweaked depending on whether
adult mode is enabled or not.  If it's not, those wall picnums are replaced
with blank or broken screens.  If it is, they are restored from the wall's
.extra member.  Apparently though, Mapster32 leaves some .extra members
floating around even after deleting a TROR nextwall link (it's used as the
'lower wall index').  Because MAXWALLS is greater than MAXTILES, this may
produce out-of-bounds accesses and corrupt memory (besides setting wall
tilenums to nonsensical values) later in the game.

Other than that, the change only affects loading savegames created with adult
mode OFF. Kinky TV screenies simply won't be restored then.

git-svn-id: https://svn.eduke32.com/eduke32@2235 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-05 20:48:37 +00:00
helixhorned
b5f2955895 savegame.c: some const void **ptr -> void **ptr, since they're certainly not const
git-svn-id: https://svn.eduke32.com/eduke32@2234 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-05 20:48:20 +00:00
helixhorned
74b823d6dc trivial tweaks: some NULLing pointer after freeing them; move the 'too much mirrors'
check one 'if' down since mirrors are only created when the condition holds

git-svn-id: https://svn.eduke32.com/eduke32@2233 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-05 20:48:05 +00:00
helixhorned
bb17cff9b7 Pass bit 16 to P_SetGamePalette from CON's setgamepalette (forgotten from earlier commit)
git-svn-id: https://svn.eduke32.com/eduke32@2232 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-03 19:56:10 +00:00
helixhorned
76d210c4b8 Patch up access of malloc'd buffer one byte beyond its size in kplib's
JPEG decoder (unearthed by valgrind).

git-svn-id: https://svn.eduke32.com/eduke32@2231 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-03 19:55:55 +00:00
helixhorned
f87c0db3ce In G_NewGame(), call Gv_RefreshPointers after Gv_ResetVars.
Resetting the gamevars might produce inconsistencies between an earlier loaded
game (for example, if it was saved with different/earlier CON code), and worst
of all, the gamevars that reference C variables might be overwritten (i.e. the
addresses to those variable, which is very bad!).

git-svn-id: https://svn.eduke32.com/eduke32@2230 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-03 19:55:38 +00:00
hendricks266
13c399f612 - Format CON crash output in VM_ScriptInfo() much more nicely.
- Execute VM_ScriptInfo() when DNDEBUG is used.

git-svn-id: https://svn.eduke32.com/eduke32@2229 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-01 04:14:06 +00:00
hendricks266
e9aec2a65b Comment ldcty[12] array from kpegrend() to remove last of set-but-unused warnings. I don't see any reason to leave this alone.
git-svn-id: https://svn.eduke32.com/eduke32@2228 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-01 04:12:37 +00:00
helixhorned
9a7bdfa76c a.m32 light hotkeys: clamp hitag (range) to 0..32767 instead of 0..16000
git-svn-id: https://svn.eduke32.com/eduke32@2227 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-30 22:17:29 +00:00
helixhorned
afbffe5c4a CON: make the 'palette' player member actually return the player's palette ID
instead of -1. Setting is still only through 'setgamepalette'.

git-svn-id: https://svn.eduke32.com/eduke32@2226 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-29 14:26:30 +00:00
helixhorned
8ec15480c0 Besides the performance issues, there's another reason why changing the palette
'frequently' isn't such a good idea.  Assume an actor constantly changes the
palette to some value and you're attacked by a newbeast at the same time. Then
the pain tinting would be reset each time the actor's code is run.  This commit
adds a new flag 16 to setbrightness(), meaning "don't reset the fade tinting".
Its only use right now is from CON's setgamepalette command (and there, always).
The change is done in the engine and thus affects all platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2225 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:36:01 +00:00
helixhorned
d5a934f9ba Trivial tweaks of setbrightness. Add an assertion that bits 1 and 4 are clear,
mainly.  Also remove setvgapalette() from source.

git-svn-id: https://svn.eduke32.com/eduke32@2224 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:35:44 +00:00
helixhorned
65deeda53a The earlier changes introduced bugs when palettes were not set correctly in
certain situations (mostly cutscenes etc). This commit removes bit 1 from all
flags that make it to setbrightness, the meaning of which is "don't actually
update the palette". I have no idea what it was for and since the corresponding
P_SetGamePalette() calls were from places like the mentioned cutscenes, I don't
think it matters performance-wise.

git-svn-id: https://svn.eduke32.com/eduke32@2223 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:35:23 +00:00
helixhorned
92e5d8214d SDL layer: don't call SDL_SetGammaRamp() if there would be no change.
This is in the similar vein as the set-palette deferring and it's this
that fixes the low FPS in the radioactively contaminated area in AMC TC:
Megabase (since setgamma() is called from setbrightness()).

Again, update issues might be expected, but changing focus between EDuke32
and the desktop and back seems to restore the gamma settings properly on
Kubuntu. Looks like X (or whatever above handles this stuff) maintains it
on a per-application basis.

git-svn-id: https://svn.eduke32.com/eduke32@2222 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:34:57 +00:00
helixhorned
4ae50ef22a SDL layer: in 8-bit mode, defer setting the palette until showing the next frame.
CON code sometimes uses 'setgamepalette' from withing actors, which is a bit too
frequent.  Deferring the actual palette updating means that multiple requests in
between two screen redraws are coalesced into one, which is desirable for
performance reasons and for the reduction of 'tearing' artefacts (but not
prevention, since the drawing isn't synced to the screen refresh rate with
vsync off).

(Did-not-)update issues might be introduced.

Windows isn't touched because
 - I expect it to be more brittle, especially in light of the ATI HW gamma
   problems.
 - I haven't tested whether the particular performance penalty that lead to this
   change ('gas' in AMC TC) exists there too

git-svn-id: https://svn.eduke32.com/eduke32@2221 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:34:41 +00:00
helixhorned
9e1399ec14 screenshots: remove the old inversion and PCX code from the source
git-svn-id: https://svn.eduke32.com/eduke32@2220 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:34:26 +00:00
helixhorned
98bcc0e60c screenshots: if compiled with USE_LIBPNG, always use PNG, even for
color-inversed shots. For both PNG and TGA, change the way they're
done in 8-bit mode: instead of XORing every byte with 15, save the
inverse palette (each component taken 255-x).

git-svn-id: https://svn.eduke32.com/eduke32@2219 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:34:10 +00:00
helixhorned
d1d94e083f savegame.c: fix compilation warnings with release build, add timing for debug
git-svn-id: https://svn.eduke32.com/eduke32@2218 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:33:54 +00:00
helixhorned
8007da7190 Factor out two nearly identical pieces of code in game.c and gameexec.c
into G_HandleMirror().

git-svn-id: https://svn.eduke32.com/eduke32@2217 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-28 20:33:40 +00:00
helixhorned
7c245875cb engine: make smoststart[] (which saves starting "smostcnt"s) an array of int32's
instead of shorts. This fixes their values' overflow in AMC TC megabase and
probably a couple of other large maps.

git-svn-id: https://svn.eduke32.com/eduke32@2216 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-27 14:22:45 +00:00
helixhorned
51e3bc0148 net: fix bug in Net_ParseServerPacket introduced with SAMESIZE_ACTOR_T.
git-svn-id: https://svn.eduke32.com/eduke32@2215 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-27 14:22:28 +00:00
helixhorned
489605ee0d Fix sintable access with raw angle value (which might be outside [0..2047])
in overhead map drawing code.

git-svn-id: https://svn.eduke32.com/eduke32@2214 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-26 15:44:23 +00:00
helixhorned
b30711586b patch up another out-of-bounds access in the voxel drawing code, though
I'm not sure whether the increased array size is enough.

git-svn-id: https://svn.eduke32.com/eduke32@2213 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-26 15:44:09 +00:00
helixhorned
7baaa44e28 savegame.c: fix initial setting of compression threshold on savegame load;
64-bit fixes

git-svn-id: https://svn.eduke32.com/eduke32@2212 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-26 14:37:34 +00:00
helixhorned
0bf329e70d start CON code at script[3] instead of script[1]. The 'move' command permits
the constants 0 and 1, and moveptrs may reference the script up to index 2
then (though I'm not sure whether the code is reachable with moveofs either
0 or 1), so make sure it's nulled instead of whatever happened to compile at
the first two positions.  Move 1 is only used once in the original cons,
when frozen and being shattered.

git-svn-id: https://svn.eduke32.com/eduke32@2211 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:35:06 +00:00
helixhorned
5ef480ad7a fix displaying the screenshot even for old-version savegames.
git-svn-id: https://svn.eduke32.com/eduke32@2210 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:52 +00:00
helixhorned
a3a80467a7 net: send BYTEVERSION as two bytes, high byte first.
Now we don't need to worry about the numbers running out soon.
Bump BYTEVERSION by three to celebrate this, too.

git-svn-id: https://svn.eduke32.com/eduke32@2209 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:37 +00:00
helixhorned
ff6284ea8c Enable SAMESIZE_ACTOR_T described earlier.
git-svn-id: https://svn.eduke32.com/eduke32@2208 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:22 +00:00
helixhorned
b3474c75b2 Rewrite the savegame format in terms of the generic saving/loading system.
This makes savegames practically the same as the initial snapshot of a demo.
Saves are now named 'dukesavX.esv' (demos: 'edemoX.edm').
Additionally, many changes that couldn't/needn't be cleanly separated are added
with this commit:
 - make spriteext_t have the same size across 32/64 bit platforms (actor_t partially)
 - prevent saving/loading in MP games (it certainly didn't work and still doesn't)
 - it's time we start using assertions! Define NDEBUG for releasse builds.
 - reset savegame major and minor versions (we have a new magic string, so no conflict)

git-svn-id: https://svn.eduke32.com/eduke32@2207 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:34:06 +00:00
helixhorned
61257b0f6b Rewrite a couple of lines in clearfrags() to look more idiomatic.
git-svn-id: https://svn.eduke32.com/eduke32@2206 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:33:37 +00:00
helixhorned
9f2153d0ea Beauty tweaks; revert s_buildDate since we don't want windows builds to pull
snapshots in the current development state now.

git-svn-id: https://svn.eduke32.com/eduke32@2205 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:33:24 +00:00
helixhorned
664e0dcb9b Fix non-TROR build and add a warning that such a build is only useful for
debugging, i.e. savegames and the like will break.

git-svn-id: https://svn.eduke32.com/eduke32@2204 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:33:02 +00:00
helixhorned
e1a10b2d57 Eh, fix out-of-bounds issue in clearfrags() with MAXPLAYERS players.
It was identified with the clearfrags rewriting, but not corrected.

git-svn-id: https://svn.eduke32.com/eduke32@2203 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:32:44 +00:00
helixhorned
8ecb6e6bd5 Factor out filename-based music setup code into G_SetupFilenameBasedMusic.
There were two instances of nearly identical code in premap.c and savegame.c.
Also identifies a (harmless) problem with realloc'ing, we had:

    if (len+1 > sizeof(MapInfo[...].musicfn))
        MapInfo[...].musicfn = Brealloc(MapInfo[...].musicfn, len+1)

which reallocs almost all the time (since .musicfn is a pointer). Now we do
realloc every time...

git-svn-id: https://svn.eduke32.com/eduke32@2202 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:32:30 +00:00
helixhorned
bf00465922 premap.c: write out inline function clearfrags() for clarity.
git-svn-id: https://svn.eduke32.com/eduke32@2201 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:32:14 +00:00
helixhorned
9a3ae8df08 misc. cleanup in savegame.c
git-svn-id: https://svn.eduke32.com/eduke32@2200 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:32:00 +00:00
helixhorned
24e4d93226 Rewrite EDuke32's -d<demofile> option parsing code. Writing into argv[i]
isn't very wise. Also resize firstdemofile[] to BMAX_PATH bytes.

git-svn-id: https://svn.eduke32.com/eduke32@2199 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:31:46 +00:00
helixhorned
be84374899 Remove written-out savegame.c function declarations from demo.c and include
savegame.h instead.

git-svn-id: https://svn.eduke32.com/eduke32@2198 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:31:30 +00:00
helixhorned
41db6bc512 Remove 'projectile' field from actor_t because it was entirely unused.
WARNING: This silently breaks savegames on 64-bit platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2197 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:31:14 +00:00
helixhorned
60fa7d9f00 Remove a few unused variables from global.[ch], update build date string.
git-svn-id: https://svn.eduke32.com/eduke32@2196 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-25 15:30:50 +00:00
helixhorned
4fd25d1eab minor cosmetic tweaks in sector.[ch] and a off-by-one limit correction there
git-svn-id: https://svn.eduke32.com/eduke32@2195 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:43:39 +00:00
helixhorned
2f7851336b Fix out-of-bounds write when passing a map filename to Mapster32.
git-svn-id: https://svn.eduke32.com/eduke32@2194 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:43:24 +00:00
helixhorned
b72972e43b Lunatic: actor. (Needs SAMESIZE_ACTOR_T, which is not yet enabled)
git-svn-id: https://svn.eduke32.com/eduke32@2193 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:43:08 +00:00
helixhorned
f12bd9f13d misc. beautifying some game code...
git-svn-id: https://svn.eduke32.com/eduke32@2192 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:42:49 +00:00
helixhorned
6b913a39aa some more clearbuf -> memset in gamedef.c plus add a forgotten keystatus
reset in the editor

git-svn-id: https://svn.eduke32.com/eduke32@2191 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:42:32 +00:00
helixhorned
a7d1177d23 savegame.c: minor cleanup and crash prevention in doloadplayer2
if loading directly from file to state.

git-svn-id: https://svn.eduke32.com/eduke32@2190 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:42:12 +00:00
helixhorned
eee507741d CON parser cleanup: In C_Compile, initially clear three arrays with
Bmemset(..., 0, sizeof(...)) instead of clearbuf(..., MAX..., 0),
because the latter would clear only half of the data on 64-bit platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2189 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:41:55 +00:00
helixhorned
89d321c01f In EDuke32 loading/saving menus, when finding old version savegame, display
some information about it instead of simply omitting it.
Internally, struct savegame --> struct savegame_ for easier grepping.

git-svn-id: https://svn.eduke32.com/eduke32@2188 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:41:38 +00:00
helixhorned
297738389a actor t_data commoning: forgot do add a #define in duke3d.h
git-svn-id: https://svn.eduke32.com/eduke32@2187 1a8010ca-5511-0410-912e-c29ae57300e0
2011-12-21 18:41:17 +00:00
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
helixhorned
d37ef521fb A couple of small tweaks:
- fix arg checking in checkdefs.sh
 - some tilenum and quote ID validation in the CON interpreter
 - G_DrawDigiNum and friends: eliminate redundant strlen calls

git-svn-id: https://svn.eduke32.com/eduke32@2086 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:46:51 +00:00
helixhorned
35a151d2cd Workaround (two, actually) for the hardware gamma bug in 8-bit fullscreen with
ATI cards.
From the time of OpenGL initialization, gamma lookup in classic/fullscreen
will be done in software. Before that, always do a setgamma() after setting the
palette, since this is what resets the HW gamma. However, this may lead to
unappealing artifacts with portions of the scene being sent to the screen with
different gammas.

git-svn-id: https://svn.eduke32.com/eduke32@2085 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-27 13:14:22 +00:00
helixhorned
53a670e1f0 Makefile: remove ebacktrace1.dll as dependency to eduke32 and mapster32 and
add it to the 'all' target instead
source/midi.c: eliminate one 'variable set but not used' warning

git-svn-id: https://svn.eduke32.com/eduke32@2084 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-27 13:14:06 +00:00
helixhorned
d016dbd5e4 Comment out some unnecessary lines in animvpx.c
git-svn-id: https://svn.eduke32.com/eduke32@2083 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-27 13:13:51 +00:00
helixhorned
cb950911a0 Comment out some leftover code from the "make back-facing switches invisible"
hack.

git-svn-id: https://svn.eduke32.com/eduke32@2082 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-27 13:13:37 +00:00
helixhorned
f938e0bc11 Bash helper script to find wrongly-cased file names in DEFs and
maybe replace them with the proper names.

Usage:
checkdefs.sh <some.def> [[<some_dir>] -patch]

<some_dir> is taken to be the base directory of the search path.
-patch uses 'sed -i' to replace the offending findings

git-svn-id: https://svn.eduke32.com/eduke32@2081 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-27 13:13:22 +00:00
plagman
9018359a9e glbuild: tell gl.h not to include the system's glext.h
We pack our own copy of glext.h to avoid build breakages on older environments,
and having gl.h include its own was defeating all that.

git-svn-id: https://svn.eduke32.com/eduke32@2080 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-23 05:02:57 +00:00
helixhorned
aae60f64c2 Eliminate all 'variable ... set but not used [-Wunused-but-set-variable]'
warnings with GCC 4.6 except one in kplib.c

git-svn-id: https://svn.eduke32.com/eduke32@2079 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-17 18:42:10 +00:00
helixhorned
026e1f44e9 Make Polymer's FOV depend viewingrange variable in a 'tangent-linear'
fashion. Among other things, this makes the FOV widening when shrunk
work. User CON code should always check the initial viewingrange value
when attempting to do FOV effects like zoom, because it is not guaranteed
to be 65536 due to different screen aspect ratios etc.

git-svn-id: https://svn.eduke32.com/eduke32@2078 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-17 18:41:38 +00:00
helixhorned
50bc3a3fcb Two tweaks when keying in values directly in the editor's 3D mode.
First, when pressing 'S on signed members (like the shade), display
the real signed value instead of the value cast to an unsigned type.
Second, when aiming at an overwall and pressing G, affect the overwall
instead of the wall. Maybe these changes affect a few other queries too...

git-svn-id: https://svn.eduke32.com/eduke32@2077 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-17 18:41:17 +00:00
helixhorned
d540f18ef4 OSX build: don't include startup window (where the hell is the nib file?); makefile bits for libpng from maxports (dynamically linked, not enabled); update osxbuild.sh so that the 64-bit build links (statically) to libvpx
git-svn-id: https://svn.eduke32.com/eduke32@2076 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-11 16:53:52 +00:00
helixhorned
5b369505f1 mapster32 script: when defining an event, enable it automatically
git-svn-id: https://svn.eduke32.com/eduke32@2075 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-11 16:53:29 +00:00
helixhorned
2247b77126 lunatic: more sandboxing mechanisms, makefile lines for OSX
git-svn-id: https://svn.eduke32.com/eduke32@2074 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-11 16:53:15 +00:00
helixhorned
9196bdbd81 fix osx build: looks like it doesn't have the GL debugging functions
git-svn-id: https://svn.eduke32.com/eduke32@2073 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-11 16:52:53 +00:00
hendricks266
9d04c42219 Tripbombs now stop producing laserlines when they reach invalid space. In effect, tripbombs facing the wrong way will not make infinite laser lines.
fix: http://forums.duke4.net/topic/4907-laserline-crash-bug/

git-svn-id: https://svn.eduke32.com/eduke32@2072 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-10 00:07:00 +00:00
helixhorned
9b04832153 Fix being squished in sectors with little headroom but extended non-blocking
ceilings or floors. In such cases, you're not squished unconditionally (instead
of fetching the ceiling or floor height of the neighbor sector), but TROR isn't
meant for small-scale RoR anyway.

git-svn-id: https://svn.eduke32.com/eduke32@2071 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-03 17:44:06 +00:00
helixhorned
2a4a7cd731 Fix dragpoint()!!! There was a bug that omitted setting the new position of certain wall-points since the TROR introduction.
git-svn-id: https://svn.eduke32.com/eduke32@2070 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-03 17:43:51 +00:00
helixhorned
48c49e751f Initialize prlights[lighti].flags.invalidate with 0 when calling
polymer_addlight().  I have no idea whether it's the 'right' thing,
but it fixes this:

Conditional jump or move depends on uninitialised value(s)
  at polymer_updatelights (polymer.c:5090)
  by polymer_drawrooms (polymer.c:938)
              . . .
Uninitialised value was created by a stack allocation
  at loadmaphack (engine.c:9482)

Fix another uninitialized access when rendering jpegs.

git-svn-id: https://svn.eduke32.com/eduke32@2069 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-03 17:43:36 +00:00
helixhorned
6cfdc2b376 Delete maphack lights when changing from Polymer to another renderer.
This fixes a crash when loading a map afterwards.

Tweak a few debugging messages and some whitespace.

git-svn-id: https://svn.eduke32.com/eduke32@2068 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-03 17:43:16 +00:00
plagman
f08610b6c8 Polymer: support for creating a debugging context in winlayer
This also fixes a warning when building for Windows.

git-svn-id: https://svn.eduke32.com/eduke32@2067 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-03 00:14:56 +00:00
helixhorned
a0b928583b Show fake TROR texture when show-invisibility [I] is on in Mapster32/Polymer.
Also move a 'int16_t editstatus' declaration from polymost.c to engine_priv.h.

git-svn-id: https://svn.eduke32.com/eduke32@2066 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 22:38:09 +00:00
helixhorned
eba8de3007 kextract <groupfile> (without further filenames) lists all files in the GRP.
git-svn-id: https://svn.eduke32.com/eduke32@2065 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 22:37:51 +00:00
helixhorned
b63f7e558b maint: refactor closing cache files and removing duplicate pointers into their own functions
git-svn-id: https://svn.eduke32.com/eduke32@2064 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 22:37:33 +00:00
plagman
8b7af4f486 Polymer: fix stupid typo that broke r2057
git-svn-id: https://svn.eduke32.com/eduke32@2063 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 11:44:05 +00:00
hendricks266
98ae1ce50a fix clobbering of ebacktrace1.dll during synthesis building
git-svn-id: https://svn.eduke32.com/eduke32@2062 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 07:47:18 +00:00
hendricks266
751a0630ef Fix GCC 4.6 out-of-bounds and uninitialized warnings involving bossmove[].
My choice of solution is simply to add an extra set of values duplicating the previous five because doing so would definitely show the user no changes. I could have tinkered with the messy loop where the out-of-bounds references are made but there is no guarantee I could have succeeded or kept compatibility.

git-svn-id: https://svn.eduke32.com/eduke32@2061 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 07:18:49 +00:00
hendricks266
885b9a46fd remove two instances of duplicate USE_OPENGL preprocessor checks missed by the removal of the POLYMOST definition
git-svn-id: https://svn.eduke32.com/eduke32@2060 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 07:18:17 +00:00
hendricks266
05cf720c4d move Electric Fence (EFENCE) handling from build/Makefile to Makefile.common
git-svn-id: https://svn.eduke32.com/eduke32@2059 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 07:16:57 +00:00
plagman
dee99139f5 Polymer: constantly get the textures handle for projective spotlights
Getting the texture handles without requiring invalidation means we can
handle ART-animating tilenums without impacting performance too much.

git-svn-id: https://svn.eduke32.com/eduke32@2058 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 07:09:15 +00:00
plagman
bba68b1913 Polymer: fix horizontal spotlight SEs constantly getting invalidated
Polymer has a hack that snaps horiz values of spotlights between 90 and 110
to 90 and 110 to avoid triggering aliasing artifacts with perfectly horizontal
spotlights. Propagate that change all the way to the spotlight SE sprite so
that the code won't think that the horiz is always different from the light
and mark it invalid each frame.

git-svn-id: https://svn.eduke32.com/eduke32@2057 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 07:09:04 +00:00
plagman
93b4d6182e Polymer: preliminary support for GL_ARB_debug_output
This won't actually do anything until the a debug bit is added when
creating the context, but that requires support for GLX_create_context
which SDL doesn't support. I'll add support for WGL_create_context to
winlayer in a bit as a stopgap.

Also updates our local copy of glext.h with a fresh one from the
Khronos registry.

git-svn-id: https://svn.eduke32.com/eduke32@2056 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 05:56:35 +00:00
plagman
e7c735418f Polymer: Fix upside-down projective textures
We need to Y-invert the projection texcoords when sampling
from the lightmap.

git-svn-id: https://svn.eduke32.com/eduke32@2055 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 03:09:20 +00:00
plagman
7c4b84a8f2 Polymer: apply ART animation to spotlight lightmaps.
git-svn-id: https://svn.eduke32.com/eduke32@2054 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 01:44:54 +00:00
plagman
98b6be4fed Polymer: Discard cached sprite planes on texinvalidate
Sprites would stick with their old material on global palette change.
This goes through all prsprites and clobbers their CRCs so that an
alternate skin / tint / highpal can be applied accordingly.

git-svn-id: https://svn.eduke32.com/eduke32@2053 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 01:00:14 +00:00
plagman
a6d349c90a Polymer: account for model flipping for backface culling.
The winding order of faces is different if only flipping about X or Y,
and we were unconditionally culling CW faces.

git-svn-id: https://svn.eduke32.com/eduke32@2052 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 00:32:00 +00:00
plagman
6863a463b4 polymer: fix leading whitespace in polymer_drawmdsprite
git-svn-id: https://svn.eduke32.com/eduke32@2051 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-02 00:31:46 +00:00
helixhorned
83a359973c fix a stupid copy&paste error that made sector[].ceilingbunch/floorbunch not functioning
git-svn-id: https://svn.eduke32.com/eduke32@2050 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-30 14:30:33 +00:00
helixhorned
b3f1bd409c fix for the fix
git-svn-id: https://svn.eduke32.com/eduke32@2049 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-30 14:02:13 +00:00
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
helixhorned
b391f62ca5 Oops...
git-svn-id: https://svn.eduke32.com/eduke32@1998 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-01 19:58:40 +00:00
helixhorned
8db922737a BACKSPACE key in 3D mode now deletes a red-wall link when aimed at a wall or mask.
With script_expertmode enabled, SHIFT-BACKSPACE clears the upwall link and CTRL-
BACKSPACE the downwall link. These functions are useful because the automatic
nextwall determination code sometimes gets it wrong (not corrupting anything) or
if you want to vertically displace a sector attached to a higher or lower level.
Also add the exploding ceiling example to the TROR test map.

git-svn-id: https://svn.eduke32.com/eduke32@1997 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-01 19:53:05 +00:00
helixhorned
99ce725b60 Much more elegant solution to updating the player's sectnum when passing through
TROR portals that works with a little help from updatesectorz() (change not visible
from CON code). Relies only on the presence of an extension whose portal isn't
blocked and also plays nicely with corner cases like being shrunk and enabling
the jetpack. This should fix the upward moving platforms in WGR2.

git-svn-id: https://svn.eduke32.com/eduke32@1996 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-01 18:38:13 +00:00
helixhorned
b72d351f20 * game and editor: emit a warning when a search-path directory specified
on the command-line isn't found (instead of saying nothing)
* editor: Move inconsistent (stat&2)/heinum detection into the corruption
  checker. This makes a lot of original maps spew countless 'errors', but
  it's preferable for new maps since such floors and ceilings could behave
  strangely with TROR.

git-svn-id: https://svn.eduke32.com/eduke32@1995 1a8010ca-5511-0410-912e-c29ae57300e0
2011-09-01 18:37:53 +00:00
helixhorned
317aca0093 polymost.c: remove the rest of the rendmode 1 and 2 code from the build
git-svn-id: https://svn.eduke32.com/eduke32@1994 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-28 17:31:08 +00:00
plagman
c17818aa6e Polymer: fix leak of GL query objects
In cases where performing occlusion queries for multiple red walls
leading to the same sector, we would sometimes leak a number of
query objects. This was apparently harmless on NVIDIA drivers, but
would leak tons of memory on ATI.

git-svn-id: https://svn.eduke32.com/eduke32@1993 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-28 04:42:27 +00:00
hendricks266
304a2c9feb weapons.con.sample: fix a potential bug modders may encounter: use the special G_Draw temp variables in G_DrawWeaponTile(_crystal) instead of the ones intended for individual drawing states
git-svn-id: https://svn.eduke32.com/eduke32@1992 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-27 05:08:31 +00:00
plagman
95d6c6f281 Polymer: fix sector masks translucency.
The code was using the Polymer-cached version of the sector cstat to
determine the translucency of its diffuse material, meaning it would
never get it right on the first try; that's what you get for having
completely different variables named 's' and 'sec'.

git-svn-id: https://svn.eduke32.com/eduke32@1991 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-21 19:41:34 +00:00
plagman
458ad8fa04 Polymer: Don't draw back faces of sector masks.
We normally enable backface culling always, but turn it off for
two-sided sprites; we need to make sure it's re-enabled after that
as sector masks are drawn after.

git-svn-id: https://svn.eduke32.com/eduke32@1990 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-21 19:41:22 +00:00
hendricks266
233e48141e quotes don't print at all if blank
git-svn-id: https://svn.eduke32.com/eduke32@1989 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-20 23:28:36 +00:00
hendricks266
a34f007fe2 add weapons.con.sample, a direct port of the HUD display code to CON
git-svn-id: https://svn.eduke32.com/eduke32@1988 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-20 23:28:19 +00:00
hendricks266
6cbc6a1a0c add support for the include command to names.h loaded by Mapster32, and names.h no longer requires # in front of commands for CON compatibility
git-svn-id: https://svn.eduke32.com/eduke32@1987 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-20 23:28:14 +00:00
hendricks266
8f55e7c94a change the help dialog to say 'demo.edm' instead of 'demo.dmo', change support for drag and drop demo files from '.dmo' to '.edm', and change the debughelp dialog to remove the reference to the removed '-nD' gamevars.txt dumping parameter
git-svn-id: https://svn.eduke32.com/eduke32@1986 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-20 23:28:06 +00:00