Commit Graph

477 Commits

Author SHA1 Message Date
helixhorned 2003954492 CON: add projectile member .userdata and predefined label PROJ_USERDATA.
It is a 32-bit signed integer. No version bump necessary, although CON code
accessing this new member will not work with earlier revisions (obviously).

git-svn-id: https://svn.eduke32.com/eduke32@3866 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:18 +00:00
hendricks266 e0a373893a Replace use of preprocessor macro WIN32 with _WIN32. (Blame clang.)
git-svn-id: https://svn.eduke32.com/eduke32@3839 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:57:00 +00:00
hendricks266 4297507c8f Dynamicsoundremap.
git-svn-id: https://svn.eduke32.com/eduke32@3834 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:30 +00:00
hendricks266 ced47cf9fc Add qstrdim and screentext, powerful new functions for HUD text.
git-svn-id: https://svn.eduke32.com/eduke32@3833 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:00 +00:00
helixhorned 640eda2194 LunaCON: implement 'definegametype', allow writing userdef.level_number.
Also, allow (implicit) actor index -1 to 'sound' like in C-CON and fix
MULTIMODE gamevar definition (was 0, not 1).

git-svn-id: https://svn.eduke32.com/eduke32@3826 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:49 +00:00
helixhorned a52130a996 C-CON: remove "found `gettspr' outside of EVENT_ANIMATESPRITES" warning.
Because one may obviously use gettspr/settspr in states called from that
event.

git-svn-id: https://svn.eduke32.com/eduke32@3820 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-28 19:52:45 +00:00
terminx 4e9cf9722a Well then, I sure fucked that last commit up didn't I
git-svn-id: https://svn.eduke32.com/eduke32@3816 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-25 22:50:46 +00:00
terminx e3dedb19ee Fixes a crash after killing the boss in Duke 0.99 and fixes the issue with WGR2 SVN being detected as 0.99 due to malformed definelevelname statements
git-svn-id: https://svn.eduke32.com/eduke32@3815 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-25 20:25:39 +00:00
terminx 85cf8de0f3 Add support for shareware 0.99/1.0/1.1, for shits and giggles.
git-svn-id: https://svn.eduke32.com/eduke32@3803 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-23 18:28:04 +00:00
helixhorned edcef5c3ec Define a macro LUNATIC_EXTERN that expands to 'static' in non-Lunatic builds.
git-svn-id: https://svn.eduke32.com/eduke32@3645 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:18 +00:00
helixhorned 203bd1e9e9 Take over and use static assertion macro found in LuaJIT sources.
git-svn-id: https://svn.eduke32.com/eduke32@3644 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:14 +00:00
hendricks266 30f510d521 Add "rotatespritea" to CON and M32script.
I hope I didn't bruise Lunatic too much.

git-svn-id: https://svn.eduke32.com/eduke32@3610 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:33:03 +00:00
hendricks266 d7e30a65dd Relax CAPITALIZATION restrictions.
git-svn-id: https://svn.eduke32.com/eduke32@3606 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:31:09 +00:00
helixhorned 56ea732ccd Lunatic translator: dynamic tile remapping.
Also, fix message when tiles get remapped in debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@3568 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:38 +00:00
helixhorned 92e85fa0d3 Lunatic translator: music 0, add two userdefs members.
git-svn-id: https://svn.eduke32.com/eduke32@3567 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:27 +00:00
helixhorned 1606c17a77 Lunatic: fixups and debugging helpers.
- add LuaJIT's 'v' module printing trace info
- translator: fix game function name definitions
- revert math.fmod -> math.modf, they are different!
- disable JIT compilation for a function we're getting strange crashes with
- Make some of DukePlayer_t's members 'bool' on the Lua side. It's way
  too easy to write something like "ps.jetpack_on" where "ps.jetpack_on~=0"
  was meant. [Background: Kyle873 observed that Duke was always floating.]
- Error out if looping in our_module(). I find this behavior more logical
  than returning true.
- fix a couple of missed FORBID variables

git-svn-id: https://svn.eduke32.com/eduke32@3530 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:30:04 +00:00
helixhorned 0354e38843 CON parser: don't allow read-only gamevars to 'readgamevar' command.
git-svn-id: https://svn.eduke32.com/eduke32@3522 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:05 +00:00
helixhorned acddac64be Lunatic translator: nearing a workable state...
- some more outer commands
- gamearray persistence
- faster 'mod': use math.modf instead of math.fmod (the former is JIT-compiled)
- checkavail*
- THISACTOR special handling
- Fix building in Windows (export A_ShootWithZvel instead of A_Shoot).

git-svn-id: https://svn.eduke32.com/eduke32@3516 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:22 +00:00
helixhorned 5dfb4dc48b CON: don't accept read-only vars for first arg of qstrlen.
git-svn-id: https://svn.eduke32.com/eduke32@3505 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:54 +00:00
helixhorned b92edcc798 Lunatic: projectiles...
git-svn-id: https://svn.eduke32.com/eduke32@3463 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:01:03 +00:00
helixhorned 8e0c7b133e Move around some #ifdef LUNATIC to compile out more code, minor cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3459 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-07 21:00:48 +00:00
helixhorned 92f5158a70 CON parser: don't accept read-only gamevars for 1st arg of *sprite{sect,stat}.
git-svn-id: https://svn.eduke32.com/eduke32@3429 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-24 20:02:52 +00:00
helixhorned 142e36d6f4 Lunatic: cmdline switch to run test script, compile out more code, 2 more GVs.
git-svn-id: https://svn.eduke32.com/eduke32@3415 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 21:17:06 +00:00
helixhorned 2b0b8d34cc Remove mixed Lunatic/legacy build option.
git-svn-id: https://svn.eduke32.com/eduke32@3410 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:29:00 +00:00
helixhorned 898462152c Fix MUSICANDSFX ambient sounds (bit 2) playing only one instance.
This is done by introducing an additional internal bit, meaning
"play only one instance". It is set for all sounds which have bit 1
("repeat in the sound system") set at definesound time, but not those
that set bit 1 temporarily (see r3336).

git-svn-id: https://svn.eduke32.com/eduke32@3393 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:36 +00:00
helixhorned 8ed4667265 Lunatic: grabbag of different things.
- fix error handing with recursing events
- wallsofsect iterator, sector[]:contains()
- more codegen; mangle function names
- m32: compinside

git-svn-id: https://svn.eduke32.com/eduke32@3375 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:31 +00:00
helixhorned 50f5a2340f Lunatic: more commands, mostly of the define* variety.
git-svn-id: https://svn.eduke32.com/eduke32@3373 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:19 +00:00
helixhorned eda5b22030 Lunatic: more code...
git-svn-id: https://svn.eduke32.com/eduke32@3357 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:28 +00:00
helixhorned a24ab8d4fa Factor out some code into C_AllocQuote() and C_InitQuotes().
In Lunatic-only build, also always allocate the first 128 quotes.

git-svn-id: https://svn.eduke32.com/eduke32@3356 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:25 +00:00
helixhorned 311967f425 Lunatic: definesound, more control.lua fixes.
git-svn-id: https://svn.eduke32.com/eduke32@3355 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:22 +00:00
helixhorned fd390efe2a Lunatic: compile out more code with LUNATIC_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3354 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:18 +00:00
helixhorned 80ee967b8e Lunatic: beginning to glue things together. Introducing LUNATIC_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3343 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:24 +00:00
helixhorned 9c328bf0a5 Encapsulate aplWeapon* array accesses in a PWEAPON(Player, Weapon, Wmember) macro.
In the normal game, these arrays are conceptually [MAX_WEAPONS][MAXPLAYERS],
allocated as CON per-player gamevars (e.g. WEAPONx_WORKSLIKE).
For Lunatic, they are replaced with
weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS].

git-svn-id: https://svn.eduke32.com/eduke32@3328 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:16 +00:00
helixhorned 6a4add81bd Fix rotation-fixed useractors (those having usertype bit 4 set).
Rotation-fixing happens for a couple of hard-coded statnums that presumably
never move (DEFAULT, STANDABLE, FX, FALLER, LIGHT), but for actors it wouldn't
make sense since the common case is that they do move. For this reason, bit 4
was introduced in r1934. The position of such useractors will not diverge
due to error roundoff accumulation in rotating sectors (SE0, train).

git-svn-id: https://svn.eduke32.com/eduke32@3316 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 19:24:21 +00:00
hendricks266 dac94ce284 Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)

To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.

All compiler and linker warnings when building in 64-bit mode have been fixed.

Remaining 64-bit to-do:
 - The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
 - RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
 - DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
 - Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)

This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.

In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.

git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
hendricks266 6f2fa332dd Port system gamearray access from M32Script to CON. Expose tilesizx and tilesizy.
Also, fix deficient logic in Gv_Free and Gv_Clear (both M32 and CON) so that gamevar and gamearray erasure results are (closer to) correct, and so that the game does not crash when system arrays are accessed from CON because they all have been nulled.

git-svn-id: https://svn.eduke32.com/eduke32@3274 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:33:53 +00:00
helixhorned 10ae7e342c CON: proper bound checks for {re,}definequote commands.
git-svn-id: https://svn.eduke32.com/eduke32@3262 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:42:38 +00:00
helixhorned 5c06ef08bf Make EventNames[] an array of (const char *) instead of const tokenlist.
git-svn-id: https://svn.eduke32.com/eduke32@3258 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:36 +00:00
helixhorned cff452d814 Lunatic translator: update default defines.
git-svn-id: https://svn.eduke32.com/eduke32@3225 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:18:41 +00:00
hendricks266 5e0ffb93b3 RENDERTYPE=SDL on Windows, part 2.
This introduces winbits.[ch] in the engine, containing layer-independent code migrated from winlayer, including nedmalloc, ebacktrace1, OS version detection, and high-resolution profiling timers.

sdlayer has been expanded to include the code from winbits under _WIN32.

All uses of RENDERTYPEWIN in the source have been examined and changed to _WIN32 (or removed) where the block in question is layer-independent.

git-svn-id: https://svn.eduke32.com/eduke32@3221 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 04:26:37 +00:00
terminx ed464aaadc Add "ulotag" and "uhitag" to get/setactor/wall/sector, which exposes the tags unsigned, without the typecast to int16_t. This might be useful to someone.
git-svn-id: https://svn.eduke32.com/eduke32@3192 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-16 00:54:04 +00:00
helixhorned 107fa9cc39 Split r3159..r3161, part 12: Add explicit casts, non-pointer types.
Notes:
 - Atomic Edition (Censored) -> Plutonium Pak in grpscan.c
 - "scale" in astub.c:drawtileinfo() is incorrect, I think.
 - in demo.c, the gethitickms() value should be returned to a double.

git-svn-id: https://svn.eduke32.com/eduke32@3178 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:41 +00:00
helixhorned 5ad385c043 Split r3159..r3161, part 10: add explicit casts to *alloc return values.
NOTE: changes such as these are best viewed with something like
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]'

git-svn-id: https://svn.eduke32.com/eduke32@3176 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:29 +00:00
helixhorned f7eb5adb40 Split r3159..r3161, part 4: Tweaks of tiledata_t's "cacherange" member.
REM: This will need a savegame version bump.

git-svn-id: https://svn.eduke32.com/eduke32@3169 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:00 +00:00
helixhorned 9dd3748b03 Split r3159..r3161, part 3: MSVC, nedmalloc, *layer, startup windows.
git-svn-id: https://svn.eduke32.com/eduke32@3168 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:57 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00
terminx 3ff46c02b2 Fix the warnings when building with C++, add MSVC C++ build support. This also changes the internal type of lotags, hitags and cstat type fields to uint16_t instead of int16_t to clean up some dubious behavior wherein the code was using a value of 32768 as a flag in these fields for certain types of things, like invisible sprites (using the value as if it was uint16_t) where it was elsewhere checking if the value was < 0 (using the value as if it was int16_t). This change may break a few specific effects if any part of the relevant code was missed when looking for areas that needed to be addressed.
I think there's also a fix for the CON precache system breakage in here (lost it in my local tree when I started getting the C++ build working in MSVC, sorry!)


git-svn-id: https://svn.eduke32.com/eduke32@3159 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-14 23:32:43 +00:00
terminx 39437b2fdc Fix useractor enemystayput breakage
git-svn-id: https://svn.eduke32.com/eduke32@3154 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 18:46:02 +00:00
helixhorned a76a796ebb Fix demo playback with diff application enabled.
This requires ripping out the .proj member of tiledata_t back into
ProjectileData[] again because it was the only one in g_tile[] that
changed during the course of a game.  The g_tile[] array is now also
correctly flagged as "constant throughout a game" (DS_NOCHK).
Savegame version bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3151 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-11 17:57:06 +00:00
terminx 6f3f2eb1b8 Hopefully fix the projectile breakage, and add some predefined names for working with the built in statnums
git-svn-id: https://svn.eduke32.com/eduke32@3105 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-31 15:03:33 +00:00
terminx 88c95a18f7 Retire the actorscrptr[], actorLoadEventScrptr[], SpriteFlags[], ActorType[], SpriteCacheList[], ProjectileData[] and DefaultProjectile[] arrays in favor of a tile_t structure exposed as g_tile[]. This consolidates most of the MAXTILES sized arrays on the game side into one place.
git-svn-id: https://svn.eduke32.com/eduke32@3102 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-30 15:54:35 +00:00
hendricks266 f18ef269ed Add EVENT_CHANGEMENU and clean up menus.c a little more.
This event is useful in certain circumstances where you want to skip a menu/screen value and the design of the monster switch statement would require the M_ChangeMenu() call to be intercepted or the unwanted screen will flash for a split second.

git-svn-id: https://svn.eduke32.com/eduke32@3101 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:29:45 +00:00
hendricks266 2066656aed Two new player structure members: "autostep" and "autostep_sbw".
These control the maximum difference in height between two sectors that the player will automatically traverse without needing to jump.

The latter controls the special case when the player's sector's lotag is ST_1_ABOVE_WATER or p->spritebridge == 1.

BYTEVERSION bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3100 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:29:17 +00:00
terminx fdef8a6b8c Remove a debug line I accidentally committed a few days ago.
git-svn-id: https://svn.eduke32.com/eduke32@3090 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-20 15:58:06 +00:00
terminx 2c00f53008 Add some CON defines for friendly names to pass to definegamefuncname. Now, instead of "definegamefuncname 36 something" you would "definegamefuncname GAMEFUNC_TURNAROUND something". It's just a little something to make CON files more readable.
git-svn-id: https://svn.eduke32.com/eduke32@3089 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-16 17:05:14 +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 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 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
hendricks266 2620738eb9 Add EVENT_PREGAME. Now all sprites are processed in the following fashion:
1. EVENT_PREGAME
2. hardcoded stuff
3. EVENT_GAME

One potential use is to examine values which are clobbered by commands such as ifhitweapon/ifwasweapon.

git-svn-id: https://svn.eduke32.com/eduke32@2973 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-27 03:49:55 +00:00
hendricks266 da4fcec462 Fix the overlooking of EDUKE.CON in the absence of DUKE3D.GRP caused by r2726. Also, tweak a few string literals' use of quotation marks.
git-svn-id: https://svn.eduke32.com/eduke32@2789 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-27 17:45:52 +00:00
helixhorned 3975e34625 gamedef.c: some bound tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2766 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:46 +00:00
helixhorned e57a8715fc CON: warn on out-of-range hex literals and ignored redefines with different values
git-svn-id: https://svn.eduke32.com/eduke32@2751 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:27 +00:00
helixhorned c3955f7462 CON parser/runtime: two bound tweaks, defer setting insptr in (load)actor.
git-svn-id: https://svn.eduke32.com/eduke32@2750 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:24 +00:00
helixhorned f9077dc9cd Silence "number greater than INT32_MAX converted to a negative one" warning.
Literals written out as if they were unsigned and having the highest-order
bit set are all too ubiquitous, like hitscan masks for example.

git-svn-id: https://svn.eduke32.com/eduke32@2742 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-06 22:03:35 +00:00
hendricks266 67ed6945fd The handling for grp, con, and def filenames has been massively cleaned up and factored into common.c. A new header, common_game.h, was created because common.h was placed in build/include (see r2542) and we need a common header for things that strictly should not be in the engine. RTS file names were also improved but some of the patterned changes were already made in r2420, and they were not factored because they are strictly part of the game, not the editor.
NAM and Napalm can now share their con, def, and rts files if the one for their respective game is not present because the con and rts files are identical.

Also, decapitalize two string literals missed in r2540.

git-svn-id: https://svn.eduke32.com/eduke32@2726 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:09:33 +00:00
helixhorned 35d989646e A couple of minor fixes and comments that got accumulated in my tree.
git-svn-id: https://svn.eduke32.com/eduke32@2709 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:55 +00:00
helixhorned efa0079474 On Windows, check file name case with 'sound' and 'music' CON commands.
This is done by kopen4loadfrommod'ing and immediately closing the file
(since the checker is still run from there when not ingame).
On my system, times were like 0.12 ms, 0.2 ms and 0.5 ms for each
openfrompath/findfrompath, openfrompath/Bopen and SHGetFileInfo
respectively, so it shouldn't have a too noticable impact on initial
loading times.

git-svn-id: https://svn.eduke32.com/eduke32@2704 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-28 18:15:26 +00:00
helixhorned eebddcd559 Cleanup & minor rewrites, among other things in premap.c:G_EnterLevel().
git-svn-id: https://svn.eduke32.com/eduke32@2695 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 18:39:22 +00:00
hendricks266 7f920c5541 Add EVENT_LOADGAME and EVENT_SAVEGAME, self-explanatory. Also make EVENT_NEWGAME use myconnectindex for player ID instead of screenpeek.
git-svn-id: https://svn.eduke32.com/eduke32@2688 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 05:14:19 +00:00
terminx 4ba6da5007 Addition of 3 events:
EVENT_SOUND: triggered upon playback of any sound, this allows the "hard coded" sounds to be altered in a context-aware fashion instead of having to resort to clunky hacks like replacing them with a blank sound effect.  RETURN var
iable is set to the sound effect # of the sound to be played, or -1 to cancel playback.

EVENT_CHECKTOUCHDAMAGE: triggered in P_CheckTouchDamage() whenever the player collides with anything.  Value of RET
URN is set to the result provided by clipmove() and so can be decoded in the same way.  Value of RETURN when the event is over can also be manipulated to control some of the hard coded damage effects.

EVENT_CHECKFLOORDAMAGE: triggered in P_CheckFloorDamage(), RETURN is simply the picnum of the floor of the sector t
he player is in.  Can be used to cancel hard coded floor damage effects or to make other tiles exhibit the same eff
ects

Other misc fixes and cleanups, including a possible workaround for Duke Plus SECTOREFFECTOR light issues wherein all SE49 and SE50 that have a statnum of STAT_EFFECTOR are simply changed to STAT_LIGHT during the STAT_EFFECTOR loop
 now.


git-svn-id: https://svn.eduke32.com/eduke32@2652 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-14 18:12:27 +00:00
helixhorned 0b055de591 Add tilenum bound check to CON *actor blocks when parsing, fix the other ones.
The remaining checks now "continue;" when an oob tilenum is found where
an oob access would ensue else.  Also, it's now checked for negative
numbers (the message remains the same though).

git-svn-id: https://svn.eduke32.com/eduke32@2651 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-13 16:05:34 +00:00
helixhorned 7cd2c19801 Remove the 'inline' qualifier of some (not-so) short functions.
Besides being the compiler's job nowadays, they significantly inflate
the size of the debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@2640 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-05 22:24:02 +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
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 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 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 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
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 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 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
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 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
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
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 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 aee01a4958 Use a tokenlist for the event names and add tokenlist typedef to gamedef.h.
git-svn-id: https://svn.eduke32.com/eduke32@2327 1a8010ca-5511-0410-912e-c29ae57300e0
2012-02-09 22:44:26 +00:00
terminx 5bc595ab89 Dynamic tile remapping shouldn't actually be disabled in synthesis builds, whether the source allows it to be compi
led out or not. Removing features that certain mods may depend on to operate correctly without throwing any kind of
 error or warning at startup other than a logged message is bad.


git-svn-id: https://svn.eduke32.com/eduke32@2300 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 15:16:14 +00:00
helixhorned 75538bc8e1 add one line forgotten with dynamictileremap disabling
git-svn-id: https://svn.eduke32.com/eduke32@2299 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:38:54 +00:00
helixhorned 99f1fcb6c2 Move inithashnames() and freehashnames() declarations into namesdyn.h.
git-svn-id: https://svn.eduke32.com/eduke32@2296 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-28 14:37:56 +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 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 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 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 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 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 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 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
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