Commit Graph

1838 Commits

Author SHA1 Message Date
helixhorned fd6e36af5a Add bit 16 to the two main setbrightness() users, add bit 2 to one of them.
(I.e. also restore r2232 again.)
The first one is the palette restore logic in G_DisplayRest, the second
is CON setgamepalette, to which the "don't gltexinvalidateall()" bit is
added to mimic the first. Hightile invalidations aren't really useful for
anything other than reloading them after a video mode change, IMO.

These changes mean that
 1) active full screen tints should (almost) always be kept with a basepal
    change. The only exceptions to this are when tints really have to be
    cleared, e.g. when changing the player view in co-op play.
 2) there should be no performance issues with simultaneously changing
    basepals while a tint is applied

git-svn-id: https://svn.eduke32.com/eduke32@2637 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-05 22:22:59 +00:00
helixhorned 1a2c5ee040 Gray out CONTRAST and BRIGHTNESS sliders if no hardware gamma is available.
The sliders themselves still permit changing values, but are drawn with a
'disabled' shade because they're non-functional with software gamma.

git-svn-id: https://svn.eduke32.com/eduke32@2635 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-05 22:22:19 +00:00
helixhorned 008121cffd Some leftover stuff from the Wii patch.
- in actors.c, make a static array const (the original patch removed the
  staticness)
- remove one comment and change some compiled-out code
- remove commented out pre-Makefile.common stuff

Some changes were not adopted from tueidj's patch:
- whitespace cleanup
- ud.config.UseJoystick = 1 in config.c
- Makefile.common, as mentioned before
- proper read-in of g_numRealPalettes, because it was done with r2503

git-svn-id: https://svn.eduke32.com/eduke32@2632 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:41:35 +00:00
helixhorned 1bb6fb5cd4 Patch adding Wii support by tueidj, part 11: miscellaneous changes
- BIGX -> BIGX_, likely again because of a name clash
- make a loop in animlib.c iterate in forward direction

git-svn-id: https://svn.eduke32.com/eduke32@2631 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:41:13 +00:00
helixhorned 68e6141c32 Patch adding Wii support by tueidj, part 10: sound and endianness changes
This part is a mixture of the original patch and my changes.  It seems like
tueidj had some trouble
 1) getting OGG to work, which is why it's conditionally compiled out
 2) struggling with endianness with the mixing routines?  This may be also
    due to him missing to define two others BIGENDIAN macros (our code is
    in need of cleanup there).  Note the change in jaudiolib/src/mix.c!

Because I added my share to this part, I might have actually broken sound
mixing on big-endian platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2630 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:40:53 +00:00
helixhorned dfa212aaf9 Patch adding Wii support by tueidj, part 8: system-specific changes
- conditionally compiles out some code intended for the PC platforms
- compat.c: get home directory routine, access() implementation
- game.c: don't use ioctl(), lower cache1d size to 8 MiB, Wii-specific
  initialization code and application directory ("apps/eduke32")

git-svn-id: https://svn.eduke32.com/eduke32@2628 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:40:08 +00:00
helixhorned 4ec6ffcef8 Patch adding Wii support by tueidj, part 7: networking
This simply macro-defines various low-level networking functions.

git-svn-id: https://svn.eduke32.com/eduke32@2627 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:39:41 +00:00
helixhorned f775faf435 Patch adding Wii support by tueidj, part 5: game-side input device changes
- the crosshair is displayed at the position read from the absolute pointing
  device
- in the menus, use the hat input (that was mapped to mouse buttons in part 4)
  for navigation

git-svn-id: https://svn.eduke32.com/eduke32@2625 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:39:02 +00:00
helixhorned a1d3c2dcea Patch adding Wii support by tueidj, part 4: joystick support
- sdlayer.c: custom "get joystick button names" routine
- jmact/mouse.c: packs some joystick events into the value returned by
  MOUSE_GetButtons(): bits used are 256, 512, 4096, 8192
- MOUSE_Init() --> Mouse_Init(), presumably because of a name clash?
- comments out right-shift of joystick analog values by 5, maybe this fixes
  the scale problems with the joystick on the PC too?

git-svn-id: https://svn.eduke32.com/eduke32@2624 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:38:43 +00:00
helixhorned bd8559f6c3 Patch adding Wii support by tueidj, part 2: Makefile changes
I didn't add Makefile.common, because it needs to be made conditional.

git-svn-id: https://svn.eduke32.com/eduke32@2622 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-01 12:37:53 +00:00
helixhorned 226f04ddae Revert r2232, "don't reset full-screen tint on basepal change" in CON setgamepalette.
Because gltexinvalidate*() could be called too often when setgamepalette is used
while having a tint overlaid else.  Pending thorough analysis/reworking of the
32-bit mode base palette handling / texture invalidation.

git-svn-id: https://svn.eduke32.com/eduke32@2620 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-29 20:55:10 +00:00
helixhorned f5ee6ca7eb Lunatic translator: nearing syntax completion while treading in murky waters.
- bump lpeg stack limit to 1024 (hack) for long if/if/if...else chains
- lexical: newline, EOF and whitespace; "bad" identifiers; hex literals,
           newline terminated strings (allow empty string)
- syntax: allow nesting of array expressions, it's easier than special-casing;
          handle issues with structs expecting parm2 (hackish); userdef;
          switch/case/default
- fix parsing some commands; mind prefixes!
- frontend: if failing match, print last keyword and its position; warn on
  "bad" identifiers (one per such); batch processing from command line
- Files that locate finds from my linux box now pass (except where there are
  really syntax errors).

git-svn-id: https://svn.eduke32.com/eduke32@2616 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-29 20:54:06 +00:00
helixhorned b2b8ab7890 CON palfrom: sanity-check current player and maybe print error message.
git-svn-id: https://svn.eduke32.com/eduke32@2615 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-28 21:56:38 +00:00
helixhorned 5dd8d20e7a Make two-way trains capable of carrying SE49 or SE50 sprites.
git-svn-id: https://svn.eduke32.com/eduke32@2614 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-28 21:56:23 +00:00
helixhorned 475b920e8e Fix 'mulscale' accepting defines or constants where writable var expected.
git-svn-id: https://svn.eduke32.com/eduke32@2613 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-22 19:11:01 +00:00
helixhorned cb8e0d1b57 Lunatic translator improvements.
git-svn-id: https://svn.eduke32.com/eduke32@2612 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-22 19:10:46 +00:00
helixhorned 6d9411f669 Lunatic: preliminaries for persistence
git-svn-id: https://svn.eduke32.com/eduke32@2611 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-22 19:10:29 +00:00
helixhorned 4322dff22c Cleanup in game.c/actors.c part2, only whitespace changes.
git-svn-id: https://svn.eduke32.com/eduke32@2609 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-13 10:46:04 +00:00
helixhorned ab88ea66ef Some cleanup in game.c/actors.c, part 1.
git-svn-id: https://svn.eduke32.com/eduke32@2608 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-13 10:45:49 +00:00
helixhorned 7c8f2c2887 actors.c: factor out various duplicated code in G_MoveEffectors.
- 4 instances -> HandleSE31
- 4 instances -> MaybeTrainKillPlayer
- 2 instances -> MaybeTrainKillEnemies
- move a couple of variables into inner blocks and add 'const' for easier reading

In passing, fix a minor glitch where the squishing sound of an enemy that got
run over by an SE 6 or 14 car would appear to originate from the SE instead
of the enemy's last position.

git-svn-id: https://svn.eduke32.com/eduke32@2607 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-13 10:45:33 +00:00
helixhorned d1fed44da6 Mapster/classic: Make Ctrl-P toggle parallax rendering types in 3D mode again.
Of course, it's just for the heck of it, since this setting is not saved into
MAP files.  I kinda like the cylindrical projection...

git-svn-id: https://svn.eduke32.com/eduke32@2605 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-10 20:14:31 +00:00
helixhorned d44f8c761e Fix flipping masked walls in Mapster/classic.
This has been there since searchbottomwall introduction in r1466.

git-svn-id: https://svn.eduke32.com/eduke32@2604 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-10 20:14:17 +00:00
plagman 1824b820e1 I don't know if that was the intent, but it's better than not building.
git-svn-id: https://svn.eduke32.com/eduke32@2595 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-08 00:01:31 +00:00
helixhorned a18a89b513 Lunatic: prototype of The Translator.
Currently syntax only.  Parses the original scandcode 0x1d files, which is
harder than you'd imagine given the relatively simple structure.  Chokes on
new-gen custom stuff.

git-svn-id: https://svn.eduke32.com/eduke32@2594 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-07 20:10:03 +00:00
helixhorned dbd8745620 Fix CON parser accepting defines and numbers where writable var expected (4 cmds)
git-svn-id: https://svn.eduke32.com/eduke32@2593 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-07 20:09:44 +00:00
helixhorned 9a7d1ed1a5 A couple of less interesting changes.
- strip 'inline' from animateoffs() definition, remove declaration in build.h
- one min/max -> clamp
- one malloc/strlen/strcpy -> strdup

git-svn-id: https://svn.eduke32.com/eduke32@2592 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-05 19:49:54 +00:00
helixhorned c01109c483 m32script: fix some commands breaking too early in case of a failed validation.
If one next instruction happened to be interpreted, madness would ensue,
because the pointer wouldn't be aligned on the "opcode" part anymore.
Also, with "seti", set current sprite index only after a successful validation.

git-svn-id: https://svn.eduke32.com/eduke32@2591 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-05 19:49:30 +00:00
helixhorned 607774a982 New M32Script command "getspritelinktype" <spritenum> <<linktypevar>>.
This get into the writable variable the "linking type" of the sprite with index
<spritenum>.  The result is a bit field of ORed values:
 1: lotag has linking semantics
 2: hitag
 4: extra, 8: xvel, 16: yvel, 32: zvel, 64: owner  (custom only)

Custom setting about which sprites have what kind of linking can be programmed
via EVENT_LINKTAGS: it receives a sprite index as the 'current sprite' and is
supposed to return the bit field in RETURN.

An example which lists sprites and their linking hi- and lotags is provided in
the state 'listusedtags' in a.m32.

git-svn-id: https://svn.eduke32.com/eduke32@2590 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-05 19:49:12 +00:00
helixhorned b85d40ea63 Fix "ignored application parameter" message for short options.
git-svn-id: https://svn.eduke32.com/eduke32@2589 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:58:33 +00:00
helixhorned b7df5ffa5f Big clean up in defs.c and related content. The usual stuff...
- factor out many identical checks in a convenient function; some messages
  may read slightly differently now and tile ranges may be handled more strictly
  (error out if one of the limits is invalid)
- factor out two instances of identical (up to one arg) code into
  tile_from_truecolpic
- factor out setting picsiz[] and stuff into set_picsizanm
- some checks
- Make "undefmodelof" non-functional and warn.
- in "animtilerange", if the tile difference is >= 64, error out since we
  can't store it in picanm[]

git-svn-id: https://svn.eduke32.com/eduke32@2588 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:58:19 +00:00
helixhorned 78aa420de0 Fix "Thanks (...) for giving us big heads" message at the end of Ep4.
This was more or less done by trial and error rather than understanding what
exactly is going on there.  In any case, the code for all the different ending
scenes ought to be factored out instead of being duplicated with subtle
differences every time.

git-svn-id: https://svn.eduke32.com/eduke32@2585 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:57:20 +00:00
helixhorned f8796d1a1b When in GL modes, clear the screen first in some non-in-game places.
This is so that when hud_bgstretch is disabled (i.e. background pictures are
not stretched to the whole screen), the frame buffer has no leftover contents
from previous frames on the sides of the screen. This was particularly noticable
when using the console.
The "places" are the following:
 - before drawing an anim frame
 - before drawing a "full-screen" background
 - while displaying logo, titlescreen, loadscreen
(this leaves a couple others which I didn't test, and didn't tweak)

git-svn-id: https://svn.eduke32.com/eduke32@2584 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:57:06 +00:00
helixhorned cd2ae337a2 game.c: fadepal{,tile}'s limits are now always inclusive; rewrite to avoid code dup.
Also, do a setpalettefade(..., end) when breaking fadepaltile now, too.

git-svn-id: https://svn.eduke32.com/eduke32@2583 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:56:50 +00:00
helixhorned 2113959dd5 game.c: make fadepal/fadepaltile first calculate inclusive end limit.
When requesting an increasing ramp, the upper limit is taken to be exclusive.
When it is passed to G_FadePalette, only the lowest 6 bits are passed further
to setpalettefade, which means that a limit of 64 is incorrectly set as 0.
Also, when breaking from the fade loop, set the fade value to the end one for
fadepal!

git-svn-id: https://svn.eduke32.com/eduke32@2582 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:56:31 +00:00
helixhorned fa1521703c game.c: factor out a couple of often-used few-liners, make Ep3 ending cancelable.
git-svn-id: https://svn.eduke32.com/eduke32@2581 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-04 18:56:16 +00:00
helixhorned 015affaa27 CON showview/showviewunbiased: silently clamp 'horiz' to HORIZ_MIN..HORIZ_MAX.
git-svn-id: https://svn.eduke32.com/eduke32@2575 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-31 11:22:32 +00:00
helixhorned 34c0e85295 Allow the screen bounds difference in CON showview/-unbiased to be less than 2.
This requires one tweak in drawrooms' umost/dmost setup to prevent oob access.
Specifically, a coordinate difference of 0 is allowed.  In the classic renderer,
this would mean a one-pixel (real screen coords) height or width.  In Polymost,
it would currently mean a one-pixel height and zero-pixel width, but this might
be subject to change.

git-svn-id: https://svn.eduke32.com/eduke32@2574 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-31 11:22:19 +00:00
helixhorned 1ae1bfa479 New CON command 'showviewunbiased', mapping the screen coords w/o round-to-0 bias.
The showview command transforms the 320-based screen bound coordinates to the real
screen bounds like xreal = (x*xdim)/320, which shows a bias towards zero: for
example, for a 1680 screen width, the maximum permissible value 319 is mapped to
round_to_zero((319*1680)/320) == 1674.  (The rounding is implicit in the integer
division).  This makes it impossible for a view to cover the whole screen with any
other resolution than 320x200.  The new command transforms the bounds like
xreal = (x*(xdim-1))/319, which would map 319 to 1679 in the preceding example.

git-svn-id: https://svn.eduke32.com/eduke32@2573 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-31 11:22:00 +00:00
helixhorned 0be9b7e568 Make makepalookup() accept NULL for 'remapbuf', meaning "use identity mapping".
Also,
 - use this in game.c and astub.c palookup loading code
 - when makepalookup() is passed a 0 palnum, return early.  This means that
   'fogpal' will silently fail when attempting to change pal 0.
 - in 'makepalookup' DEF command, error out if passed a pal of 0.

git-svn-id: https://svn.eduke32.com/eduke32@2569 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-29 21:17:03 +00:00
helixhorned 4e904839dc In OpenGL modes, save savegame screenshots as they appear on the screen.
Instead of drawing the rooms and masks with the classic renderer once.
The captured scene is transformed to use the base palette, so that the
screenshot will also show up in classic.  No aspect correction is done.

git-svn-id: https://svn.eduke32.com/eduke32@2567 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-29 21:16:20 +00:00
helixhorned c5d8aa29ee The obligatory portion of trivial stuff.
git-svn-id: https://svn.eduke32.com/eduke32@2566 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:45:25 +00:00
helixhorned a7ec51e375 Clean up astub.c in a similar fashion to the preceding changes.
git-svn-id: https://svn.eduke32.com/eduke32@2564 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:44:47 +00:00
helixhorned b06ce8456a Make g_grpNamePtr memory-clean, extern clearGrpNamePtr().
git-svn-id: https://svn.eduke32.com/eduke32@2563 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:44:33 +00:00
helixhorned 3deb8d1d99 Clear up handling of g_*NamePtr in the game.
The primary change is that things have been made memory-clean.  Some of these
pointers may point to wildly different places during the course of the program
such as statically or dynamically allocated storage, the buffer returned by
getenv() (which must not be modified according to the docs), or an element of
argv[].  Consequently, we need to strdup, or better, dup_filename them if they
are ever to be passed to a function that modifies their pointed-to data.

Specifically:
 - added statics or consts according to usage
 - 3 new functions clear{Grp,Def,Script}NamePtr, only 'Def' one extern for now
 - in G_CheckCommandLine, don't strip 'const'; use Bstrncpyz where appropriate
 - remove multiple declarations

Also, warn if an application parameter has been ignored (not matched).

git-svn-id: https://svn.eduke32.com/eduke32@2561 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:44:00 +00:00
helixhorned 77918caf9c New helper function "char *dup_filename(const char *fn)" in common.h.
It allocates a buffer of size BMAX_PATH and copies the passed string into it.

git-svn-id: https://svn.eduke32.com/eduke32@2560 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:43:39 +00:00
helixhorned 0e3adea64e Replace various occurences of "Bstrncpy(buf, src, sz); buf[sz-1]=0;" with Bstrncpyz
git-svn-id: https://svn.eduke32.com/eduke32@2559 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:43:21 +00:00
helixhorned 26d2cf7e01 Replace {get,clear}filenames and duplicate autoload code in astub.c/game.c.
This additionally fixes leaks that were caused by traversing the file name
list with the 'findfiles' pointer and not clearing them afterwards (even if
there was a handle to the list head via 'findfileshigh').

git-svn-id: https://svn.eduke32.com/eduke32@2557 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:42:32 +00:00
helixhorned 0c5c58cbbb Replace {get,clear}filenames with fnlist functions in build.c, menus.c and osdcmds.c
git-svn-id: https://svn.eduke32.com/eduke32@2556 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:42:16 +00:00
helixhorned a7f6f3bacc Factor out different {clear,get}filenames definitions into fnlist_t + functions.
Don't actually replace the instances in the code now.
Additions in common.h:
 - fnlist_t, which combines CACHE1D_FIND_REC *finddirs, *findfiles and
   int32_t numdirs, numfiles
 - the FNLIST_INITIALIZER macro, which MUST be used for automatic variables
 - fnlist_clearnames, fnlist_getnames functions
 - G_LoadGroupsInDir, G_DoAutoload, two often-occurring uses of these

git-svn-id: https://svn.eduke32.com/eduke32@2555 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:41:57 +00:00
helixhorned d77e388522 Factor out eleven (!) instances of identical code into check_file_exist().
git-svn-id: https://svn.eduke32.com/eduke32@2554 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-28 19:41:39 +00:00
helixhorned 68f0842b85 Fix a potential sprintf to a buffer passed to it as a string argument.
git-svn-id: https://svn.eduke32.com/eduke32@2552 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:06:05 +00:00
helixhorned af9db8cfa2 Mapster32: fix specifying a custom configuration file with -cfg.
We were writing into a string literal. Ouch!

git-svn-id: https://svn.eduke32.com/eduke32@2551 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:05:51 +00:00
helixhorned e7f091cd90 Factor out various instances of getatoken() into common.c.
Alongside, these make into into the header:
 - the 'tokenlist' type (a typedef'd struct)
 - the T_EOF and T_ERROR enumeration values

git-svn-id: https://svn.eduke32.com/eduke32@2549 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:05:23 +00:00
helixhorned e74f8cada1 Replace all occurences of assert in our code with Bassert.
git-svn-id: https://svn.eduke32.com/eduke32@2547 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:04:44 +00:00
helixhorned f0885f665b Capitalize numgrpfiles macro to NUMGRPFILES.
git-svn-id: https://svn.eduke32.com/eduke32@2543 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:03:40 +00:00
helixhorned ee5dd2cf32 Add common.[ch] which should be used for common non-engine types/functions/data.
As inauguration, move G_AddGroup, G_AddPath and struct strllist there.
The header is located in build/include, because in the future, code that resides
closer to (but is not strictly part of) the engine might need to be factored
into here.  The source file, however, is in the source/ directory.

git-svn-id: https://svn.eduke32.com/eduke32@2542 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 22:03:20 +00:00
hendricks266 efb440ada0 All string literals sent as normal messages to the player in-game written in ALL CAPS have been converted by hand to more proper capitalization. (Critical errors have been left as-is, and the editor did not need changes.)
git-svn-id: https://svn.eduke32.com/eduke32@2540 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:07:12 +00:00
hendricks266 9f61e6e2d5 Superficial text changes:
- Help window text cleaned and made more consistent between game and editor
 - Added help entry for "-clipmap"
 - Log text for using CON, DEF, and RTS files has been made consistent
 - All instances of '%s' have been replaced with \"%s\" because ' is a valid filename character. (At least on Windows.)

git-svn-id: https://svn.eduke32.com/eduke32@2538 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:05:57 +00:00
helixhorned ef7ad7b554 Lunatic: more complex gamevar-decl code.
git-svn-id: https://svn.eduke32.com/eduke32@2534 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:01:36 +00:00
helixhorned b897a59d82 Bound-check the 'picnum' argument to rotatesprite; tweak CON digitalnumber check.
There are instances where oob picnums may propagate to that function, so
protect it.  The digitanumber[z] bound check is actually made more permissive,
but could also just as well be removed now.

git-svn-id: https://svn.eduke32.com/eduke32@2533 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:01:21 +00:00
helixhorned 6cd11d0468 Accumulated trivia.
- engine.c: move some variables into a lower block
- premap.c: clearbufbyte --> Bmemset

git-svn-id: https://svn.eduke32.com/eduke32@2532 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:01:03 +00:00
helixhorned c4efd9b1fa Take over more correct G_AddGroup from game.c to astub.c.
The code in the editor was potentially doing a strcat on a strdup'd string.
Also, rename AddGamePath to G_AddPath in astub.c and add CODEDUP markers
because shared stuff like this ought to be factored out into a separate
source file some time.

git-svn-id: https://svn.eduke32.com/eduke32@2531 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:00:42 +00:00
helixhorned 694acef9fe Allow up to 7 skills, coded by M210 and taken over with modifications.
Skill names are defined via 'defineskillname' as before, but the index
of the last non-empty skill name (plus one) is taken as the skill count.
So, if you only define the 6th, there will be no effect.
Note that currently, there is no way to specify less than four skills
because the CON parser doesn't allow the empty string for the name (it'll
go beyond the line) and because the default skill names are initialized in
EDuke32 too, in addition to the CONs.

git-svn-id: https://svn.eduke32.com/eduke32@2530 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 22:00:27 +00:00
helixhorned 386d34e3b4 Fix static-main-arrays debug build, which is without the clipshape feature.
git-svn-id: https://svn.eduke32.com/eduke32@2528 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-25 13:54:46 +00:00
helixhorned cd3947f3f4 Correct 'nofloorpalrange' range clamping, move one get_hud_pal() farther down.
The nofloorpalrange beginning and end indices are silently clamped to 1 .. 255.

git-svn-id: https://svn.eduke32.com/eduke32@2524 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-24 15:59:39 +00:00
hendricks266 62dd05a2e5 Update credits in menus.c with people from the Credits wiki page. Also, fix the text and order of other entries.
git-svn-id: https://svn.eduke32.com/eduke32@2522 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-23 20:24:30 +00:00
hendricks266 64595adfb2 Makefiles:
- Properly handle the architecture definition when BUILD32_ON_64=1
 - Add proper $(*LDFLAGS) to which LTO and ARCH are correctly passed.
 - Cleanup of compiler flag variables.

This should fix to some degree building of the Build tools on OS X, and it may possibly fix the crashing of the OS X x86 32-bit build.

git-svn-id: https://svn.eduke32.com/eduke32@2520 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-23 20:22:10 +00:00
helixhorned b5894eb7e0 Make 'nofloorpalrange' def token affect HUD weapons.
git-svn-id: https://svn.eduke32.com/eduke32@2518 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:47:47 +00:00
helixhorned 5944a9ab0f New game def token "nofloorpal <pbeg> <pend>", disabling sprites taking on floor pals.
It has always annoyed me how floors with "shirt-color" type palookups like 21
affected the color of its containing sprites and HUD-drawn stuff.  This commit
allows one to specify an inclusive range of pals for which this should be
disabled for sprites (but not for HUD stuff, yet).

git-svn-id: https://svn.eduke32.com/eduke32@2517 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:47:29 +00:00
helixhorned 85ab7d2e39 Remove global 'uint8_t *anim_pal' which was only used once as a temporary.
git-svn-id: https://svn.eduke32.com/eduke32@2516 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:47:13 +00:00
helixhorned 3e1a8c523d In Mapster32, remove ReadGamePalette() and GAMEpalette[] and use engine's palette[].
git-svn-id: https://svn.eduke32.com/eduke32@2515 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:46:56 +00:00
helixhorned 46246b8ab7 Comment out computergetinput() and children, which are unused since ng netcode.
git-svn-id: https://svn.eduke32.com/eduke32@2512 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-22 22:46:07 +00:00
hendricks266 270342463f More "malloc + strlen + strcpy --> strdup" in module parameter code.
git-svn-id: https://svn.eduke32.com/eduke32@2506 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-20 19:28:22 +00:00
helixhorned 8a50b75de2 Weirdness removal in G_LoadExtraPalettes (which reads lookup.dat).
- replace bit tweaking for big endian archs with clear code
- allow palette lookups >= 128, previously we read into a signed byte

git-svn-id: https://svn.eduke32.com/eduke32@2503 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-20 18:31:37 +00:00
helixhorned 97020caf73 Clear up after r2495. (Because I'm a pedantic asshole.)
- in Mapster, pre-form the default 10 clip map names before returning from
  G_CheckCommandLine() so it gets loaded even if we passed no cmdline args.
- malloc + strlen + strcpy --> strdup
- don't need to spank dead variables ;)
- we may call calloc with zero size, which isn't bad by itself, but asserting
  for non-null afterwards is.  Allocs of 0 are implementation-defined, and may
  well return a null pointer (C99 7.20.3).

git-svn-id: https://svn.eduke32.com/eduke32@2502 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 23:18:32 +00:00
helixhorned 9628041766 Assorted trivia.
Make some computer Duke opponent variables in player.c static.

git-svn-id: https://svn.eduke32.com/eduke32@2501 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 23:18:12 +00:00
helixhorned 68603b0a28 Mapster32 tag-label system: don't consider 'switch' walls with an upwall as linking.
git-svn-id: https://svn.eduke32.com/eduke32@2496 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 23:16:37 +00:00
hendricks266 cf2b9ec940 New "-clipmap" command-line switch to specify sector collision clip maps. This switch works in an additive fashion like -mx and -mh. _clipshape0.map through _clipshape9.map remain loaded by default.
Also, a very minor change in the con/def module code. (int --> int32_t)

git-svn-id: https://svn.eduke32.com/eduke32@2495 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-18 08:50:41 +00:00
helixhorned 0f7615daf7 Remix undo/redo system, fixing potential access of freed memory.
A run of consecutive mapstates may share sector/wall/sprite blocks, but
the code was deciding whether to free them solely on local properties.
Now, save a reference count at the beginning of each such allocated block
and free it only if it reaches zero.

git-svn-id: https://svn.eduke32.com/eduke32@2492 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:35:35 +00:00
helixhorned 4412d5729e In undo/redo, always print the revision that got _restored_.
git-svn-id: https://svn.eduke32.com/eduke32@2491 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:35:16 +00:00
helixhorned 5246f17169 "Promote" oob sectnum/statnum sprites to corruption level 4.
Also, always print at least level 5 corruptions (that is, have no instances
of completely silent corruptcheck).

git-svn-id: https://svn.eduke32.com/eduke32@2490 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:34:54 +00:00
helixhorned 4042fa90c4 Mapster32: sprite list consistency checker in corruptcheck.
This checks for about every possible type of sprite list corruption and
reports back with a corruption level 5 if one of the 14 validations fail.

git-svn-id: https://svn.eduke32.com/eduke32@2489 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:34:32 +00:00
helixhorned d1538d5dfd Tweak Mapster32's sound index (F2).
- start scrolling from about half of the visible page
- PGUP/DGDN moves the cursor by 1/4 of the page
- code cleanup (we only need one displine[80], use clearkeys())

git-svn-id: https://svn.eduke32.com/eduke32@2488 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-17 11:34:09 +00:00
helixhorned 5e1b3bd44b Re-enable Mapster32's undo/redo functionality.
git-svn-id: https://svn.eduke32.com/eduke32@2486 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-15 18:12:17 +00:00
helixhorned 65fe7ce3bd This should fix the assertion failure with undo/redo, my failure in r2478.
git-svn-id: https://svn.eduke32.com/eduke32@2485 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 23:17:54 +00:00
helixhorned cf56956dff Make 'Numsprites' also accessible from CON (read-only) under the same name.
Note the capitalization. I hope that this makes clashes with user variable
names less likely.

git-svn-id: https://svn.eduke32.com/eduke32@2484 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:32:04 +00:00
helixhorned acc2a2f70e Save 'Numsprites' into savegames and mapstates. Bump savegame minor version.
git-svn-id: https://svn.eduke32.com/eduke32@2483 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:31:49 +00:00
helixhorned 76de780d8b Fix (still not enabled) undo/redo code compilation.
Also include one comment about a currently failing assertion there.

git-svn-id: https://svn.eduke32.com/eduke32@2482 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:31:32 +00:00
helixhorned fbf0b9ea4f Include <assert.h> in compat.h.
git-svn-id: https://svn.eduke32.com/eduke32@2481 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:31:19 +00:00
helixhorned 4d4221d71f Continuously keep track of the number of sprites in the world.
New engine variable 'int32_t Numsprites', not yet saved into savegames
or mapstates. (The capitalization is to distinguish it from the often-used
'numsprites' locals or structure member names.
In the editor, get rid of updatenumsprites().

git-svn-id: https://svn.eduke32.com/eduke32@2478 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-14 22:30:24 +00:00
helixhorned 26dfddfaf0 Trivial stuff that got accumulated and not committed.
git-svn-id: https://svn.eduke32.com/eduke32@2471 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:07:40 +00:00
helixhorned b044502709 When deleting sprites, insert them at the tail (instead of head) of the freelist.
The major outside-visible change is that this fixes the sound cutoff bugs that
happened because newly-spawned sprites took the place of those whose sounds
had not yet finished playing.

Besides, there are these changes:
 - remove deletesprite{sect,stat}
 - we have a new engine variable 'tailspritefree' that keeps track of the
   sprite freelist tail
 - we need to store it in savegames and mapstates, so bump the savegame
   minor version

git-svn-id: https://svn.eduke32.com/eduke32@2470 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:07:17 +00:00
helixhorned a673b762d0 Remove old functions from savegame.c.
git-svn-id: https://svn.eduke32.com/eduke32@2464 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:05:33 +00:00
helixhorned b359d0dce9 engine cleanup: make pow2char and pow2long const, make voxlock static.
git-svn-id: https://svn.eduke32.com/eduke32@2463 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:05:20 +00:00
hendricks266 c5519e3fe8 More Build tools improvements:
- JFBuild ports: arttool, givedepth, and mkpalette
 - All viable tools are now built when 'make utils' is invoked, not just some
 - Revert "initprintf" hack of previous commit and replace it with "compat_tools.c"
 - Move Bstrtolower from baselayer.c to compat.c
 - Makefiles: Add start and finish messages for the tools
 - Makefiles: To prevent "-Wimplicit" from being passed to the C++ compiler, create $(*CONLYFLAGS)

git-svn-id: https://svn.eduke32.com/eduke32@2458 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-12 04:48:42 +00:00
hendricks266 858746d081 Fix JonoF's email address.
git-svn-id: https://svn.eduke32.com/eduke32@2456 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-12 04:47:04 +00:00
helixhorned 8f8bb68ace Rename ud.clipping to ud.noclip internally for sanity.
This might now be even more confusing for users reading both the source
and CON code (where the access is necessarily still via '.clipping'),
but at least reading the source now makes sense :P

git-svn-id: https://svn.eduke32.com/eduke32@2454 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:38:50 +00:00
helixhorned c0228fa14c After executing actor or loadactor CON code, null the instruction pointer.
This is so that in the event of a crash, no CON dump will be printed if no
(actor or loadactor) CON code was actually executing at the time of the
crash, confusing the users.  Note: doesn't apply for event code.

git-svn-id: https://svn.eduke32.com/eduke32@2453 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:38:27 +00:00
helixhorned bdc02d36d9 Explicitly call A_DeleteSprite() from game code instead of relying on macro expansion.
git-svn-id: https://svn.eduke32.com/eduke32@2452 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:38:13 +00:00
helixhorned 3917e05c1e Remove non-SAMESIZE_ACTOR_T code and remaining #defines.
We've been running with same-sized actor_t for a while without problems now.
In the unlikely event (famous last words) that an issue should pop up later,
this revision should be consulted for the differences between the two versions.

git-svn-id: https://svn.eduke32.com/eduke32@2451 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:37:50 +00:00
helixhorned af2f862c85 Remove YES and NO #defines from duke3d.h since they're giving warnings on OS X.
git-svn-id: https://svn.eduke32.com/eduke32@2450 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:37:25 +00:00
helixhorned ba9a3f9d1b Save TROR-related information into map states and bump BYTEVERSION.
git-svn-id: https://svn.eduke32.com/eduke32@2449 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:37:08 +00:00
helixhorned ea9ecf0735 Remove a couple of redundant declarations in actors.c and gameexec.c.
git-svn-id: https://svn.eduke32.com/eduke32@2447 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:36:32 +00:00
helixhorned dccb559df6 M32Script: fix twisted pstat/nstat and psect/nsect references.
git-svn-id: https://svn.eduke32.com/eduke32@2446 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-11 17:36:16 +00:00
helixhorned 95cbdbd1be Rename SOUNDOWNER's (used in sound_t) member .i to .ow for easier grepping.
git-svn-id: https://svn.eduke32.com/eduke32@2442 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-10 21:22:44 +00:00
helixhorned a2328cd597 With dndebug, show the currently playing sounds.
The format is
 snd #<sound number>
 inst <instance of that sound>:
 voice <internal voice handle>,
 ow <owner's sprite ID/-1>  (this is the interesting part)

git-svn-id: https://svn.eduke32.com/eduke32@2441 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-10 21:22:22 +00:00
helixhorned 139b2086c1 Rename P_ActivateSwitch()'s 3rd argument from 'switchtype' to 'switchissprite'.
git-svn-id: https://svn.eduke32.com/eduke32@2440 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-10 21:22:03 +00:00
helixhorned 4659b691e6 Some sound source cleanup, no functional changes.
- make a couple variables static in sounds_mapster32.c
- KHz --> Hz in initialization text

git-svn-id: https://svn.eduke32.com/eduke32@2439 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-10 21:21:42 +00:00
hendricks266 7bcb4a1faf OS X: Since the posix_memalign function causes problems when running on 10.5, not just building, I am making this more "risky/daring" change because OS X guarantees 16 byte alignment so it should be safe.
git-svn-id: https://svn.eduke32.com/eduke32@2434 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-09 07:57:00 +00:00
hendricks266 92b49b6938 OS X: fix build under Leopard/Xcode 3.1.4
git-svn-id: https://svn.eduke32.com/eduke32@2432 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-09 07:43:49 +00:00
hendricks266 9f78a773f1 Add "OSX_STARTUPWINDOW" Makefile variable to toggle the OS X startup window. Off by default.
git-svn-id: https://svn.eduke32.com/eduke32@2426 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-08 06:07:10 +00:00
hendricks266 35937454ad Fix -Wformat-security and -Wformat-extra-args warnings under clang.
git-svn-id: https://svn.eduke32.com/eduke32@2421 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-05 07:25:24 +00:00
hendricks266 3fdb7ee8fc Rewrite code for the "-rts" command line parameter to remove an unnecessary int32_t, prevent needless string copying, factor out duplicate math, centralize the default RTS name, and prevent clobbering of the RTSName CFG setting.
git-svn-id: https://svn.eduke32.com/eduke32@2420 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-05 07:24:34 +00:00
hendricks266 1c2ea1e96e Add "echo" CON command which allows the user to print a quote only to the console and log file, for debugging or informational purposes. EVENT_INIT can finally be put to use!
git-svn-id: https://svn.eduke32.com/eduke32@2419 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-05 07:24:04 +00:00
helixhorned f12b09b512 Tweak 'dncoords' display.
added: sector extra; viewingrange and yxaspect before the main drawrooms call
removed: randomseed

git-svn-id: https://svn.eduke32.com/eduke32@2413 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 20:14:32 +00:00
helixhorned fbbefc0df9 sector.c: fix a possible oob access of a local array.
git-svn-id: https://svn.eduke32.com/eduke32@2411 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 20:14:01 +00:00
helixhorned 5791d5e068 Clamp ud.camerahoriz after EVENT_DISPLAYROOMS (instead of before).
git-svn-id: https://svn.eduke32.com/eduke32@2410 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 20:13:47 +00:00
hendricks266 56c002d3a1 Add APPLE_FRAMEWORKS Makefile variable which can be passed to the make invocation.
ex: make APPLE_FRAMEWORKS=~/Library/Frameworks

git-svn-id: https://svn.eduke32.com/eduke32@2398 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 09:31:37 +00:00
hendricks266 27b279a1ce JFDuke3D port: OS X Startup Window, copied almost verbatim
It needs to have the sound quality box removed and the Game directory box added, possibly among other things.

git-svn-id: https://svn.eduke32.com/eduke32@2396 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 09:30:27 +00:00
hendricks266 56b40e233e JFDuke3D port: Display DUKETEAM.ANM at the end of episode 3 under v1.3D.
Fix for end-of-game sequence with 1.3D data, by Turrican.

git-svn-id: https://svn.eduke32.com/eduke32@2395 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-04 09:29:05 +00:00
helixhorned e5a133db8b When failing to open a savegame file for writing, print the reason to the log.
git-svn-id: https://svn.eduke32.com/eduke32@2393 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-01 23:35:53 +00:00
helixhorned edb110b692 More rebust (and "correct"/expected) decimal number parsing in CON.
The replacement of atoi with strtol in r2374 had the side-effect that numbers
out of the range of a 32-bit integer were being returned as LONG_MAX/LONG_MIN
instead of being converted by taking the bits and re-interpreting them (note
that it was a coincidence that atoi behaved that way; to be strict, the
behavior was undefined and there is no regression).

Now, we implement parsing decimal integers using strtoll (with assuming
"long long" being the same as int64_t) and check in which range the number
falls.  If it's in the range (INT32_MAX <= x <= UINT32_MAX), issue a warning;
if it's not in (INT32_MIN <= x <= UINT32_MAX), warn too (though this better
ought to be an error?).  In each case, the bit representation is converted to
the CON number type (int32 to assume maximum portability) by re-interpreting
the bits [this is the same as an int/int cast, with GCC at least; more
generally, it's implementation-defined per C99].

git-svn-id: https://svn.eduke32.com/eduke32@2392 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-29 15:27:40 +00:00
helixhorned 925b27e3cd Try to find another mirror wall if the assigned one breaks.
This fixes mirrors consisting of more than one walls not drawing when the
first assigned mirror wall breaks. It still does not let you have more
than one mirror (i.e. mirror sectors) showing up at the same time in
the scene.  Affects classic and Polymost only.

git-svn-id: https://svn.eduke32.com/eduke32@2387 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-25 15:59:44 +00:00
helixhorned 0175562e1f Do bound check for "quick" sector/wall accesses from CON, i.e. in getvarvar.
This was causing oob sector accesses with code like this:
    getwall[hitwall].nextsector temp
    ifvarvare sector[temp].floorz sector[temp].ceilingz setvar tempb 1
(from DT's HYPERCORE).

Also validate quote indices passed to CON's quote and userquote commands at
runtime.

git-svn-id: https://svn.eduke32.com/eduke32@2381 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-24 19:51:54 +00:00
helixhorned 668774c12e Fix user quotes colored with a 2-digit number being wrongly x-aligned.
Such game text was shown starting from about the center of the screen.
The reason for the bug was this code:
  t += 1 + isdigit(*(t+2));
The sequence points here are at the beginning and end of this assignment
expression, and the updating of t may happen anywhere between these (C99
6.5.16 #3).  Please don't write such code.  When in doubt, and assignment
and reference to the same object should be split!

git-svn-id: https://svn.eduke32.com/eduke32@2380 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-24 19:51:37 +00:00
helixhorned 0919c186ba Pull the 'for (' ... ')' out of the TRAVERSE_{CONNECT,SPRITE_*} macros.
This plays more nicely with automatic formatters.  Also indent accordingly.

git-svn-id: https://svn.eduke32.com/eduke32@2379 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-21 19:33:33 +00:00
helixhorned 0309ba3141 QUOTE_NVG_OFF-p->heat_on --> QUOTE_NVG_OFF-!!p->heat_on in sector.c.
Because: 1) It used to be like this; 2) guard against bad CON input.

git-svn-id: https://svn.eduke32.com/eduke32@2378 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-21 19:33:09 +00:00
helixhorned 0f933a8522 Fix potential (certain?) oob access with ST28/SE21.
Encountered with Scent.map.  Since the SE21 are deleted after they have
been used, the search for them in the ST28 code in sector.c may come up
empty, in which case sector[-1] would be accessed.

git-svn-id: https://svn.eduke32.com/eduke32@2377 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-21 19:32:55 +00:00
helixhorned cf9e0490a2 Uncomment "CrosshairColor" parsing code in config.c.
Untested, but LeoD says it works.

git-svn-id: https://svn.eduke32.com/eduke32@2375 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 21:18:57 +00:00
helixhorned 8b7a4dab9b Define Batoi/Batol to strtol(...) in compat.h and use these when necessary.
That is, everyplace a user input is to be converted.  The only remaining
instance of atoi() is now atoi(s_buildDate).

git-svn-id: https://svn.eduke32.com/eduke32@2374 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 21:17:39 +00:00
helixhorned 80bd1bb4e4 engine: make neartag accept a sprite-blacklist function and use it in sector.c.
Internally, the last argument to neartag is now a pointer to a function
  int32_t (*blacklist_sprite_func)(int32_t i),
which is supposed to return 1 if sprite[i] should NOT be considered for hitting.

This is now used in the hard-coded neartag() calls in sector.c, but not in any
way in CON (there's neither a C blacklist function provided, nor is there a
possibility to define one in CON).  There, all sprites with picnums >=1 and <=10
(i.e. the effectors) will be blacklisted.  This remedies problems where such
sprites would get in the way of switches.

Note that a whitelist approach (only consider a predefined set, namely those
picnums which will be checked afterwards) has back-compatibility implications
since people may have used e.g. lotagged window sprites to cover a switch.

Also, the >=1 to <=10 range is [sic] (the static, not dynamic values are used),
since anyone redefining effector picnums is clearly out of their mind.

git-svn-id: https://svn.eduke32.com/eduke32@2373 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 19:54:24 +00:00
helixhorned be0d5a7885 Use maps selector: draw files found in ZIPs with pal 8.
git-svn-id: https://svn.eduke32.com/eduke32@2370 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-20 19:53:07 +00:00
helixhorned 97ebb029d6 Make compiler happy: remove 'may be used uninitialized' warning in multivoc.c.
I'm not getting this warning (synthesis is) but I think it's justified because
the VOC block parsing code isn't terribly validating...

git-svn-id: https://svn.eduke32.com/eduke32@2364 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 22:15:35 +00:00
helixhorned 103a6e76f9 constify various cache1d and pragmas functions, some copybuf* -> memcpy/move.
The following functions have const qualifiers attached for the 'destination'
arguments: kdfwrite, dfwrite in cache1d.c and copybuf{byte,reverse,} in the
pragmas source or headers.  A couple uses of the latter ones were replaced
with calls to standard library functions.

git-svn-id: https://svn.eduke32.com/eduke32@2361 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 22:14:45 +00:00
helixhorned 1ad110ff6a menus.c: rename _bar to sliderbar.
git-svn-id: https://svn.eduke32.com/eduke32@2359 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 17:56:52 +00:00
helixhorned 079056df67 Menus: make aspect ratio also control r_usenewaspect.
- RENDERER SETUP is now also accessible from classic, with only 2 options:
  'aspect ratio' and 'ambient light level'
- remove the latter option from the VIDEO SETUP menu
- When compiled with OpenGL, the aspect ratio option cycles between 3 states:
  r_usenewaspect=1 (the modern way), and r_usenewaspect=0 but r_widescreen=0/1.
  In non-GL builds, there are only 2 states.
- don't display black translucent overlay in COLOR CORRECTION menu

git-svn-id: https://svn.eduke32.com/eduke32@2358 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 17:56:39 +00:00
helixhorned e14b2808ef Fix non-OpenGL build.
git-svn-id: https://svn.eduke32.com/eduke32@2357 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-18 17:56:26 +00:00
helixhorned 0ef1721955 Mapster32: Fix extended ceiling/floor picnums taking on picnum 0 in Polymer.
The reason was that drawmasks(), which was where the resetting of the fake
RoR textures happened under Polymer, can be called from polymer_displayrooms()
when mirrors are present. I was assuming that drawmasks() was only ever called
after the 'main' drawrooms and that hence the sequence of fake RoR tile tweaking
was set, reset, set, reset, ... which it was not.
Now, do the resetting explicitly after every drawmasks() in the editor.

git-svn-id: https://svn.eduke32.com/eduke32@2350 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:25:42 +00:00
helixhorned ebbf4d79ce Clean up VOC in-memory block type parsing.
- Maintain a position relative to the start of the data. VOC doesn't
  mandate an EOF marker (blocktype 0). If we go over the end, fake
  that marker, so as to restart a looping sound or stop a one-shot one.
  This fixes an uninitialized mem access with the corrupt SNAKRM.VOC.
- When encountering the EOF marker, don't read the 3 bytes of block size,
  since they may not be there.
- Read blocksize by ORing and shifting the 3 bytes, not with *(int32_t *)...

git-svn-id: https://svn.eduke32.com/eduke32@2346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:24:28 +00:00
helixhorned 17ba2664f9 Mapster32: don't use lazy tile loading with r_hightile=0.
git-svn-id: https://svn.eduke32.com/eduke32@2345 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-16 19:24:09 +00:00
helixhorned b04e743236 Fix use of an uninitialized variable in P_FindWall->FindDistance2D with noclip.
git-svn-id: https://svn.eduke32.com/eduke32@2344 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-14 23:14:07 +00:00
helixhorned 53d9264f92 Fix a couple of out-of-bounds accesses when roaming around with noclip.
- guard cansee() against negative sectnums (return 0 immediately), since
  it's often called with the player sectnum as one argument
- in resetpspritevars(), don't inset APLAYER sprite if sectnum < 0, which
  can happen if a map is started in void space accidentally (e.g. from
  the editor)
- two checks before accessing sector[] with a player sectnum

git-svn-id: https://svn.eduke32.com/eduke32@2342 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-14 23:13:38 +00:00
helixhorned f89d73504d Draw HANDHOLDINGLASER and ~ACCESS with guniqhud=200 and 201, respectively.
This fixes updateanimation picking up foreign (and thus potentially oob)
frame numbers at "3: c > n".

git-svn-id: https://svn.eduke32.com/eduke32@2339 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-13 21:38:00 +00:00
helixhorned 5f23cb6bcd Debugging helper disabling a.nasm calls with OpenGL renderers.
Uncomment #define DEBUG_VALGRIND_NO_SMC in duke3d.h to be able to
 valgrind --smc-check=none (or the default stack-only)
with Polymost and Polymer renderers.

git-svn-id: https://svn.eduke32.com/eduke32@2337 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-12 13:47:33 +00:00
helixhorned 8ab0fbf7f4 Patch up out-of-bounds access (r/w) when mixing 16-bit stereo *source* data.
... by allocating two bytes more for the mixing buffers.

git-svn-id: https://svn.eduke32.com/eduke32@2336 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-12 13:47:15 +00:00
helixhorned 09addc955c jmact/control.c: rewrite strange looking loop.
git-svn-id: https://svn.eduke32.com/eduke32@2334 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-11 11:52:33 +00:00
helixhorned f872d556d8 Draw translucent black background only when playing (back a demo or oneself).
git-svn-id: https://svn.eduke32.com/eduke32@2333 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-11 11:52:19 +00:00
helixhorned ca30952b21 Fix menu text not drawing when not playing (back), introduced in r2326.
git-svn-id: https://svn.eduke32.com/eduke32@2332 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-11 11:51:48 +00:00
helixhorned 15532fa96a Remove a couple of redundant declarations.
git-svn-id: https://svn.eduke32.com/eduke32@2330 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:45:38 +00:00
helixhorned ebd7fc402b Lunatic: interface to events.
git-svn-id: https://svn.eduke32.com/eduke32@2329 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:45:18 +00:00