Commit Graph

2899 Commits

Author SHA1 Message Date
terminx f6a11eacc1 Clean up a couple of functions, namely P_IncurDamage()
git-svn-id: https://svn.eduke32.com/eduke32@3081 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:10:29 +00:00
terminx 7e248dcc49 Remove some outdated/incorrect code that was causing some issues when multiple copies of a single sound were playing and just one of them needed to be stopped.
git-svn-id: https://svn.eduke32.com/eduke32@3080 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:09:16 +00:00
terminx 901b1bff0f Networking updates. Don't bother testing this to see if things are any better, because they aren't. :p
git-svn-id: https://svn.eduke32.com/eduke32@3079 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 21:52:51 +00:00
helixhorned d5f7e5becf Texel-granular hitscan() for wall-aligned sprites.
The attribute is set per tile from DEF: either
    texhitscanrange <begintile> <endtile>
or
    tilefromtexture <tile> { ... texhitscan ... }
(As a special case, the list may only contain "texhitscan", in which case the
texture is not changed.)

In passing, do some cleanup for "tilefromtexture" DEF parsing: the list tokens
should now be accepted in any order, and errors don't appear in the middle of
the list parsing.

git-svn-id: https://svn.eduke32.com/eduke32@3078 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:34 +00:00
helixhorned ce948c6ee4 Factor out 2x identical code into G_WeaponHitCeilingOrFloor().
git-svn-id: https://svn.eduke32.com/eduke32@3077 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:30 +00:00
helixhorned b03c95443b Clean up G_MoveWeapons(), among other things getting rid of weird indentation.
git-svn-id: https://svn.eduke32.com/eduke32@3076 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:28 +00:00
helixhorned abd8753e66 Clean up A_MoveSprite(), no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@3075 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:25 +00:00
helixhorned 8adb9d27af Rearrange G_MoveTransports() code a little to cut down on nested switches.
git-svn-id: https://svn.eduke32.com/eduke32@3074 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:23 +00:00
helixhorned a92d5486c4 Replace all/most literal SE lotags 1/2 with SE_1_ABOVE_WATER or SE_2_UNDERWATER.
Also catch some other literal SEs and statnums.

git-svn-id: https://svn.eduke32.com/eduke32@3073 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:21 +00:00
helixhorned e921346dac TROR: Prototypical no-SE7 water submersion/emersion.
Submersion only happens when the upper sector has lotag 1 and its vertical
neighbor has lotag 2 (this can be useful to create non-submergible above-water
sectors).  Currently, only the player is handled.  On the implementation side,
the water handling code is split into P_Submerge() and P_Emerge() preparing the
"teleportation", and P_FinishWaterChange() for the finalization.

git-svn-id: https://svn.eduke32.com/eduke32@3072 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:17 +00:00
terminx bc9a29b121 CON access to ud.runkey_mode through get/setuserdef
git-svn-id: https://svn.eduke32.com/eduke32@3071 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 18:18:30 +00:00
terminx 521ee43173 Fix setting r_pr_maxlightpasses from .cfg at startup
git-svn-id: https://svn.eduke32.com/eduke32@3070 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 14:51:29 +00:00
terminx 2d58801d8c Add cvar "cl_runmode" to control ud.runkey_mode. This should fix the "allow walk while running" preference not saving.
git-svn-id: https://svn.eduke32.com/eduke32@3069 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 14:43:37 +00:00
terminx f7ed6f47de Prevent Windows "case mismatch" spam when loading files from disk with the Windows Explorer "hide extensions for known file types" option enabled. This simply changes the relevant Bstrcmp() calls to Bstrncmp() calls instead, using the length of the string returned by SHGetFileInfo() as the number of bytes to compare.
git-svn-id: https://svn.eduke32.com/eduke32@3068 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-13 14:53:26 +00:00
terminx 83dd447621 Fix the bug I caused with custom projectiles :p
git-svn-id: https://svn.eduke32.com/eduke32@3067 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-11 03:25:10 +00:00
terminx 084ec632ea The other half of the previous commit.
git-svn-id: https://svn.eduke32.com/eduke32@3066 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-08 07:07:59 +00:00
terminx 5010b17efe Fix issue with explosion sound cutoff in E1L2. This implements functionality to stop playback and free up the voice of a currently playing sound of the same ID when there are already MAXSOUNDINSTANCES (currently 8) of the same sound playing, determined by distance/volume and which sound is oldest.
Initial determination is based purely on distance/volume, and if two qualifying sounds have the same distance/volume the one which started playback first is the one that gets the axe.

Feedback from other developers welcome.


git-svn-id: https://svn.eduke32.com/eduke32@3065 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-08 07:07:17 +00:00
helixhorned a2ed3682ee Lunatic: expose updatesector*, add random walker as timing test for them.
git-svn-id: https://svn.eduke32.com/eduke32@3064 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:29 +00:00
helixhorned 8f89c89d86 Lunatic: various tweaks and API changes/additions.
git-svn-id: https://svn.eduke32.com/eduke32@3063 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:24 +00:00
helixhorned 3a7b697a32 Lunatic-m32: save command input history.
git-svn-id: https://svn.eduke32.com/eduke32@3062 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:20 +00:00
helixhorned 5b311f98cc Clean up redundant/local function declarations in build.c.
git-svn-id: https://svn.eduke32.com/eduke32@3061 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:17 +00:00
helixhorned 1682eae693 Lunatic: various tweaks.
Going to extremes to avoid code duplication like the plague, but at
least it's great to learn about the whole function environment business.

git-svn-id: https://svn.eduke32.com/eduke32@3060 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:13 +00:00
helixhorned 36687ab986 Lunatic-m32: take over load path.
git-svn-id: https://svn.eduke32.com/eduke32@3059 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:09 +00:00
helixhorned 2851f412d2 Lunatic-m32: add an OSD command to be able to interface with stuff.
git-svn-id: https://svn.eduke32.com/eduke32@3058 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:26:04 +00:00
helixhorned f9e61ce37e Lunatic: fix up Makefiles, split dynsymlists.
The Makefile now has separate {GAME,EDITOR}LDFLAGS, so the correct
dynamic symbol list can be specified.

git-svn-id: https://svn.eduke32.com/eduke32@3057 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:25:58 +00:00
helixhorned 851c6b081d Lunatic: prototypical editor binding.
git-svn-id: https://svn.eduke32.com/eduke32@3056 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-07 15:25:52 +00:00
terminx 9120696e86 Minor cleanups in actors.c, mostly relating to custom projectiles and the like. A bug causing custom projectiles to knock the player back twice as far as the hard-coded ones was also fixed. There should be no other functional changes for the end user.
git-svn-id: https://svn.eduke32.com/eduke32@3053 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-05 20:48:10 +00:00
helixhorned f8480d00f9 In savegames, store dummy constant-length block instead of a _prlight array.
sizeof(_prlight) differs across compilers, and besides, Polymer lights were
not loaded anyway (they're restored live in-game later).  The savegame version
was not bumped, but only savegames made with builds where sizeof(_prlight)==261
(like synthesis) will stay compatible!
Report and helpful debugging information by LeoD.

git-svn-id: https://svn.eduke32.com/eduke32@3052 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-03 15:29:12 +00:00
helixhorned 30856c3949 In DNCOORDS display, add spritebridge and sbs.
git-svn-id: https://svn.eduke32.com/eduke32@3051 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-03 15:29:10 +00:00
helixhorned 04a542f1b3 On non-{Windows, OS X}, don't link to libpng when PNG support is not requested.
git-svn-id: https://svn.eduke32.com/eduke32@3050 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-03 15:29:07 +00:00
helixhorned 1ba5ec469b Add helper program profdemo.lua, running EDuke32's demo profiling N times.
... and displaying statistics afterwards.  It was easier to do it this way
than porting stat.lua to C and especially adding more logic to the already
spaghetti-like demo playback code.

git-svn-id: https://svn.eduke32.com/eduke32@3049 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:52 +00:00
helixhorned b6db86ef0a In Load Game menu, show 32- or 64-bitness of save game on mismatch.
git-svn-id: https://svn.eduke32.com/eduke32@3048 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:49 +00:00
helixhorned 57348c1fdc Mapster32: make 'corruptcheck_noalreadyrefd' a separate OSD command.
Instead of having 'noalreadyrefd' as a 'corruptcheck' subcommand.
This way, TAB completion can be had.

git-svn-id: https://svn.eduke32.com/eduke32@3047 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:47 +00:00
helixhorned 9d0bffebde Mapster32: factor out some code (3x) into GetSaveBoardFilename().
git-svn-id: https://svn.eduke32.com/eduke32@3046 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:44 +00:00
helixhorned 13599f56b8 In -d command line arg, allow specifying demo number in addition to file name.
git-svn-id: https://svn.eduke32.com/eduke32@3045 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:40 +00:00
helixhorned 54167d4c7e Factor out prepare/finish parts from load{old,}board(), misc. cleanup.
This means that loadoldboard() now should also initialize Polymer map
info after loading a v5/v6 map.  Make the variables holding a file descriptor
an int32_t instead of int16_t.

git-svn-id: https://svn.eduke32.com/eduke32@3044 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:37 +00:00
helixhorned 7efc08a919 Rip out v5/v6 map definitions and routines into src/engine_oldmap.h.
git-svn-id: https://svn.eduke32.com/eduke32@3043 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:34 +00:00
helixhorned 9128e8af04 For loadboard() and friends, pass a vec3_t position instead of separate x/y/z.
git-svn-id: https://svn.eduke32.com/eduke32@3042 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:30 +00:00
helixhorned f10bfb6774 A bit stylistic Polymost code cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3041 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:25 +00:00
helixhorned b3daea46d6 Add compilation switch MODEL_OCCLUSION_CHECKING to polymost.h, leave it enabled.
git-svn-id: https://svn.eduke32.com/eduke32@3040 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:22 +00:00
helixhorned 735d1ed77e Remove last argument from yax_getneighborsect(), make radarang[] engine.c-local.
git-svn-id: https://svn.eduke32.com/eduke32@3039 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:18 +00:00
helixhorned 2ab247b68a A couple of inside()-related cleanups.
- make inside_editor() static in build.c
- replace comparisons of inside()'s return values with 0 by ones with 1
  (since a returned 0 can mean -1 or 1, i.e. oob sector or is really inside)
- prevent a theoretically possible oob access in correct_ornamented_sprite()

git-svn-id: https://svn.eduke32.com/eduke32@3038 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:13 +00:00
helixhorned d4ff4c4595 Clean up updatesector* family, no functional changes.
- factor out the "is inside" predicates
- rename updatesector_onlynextwalls() -> updatesectorbreadth()
- add ATTRIBUTE((nonnull(4))) to the bitmap arg of updatesectorexclude().

git-svn-id: https://svn.eduke32.com/eduke32@3037 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 17:52:09 +00:00
terminx 6019e86010 Update ENet with the latest changes from github
git-svn-id: https://svn.eduke32.com/eduke32@3036 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-01 05:37:31 +00:00
terminx ead8204e1e Fix a.masm changes so MSVC builds work again. The relevant functionality seems to work (non-power of 2 textures drawn without error), even with CLASSIC_NONPOW2_YSIZE_WALLS defined in engine.c, but I'm not familiar with any corner or edge cases that need to be watched out for with this.
Note: CLASSIC_NONPOW2_YSIZE_WALLS is still not enabled in svn.


git-svn-id: https://svn.eduke32.com/eduke32@3035 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-30 14:40:42 +00:00
helixhorned ede713af62 engine.c: Split CLASSIC_NONPOW2_YSIZE into _WALLS and _SPRITES, enable the second
git-svn-id: https://svn.eduke32.com/eduke32@3034 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-28 15:20:13 +00:00
helixhorned beb47f47b5 Port non-pow2 ysize texture mapping routines to MASM, untested.
It's mostly taking over the NASM code, with a couple of changes:
- declarations for externals and globals are slightly different
- the masm seems to have e.g. "dword ptr [...]" where the nasm has only
  "dword [...]", though the masm also has a couple of the latter. The "ptr"
  modifier seems kinda redundant to me, but I added it to every indirection
  anyway.

git-svn-id: https://svn.eduke32.com/eduke32@3033 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-28 15:20:10 +00:00
helixhorned ddc22ee395 a.nasm: add 'dword' to some stores in the nonpow2 routines for consistency.
git-svn-id: https://svn.eduke32.com/eduke32@3032 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-28 15:20:07 +00:00
helixhorned 52ed3e1a66 engine.c: add compilation switches for non-pow2 ysize functions, disable for now.
Previously, we used them in our builds for sprites, but MSVC builds don't have
the ASM ported to MASM, and thus the workaround of ignoring the linking errors
was not safe.

git-svn-id: https://svn.eduke32.com/eduke32@3031 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-28 15:20:03 +00:00
helixhorned 99f9cfca7f foreachmap.lua: add option of only printing matching file names (like grep -l)
Also, add convenience wrapper script findmaps.sh for quickly searching for
sprites/walls/sectors satisfying a certain condition in all map files under
a given directory.

git-svn-id: https://svn.eduke32.com/eduke32@3030 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-26 22:54:01 +00:00
helixhorned 599a2049e6 Mapster32: add check for sprites being out of the maximal grid range (+-524288).
Requested auto-correction will place such sprites at their sector's first point.

git-svn-id: https://svn.eduke32.com/eduke32@3029 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-26 22:53:57 +00:00
helixhorned 5957e0f143 Revert "Abyss crash prevention code", but make the overflow explicit.
git-svn-id: https://svn.eduke32.com/eduke32@3028 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-26 22:53:53 +00:00
helixhorned aba1ce9e7f Disable spot lights on ATI cards, fixing the recent crashes with Catalyst 12.8.
git-svn-id: https://svn.eduke32.com/eduke32@3027 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-24 21:09:37 +00:00
helixhorned 2d3fe5083d Fix compilation on Debian 6.0 (Squeeze).
git-svn-id: https://svn.eduke32.com/eduke32@3026 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-24 21:09:34 +00:00
helixhorned 94ebe8211b Revert r2223's removing of bit 1 making it to setbrightness(), now a noop.
Hendricks found a bug caused by that commit, so this one enables exprimentation
with setbrightness() bit 1 behavior.

git-svn-id: https://svn.eduke32.com/eduke32@3025 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-24 21:09:31 +00:00
helixhorned 2e36784575 Add the option of starting demo profiling from the command line.
EDuke32 will exit afterwards.

git-svn-id: https://svn.eduke32.com/eduke32@3024 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-24 21:09:27 +00:00
helixhorned c04f7cbb4c foreachmap.lua: add shortcut for quickly finding certain sectors/walls/sprites.
git-svn-id: https://svn.eduke32.com/eduke32@3023 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-24 21:09:22 +00:00
helixhorned 7e05f5884c With SDL 1.2 builds, make the profiling be cancelable by pressing any key.
git-svn-id: https://svn.eduke32.com/eduke32@3022 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-15 15:28:30 +00:00
helixhorned 95d11b9703 Add a profiling option to the 'demo' OSD command.
See the comment in source/osdcmds.c for instructions on its usage.

git-svn-id: https://svn.eduke32.com/eduke32@3021 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-15 15:28:26 +00:00
helixhorned 6389874b5d Fix aspect determination from showview in fullscreen mode.
This makes the splitscreen mod not have a ridiculous view distortion.
Such scenes will have no correction for non-square pixels, though.

git-svn-id: https://svn.eduke32.com/eduke32@3020 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-15 15:28:21 +00:00
hendricks266 f662911008 Remove old backtrace DLLs. For some time they have been unused and supplanted by ebacktrace1.dll.
git-svn-id: https://svn.eduke32.com/eduke32@3019 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-13 07:08:20 +00:00
hendricks266 8990017700 Add detection of Windows 8 and Server 2012 to win_printversion().
git-svn-id: https://svn.eduke32.com/eduke32@3018 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-13 07:07:54 +00:00
hendricks266 9f0824e79f Fix three (probably harmless) maybe-uninitialized warnings.
git-svn-id: https://svn.eduke32.com/eduke32@3017 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-13 07:07:21 +00:00
hendricks266 132aebf1c1 patch from jfmact: "added c++ trimming to header" mathutil.h
git-svn-id: https://svn.eduke32.com/eduke32@3016 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-13 07:06:47 +00:00
hendricks266 74c00dbbd6 Revise EVENT_CHANGEWEAPON so that RETURN has no effect except for two values. -1 will cancel the weapon switch. -2 will override the switch to whatever value p->curr_weapon is set in the course of the event.
While we're at it, factor out duplicate code into P_ChangeWeapon().

git-svn-id: https://svn.eduke32.com/eduke32@3015 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-13 07:06:11 +00:00
hendricks266 a7688523a1 Possible fix for saving the "Fav priority" autoswitch setting.
git-svn-id: https://svn.eduke32.com/eduke32@3014 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-13 07:02:56 +00:00
helixhorned 91e8613ae4 SE17 setup: when failing to find warp z height for lower level, use heuristic.
Specifically, use the elevator's own ceiling z height instead of searching
nextsectors with nextsectorneighborz().  This makes maps like L9.map (Spaceport
from N64) or DEMOUNT.MAP work.  [Note well: work at all, since if it happened
to work before, that was pure coincidence.]

git-svn-id: https://svn.eduke32.com/eduke32@3013 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-12 09:48:31 +00:00
helixhorned 22a4eaaf3d __fastcall int32_t getangle -> int32_t fastcall getangle. Might fix MSVC build.
git-svn-id: https://svn.eduke32.com/eduke32@3012 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-12 09:47:26 +00:00
helixhorned 011e2b714a Replace some literal statnums with the corrensponding STAT_...
git-svn-id: https://svn.eduke32.com/eduke32@3011 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-12 09:46:21 +00:00
helixhorned 8f6d9c0986 Replace some more literal SE numbers, rename a couple of functions.
git-svn-id: https://svn.eduke32.com/eduke32@3010 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-12 09:45:14 +00:00
helixhorned 15d1c94d03 STHELP.HLP/SEHELP.HLP: reference SE11 and ST23 from each other.
git-svn-id: https://svn.eduke32.com/eduke32@3009 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:47 +00:00
helixhorned eb4848fe05 Replace most other literal SEs/STs by symbolic enumeration values.
Have fun researching Duke3D's hardcoded weirdness!!!

git-svn-id: https://svn.eduke32.com/eduke32@3008 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:44 +00:00
helixhorned fba2556f9b Clean up some timing-related code.
- duke3d.h: comment the timing marcos a bit more
- factor out smoothratio calculation
- (TICRATE/TICSPERFRAME) --> REALGAMETICSPERSEC

git-svn-id: https://svn.eduke32.com/eduke32@3007 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:40 +00:00
helixhorned 8fba52a2bb New OSD cmd: demo <demonum or demofile>, starting one instantly from the menu.
Also, correct some comments made in the demo source made earlier. Oops.

git-svn-id: https://svn.eduke32.com/eduke32@3006 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:37 +00:00
helixhorned 8f8a3c6846 Move enum cheatindex_t from game.c to game.h and use its values in osdcmds.c.
git-svn-id: https://svn.eduke32.com/eduke32@3005 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:34 +00:00
helixhorned 06a64b8dd4 OSD command 'map': entering a name with a '*' wildcard lists those that match.
A new function maybe_append_ext() is added to common.c and used in the handling
of the -d<demo.edm> cmdline parameter and the 'map' OSD command with one
non-wildcard arg.  (It's slightly different from the way the extension was
maybe-appended previously.)

git-svn-id: https://svn.eduke32.com/eduke32@3004 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:31 +00:00
helixhorned ef7e057fd9 Make demos be named edemoXXX.edm, XXX ranging from 000 to 999.
Also, don't stop playback cycling at the 10th demo and show the demo
number when beginning to record one.

git-svn-id: https://svn.eduke32.com/eduke32@3003 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:28 +00:00
helixhorned a1aac0480b Fix entering the game from within a demo, but don't enable it.
git-svn-id: https://svn.eduke32.com/eduke32@3002 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:26 +00:00
helixhorned 312609d9ab demo.c: minor cleanup; comment the G_PlaybackDemo() a little.
git-svn-id: https://svn.eduke32.com/eduke32@3001 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:22 +00:00
helixhorned 7305fbbae9 Add macro CON_ERRPRINTF(Fmt, ...) and use that everywhere.
git-svn-id: https://svn.eduke32.com/eduke32@3000 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:47 +00:00
helixhorned 1729f8fa38 Factor out some repeated code into G_{Load,Save}PlayerMaybeMulti.
This currently says that MP saving/loading isn't supported, but doesn't
really work correctly.  Also, properly bound-check the immediate argument
to CON's 'save' command and one more ... -> G_HandleAsync().

git-svn-id: https://svn.eduke32.com/eduke32@2999 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:43 +00:00
helixhorned 0665d961d2 Use Bstrncpyz in 1 place; fix displaying err msg if write-opening savegame fails
git-svn-id: https://svn.eduke32.com/eduke32@2998 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:40 +00:00
helixhorned bb5d3496ee Factor out snprintf'ing a maybe-modDir'd file name into macro G_ModDirSnprintf().
... and use it in three places. In two of these uses,
1) CON {read,write}arrayfromfile and
2) G_SavePlayer,
display an error message if the file name such generated is too long.

In the CON commands of 1), also error out if the file couldn't be opened.

git-svn-id: https://svn.eduke32.com/eduke32@2997 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:37 +00:00
helixhorned e417274c1e Move G_HandleAsync() into game.h as 'static inline' and use everywhere else.
git-svn-id: https://svn.eduke32.com/eduke32@2996 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:34 +00:00
helixhorned 9311432cbf Fix crash when recording demo, stooping it, going to title screen, and exiting.
A macro MAYBE_FCLOSE_AND_NULL(fileptr) is introduced in compat.h that does
what it says.

git-svn-id: https://svn.eduke32.com/eduke32@2995 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:31 +00:00
helixhorned 667de29e01 Demo: rename some functions for new-style conventions, functionize one marco...
git-svn-id: https://svn.eduke32.com/eduke32@2994 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-05 17:25:26 +00:00
terminx a0d993c900 Rename a couple functions local to actors.c, remove IFHITSECT macro. This is mostly a test commit to make sure our CIA.vc script is properly updated now.
git-svn-id: https://svn.eduke32.com/eduke32@2993 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:30:32 +00:00
helixhorned 202d544f14 compat.h: tweak indentation of some preprocessing directives.
git-svn-id: https://svn.eduke32.com/eduke32@2992 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:13:06 +00:00
helixhorned 72b73f6356 Make getangle() a __fastcall function instead of static inline.
This trims four 4k pages of code from the release EDuke32 build and
one page from Mapster32.

git-svn-id: https://svn.eduke32.com/eduke32@2991 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:12:01 +00:00
helixhorned 1fdc464568 In dosetaspect(), bail out calculating radarang2[] instead of failing assertion.
When this happens, parallaxmodes other than 0 will be unavailable and silently
draw as parallaxmode 0.  This usually happens with extremely wide resolutions.

git-svn-id: https://svn.eduke32.com/eduke32@2990 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:10:55 +00:00
helixhorned dd681886c3 Add lunatic/test/tables.lua, which was used to compare the calc'd sin/atan values.
git-svn-id: https://svn.eduke32.com/eduke32@2989 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:09:49 +00:00
helixhorned ee39d713e8 Calculate sine and arctan tables, getting rid of TABLES.DAT dependency.
We're pulling stuff from math.h even in non-GL builds right now, so
adding libc's sin() and atan() doesn't seem like a big deal.  In the
unlikely event that their accuracy is so bad that the calculated tables
don't match the original ones, a warning is issued on little-endian
platforms.

git-svn-id: https://svn.eduke32.com/eduke32@2988 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:08:43 +00:00
helixhorned 5bca5f59ad Move #define PI from to build.h, add bound-checking assertion in dosetaspect().
git-svn-id: https://svn.eduke32.com/eduke32@2987 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:07:36 +00:00
helixhorned 52bb35361b Some [U]INT_MAX --> [U]INT32_MAX.
git-svn-id: https://svn.eduke32.com/eduke32@2986 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:06:30 +00:00
helixhorned 7f74880c96 Move #include <math.h> from polymer.h to polymer.c.
git-svn-id: https://svn.eduke32.com/eduke32@2985 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:05:23 +00:00
helixhorned 6fe5eb2863 Clean up A_FindPlayer(), constify some function args, some 0x7fffffff->INT32_MAX
git-svn-id: https://svn.eduke32.com/eduke32@2984 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:04:16 +00:00
helixhorned 59151dd045 player.c: factor out 7x similar code into GetAutoAimAngle().
This is one of the cases where the duplicated code has minor modifications
at each site. These are handled by function args here.

git-svn-id: https://svn.eduke32.com/eduke32@2983 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:03:10 +00:00
helixhorned a9d3103373 Remove commented out AI Duke opponent code.
git-svn-id: https://svn.eduke32.com/eduke32@2982 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:02:04 +00:00
helixhorned b8ed142c6b Remove some #if 0 blocks that are probably of no interest any more.
For reference, they are the following:
 - cache1d.c: suckcache()
 - build.c: compare_wall_coords()
 - make switch-invisible heuristic
 - Mapster32: old sprite search
 - Mapster32: manual z range
 - m32script: read/writearray, qgetsysstr
 - menus.c: savetemp()

git-svn-id: https://svn.eduke32.com/eduke32@2981 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 14:00:58 +00:00
helixhorned e4bb83cd39 player.c: factor out inline checks for shootable switch picnums.
git-svn-id: https://svn.eduke32.com/eduke32@2980 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-02 13:59:50 +00:00