Commit graph

3312 commits

Author SHA1 Message Date
helixhorned
c3ff173553 LunaCON: warn if a 'spriteflags' is issued after its actor definition...
... or another 'spriteflags' or 'sprite*' directive.

git-svn-id: https://svn.eduke32.com/eduke32@4373 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-15 14:10:49 +00:00
helixhorned
6908ce6be7 LunaCON: warn if using reserved bits in 'spriteflags'.
Reserved bits are those that have no predefined SFLAG_* label in CON.

git-svn-id: https://svn.eduke32.com/eduke32@4372 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-15 14:10:48 +00:00
helixhorned
5cb6e20c63 Add new actor flag and predefined CON label SFLAG_NODAMAGEPUSH.
This flag is set from C for some enemies that should not be pushed back when
damaged, such as TANK. Both the tile flag and the per-sprite flag are used
(i.e. the ultimate flag value is the XOR of the two).
Add currently non-functional example to test.lua that attempts to set this bit
for NEWBEAST.

git-svn-id: https://svn.eduke32.com/eduke32@4371 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-15 14:10:47 +00:00
helixhorned
55d6b9c5c7 Lunatic: implement passing string label to 'spawn' OSD command.
Unlike in C-CON, it only tries an exact match with the given and uppercased
label, not "full" case-insensitive search.

git-svn-id: https://svn.eduke32.com/eduke32@4370 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-15 14:10:45 +00:00
helixhorned
69d906c4f7 If 3rd person view gets outside map, try again w/o subtracting 3072 from player z.
Also, clean up G_DoThirdPerson().

git-svn-id: https://svn.eduke32.com/eduke32@4369 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-15 14:10:42 +00:00
helixhorned
802650048d Lunatic: extend map-VX walltype by 'blend' member. BUILD_LUNATIC.
Make Mapster32 save as map-text if there is a wall with non-zero 'blend'.

git-svn-id: https://svn.eduke32.com/eduke32@4368 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-10 20:08:27 +00:00
terminx
7d88e047d3 Make non-pal 0 enemy health doubling depend on running 1.3D or earlier
git-svn-id: https://svn.eduke32.com/eduke32@4366 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-07 22:17:25 +00:00
helixhorned
73b3199b7c Classic: implement screen tilting by 180 degrees without quality loss.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4364 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-05 21:12:59 +00:00
helixhorned
acc4d12f4b LunaCON: fix 'getincangle'.
git-svn-id: https://svn.eduke32.com/eduke32@4362 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-05 21:12:57 +00:00
helixhorned
e0ed3688f9 Mapster32: for wall alignment with [.]/[,], reverse meaning of Alt modifier.
git-svn-id: https://svn.eduke32.com/eduke32@4361 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-05 21:12:56 +00:00
helixhorned
689a8aef1d Propagate 'blend' to rotatesprite_(), but don't hook it up to scripting yet.
git-svn-id: https://svn.eduke32.com/eduke32@4360 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-05 21:12:54 +00:00
hendricks266
4b0fc93155 When osdcmd_quit(), OSD_ShowDisplay(0).
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4358 1a8010ca-5511-0410-912e-c29ae57300e0
2014-03-01 11:41:29 +00:00
helixhorned
a399bd5717 a.m32: add states 'uniformceiling' and 'uniformfloor'.
Given highlighted sectors, these take the arithmetic mean of their ceiling's
or floor's (respectively) z, removing the slope bit from all, and setting the
new z to the mean one, rounded down to 1024 Build z units (one PGUP/PGDN).

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4357 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-28 20:33:47 +00:00
helixhorned
ea8c081084 LunaCON: add and document option -ferror-negative-tag-write.
git-svn-id: https://svn.eduke32.com/eduke32@4356 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-28 20:33:46 +00:00
helixhorned
82b87e1812 engine.c: in loadlookups(), allow pal 0.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4355 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-26 20:18:28 +00:00
helixhorned
605c4dbc21 Fix crosshair color.
git-svn-id: https://svn.eduke32.com/eduke32@4354 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-23 20:44:43 +00:00
helixhorned
f346e46ed8 A few stylistic tweaks, like substituting missed SE_* enum constants.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4353 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:54 +00:00
helixhorned
f077d57547 Amend r3822 ("Make deletion of an amb. sound MUSICANDSFX stop its sound again.")
We shouldn't be using its actor[].t_data[8] because that one is used by the
sprite rotation-fixing system (which fixes STAT_FX sprites to the positions
relative to the pivot, too).
Test case source/lunatic/test/delmusicsfx.lua still passes with this
modification.

git-svn-id: https://svn.eduke32.com/eduke32@4352 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:53 +00:00
helixhorned
b8bd2069ea Rename SPRITE_* flag enum constants to SFLAG_*, for consistency with CON.
git-svn-id: https://svn.eduke32.com/eduke32@4351 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:52 +00:00
helixhorned
6f34193bb6 Give sprite cstat bit 2048 (NOSHADE, Mapster32 key [N]) a macro name.
git-svn-id: https://svn.eduke32.com/eduke32@4350 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:51 +00:00
helixhorned
7a7fb71169 Mapster32: include .blend in sprite display/edit/search (Shift+TAB/F8/Alt+F8).
git-svn-id: https://svn.eduke32.com/eduke32@4349 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:49 +00:00
helixhorned
597400e0f3 Mapster32: don't save comments to mapster32.cfg's command-line history.
git-svn-id: https://svn.eduke32.com/eduke32@4348 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:48 +00:00
helixhorned
b02aa43036 Lunatic: generalize shadexfog.create_trans() further.
It now accepts a number of tables to create as 3rd arg. The function that
create_trans() takes as the 2nd argument is now being passed
(r,g,b, R,G,B, tablei, numtables).
Rewrite create_additive_trans() in terms of it.
Rename create_128_trans() -> create_alpha_trans().

git-svn-id: https://svn.eduke32.com/eduke32@4347 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:48 +00:00
helixhorned
1b1cb73e1c A couple of very minor code beauty tweaks.
git-svn-id: https://svn.eduke32.com/eduke32@4346 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 19:38:47 +00:00
hendricks266
a21f340553 Mapster32: Introduce m32_settings.cfg, analogous to settings.cfg, so that you can save your cvars and aliases for the editor.
One potential use is to add r_togglecomposition "0" if you don't like Aero turning on and off every time you switch between 2D mode and 32-bit 3D mode.

git-svn-id: https://svn.eduke32.com/eduke32@4344 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 08:03:02 +00:00
hendricks266
14db3b178d Build system: Detect the SVN revision and generate rev.h directly from the Makefile, if applicable.
git-svn-id: https://svn.eduke32.com/eduke32@4343 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 08:02:41 +00:00
terminx
ea602827cd Indicate MSVC in build string
git-svn-id: https://svn.eduke32.com/eduke32@4339 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-22 01:26:34 +00:00
helixhorned
2afb680d22 engine.c: always setup blending table whenever drawing translucent objects.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4338 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-19 19:47:28 +00:00
helixhorned
caed55e9a4 Lunatic: engine.setupDebugBasePal(), auto-detect 2nd+ shadexfog.translate().
engine.setupDebugBasePal() set up the water base palette such each of the first
15 "ramps" of 16 consecutive colors has a single, "representative" color. For
example, color indices 0-15 and black, 16-31 are dark gray.
In shadexfog.lua, list remappings from LOOKUP.DAT that are expressible as
remappings of 16-tuples.

git-svn-id: https://svn.eduke32.com/eduke32@4337 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-19 19:47:25 +00:00
helixhorned
b79fa42903 Lunatic: add engine.saveLookupDat() and document, related tweaks.
- Mapster32: before loading LOOKUP.DAT, set palookup[0][239]=239 to
  make an identity map of the base shade table's shade 0
- Rewrite color index remapping case of makepalookup() for clarity

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4336 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:16:06 +00:00
helixhorned
df25e3cd7c In loadlookups(), look for gap of 4 consecutive unused pals for fog pals.
As opposed to the previous way, where the first fog pals was <numlookups>+1,
where <numlookups> is the first byte value of LOOKUP.DAT. This allows to
pack e.g. lookups [1 .. 25] and [30 .. <lastpal>] into LOOKUP.DAT and have fog
pals be generated at pals [26 .. 29] (i.e. the additional lookups don't
shift the fog pals, making user maps depending on these numbers not look as
intended.)

git-svn-id: https://svn.eduke32.com/eduke32@4335 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:16:05 +00:00
helixhorned
7e7507746d Factor out common parts of loading LOOKUP.DAT into engine.c:loadlookups().
Also, error if didn't read enough data and account for TITLE and REALMS
swap between basepal number and on-disk order (sigh).

git-svn-id: https://svn.eduke32.com/eduke32@4334 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:16:03 +00:00
helixhorned
37ffae149e Lunatic: rewrite shadexfog.create_128_trans to allow creating fewer tables.
It must be a power of two in [2 .. 128]. Rewrite test/sprite_access.con's
liztroop example to account for that.
Also, add function shadexfog.create_trans() which aceepts a function
(r,g,b,R,G,B) -> blended (r,g,b) and rewrite shadexfog.create_additive_trans()
in terms of it.

git-svn-id: https://svn.eduke32.com/eduke32@4333 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:16:01 +00:00
helixhorned
e68d5a14b3 Lunatic: in shade table 'remap16' method, allow sparse table, document it.
Add shadexfog.createremap() convenience function.

git-svn-id: https://svn.eduke32.com/eduke32@4332 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-16 19:15:59 +00:00
helixhorned
00a6a058ef Lunatic: in engine.savePaletteDat(), open file in binary mode. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4331 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-13 15:39:28 +00:00
helixhorned
23ecf8cce0 Amend r4318: Lunatic doesn't need the safety check.
git-svn-id: https://svn.eduke32.com/eduke32@4328 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-12 21:02:59 +00:00
terminx
faa8133cda Support "r_windowpositioning" in SDL builds.
git-svn-id: https://svn.eduke32.com/eduke32@4327 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-11 17:55:45 +00:00
hendricks266
70caa24f24 MSVC: Set up support for SDL2. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4326 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-11 07:39:09 +00:00
hendricks266
c2cb6a9754 Networking updates.
- Added preprocessor value NETVERSION, to be incremented in the source whenever changes are made to the network protocol.
- Implemented proper server-side version verification of all clients upon connection.
- Implemented connection refusal when we reach MAXPLAYERS. (Should be expanded to implement server player caps.)
- Protected against OOB array accesses if an invalid player id is received.
- Renamed all "Recieve" to "Receive".

git-svn-id: https://svn.eduke32.com/eduke32@4322 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 11:00:25 +00:00
hendricks266
3b5dea7347 Fix warnings when building in C++11 mode, i.e. with CPLUSPLUS=1 CUSTOMOPT="--std=gnu++11".
git-svn-id: https://svn.eduke32.com/eduke32@4321 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 11:00:07 +00:00
hendricks266
8f9ffcf23f MSVC: Add support for x64 building and all synthesis libs (libpng/zlib, libvpx, libFLAC).
External ogg/vorbis are no longer required.

git-svn-id: https://svn.eduke32.com/eduke32@4320 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 10:59:42 +00:00
hendricks266
fd3712ab22 Windows: Full library refresh.
git-svn-id: https://svn.eduke32.com/eduke32@4319 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 10:58:38 +00:00
hendricks266
8146f6014c Don't crash if for some reason your CONs don't define actors like SHOTSPARK1, which has its strength value used in hardcoded behavior.
git-svn-id: https://svn.eduke32.com/eduke32@4318 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 10:56:27 +00:00
hendricks266
5d92bef194 Very minor changes after an investigation into the possibility of Polymost on Wii.
git-svn-id: https://svn.eduke32.com/eduke32@4317 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 10:56:14 +00:00
hendricks266
7deb709ab6 Replace QuickLZ with LZ4.
git-svn-id: https://svn.eduke32.com/eduke32@4316 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 10:55:49 +00:00
helixhorned
0aa7b11dca C-CON: add *actor[].blend as an alias to .detail, *tspr[].tsprblend analogously.
See lunatic/test/sprite_access.con for a LIZTROOP that periodically smoothly
alpha-fades in and out. (Assuming that the 128 alpha blending tables from
shadexfog.create_128_trans(1) are installed.)

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4313 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-09 19:22:36 +00:00
helixhorned
846fcdf31c Extend PALETTE.DAT format to allow carrying additional blending tables.
Lunatic: also, add an additional argument 'moreblends' to
engine.savePaletteDat() and document that function.
See test/shadexfog.lua for a "user-friendly" wrapper shadexfog.save() which
prints success or errors.

git-svn-id: https://svn.eduke32.com/eduke32@4312 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-09 19:22:35 +00:00
helixhorned
075d817ed7 Lunatic: move code in test/shadexfog.lua to engine.savePaletteDat() and complete it.
The function now writes out a full PALETTE.DAT: base balette, shade table and
translucency table.

git-svn-id: https://svn.eduke32.com/eduke32@4311 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-09 19:22:33 +00:00
helixhorned
eec27960ea Lunatic: update dynsymlists. Move blendtable[] from build.h to engine.c.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4309 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:59 +00:00
helixhorned
a9fb9e6356 Lunatic: add a 'lastokcol' argument to engine.nearcolor() and document it.
On the C side, slightly rewrite (now) getclosestcol_lim() for clarity.

git-svn-id: https://svn.eduke32.com/eduke32@4308 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:58 +00:00
helixhorned
5726a15bb3 Lunatic: document engine.*blendtab() and engine.getrgb() functions.
git-svn-id: https://svn.eduke32.com/eduke32@4307 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:57 +00:00
helixhorned
0637c2b6a8 M32script: remove sprite members 'detail' and 'filler', add 'blend', make r/w.
git-svn-id: https://svn.eduke32.com/eduke32@4306 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:56 +00:00
helixhorned
ad8d6795e2 In the C code, rename sprite[].filler to 'blend'.
Also, fix a missed .filler -> g_ambiencePlaying[] rewrite in the editor.
In C-CON, 'detail' is kept as alias to C-side (former) .filler / now .blend,
but that name is *deprecated*.

git-svn-id: https://svn.eduke32.com/eduke32@4305 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:55 +00:00
helixhorned
e379cd3655 Polymer: factor out polymer_invalidatesprite(), use when viewscreen tex changed.
Also, rewrite invalidatetile() for clarity.

git-svn-id: https://svn.eduke32.com/eduke32@4303 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:52 +00:00
helixhorned
a37c31cab7 Lunatic: rename sprite[].filler member to 'blend' on the Lua side.
From LunaCON, remove 'detail' as alias to that member.

git-svn-id: https://svn.eduke32.com/eduke32@4302 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:51 +00:00
helixhorned
330b744a1b Classic: support for multiple blending tables + Lunatic interfaces.
Currently, sprite[].filler (to be renamed) selects a blending table. If none
is installed with that index, the blending table at index 0 is taken (which is
read from PALETTE.DAT on engine startup). Thus, for now, the non-Lunatic build
will never use a custom blending table because there's no way to register one!
But the functionality is there.

git-svn-id: https://svn.eduke32.com/eduke32@4301 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:49 +00:00
helixhorned
54c74ca78e astub.c: in M32_MoveFX, use separate bit array to store "sound is playing".
Instead of sprite[].filler.

git-svn-id: https://svn.eduke32.com/eduke32@4300 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:48 +00:00
helixhorned
bd34885653 LunaCON: add and document -Wnever-used-gamevar and -Wnever-read-gamevar.
git-svn-id: https://svn.eduke32.com/eduke32@4299 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:47 +00:00
helixhorned
0d0f3a1cd2 Add Makefile.common switch ALLOCACHE_AS_MALLOC, remove DEBUG_WITH_VALGRIND.
git-svn-id: https://svn.eduke32.com/eduke32@4298 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-08 14:37:41 +00:00
terminx
f0da70b4c1 Fix yellow keycards
git-svn-id: https://svn.eduke32.com/eduke32@4297 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-02 22:18:35 +00:00
terminx
482b36521d Fix a missing reference to WEAPON_POS_LOWER
git-svn-id: https://svn.eduke32.com/eduke32@4296 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-02 22:18:21 +00:00
helixhorned
2b583e9c9e gloadtex() cleanup, make some vars in kplib.c static, add source/valgrind_errors.log.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4295 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-02 15:56:13 +00:00
helixhorned
41cee5ed69 sounds.c: exit S_PlayMusic() early if length of file is <4 bytes, clean up mem mgmt.
git-svn-id: https://svn.eduke32.com/eduke32@4294 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-02 15:56:11 +00:00
helixhorned
21a8788b6b LunaCON: implement 'precache'.
git-svn-id: https://svn.eduke32.com/eduke32@4291 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-02 10:50:40 +00:00
helixhorned
6d8ea48257 LunaCON: add option -ferror-nonlocal-userdef, on by default.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4290 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-01 16:19:59 +00:00
helixhorned
f04ec9e117 sounds.c: do S_MusicVolume() in S_SoundStartup().
This fixes this initialization issue:
http://forums.duke4.net/topic/7144-midi-volume-weirdness/

git-svn-id: https://svn.eduke32.com/eduke32@4289 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-01 16:19:58 +00:00
helixhorned
f7035da876 Some functionality-conserving cleanup of jaudiolib code.
git-svn-id: https://svn.eduke32.com/eduke32@4288 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-01 16:19:57 +00:00
helixhorned
7c26c180cd LunaCON: accept empty square brackets for {g,s}etuserdef optional index part.
git-svn-id: https://svn.eduke32.com/eduke32@4287 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-01 16:19:55 +00:00
helixhorned
842cce37b7 Lunatic: Fix compilation of C++ build, but not starting up yet.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4286 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:13:03 +00:00
helixhorned
60612d07f0 LunaCON: error on userdefs accesses with non-local current player.
Add lunatic/test/getuserdef.con.

git-svn-id: https://svn.eduke32.com/eduke32@4285 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:13:01 +00:00
helixhorned
6d4f56c643 Get rid of neartag* global variables. LunaCON: fix 'operate'.
git-svn-id: https://svn.eduke32.com/eduke32@4284 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:13:00 +00:00
helixhorned
aa547e8c16 sector.c: factor out goto soup in P_CheckSectors() into function.
git-svn-id: https://svn.eduke32.com/eduke32@4283 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:12:59 +00:00
helixhorned
6de687ba86 sector.c: cleanup round 3, P_ActivateSwitch() refactoring.
git-svn-id: https://svn.eduke32.com/eduke32@4282 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:12:58 +00:00
helixhorned
ab5c89430c sector.c and related cleanup, round 2.
- use SPRITES_OF* iterator macros
- new function: E_SpriteIsValid(); add some safety checks
  (e.g. hitag used as sprite index)
- the rest is mostly "the usual code transformations"

git-svn-id: https://svn.eduke32.com/eduke32@4281 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:12:56 +00:00
helixhorned
8fbefe829a sector.c: cleanup round 1, trivial changes.
git-svn-id: https://svn.eduke32.com/eduke32@4280 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-31 21:12:55 +00:00
helixhorned
bebdc6ff4f Follow-up to RTS cleanup: factor out 2x almost-same code into G_StartRTS().
git-svn-id: https://svn.eduke32.com/eduke32@4279 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-30 19:12:10 +00:00
helixhorned
da6c7109c1 Reincarnate RTS sound functionality together with cleaning up related code.
- Make Win+F* also make play and RTS sound, since modern OS's window managers
  like to eat Alt-F*. (Some Win+F* may be inaccessible too, but together all
  10 should hopefully be covered.)
- Fix an issue where keys other than F1-F10 were considered as starting an RTS
  sound and crashing EDuke32 in the process

git-svn-id: https://svn.eduke32.com/eduke32@4278 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-30 19:12:08 +00:00
helixhorned
1b3046d1c8 Fix respawn operation with monsters off, rewriting G_OperateRespawns().
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4276 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-29 18:32:51 +00:00
helixhorned
63e0de5e3d TROR: when clearing bunch number of c/f with yax_setbunch(), don't reset xpanning.
In the non-Lunatic build naturally, since the Lunatic one uses its own member.

git-svn-id: https://svn.eduke32.com/eduke32@4275 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-28 19:03:47 +00:00
hendricks266
62abd504ef Print "32-bit"/"64-bit" along with the version number in the log.
git-svn-id: https://svn.eduke32.com/eduke32@4274 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-27 10:31:39 +00:00
hendricks266
b2a3aec334 audiolib: Introduce support for PlayStation CD-XA audio, a simple ADPCM format.
It's functional, but due to the odd 37.8 KHz nature of the format, I will need to add a resampler to the audiolib to prevent the aliasing artifacts that occur at present. I also hear clicks/pops every so often, but I do not know if a resampler would fix these as well or if they are a separate problem.

Note that you cannot directly use the four XA files on the Total Meltdown disc because they each contain eight songs. They would need to be split using a utility I wrote that is outside the scope of this SVN.

git-svn-id: https://svn.eduke32.com/eduke32@4268 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-27 10:30:00 +00:00
helixhorned
3a85134e31 LunaCON: add codegen option -fbad-getactorvar-use-pli for C-CON compatibility.
Also, improve -Wnumber-conversion warning by printing the resulting number.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4266 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-24 21:39:04 +00:00
helixhorned
8b7cb9e6c9 Mapster32: make wall texture alignment [.]/[,] work with bottom-swapped walls.
In simple cases, it should be added. Combinations of alignment across TROR
boundaries and bottom-swapping will probably not work right.

git-svn-id: https://svn.eduke32.com/eduke32@4265 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-24 21:39:03 +00:00
helixhorned
0ab2814f2e jaudiolib: don't attempt audio format auto-detection for less than 12 bytes.
git-svn-id: https://svn.eduke32.com/eduke32@4263 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-24 21:38:59 +00:00
helixhorned
b6e9c0b409 Lunatic: document engine.*shadetab() functions. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4262 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-19 20:17:25 +00:00
helixhorned
14db86ebb5 Lunatic: make gv.current{Level,Episode} one-based and document them.
Also, in LunaCON, make player .palette member read-only. BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4260 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-15 20:29:10 +00:00
helixhorned
63464e3693 ivfrate: fix one error message, make -h/--help display usage.
Actually, right now, any first arg starting with '-' will show the usage.

git-svn-id: https://svn.eduke32.com/eduke32@4258 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-15 20:29:06 +00:00
helixhorned
4881a13f99 Engine-side per-map ART file support.
When a map named <filename>.map is loaded (<filename> may also contain directory
separators), the engine checks for existence of <filename>_XX.art in the virtual
file system, where XX is a 0-padded number from 00 to 19. It loads a consecutive
sequence of these ART files, i.e. aborts whenever a number in the sequence isn't
found (in contrast to normal ART loading).

Restrictions:
 - the per-map ART files must not reside in ZIP files
 - if a tile number is attempted to be overridden that has a dummytile or is
   cache1d-locked, per-map ART loading fails
On failure, the map is still loaded, but a diagnostic message is output to the
log/OSD.

Loaded per-map ART data are cleared whenever the map is "left". In particular:
 - whenever another map is loaded
 - in the editor: when a new map is started
 - in the game: after the bonus ending screen of a finished level, after going
   to the title screen via the menu

A final note: file names are supposed to be looked up and compared
case-sensitively. That is, <filename> must match EXACTLY between the map's and
per-map ART one; 'art' must be lowercase. Otherwise, the cookie monster will
come and eat you!

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4257 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:54:36 +00:00
helixhorned
8d47e476c7 LunaCON: for readgamevar, if ud.config.scripthandle < 0, keep value, don't err.
git-svn-id: https://svn.eduke32.com/eduke32@4256 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:54:34 +00:00
helixhorned
3b1515e51b Stylistic/formatting tweaks in cache1d code.
git-svn-id: https://svn.eduke32.com/eduke32@4255 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:54:33 +00:00
hendricks266
f046a405e6 Fix a case where the bonus screen would immediately end with an input press because all code between iterations of the bonus screen would execute in less than 1/120th of a second, not leaving any time for totalclock to increment.
EDuke32. Where our code runs so fast, it breaks old code.

git-svn-id: https://svn.eduke32.com/eduke32@4252 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:05:39 +00:00
hendricks266
cf16225f5e Fix the display of the multiplayer results screen.
git-svn-id: https://svn.eduke32.com/eduke32@4251 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:05:23 +00:00
hendricks266
e263d0ada9 Run Net_SendClientInfo() after game state creation to properly set up the player's user_name.
git-svn-id: https://svn.eduke32.com/eduke32@4250 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:05:07 +00:00
hendricks266
3ed90ca4f2 Block off hacks for the primitive splitscreen CON mod with SPLITSCREEN_MOD_HACKS so they are no longer compiled.
These hacks could no longer be allowed to co-opt the fake multiplayer mode, used for local testing and mod development.

I have half a mind to remove the hacks outright because they could be likened to drilling bolts directly into your car engine just so you could mount a bowling ball as a hood ornament. However, I don't want to take away the splitscreen hack mod from anyone who uses it, and the work done on these hacks should be useful if proper splitscreen were implemented internally using per-player input and multiple renderer/audio passes.

git-svn-id: https://svn.eduke32.com/eduke32@4249 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:04:51 +00:00
hendricks266
3b1b5bb41d For DISABLEINLINING=1, apply __fastcall to make up for the lack of inlining.
git-svn-id: https://svn.eduke32.com/eduke32@4247 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:04:02 +00:00
hendricks266
90f4e7d7c8 Always run tsprites with statnum TSPR_TEMP though EVENT_ANIMATESPRITES, such as the "show opponent's weapon" in multiplayer.
git-svn-id: https://svn.eduke32.com/eduke32@4246 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:03:37 +00:00
hendricks266
8fa00afb7c Mapster32: Add EVENT_LOADMAP, EVENT_SAVEMAP, EVENT_PRELOADMAP, and EVENT_PRESAVEMAP.
Some are more useful than others.

git-svn-id: https://svn.eduke32.com/eduke32@4244 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:03:00 +00:00
hendricks266
1014af812f Allow the episode 4 cutscenes to be skipped in their entirety with one keypress, as in the original DOS game, instead of requiring input for each ANM file.
git-svn-id: https://svn.eduke32.com/eduke32@4243 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:02:30 +00:00
helixhorned
9e968b0093 Lunatic: remap16 method for engine.shadetab, 2nd attempt at recreating orig. one.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4242 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-05 14:06:14 +00:00
helixhorned
a9fb18b228 Lunatic: document fundamentals of shade tables, but not 'engine' API yet.
git-svn-id: https://svn.eduke32.com/eduke32@4239 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-02 00:08:39 +00:00
helixhorned
e71df2b6e3 Lunatic/m32: make Mapster23 actually start stand-alone, oops.
git-svn-id: https://svn.eduke32.com/eduke32@4238 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-02 00:08:36 +00:00
helixhorned
49de6d79b3 Lunatic/m32: include the Lua bytecode into the binary, exit if setup failed.
git-svn-id: https://svn.eduke32.com/eduke32@4237 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:52:01 +00:00
helixhorned
13c125db02 Lunatic: add 'engine' module, currently allowing to create custom shade tables.
Available in the game and editor. Provide test/shadexfog.lua, containing a
function to creating a set of 32 shade tables corresponding to different shades
of the same fog palookup table, together with some tests and convenience
functions.

Also,
- Add gv.LUNATIC_CLIENT{,_EDUKE32,_MAPSTER32}
- Add LUNATIC_FIRST_TIME in the global env for the game
- defs_m32.lua: add reload() convenience function
- Failed attempt at recreating the base shade table. It is NOT a linear ramp
  of the base palette colors to (0,0,0). That is, it's not created by
  build/util/transpal.exe!

git-svn-id: https://svn.eduke32.com/eduke32@4236 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:52:00 +00:00
helixhorned
75f5449e9a build.lua: add a flag toggling multiplication of the color components by 4.
git-svn-id: https://svn.eduke32.com/eduke32@4235 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:57 +00:00
helixhorned
2174b17901 Lunatic: fix setup under Mapster32, remove a few obsolete lines in defs_common.lua.
git-svn-id: https://svn.eduke32.com/eduke32@4234 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:55 +00:00
helixhorned
8a4c5259a8 In the no-netcode build, don't expose four internal engine functions.
Also don't compile three multiplayer related OSD commands there.

git-svn-id: https://svn.eduke32.com/eduke32@4233 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:54 +00:00
helixhorned
70d84cd75b Lunatic: run EVENT_INIT after initial Lua state creation.
git-svn-id: https://svn.eduke32.com/eduke32@4231 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-31 11:51:50 +00:00
helixhorned
148badc32a Lunatic: allow access to sprite[].yvel through set_yvel() member, document.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4230 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:39 +00:00
helixhorned
21d8e52f0a Remaining sanitizing of .yvel usage plus minor cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@4229 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:36 +00:00
helixhorned
2dd9b7e495 Clean up legacy ROR code and introduce LEGACY_ROR define in game.h.
Also, bound-check two .yvel meant as sprite indices in actors.c.

git-svn-id: https://svn.eduke32.com/eduke32@4228 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:34 +00:00
helixhorned
9b045deb4b Make a couple of player functions take player indices instead of DukePlayer_t *.
git-svn-id: https://svn.eduke32.com/eduke32@4227 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:31 +00:00
helixhorned
efdd31d5a9 Guard retrieval of player index (.yvel) from APLAYER sprite.
It is unacceptable that yvel is on one hand modifiable without restriction from
scripting, but can be used as an array index without prior bound check in the C
code. Because that member has an overloaded meaning and is also used for
innocuous purposes such as the green color intensity of an SE light, it's
infeasible to restrict access from scripting. Consequently, we must add bound
checks on the C side. This is the first part of the effort to make .yvel safe,
adding two functions P_Get() and P_GetP(). There are a couple of other uses as
some kind of index.

git-svn-id: https://svn.eduke32.com/eduke32@4226 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:27 +00:00
helixhorned
8a2d786e23 Reserve 16 tiles from the end of MAXTILES, don't allow as user tiles from ART/DEF.
git-svn-id: https://svn.eduke32.com/eduke32@4225 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:22 +00:00
helixhorned
2442b107f7 Lunatic: add example toggling forcefield wall to test.lua.
git-svn-id: https://svn.eduke32.com/eduke32@4224 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-28 17:04:18 +00:00
helixhorned
35b848e81f Don't consider W_FORCEFIELD+2 (surgery instruments) a forcefield picnum.
git-svn-id: https://svn.eduke32.com/eduke32@4222 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:15 +00:00
helixhorned
46ec5c4146 Clean up code related to forcefield player damage etc.
git-svn-id: https://svn.eduke32.com/eduke32@4221 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:14 +00:00
helixhorned
d26ae58627 Rename 'camsprite' to 'g_curViewscreen', other related cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@4220 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:12 +00:00
helixhorned
d3665719d9 Add helper utility lunatic/util/cmpart.lua.
git-svn-id: https://svn.eduke32.com/eduke32@4219 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:09 +00:00
helixhorned
2900144e22 Lunatic: swap con.insetsprite's 4th and 5th positional arguments.
git-svn-id: https://svn.eduke32.com/eduke32@4218 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:06 +00:00
helixhorned
3cef7cccc0 Lunatic: expose player[].gotweapon, document it and *_weapon() methods.
git-svn-id: https://svn.eduke32.com/eduke32@4217 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:03 +00:00
helixhorned
380aa880dc Consolidate P_AddWeaponNoSwitch into an additional P_AddWeapon argument.
git-svn-id: https://svn.eduke32.com/eduke32@4216 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:45:00 +00:00
helixhorned
c45ca57eb0 Minor stylistic tweaks of code related to weapon switching.
git-svn-id: https://svn.eduke32.com/eduke32@4215 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-26 19:44:56 +00:00
helixhorned
030f72d551 premap.c: stylistic cleanup in map loading code.
git-svn-id: https://svn.eduke32.com/eduke32@4214 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-24 09:44:25 +00:00
helixhorned
8dcee7c8dc Factor some code in config.c into OSD_WriteAliases(), move symbol_t to osd.c.
git-svn-id: https://svn.eduke32.com/eduke32@4213 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-24 09:44:24 +00:00
helixhorned
cc09a0ac92 Lunatic: don't allow starting demo recording, since gamevar diffing is NYI.
git-svn-id: https://svn.eduke32.com/eduke32@4211 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-24 09:44:21 +00:00
helixhorned
a4510e35a1 Lunatic: error on invalid static data read like 'sprite.picnum'.
git-svn-id: https://svn.eduke32.com/eduke32@4209 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-24 09:44:19 +00:00
helixhorned
02e0929ca7 Pass RETURN to EVENT_DAMAGEHPLANE in the 'dist' arg to allow chained callbacks.
git-svn-id: https://svn.eduke32.com/eduke32@4208 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-24 09:44:14 +00:00
helixhorned
fa6746867c Lunatic: add ceiling-or-floor method set_picnum(). BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4207 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:35 +00:00
helixhorned
0c69779b98 Scripting: Add EVENT_DAMAGEHPLANE and document it in Lunatic doc Appendix B.
Also add test/damagehplane.lua with these demonstrations:
 - custom breakable ceilings
 - breakable TROR glass

git-svn-id: https://svn.eduke32.com/eduke32@4206 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:33 +00:00
helixhorned
f10e1b1a16 Generalize Sect_DamageCeiling to Sect_DamageCeilingOrFloor, use appropriately.
- in the function itself: for floor, currently, do nothing (but this commit
  is in preparation of the next one, again)
- In Proj_MaybeDamageCF(), Proj_MaybeDamageCF2() and the A_RadiusDamage() use
  if the function, generalize to floors, but with the special case that
  parallaxed floors keep blocking projectiles, as before (in constrast to
  parallaxed ceilings). However, Sect_DamageCeilingOrFloor() is only
  called for non-parallaxed ceilings *and* floors.

git-svn-id: https://svn.eduke32.com/eduke32@4205 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:29 +00:00
helixhorned
99894812d8 Minor no-functionality-changing tweaks.
- factor out: G_WallSpriteDist()
- factor out: Proj_MaybeDamageCF() and Proj_MaybeDamageCF2()
  in preparation for the next commit
- Make PROJ_DECAYVELOCITY macro take an arg for readability's sake

git-svn-id: https://svn.eduke32.com/eduke32@4204 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:26 +00:00
helixhorned
0f6e22e20e sector.c: in ST9 handling code, prevent oob for improperly constructed doors.
git-svn-id: https://svn.eduke32.com/eduke32@4203 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:24 +00:00
helixhorned
dd52afbf1b Lunatic: fix a couple of spelling mistakes in the doc, found using Emacs ispell.
git-svn-id: https://svn.eduke32.com/eduke32@4202 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:22 +00:00
helixhorned
25108494d1 Lunatic: expose "con.shoot(tilenum, i [, zvel])". Document and add example.
git-svn-id: https://svn.eduke32.com/eduke32@4201 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 18:31:20 +00:00
hendricks266
cfedcbd7d7 Rewrite and unify the handling of the scrollwheel between layers, fixing it in the editor's 2D mode and tile selector under SDL.
The scrollwheel is unique among PC input because it has no innate "hold length". Previously, the layers gave the mousewheel a fake hold length to allow the not-necessarily-synchronous game/editor code to pick up the input before the layers marked it as "no longer pressed". This passed under Windows, but it didn't slide under SDL.

Besides the two problems listed above, it also potentially limited the rate of weapon selection, where scrolling too fast would not register every clicks. [Unrelatedly, this is still the case when you scroll faster than the game's own tickrate, but addressing that would require rewriting input handling to go through a list of "events" for each tic instead of looking at overall pressed/unpressed states.]

git-svn-id: https://svn.eduke32.com/eduke32@4200 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-20 07:24:09 +00:00
helixhorned
ee9e84c356 Various stylistic cleanup.
- Move ARRAY_SIZE() macro to compat.h, add another one ARRAY_SSIZE()
- In A_RadiusDamage(): note maybe-unaligned access issue, prevent unlikely oob
- sector.c: use SPRITES_OF* macros where appropriate

git-svn-id: https://svn.eduke32.com/eduke32@4199 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-12 19:22:16 +00:00
helixhorned
9e4f10f3e1 Lunatic: add "for s, what in sectorsofbunch(bunchnum, gv.BOTH_CF)" iterator.
git-svn-id: https://svn.eduke32.com/eduke32@4198 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-12 19:22:14 +00:00
helixhorned
c323fac09d m32script: fix parsing negated labels, getnumber* with neg. 'max'.
Exposed by this snippet from a.m32:
    getnumber256 .owner "OWNER (projection picnum): " -MAXTILES
Now, Alt+KP2 works as expected in 3D mode.

git-svn-id: https://svn.eduke32.com/eduke32@4196 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-11 21:23:47 +00:00
helixhorned
44351528db LunaCON: statically check some member assignments with literal numbers.
And issue warnings whenever the assignment would fail (error) at game time.

git-svn-id: https://svn.eduke32.com/eduke32@4195 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-11 21:23:42 +00:00
helixhorned
a5f0610b38 Do not consider system gamearrays for updating from demos.
This generally fixes demo playback. Before, tilesizx[]/tilesizy[] were written
into twice as many bytes as needed. Now, don't do that at all.

git-svn-id: https://svn.eduke32.com/eduke32@4191 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-06 18:56:39 +00:00
helixhorned
1542596290 Lunatic: in fs.listpath() use FIND_NOCURDIR. Also document that function.
git-svn-id: https://svn.eduke32.com/eduke32@4189 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-01 18:28:02 +00:00
helixhorned
67c1157b64 Guard a sprite/actor access with sector[].hitag as index from OOB.
Unlikely but possible for rogue CON code.

git-svn-id: https://svn.eduke32.com/eduke32@4185 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-01 18:27:52 +00:00
helixhorned
ce68b4ab0f Lunatic: document a couple of player members, especially some 'bool' ones.
Important because in Lua, a value of zero yields true in a boolean context.

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4184 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:18:11 +00:00
helixhorned
9688dccfff multivoc.c: use a local variable instead of a file-scope one used locally.
git-svn-id: https://svn.eduke32.com/eduke32@4183 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:18:09 +00:00
helixhorned
7350e1cfa0 In P_HandleSharedKeys(), clean up weapon index bound checking.
In particular, (int32_t)j != -1 is replaced by (uint32_t)j < MAX_WEAPONS
to prevent a value >= MAX_WEAPONS to be assigned to p->wantweaponfire (it's
used as a weapon index in P_CheckWeapon().

git-svn-id: https://svn.eduke32.com/eduke32@4181 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:18:05 +00:00
helixhorned
8ab35ec520 Don't assign result of A_PlaySound() to p->scream_voice if the former is >127.
Because p->scream_voice is an int8_t.
This is an unlikely situation (126 voices ought to be playing simultaneously
while starting the "scream" sound), but still...

git-svn-id: https://svn.eduke32.com/eduke32@4180 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:18:04 +00:00
helixhorned
b6efd5e57e LunaCON: disable some player members, tweak decls of others.
The ones disabled are because they were found to not be used in any mod I
tested. Exposing members directly is rarely good API.

- bool toggle_key_flag -> const uint8_t ... (because value 2 is used)
- make scream_voice, cheat_phase read-only

git-svn-id: https://svn.eduke32.com/eduke32@4179 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:18:02 +00:00
helixhorned
f26663a9dc Lunatic: slightly tweak the event/actor times printout when exiting.
git-svn-id: https://svn.eduke32.com/eduke32@4178 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:18:00 +00:00
helixhorned
cc1574464b LunaCON: fix assignment to projectile sound/bsound/isound.
git-svn-id: https://svn.eduke32.com/eduke32@4177 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:17:56 +00:00
helixhorned
fd978ced59 Classic: implement horiz. tex panning for sprites (spriteext[].xpanning).
Known as getactor/sprite[].xpanning from CON, values are 0-255. It should be
assumed that this is only valid for wall-aligned sprites (currently, face
sprites also pan).

A test is provided in lunatic/test/animatesprites.con. It should be run in E1L2
and only with the Lunatic build.

git-svn-id: https://svn.eduke32.com/eduke32@4170 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:21 +00:00
helixhorned
bc54631888 a.m32: add [']+[F] menu function setting xvel=1 on all sel. wall/floor sprites.
For sanitizing underwater sections, see r4166.
Also, don't print "Menu function executed successfully" when the function
printed something itself.

git-svn-id: https://svn.eduke32.com/eduke32@4169 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-19 19:00:02 +00:00
helixhorned
ffed49b395 Amend r4142: make e.g. 'include a' (names shorter 4 chars) append ".m32".
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4168 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-18 10:51:26 +00:00
helixhorned
2972155f14 sdlmusic.c: disable FORK_EXEC_MIDI.
Also, if it were to be reenabled again, use execv() instead of execvp(),
i.e. don't look up $PATH for the executable.

git-svn-id: https://svn.eduke32.com/eduke32@4167 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:23 +00:00
helixhorned
863aae3fb1 Game: make underwater blocking floor sprites w/ xvel 1 NOT act like sprite bridge.
Likewise for blocking wall sprites. This makes it possible to construct
underwater sections containing complex spritework without losing the
"underwater-ness" when over such sprites, in a backward-compatible way.
Actually, the check is for bit 1 being set, but all other bits should be
considered reserved.

git-svn-id: https://svn.eduke32.com/eduke32@4166 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:21 +00:00
helixhorned
9ceae0d892 lunatic/util/foreachmap.lua: don't expand .xxx after ']'.
Add an example searching for all maps containing blocking floor-aligned
sprites in underwater sectors.

git-svn-id: https://svn.eduke32.com/eduke32@4165 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:19 +00:00
helixhorned
4dcd167c7a LunaCON: for gamevar-already-defined warnings/errors, show old location.
Synthesis, BUILD_LUNATIC! Got the build? Good synthesis.

git-svn-id: https://svn.eduke32.com/eduke32@4153 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-12 21:03:23 +00:00
helixhorned
25081fb459 LunaCON: In lunacon.lua, make room for a couple more locals at file scope.
Also, really reset all label-related tables in reset.labels().

git-svn-id: https://svn.eduke32.com/eduke32@4152 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-12 21:03:20 +00:00
helixhorned
82fb8a0724 LunaCON: for *-already-defined style warnings/errors, show location of old def.
git-svn-id: https://svn.eduke32.com/eduke32@4151 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-12 21:03:18 +00:00
helixhorned
987eb858d3 LunaCON: add a couple of userdefs members, fix tsprite's sectnum for writing.
git-svn-id: https://svn.eduke32.com/eduke32@4150 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-12 21:03:16 +00:00
helixhorned
78d30bee9b LunaCON: implement 'ssp' command.
git-svn-id: https://svn.eduke32.com/eduke32@4149 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-12 21:03:11 +00:00
helixhorned
42f66ce9ca Lunatic: add 'fs' module containing 'listpath' function, 'd' in global env.
See the updated documentation for (ATM sparse) details.

git-svn-id: https://svn.eduke32.com/eduke32@4147 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-11 16:48:23 +00:00
helixhorned
8029aceaa4 CON: add sprite pseudo-member 'isvalid', getting 1 if the sprite is valid.
And 0 otherwise. Before accessing a sprite that is not not known to be
definitely valid (e.g. a loop over all sprites from 0 to MAXSPRITES-1),
one should check for validity before accessing it in any other fashion.

git-svn-id: https://svn.eduke32.com/eduke32@4146 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-11 16:48:17 +00:00
helixhorned
92594f09c8 Lunatic: add two names forgotten for dynsymlist.
Let's BUILD_LUNATIC to see whether it still works...

git-svn-id: https://svn.eduke32.com/eduke32@4145 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:49 +00:00
helixhorned
f63510cc33 In C_SetCfgName, don't use unsafe string functions with unknown-length input.
git-svn-id: https://svn.eduke32.com/eduke32@4144 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:47 +00:00
helixhorned
b67c76f814 LunaCON: implement 'setcfgname'.
Factor out a block of code into C_SetCfgName() and use that from lunacon.lua.

git-svn-id: https://svn.eduke32.com/eduke32@4143 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:45 +00:00
helixhorned
f620a28d74 LunaCON: on 'starttrack' with null music, issue a 'soft' error.
That is, one that doesn't break the control flow.

git-svn-id: https://svn.eduke32.com/eduke32@4142 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:42 +00:00
helixhorned
84357152eb Lunatic: fix ported A_FurthestVisiblePoint().
git-svn-id: https://svn.eduke32.com/eduke32@4141 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:40 +00:00
helixhorned
77574e30b9 LunaCON: implement NORESET flag for gamevars.
git-svn-id: https://svn.eduke32.com/eduke32@4140 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-08 18:08:37 +00:00
helixhorned
37d8cbedcc OSD: factor out getting sh/pal using format+text buffers into OSD_GetShadePal().
git-svn-id: https://svn.eduke32.com/eduke32@4136 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:08 +00:00
helixhorned
794edf18ff Lunatic: add 'lua' OSD command, permitting to execute arbitrary code.
That is, everything that would be possible via scripting.

git-svn-id: https://svn.eduke32.com/eduke32@4134 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 22:56:03 +00:00
helixhorned
e132073640 For demos, make savehead.savename[] carry the SVN revision number.
Also, shorten "FAILED STARTING DEMO RECORDING." message so that it fits on
the screen. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4133 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 18:21:09 +00:00
helixhorned
4cb24de24e In exprs like "Bmemcpy(&p->pos.x, &sprite[i].x, sizeof(vec3_t))", drop the ".x".
git-svn-id: https://svn.eduke32.com/eduke32@4132 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-04 18:21:07 +00:00
hendricks266
ccf7d2d470 Allow -g, -x, -h, -j, and for the game, -d, to take their file name after a space. This allows quotes to be used with them properly.
I updated the help windows to prefer these variants because they are superior to the -xSquished versions.
Also, factor out the command-line processing code for the above, plus con/def modules and clipmaps.

git-svn-id: https://svn.eduke32.com/eduke32@4128 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-03 04:02:23 +00:00
hendricks266
837c5c6b84 RegCloseKey when we are done with RegOpenKeyEx.
git-svn-id: https://svn.eduke32.com/eduke32@4127 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-03 04:02:01 +00:00
helixhorned
b6475100d7 In G_SaveMapState, fix 1024-byte write beyond array bound on 64-bit platforms.
This was caused by mismatched for types mapstate_t's animateptr[] and the global
one (int32_t vs. int32_t *).

Bump BYTEVERSION.

git-svn-id: https://svn.eduke32.com/eduke32@4125 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:32 +00:00
helixhorned
8beb990640 m32script: when failing to load file, don't append '.m32' if already there.
So that there are no error messages like "M32 file `a.m32.m32' not found."

Also, in build.c's 'save as' code, add a bound check that would probably
always pass in practice, but looks a bit safer and may fail in very cornerly
cases.

git-svn-id: https://svn.eduke32.com/eduke32@4124 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:30 +00:00
helixhorned
491e67c1cc m32script: when printing error line, replace tabs with spaces.
git-svn-id: https://svn.eduke32.com/eduke32@4122 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:27 +00:00
helixhorned
c2797e4b11 Mapster32: take initial map file name from ExtPreInit()->G_CheckCommandLine().
Instead of directly in build.c:app_main(). Previously, it was possible that an
argument to an option, e.g. "WGR2" with "-game_dir WGR2", would get interpreted
as the initial map to load. This in turn would attempt to execute WGR2.cfg as
sequence of OSD commands -- where that file is an EDuke32 config file instead!

Now: maps are passed without any options, e.g. "mapster32 [opts...] debug.map".
The map file name is not added to the "additional parameters" for map testing.

git-svn-id: https://svn.eduke32.com/eduke32@4121 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-28 21:26:25 +00:00
helixhorned
25edec9c0a LunaCON: very primitive gamevar handling logic for {save,load}mapstate.
git-svn-id: https://svn.eduke32.com/eduke32@4119 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:22 +00:00
helixhorned
6c88824792 LunaCON: in {save,load}mapstate, warn that saving/restoring gamevars is NYI.
git-svn-id: https://svn.eduke32.com/eduke32@4118 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-27 21:12:20 +00:00
helixhorned
ab7d3679df At end of G_RestoreMapState(), update g_player[].ps->i from STAT_PLAYER sprites.
This fixes a potential crash caused by violating the expected invariant
 sprite[g_player[player_index].ps->i].yvel == player_index
otherwise.

git-svn-id: https://svn.eduke32.com/eduke32@4114 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-25 21:57:09 +00:00
helixhorned
335957800b Lunatic doc: add Lua source code highlighting using GNU Source-highlight.
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4113 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-24 17:48:19 +00:00
helixhorned
d9b94c772d LunaCON: implement NODEFAULT flag (1024) as session variables.
This is in contrast to C-CON, where the implications are not clearly obvious.
See this discussion/monologue:
http://forums.duke4.net/topic/955-eduke32-scripting/page__view__findpost__p__159613

Currently not implemented for session gamevars:
 - per-player, will be made a global one instead
 - per-actor, will be made a plain per-actor one instead

DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4112 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-20 12:35:06 +00:00
helixhorned
937958afef LunaCON: add necessary identifier-is-not-gamevar check.
git-svn-id: https://svn.eduke32.com/eduke32@4111 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-20 12:35:03 +00:00
helixhorned
8248ef8446 CON: Add LOGO_FLAGS bits 4096-32768 to disable E1-E4 bonus scenes, respectively.
Each scene is disabled in its entirety, there's no way to disable only a
particular part. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4109 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-17 16:44:28 +00:00
helixhorned
7791f94073 Lunatic: make it possible to build with LuaJIT 2.1, add -Lopts=profile there.
git-svn-id: https://svn.eduke32.com/eduke32@4107 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:06 +00:00
helixhorned
1b29ac6db7 build.lua: add read_basepal().
git-svn-id: https://svn.eduke32.com/eduke32@4106 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:03 +00:00
helixhorned
4cb9ab1d7c foreachmap.lua: remove the need for a space for certain '.' accesses.
That is, now it's not necessary to write e.g. "io. write" -- .xxx is
translated to <what>[i].xxx only if it's a matching member name.

git-svn-id: https://svn.eduke32.com/eduke32@4105 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:43:01 +00:00
helixhorned
78e8f476e1 build.lua: add "artfile" class, allowing to open and get pics from an ART file.
git-svn-id: https://svn.eduke32.com/eduke32@4104 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-16 19:42:59 +00:00
hendricks266
401a73862a Wii: Fix build and add custom headers and libs to SVN. (It's helpful to set up a build system from scratch.)
DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4102 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-13 09:08:31 +00:00
helixhorned
1181121729 Revert "Move CONTROL_ProcessBinds() to CONTROL_GetInput()." [r3981]
That change confounded character-based input with e.g. HUD control
under certain circumstances, see
http://forums.duke4.net/topic/6845-eduke32-savegame-annoyances/

Also, BUILD_LUNATIC ... just for the hit.sect -> hit.sector change.

git-svn-id: https://svn.eduke32.com/eduke32@4093 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-11 13:43:39 +00:00
helixhorned
f9d597f237 Lunatic: add forgotten g_argv to dynsymlist_m32.
git-svn-id: https://svn.eduke32.com/eduke32@4092 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-11 13:43:37 +00:00
hendricks266
2ab39f2cca Clean up some GUI/WM minutiae. Should fix linking Mapster32 on *nix with HAVE_GTK=0.
git-svn-id: https://svn.eduke32.com/eduke32@4091 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-08 10:00:44 +00:00
hendricks266
d738fb7ad5 Fix the vsync menu option so that it actually works.
Variables at global scope which share a name tend to actually be the same variable. Not good when you pass such a variable to function that immediately returns if the passed parameter (the variable) equals said variable (itself).

git-svn-id: https://svn.eduke32.com/eduke32@4090 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-08 10:00:25 +00:00
hendricks266
6bf0bd0c60 Windows startup window tweaks:
- Don't print osd.szCSDVersion when it is empty, preventing an extra space between the OS name and version number. (An example of what this field holds is "Service Pack 1".)
- Under SDL, allow the "console" edit field to repaint after "OK" is clicked. Important when a long def file is loading.

git-svn-id: https://svn.eduke32.com/eduke32@4086 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:41 +00:00
hendricks266
333e0f26e2 Allow wm_msgbox() to use SDL_ShowSimpleMessageBox() under SDL2.
Unfortunately, SDL2 does not (yet?) provide a Yes/No box for wm_ynbox().

git-svn-id: https://svn.eduke32.com/eduke32@4085 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:24 +00:00
hendricks266
db69800fd0 Split the handling of audio based on RENDERTYPE into a new variable named MIXERTYPE, allowing Windows builds to use SDL for input and rendering (RENDERTYPE=SDL) while using DirectSound and Windows' MIDI interface (MIXERTYPE=WIN [current default]) so that EMIDI works.
git-svn-id: https://svn.eduke32.com/eduke32@4084 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:05:03 +00:00
hendricks266
4f2bc62dc2 Fix USE_OPENGL=0 build.
git-svn-id: https://svn.eduke32.com/eduke32@4081 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:03:49 +00:00
hendricks266
c1bbf25700 Fix the long-standing trivial warnings in net.c.
Cognitively, so much time has passed that these unused variables would offer little help indicating the roadmap for networking. In any case, I have taken care only to comment rather than remove anything that is more than just a throwaway loop counter.

If this commit inconveniences anyone in any way, please contact me personally and I will make it right.

git-svn-id: https://svn.eduke32.com/eduke32@4079 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:03:23 +00:00
hendricks266
612284cfea Improve SDL2 support as much as I can, for now. The game compiles, links, and starts, but all three renderers either don't display correctly or crash.
To build with SDL2: make RENDERTYPE=SDL SDL_TARGET=2

git-svn-id: https://svn.eduke32.com/eduke32@4074 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-06 07:49:53 +00:00
hendricks266
a831f408e4 Fix building of astub.c with MinGW 4.8.
We have to work around namespace pollution in <sys/stat.h>.

git-svn-id: https://svn.eduke32.com/eduke32@4072 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-06 07:49:10 +00:00
helixhorned
b2503da051 Lunatic: rename hitdata_t member 'sect' to 'sector' for consistency. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4071 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-22 12:42:06 +00:00
helixhorned
9d21cff5d3 Lunatic: document xmath.kangvec() and hitscan().
git-svn-id: https://svn.eduke32.com/eduke32@4070 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-22 12:42:00 +00:00
helixhorned
f30cc01a7a In C++ build, fix "narrowing conversion inside { } is ill-formed" warning.
This also exposes an actual issue. The sound definitions may be dynamically
remapped, in which case they are not necessarily <=255 any more.

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4069 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:38:56 +00:00
helixhorned
514a3bfd64 Prevent calling function pointers cast to an incompatible type.
Most often, this had happened when casting comparison functions for qsort()
like these: "int yax_cmpbunches(const int16_t *b1, const int16_t *b2)"
to a function pointer type expecting "const void *". Alas, this is undefined
behavior: see
http://blog.frama-c.com/index.php?post/2013/08/24/Function-pointers-in-C
and posts linked from it.

At least two cases have not been fixed:
- The savegame system maintains pointers which are either to data or a function in
  the generic "void *". This ought to be made into a union.
- Probably also:
  #define OSD_ALIAS     (int32_t (*)(const osdfuncparm_t*))0x1337

git-svn-id: https://svn.eduke32.com/eduke32@4068 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:38:44 +00:00
helixhorned
d2cd8af510 Minor changes for Lunatic utils, replace missed sound flag literals with macros.
git-svn-id: https://svn.eduke32.com/eduke32@4067 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-21 13:38:07 +00:00
terminx
d5b6496ddb Additional fix for the shareware version
git-svn-id: https://svn.eduke32.com/eduke32@4065 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-15 17:59:21 +00:00
terminx
95cf4ec90b Fix shareware version breakage introduced in r3913
git-svn-id: https://svn.eduke32.com/eduke32@4064 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-15 16:00:55 +00:00
helixhorned
e94fa7f70f Lunatic: make hitscan accept ray as vector, add xmath.kangvec.
Also, add hitscan test to test.lua -- a crosshair-like sprite is spawned
and continuously updated to the position of where the player aims at.

git-svn-id: https://svn.eduke32.com/eduke32@4059 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-13 20:23:54 +00:00
helixhorned
694975b2f5 Polymost: make spriteext[].{x,y,z}off independent of xdimen/viewingrange/aspect.
The offsets (that will translate the axes for .pitch/.roll rotation) were
calculated improperly with screen sizes other than 1280 x 1024 and were
dependent on other related variables. The fix proceeded empirically, i.e. mostly
trial, error, and some educated guesswork. (It's telling that the magic constant
1280 is needed.)  A test for Lunatic is added to test.lua that will rotate
SEENINES.
Bug pointed out by Mblackwell.

git-svn-id: https://svn.eduke32.com/eduke32@4058 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-13 20:23:45 +00:00
terminx
1baf9fa275 Add -usecwd parameter on Windows, to disable searching for Megaton Edition or GOG.com game data
git-svn-id: https://svn.eduke32.com/eduke32@4057 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-10 22:41:19 +00:00
helixhorned
f64fdf3384 Add foreachmap.lua module 'colenemy', allow passing module name to findmaps.sh.
The 'colenemy' module searches for colored enemies in maps, excluding pal-21
liztroops. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4056 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-10 19:17:06 +00:00
helixhorned
14467dec24 Replace literal g_sounds[].m bits with enum constants. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4055 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-08 20:18:56 +00:00
helixhorned
28d99e9658 Lunatic doc: add some text and examples for using require()/module().
git-svn-id: https://svn.eduke32.com/eduke32@4054 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-08 20:18:51 +00:00
helixhorned
2065cc911f Lunatic: document gv.getangle(), -Lopts=strict, sec:zrangeat(). DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4053 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-06 14:43:21 +00:00
helixhorned
7f37ac1303 Lunatic: r/w gamearrays in binary mode, checks for mapdiff.sh, add test/gamearray.con.
git-svn-id: https://svn.eduke32.com/eduke32@4052 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-06 14:43:20 +00:00
helixhorned
eef1977662 Lunatic/util: fixes for Windows.
- Need to open some files in binary mode.
- MinGW's "find" doesn't provide -L option, detect that.

git-svn-id: https://svn.eduke32.com/eduke32@4051 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-06 14:43:17 +00:00
helixhorned
85aa90d82c Lunatic: make -Lopts=strict also error on some table reads w/ nonexistent keys.
Specifically, for the tables returned with require"DEFS" etc. This allows to
check if maybe parts of a bundle of files is missing (because comparisons like
"spr.picnum == D.NONEXISTENT_NAME" do not yield errors normally).

git-svn-id: https://svn.eduke32.com/eduke32@4050 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:47 +00:00
helixhorned
1328c66f9c Lunatic: add option -Lopts=... from command line.
Permitting to enable various debugging options. See "eduke32 -debughelp"
for which ones those are: they were previously settable from defs_common.lua,
and a new option 'strict' has been added that makes accesses to void sprites
error. (That is, already "sprite[i]", not "sprite[i].some_member".)

git-svn-id: https://svn.eduke32.com/eduke32@4049 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:46 +00:00
helixhorned
d48383d2f7 A couple of minor changes.
- engine.c: comment out some unused decls with RELEASE=0 DEBUGANYWAY=1
- Lunatic: update dump.lua and v.lua
- Lunatic: test/test_geom.lua: note a perf regression (wrt older LuaJIT,
  or I mis-configured / built something wrong)

git-svn-id: https://svn.eduke32.com/eduke32@4048 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:44 +00:00
helixhorned
1b7c622f31 Lunatic: fix _digitalnumber, remove player._INPUT_BITS, add sprite.all().
git-svn-id: https://svn.eduke32.com/eduke32@4047 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:42 +00:00
helixhorned
3b69417792 util/build.lua: lose packing, use fread(), make bound-check nan-safe.
git-svn-id: https://svn.eduke32.com/eduke32@4046 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:40 +00:00
helixhorned
7543ba7226 premap.c: delete GPSPEED/CYCLERs only after the loop with EVENT_LOADACTOR events
git-svn-id: https://svn.eduke32.com/eduke32@4045 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:38 +00:00
helixhorned
e402467676 Lunatic: gv.getangle() vs. analogous Lua function test, add some anchors to doc.
Also, in listglobals.sh, check for file existence.

git-svn-id: https://svn.eduke32.com/eduke32@4044 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:36 +00:00
helixhorned
40a2e1da24 Lunatic: in control.lua, use C's fwrite() to write gamearray to disk, fix typo.
git-svn-id: https://svn.eduke32.com/eduke32@4043 1a8010ca-5511-0410-912e-c29ae57300e0
2013-09-05 17:37:35 +00:00
terminx
603fbf7cb5 Update the info displayed in the "details" tab of the application properties dialog in Windows--change copyright date to 2013, update Duke Nukem trademark ownership from Apogee Software, Ltd to Gearbox Software, LLC
git-svn-id: https://svn.eduke32.com/eduke32@4040 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-31 04:57:46 +00:00
helixhorned
6ac486c9ee Lunatic doc: move icons to doc/ root, as they were not showing up properly online.
That is, here: http://lunatic.eduke32.com/ or more specifically in lunatic.html.
BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4036 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:19 +00:00
helixhorned
ddea95c31b Lunatic doc: add appendix with hints on how to read Programming in Lua, 1st ed.
git-svn-id: https://svn.eduke32.com/eduke32@4035 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:16 +00:00
helixhorned
e0e3973b47 Bounds-check the tile number gotten from EVENT_GETMENUTILE.
git-svn-id: https://svn.eduke32.com/eduke32@4034 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:14 +00:00
helixhorned
4f699a2f21 Lunatic: update documentation a bit.
- add gv.GET, gv.WEAPON, gv.RETURN
- specify that sprite[].x/y/z and wall[].x/y are 32-bit ints
- add an example for con.longjmp()
- add an appendix listing the RETURN usage of various events

git-svn-id: https://svn.eduke32.com/eduke32@4032 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:12 +00:00
helixhorned
15bcfe3f34 Lunatic: on the Lua side, rename gv.g_RETURN to the prettier gv.RETURN.
On the C side, keep the name g_RETURN. I'm still superstitious about
dropping the "g_".

git-svn-id: https://svn.eduke32.com/eduke32@4031 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:10 +00:00
helixhorned
55a3cda9e1 Lunatic: retire gv.*_WEAPON and gv.GET_* for gv.WEAPON.* and gv.GET.*.
git-svn-id: https://svn.eduke32.com/eduke32@4030 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:09 +00:00
helixhorned
0a06ca29f2 Lunatic: fix passing some string members to con.action(), rewrite conststruct().
... by creating a struct with 'static const int' members, as recommended on
http://www.freelists.org/post/luajit/Performance-implications-of-large-FFI-constants,4

git-svn-id: https://svn.eduke32.com/eduke32@4029 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:04 +00:00
terminx
e8c2250d0a Rip out all traces of nedmalloc. Sorry, XP users--it's time to upgrade to something newer than an OS from 2001 if this affects you.
git-svn-id: https://svn.eduke32.com/eduke32@4027 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-20 21:49:44 +00:00
helixhorned
e53c50e6aa LunaCON: allow a certain type error present in 1.3D GAME.CON to pass.
git-svn-id: https://svn.eduke32.com/eduke32@4025 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-19 19:26:58 +00:00
helixhorned
9acb219721 Lunatic: a couple of trivial changes.
git-svn-id: https://svn.eduke32.com/eduke32@4021 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 19:24:25 +00:00
terminx
ba4cfe704c Fix issue with PIPEBOMB_CONTROL mode 2, reported at http://forums.duke4.net/topic/6721-grenade-lifetime
git-svn-id: https://svn.eduke32.com/eduke32@4019 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-17 22:48:31 +00:00
helixhorned
171226c7ac game.c: remove dead bounds check for cheatbuf[], add assertion.
The check is dead because it is made after the fact (oob access), but the
cheat string matching logic below actually assures that
cheatbuflen < sizeof(cheatbuf) at all times.
Exposed using the Stack tool from http://css.csail.mit.edu/stack/ .
Also, in gamedef.c's definecheat handling, print the string length (19), not
the buffer length (20) if the cheat was truncated.

git-svn-id: https://svn.eduke32.com/eduke32@4016 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:20 +00:00
helixhorned
7a9e9fada4 When issuing "setrendmode" OSD command with mismatched vidmode, auto-switch.
git-svn-id: https://svn.eduke32.com/eduke32@4015 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:19 +00:00
helixhorned
4b44063853 Fix taking address out of bounds of stack'd array, introduced in r3983.
Clang's UBSan reports this as undefined behavior. I think that the reason
is as follows: C99 6.5.3.2#1 (Constraints) says:

 The operand of the unary & operator shall be either a function designator, the
 result of a [] or unary * operator, or an lvalue that designates an object that
 is not a bit-field and is not declared with the register storage-class specifier.

But in case of an expression like "&array[-1]", the operand ("array[-1]") does
not designate a valid object.

Moral: check first -- assure that an expression is valid for a particular
operation before carrying it out. Keep in mind that otherwise, the compiler
is absolutely free to optimize out the *check*.

git-svn-id: https://svn.eduke32.com/eduke32@4014 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:18 +00:00
helixhorned
2aa55e5900 baselayer.c: remove baselayer_onvideomodechange, onvideomodechange.
git-svn-id: https://svn.eduke32.com/eduke32@4013 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:16 +00:00
helixhorned
d095ebf9b2 net.c: move a necessary bound check to BEFORE the oob access happening.
Fixes the undefined behavior discussed here:
http://forums.duke4.net/topic/3857-the-crash-thread/page__view__findpost__p__152612

git-svn-id: https://svn.eduke32.com/eduke32@4008 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:10 +00:00
helixhorned
ff05fb9b5c Retire MultiPsky_TileToIdx() in favor of engine-side getpskyidx().
DONT_BUILD, because there have been no significant changes of the non-Lua build.

git-svn-id: https://svn.eduke32.com/eduke32@4006 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:51 +00:00
helixhorned
af243f1cd6 Lunatic util: add foreachmap module 'plax', looking for maps w/ multiple psky tiles.
In foreachmap.lua, make init() be able to return a start index for cmdline args,
for the case where the run worker script wants to handle options, for example.

git-svn-id: https://svn.eduke32.com/eduke32@4005 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:50 +00:00
helixhorned
b6ea2a5c53 Lunatic: sync defs.ilua's user_defs with r3993, adding member MasterVolume.
git-svn-id: https://svn.eduke32.com/eduke32@4004 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:48 +00:00
helixhorned
e947f1fe87 Lunatic: prepare Makefiles for synthesis build.
- libs and headers are expected in platform/Windows/* (not there yet)
- prefix Lua #includes with luajit-2.0/
- build bytecode objects with absolute path name (used for debug info)

git-svn-id: https://svn.eduke32.com/eduke32@4000 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:42 +00:00
terminx
c9f43383a7 Fix net.h, dunno why MSVC accepts functions that don't match their prototypes without complaining... :p
git-svn-id: https://svn.eduke32.com/eduke32@3996 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-07 14:29:10 +00:00
terminx
67d786f48f Factor some duplicate code into Net_SpawnPlayer(), adjust Net_ExtractPlayerUpdate() a bit.
git-svn-id: https://svn.eduke32.com/eduke32@3994 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:54:09 +00:00
terminx
3391de39be Implement a master volume control that functions separately from the sound effect and music volume controls. This is important because it allows waveform based music (like the SC-55 music pack, etc.) to play back at a louder volume than the sound effects if the end user so desires.
git-svn-id: https://svn.eduke32.com/eduke32@3993 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:55 +00:00
terminx
e83927c2f8 Refactor projectiles a bit. Tested with all of the original weapons and with the weapons in the Duke 64 mod.
git-svn-id: https://svn.eduke32.com/eduke32@3992 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:34 +00:00
terminx
1d2a6bc9df Silence a MSVC warning
git-svn-id: https://svn.eduke32.com/eduke32@3991 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:21 +00:00
terminx
c41efa2a09 Bring GROWSPARK a bit more in line with the other hard-coded hitscan projectiles, and give it the same sort of accuracy adjustment as the pistol gets when autoaim is disabled.
git-svn-id: https://svn.eduke32.com/eduke32@3989 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:00 +00:00
terminx
af2e9e8cf1 Update ud.config.LastUpdateCheck even when G_GetVersionFromWebsite() fails. SourceForge was down today and it irritated me.
git-svn-id: https://svn.eduke32.com/eduke32@3988 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:49 +00:00
terminx
6ae675347b Fix http://forums.duke4.net/topic/2961-paper-cuts-minor-bugs-and-annoyances/page__view__findpost__p__164747 (mikesnd error)
git-svn-id: https://svn.eduke32.com/eduke32@3986 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:27 +00:00
terminx
c34410b7ed Fix up a couple of functions to adhere better to unwritten code formatting standards. Should be zero functional changes in terms of what the functions actually do.
git-svn-id: https://svn.eduke32.com/eduke32@3983 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:51 +00:00
terminx
c06e4262da Move CONTROL_ProcessBinds() to CONTROL_GetInput(). I don't think this breaks anything; if it does, revert it!
git-svn-id: https://svn.eduke32.com/eduke32@3981 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:25 +00:00
helixhorned
b5c5513924 Lunatic: disable printing debug messages for the preview build. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@3979 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:51 +00:00
helixhorned
a374a401be Clean up parallaxed sky functionality, part 2.
- Rename sky_t members: yscale -> horizfrac, bits -> lognumtiles.
- Add default sky (8 tiles, horizfrac=32768 (i.e. 1/2 the scene horiz), offsets
  all zero) and CLOUDYOCEAN sky (8 tiles, horizfrac=65536, offsets all zero)
  to multipsky[].
- Get rid of "psky_t g_psky", merely maintaining a g_pskyidx instead. Set it up
  at map load time so as to keep the behavior of the legacy per-map psky:
  the last sector index with a matching psky ceiling wins.
- In mapstate_t, save g_pskyidx too, not (former) pskybits and pskyoffs[].
- Make on-map-load global psky setup consistent for the game and editor by
  factoring it out into common.c: G_SetupGlobalPsky().
- Remove a couple of useless initializations, add some static assertions.

This commit is more likely to introduce subtle differences in behavior.
Specifically, getpsky() now always returns the default sky properties instead of
the global sky ones (but with all-zero offsets) when no match for a suiting
multi-psky is found. This is only likely to affect the yscale/horizfrac of
non-multi-pskies when a global non-default multi-psky has been set up.
Bump BYTEVERSION again.

git-svn-id: https://svn.eduke32.com/eduke32@3976 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:48 +00:00
helixhorned
46e8549b5e Clean up parallaxed sky functionality, part 1.
- Consolidate psky* arrays into a "typedef struct psky_t" "g_psky" and
  "multipsky[]".
- Factor out getting parallaxed sky properties into getpsky().
- Condense initial multi-psky setup by memcpy'ing from multipsky[].
- New function: MultiPsky_TileToIdx().
- Add new define PSKYOFF_MAX and related consistency-checking assertions.
- Lower MAXPSKYTILES to 8 to reflect current usage (was 256).
- Game: make multi-pskies consider dynamically-remapped MOONSKY1, BIGORBIT1
  and LA. (Not very useful as the editor will still only act for the static
  values -- 80, 84 and 89, respectively.)

An attempt has been made to preserve behavior even in strange cases, so this
commit is unlikely to introduce regressions. Because of point 6, BYTEVERSION
had to be bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3975 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:45 +00:00
helixhorned
97dce0fe63 Lunatic: sanity-check some arguments passed to con.action().
git-svn-id: https://svn.eduke32.com/eduke32@3974 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:40 +00:00
hendricks266
e58035b51c Force orientation bit 2 for screentext in addition to qstrdim, to match all other screen drawing commands.
git-svn-id: https://svn.eduke32.com/eduke32@3971 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:28 +00:00
helixhorned
262acc7ab3 Lunatic: Add pre-compiled LPeg 0.12 for 32-bit Windows (MinGW).
git-svn-id: https://svn.eduke32.com/eduke32@3970 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:13 +00:00
helixhorned
9bbc5c52de Lunatic: rename test.elua to test.lua.
The old extension is an artifact from when I was thought that extensions
should label whether a Lunatic module is to be used in internal/external
contexts.
Also, change test.lua slightly and commit a little updated documentation.

git-svn-id: https://svn.eduke32.com/eduke32@3969 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:10 +00:00
helixhorned
f4d74e4df8 Lose the 'packed' attribute on actor_t.
Its members are already laid out on the natural alignment boundaries.
Compilation tested with {32-bit, 64-bit} x {Lunatic, non-Lua} builds.

git-svn-id: https://svn.eduke32.com/eduke32@3968 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:08 +00:00
helixhorned
a942a8f660 Lunatic: protect global environment.
git-svn-id: https://svn.eduke32.com/eduke32@3967 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:07 +00:00
helixhorned
7860fb8c01 Lunatic: remove DBG_ variable for _DEBUG_LUNATIC=0.
git-svn-id: https://svn.eduke32.com/eduke32@3966 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:06 +00:00
helixhorned
ac3a6a1bd2 Lunatic: fix some must-fail tests and module()s without require'end_gamevars'.
git-svn-id: https://svn.eduke32.com/eduke32@3965 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:05 +00:00
helixhorned
3835019c70 Lunatic: replace 'idx >= BOUND+0ULL' idiom with 'not (idx >= 0 and idx < BOUND)'
git-svn-id: https://svn.eduke32.com/eduke32@3964 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:02 +00:00
helixhorned
4f88aaf4d2 Retire global 'lastvisinc'.
It was only ever used as upper bound to the time that a visibility change
decays, but since it does that in an exponential fashion, there's really
no point.

git-svn-id: https://svn.eduke32.com/eduke32@3961 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:13 +00:00
helixhorned
19b85dc5ee Make vis decay with time independent of FPS, treat p->visibility<0 like 0.
Now, if p->visibility differs from the constant visibility, the former converges
toward the latter by three-quartering the difference each second totalclock
increment (1/60th second).
Negative player visibilities are not handled consistently throughout the
different renderers, so make it look the same as 0 (can view to infinity).

git-svn-id: https://svn.eduke32.com/eduke32@3960 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:11 +00:00
helixhorned
ec2514a91d Apply patch by forum user "John Jendro" fixing OS X build.
git-svn-id: https://svn.eduke32.com/eduke32@3958 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:06 +00:00
helixhorned
e7e8f00670 Lunatic: document previous additions and more of the existing stuff.
git-svn-id: https://svn.eduke32.com/eduke32@3956 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:04 +00:00
helixhorned
d63939d820 Clean up some player.c code.
git-svn-id: https://svn.eduke32.com/eduke32@3955 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:01 +00:00
helixhorned
9ecbd633aa Lunatic: rework weapondata_t __newindex handling for the sound members.
Also, in test.elua, add a currently failing must-fail test (i.e. it wrongly
succeeds where it should not!).

git-svn-id: https://svn.eduke32.com/eduke32@3954 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:59 +00:00
helixhorned
d7ad2c36d4 Lunatic: revamp sector changing/updating functions of sprites.
git-svn-id: https://svn.eduke32.com/eduke32@3953 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:57 +00:00
helixhorned
b9dfcc902d game.c: read sprites-on-screen count for DNDEBUG at end of G_DoSpriteAnimations.
Because that function might have inserted tsprites itself, e.g. for the fake
floor shadow. Also add one "spritesortcnt < MAXSPRITESONSCREEN" bound check
in legacy ROR code.

git-svn-id: https://svn.eduke32.com/eduke32@3952 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:55 +00:00
helixhorned
36c03b8610 Lunatic: create game Lua state just before EVENT_NEWGAME, not in G_EnterLevel().
git-svn-id: https://svn.eduke32.com/eduke32@3951 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:53 +00:00
helixhorned
d7e4d5afbf Factor out repeated few-liner into G_NewGame_EnterLevel(), misc. cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3950 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:52 +00:00
helixhorned
adbd6394fc LunaCON: add -ftrapv, -fwrapv opts, providing trapping/wrapping arith semantics.
Currently only for multiplication.

git-svn-id: https://svn.eduke32.com/eduke32@3949 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:50 +00:00
helixhorned
75204d782a Lunatic: call G_ShowView() using the Lua C API and not through the FFI.
G_ShowView() may call events. Ouch!

git-svn-id: https://svn.eduke32.com/eduke32@3948 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:49 +00:00
helixhorned
e76348cc4b In DNCOORDS display, show execution time in ms for all actors (G_MoveActors).
Smoothed using an exponential moving average... with a time constant of 1 sec
if I didn't miscalculate things. Also, split BYTEVERSION_JF into Lunatic and
non-Lua.

git-svn-id: https://svn.eduke32.com/eduke32@3947 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:47 +00:00
helixhorned
b243264d6b Lunatic: output timing results to CSV file, don't time unreg'd events/actors.
The base name is taken from the environment variable LUNATIC_TIMING_BASEFN,
which is suffixed with .actors.csv and .events.csv.

git-svn-id: https://svn.eduke32.com/eduke32@3946 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:45 +00:00
helixhorned
e13cae69ce LunaCON: add forgotted "screensound" to keyword list in con_lang.lua.
Also, fix 'spriteflags' directive.

git-svn-id: https://svn.eduke32.com/eduke32@3945 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:43 +00:00
helixhorned
b70779ba6f CON: Add predefined labels MAXSPRITES, MAXSTATUS and MAX_WEAPONS.
git-svn-id: https://svn.eduke32.com/eduke32@3944 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:41 +00:00
helixhorned
e4849af91f LunaCON: implement 'tossweapon'.
git-svn-id: https://svn.eduke32.com/eduke32@3943 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:38 +00:00
helixhorned
d53b976acf Lunatic: document more stuff (not too carefully), add red DRAFT marker.
git-svn-id: https://svn.eduke32.com/eduke32@3942 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:46 +00:00
helixhorned
5e41c1604c LunaCON: handle system gamearrays for some array commands.
- 'copy' may have them as source, 'getarraysize' works fine
- 'setarray' and 'resizearray' are obviously forbidden
- 'readarrayfromfile' and 'writearrayfromfile' is not implemented for them
  (use case?)

Also, in the Makefile: don't use realpath on directories. It may give an empty
string.

git-svn-id: https://svn.eduke32.com/eduke32@3940 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:43 +00:00
helixhorned
1e26e640e4 Lunatic: swap first and second arg of con.spawn().
git-svn-id: https://svn.eduke32.com/eduke32@3939 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:41 +00:00
helixhorned
750fbb0a0e Lunatic: slight Makefile tweak for Windows preparation.
Add doc/how_to_build_lunatic.txt and doc/lpeg-lunatic.patch.

git-svn-id: https://svn.eduke32.com/eduke32@3938 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:14 +00:00
helixhorned
7f2175fcec Lunatic: retire per-sprite tsprite access for per-tile animation callback reg.
Don't yet make this official API though, since there are unresolved issues
with newly created tsprites potentially being fed back to the animation loop.
Add xmath.angvec(), xmath.bangvec(), tspr:set_sectnum(), tspr:setpos().

git-svn-id: https://svn.eduke32.com/eduke32@3937 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:10 +00:00
helixhorned
c243bab0e7 Remove one instance of duplicate code lines and now unused TSPR_MIRROR.
git-svn-id: https://svn.eduke32.com/eduke32@3936 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:07 +00:00
helixhorned
f506e0f570 Rename the external 'gethitickms()' to 'gethiticks()'.
git-svn-id: https://svn.eduke32.com/eduke32@3935 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:05 +00:00
helixhorned
f37d845f02 Lunatic: various unrelated changes and more documentation.
- check map-text version on load
- LunaCON: don't allow (back)slash as identifier char
- LunaCON stand-alone: don't resort to default directory for root file names
- document non-local control flow functions and for LunaCON, ambigious lexical
  elements

git-svn-id: https://svn.eduke32.com/eduke32@3933 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:58:57 +00:00
helixhorned
6e443944c3 Lunatic: partially fix LTO=1 build with GCC.
Having to tag these few variables and functions as ATTRIBUTE((used))
seems sensible, but what follows is just strange. OSD_Printf? headspritesect?

git-svn-id: https://svn.eduke32.com/eduke32@3932 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:53 +00:00
helixhorned
baebd63bac Lunatic: make g_playerWeapon an array of a corresponding bcarray type.
git-svn-id: https://svn.eduke32.com/eduke32@3931 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:50 +00:00
helixhorned
4c4cf5eecc Lunatic: document the additions of the preceding commits.
git-svn-id: https://svn.eduke32.com/eduke32@3930 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:48 +00:00
helixhorned
7c3f7909cc Lunatic: various changes.
- swap 2d and 3rd args in xmath.rotate() -- now rotate(point, ang, pivot)
- add vec3 method 'rotate', calling xmath.rotate
- store game tic count in savegames

git-svn-id: https://svn.eduke32.com/eduke32@3929 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:46 +00:00
helixhorned
d580c1e998 Lunatic: many changes, motivated by writing test "helixspawner".
- some renames of functions/methods
- con.actorvar: explicitly allow (for now) boolean and number values
- added gv.gametic, player.holdskey(), player.all(), actor.check*()/hit*(),
  gv.rendmode, gv.REND, <bitint>:mask(), spr:getheightofs()
- make read of nil var in "finalized" (live) module produce error, too
- add test/helixspawner.lua

git-svn-id: https://svn.eduke32.com/eduke32@3928 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:42 +00:00
helixhorned
44f71d313f Lunatic: on palfrom from CON or C, set palsfade{speed,next} and regard prio.
git-svn-id: https://svn.eduke32.com/eduke32@3927 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:39 +00:00
helixhorned
e771c7faf3 Lunatic: document con.action/move/ai and actor methods.
Also, in some movement functions, replace e.g. (vel*TICSPERFRAME)>>2 with vel.

git-svn-id: https://svn.eduke32.com/eduke32@3925 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:35 +00:00
helixhorned
253a13ed29 Lunatic: various tweaks and fixes.
- fix getv movflags handling in VM_Move()
- add actor.fall()
- LunaCON: sanity-check some action members

git-svn-id: https://svn.eduke32.com/eduke32@3924 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:32 +00:00
helixhorned
cb2edcf45e Lunatic: in con.action and con.move, allow mixed number/string key tables.
E.g. con.action{0, 4, delay=20}; for convenience, viewtype and incval are
initialized to 1 (not 0) here.

git-svn-id: https://svn.eduke32.com/eduke32@3923 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:54 +00:00
helixhorned
cad7d49bd1 Lunatic: retire an actor's sprite[].hitag/lotag for new actor[] members.
git-svn-id: https://svn.eduke32.com/eduke32@3922 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:52 +00:00
helixhorned
73b5d064da Retire actor[].shootzvel, as it was only ever used in local scope.
That is, its value was only referenced during the duration of a function call
that had previously set it. It was also never accessible from CON.

git-svn-id: https://svn.eduke32.com/eduke32@3921 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:50 +00:00
helixhorned
e164bd7f1e Actor-related code cleanup part 2: give actor t_data[] indexes names.
Using macros like AC_COUNT(t). Clean up related code:
 - comment out the dead condition noted in the previous commit
 - Lunatic: use get_count() instead of get_t_data(0) in one place,
   rename to _get_t_data(), i.e. make that method internal

git-svn-id: https://svn.eduke32.com/eduke32@3920 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:48 +00:00
helixhorned
90ddee2296 Actor-related code cleanup part 1: rename some locals, expose one dead condition
... due to making hi/lotag unsigned in r3174. This commit keeps the compiler
warning, the next one will remove it.

git-svn-id: https://svn.eduke32.com/eduke32@3919 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:45 +00:00
helixhorned
ebe0ecaded Lunatic: add actor methods allowing overriding action delay and move hvel/vvel.
Add testing code for an example actor 1275 (newspaper) to test.elua.

git-svn-id: https://svn.eduke32.com/eduke32@3918 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:44 +00:00
helixhorned
67db095bd3 Lunatic: require'CON.ACTION' etc. gets composites from CON; add actor.MOVFLAGS.
git-svn-id: https://svn.eduke32.com/eduke32@3917 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:41 +00:00
helixhorned
36f3a8e47c Lunatic: don't register con.action/move/ai by name, make these return a cdata.
git-svn-id: https://svn.eduke32.com/eduke32@3916 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:39 +00:00
helixhorned
16f2f4c475 lunatic/listglobals.sh: allow passing multiple file names.
git-svn-id: https://svn.eduke32.com/eduke32@3915 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:37 +00:00
helixhorned
fb0c13f9f2 Lunatic: serialization for cdata types, currently xmath.vec3 and ivec3.
git-svn-id: https://svn.eduke32.com/eduke32@3914 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:35 +00:00
helixhorned
6a33c2eec1 CON: New command 'screensound', unconditionally playing a session-wide sound.
git-svn-id: https://svn.eduke32.com/eduke32@3912 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:46 +00:00
helixhorned
b2c5e2d807 Mapster32/Lunatic: ask when a <V10 map would be overwritten with a map-text one.
Also, clean up the saving/loading logic a bit:
- On load failure, display message with purple color.
- Take over the current file name ('boardfilename') only on success.
- Check SaveBoard() return values in various places.

git-svn-id: https://svn.eduke32.com/eduke32@3911 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:44 +00:00
helixhorned
5ea2eee072 Lunatic: merge updatesector and ~breadth, making the former accept a flag.
git-svn-id: https://svn.eduke32.com/eduke32@3910 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:43 +00:00
helixhorned
885036a6a3 Lunatic: retire 'geom' module, putting vector types into xmath.
git-svn-id: https://svn.eduke32.com/eduke32@3909 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:41 +00:00
helixhorned
7cb94070e1 Lunatic: allow serialization of tables in more general cases.
git-svn-id: https://svn.eduke32.com/eduke32@3908 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:39 +00:00
helixhorned
bb71052cb7 Lunatic: begin writing LunaCON documentation.
git-svn-id: https://svn.eduke32.com/eduke32@3907 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:37 +00:00
helixhorned
89d865b8b1 Lunatic: don't pass 0x80000000 to int32_t arg, document xmath functions.
git-svn-id: https://svn.eduke32.com/eduke32@3906 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:33 +00:00
terminx
e9a773a588 Add a few defined constants for commonly used weapon_pos values
git-svn-id: https://svn.eduke32.com/eduke32@3903 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:57 +00:00
terminx
214baa9475 Rename getinput() to P_GetInput(), add bounds checking for a few arrays used for weapon drawing that use kickback_pic as an index.
git-svn-id: https://svn.eduke32.com/eduke32@3902 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:39 +00:00
terminx
6516a29778 Make P_PalFrom() static inline in player.h as the whole function is just 4 assignments
git-svn-id: https://svn.eduke32.com/eduke32@3901 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:24 +00:00
helixhorned
db7f820404 engine: consider a point inside() a sector in all border cases (literally).
In other words, for a test rectangular sector, a sprite would be inside the
sector in on all 4 edges and all 4 corners. Previously, it would have been
the lower right portion only (*excluding* LL and UR corners), which led to
map editing issues.

git-svn-id: https://svn.eduke32.com/eduke32@3898 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:16 +00:00
helixhorned
a3adf3508e Substitute some symbolic SE_x_* labels for literal SE numbers that were missed.
git-svn-id: https://svn.eduke32.com/eduke32@3896 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:13 +00:00
helixhorned
bfd9feb5aa Lunatic: document vector types, add forgotten warning icon.
git-svn-id: https://svn.eduke32.com/eduke32@3895 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:12 +00:00
helixhorned
1febaae767 Lunatic: various minor tweaks and fixes.
- Pass original module name (dot=dirsep) to module via our require()
- geom.lua: fix some operations using the vector type constructor
- geom.lua: provide constructor for ivec3, useable like vec3

git-svn-id: https://svn.eduke32.com/eduke32@3894 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:09 +00:00
helixhorned
5db04f585e Lunatic: player method fadecol(), an improved palfrom.
Also, an external 'minitext' with optional shade and pal. args and
documentation for ps:padecol().

git-svn-id: https://svn.eduke32.com/eduke32@3893 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:50 +00:00
helixhorned
e8c9bf044f Don't register "savestate" and "restorestate" OSD commands even in debug builds.
They don't get registered on Windows for some reason, and mapstate debugging is
best carried out using scripting code, anyway.

git-svn-id: https://svn.eduke32.com/eduke32@3892 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:48 +00:00
helixhorned
b319ae5613 Lunatic: major overhaul of gamevar serialization for savegames.
- Handle local gamevars.
- Restore gamevars from require('end_gamevars').

git-svn-id: https://svn.eduke32.com/eduke32@3891 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:47 +00:00
helixhorned
10379910c1 Lunatic 'geom': retire tovec2 and tovec3, make vec2 and vec3 accept cdata, too.
git-svn-id: https://svn.eduke32.com/eduke32@3890 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:45 +00:00
helixhorned
4a4f90e5e7 Lunatic: fix random angle movflag, Windows build; write more documentation.
git-svn-id: https://svn.eduke32.com/eduke32@3889 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-20 18:31:42 +00:00
helixhorned
e2859cd133 Lunatic: write more documentation, handle randomangle movflag in a:set_move().
git-svn-id: https://svn.eduke32.com/eduke32@3887 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-15 12:52:06 +00:00
terminx
40b117a23c Forgot a file for a previous commit
git-svn-id: https://svn.eduke32.com/eduke32@3886 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-14 21:29:14 +00:00
terminx
47745497b0 Fix 1.3D, sorry guys
git-svn-id: https://svn.eduke32.com/eduke32@3885 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 21:17:17 +00:00
terminx
8479e63b7c Fix up handling of the Duke shareware beta a little bit, and change the dialog that pops up after running the shareware version too many times to take you to Steam instead of GOG (the Steam version is a better deal)
git-svn-id: https://svn.eduke32.com/eduke32@3884 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 21:17:03 +00:00
helixhorned
d43cfe6232 Lunatic savegames: store g_playerWeapon[][], fix 'require' with submodules.
git-svn-id: https://svn.eduke32.com/eduke32@3883 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:11:09 +00:00
helixhorned
4a49da94c1 LunaCON: check reserved bits for sound and ai movement flags.
git-svn-id: https://svn.eduke32.com/eduke32@3882 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:11:07 +00:00
helixhorned
878ba20af9 LunaCON: make mail, money, paper be affected by tile remapping, fix one printf.
git-svn-id: https://svn.eduke32.com/eduke32@3881 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:11:06 +00:00
helixhorned
51e021e810 Mapster32: fix construction of *_crash.map file name in crash handler.
git-svn-id: https://svn.eduke32.com/eduke32@3876 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:10:56 +00:00
helixhorned
9c1eeae751 Lunatic: clean up 'geom' module, make walls readable with pseudo-member 'z'.
git-svn-id: https://svn.eduke32.com/eduke32@3875 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:56 +00:00
helixhorned
9911e96fe8 Lunatic: rename spriteext[].*off->mdoff.*, actor[].actorstayput->stayputsect.
git-svn-id: https://svn.eduke32.com/eduke32@3874 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:55 +00:00
helixhorned
f6065e227a Lunatic: make gameactor and gameevent be "table-called" functions.
git-svn-id: https://svn.eduke32.com/eduke32@3873 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:53 +00:00
helixhorned
bbcf6d6353 LunaCON: implement qgetsysstr/STR_VOLUMENAME.
git-svn-id: https://svn.eduke32.com/eduke32@3872 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:51 +00:00
helixhorned
570d35dbaa Lunatic: Propagate potentially remapped CON defines to the control module.
(This is the module that implements much of the "hard-coded" functionality
formerly on the C side.)

git-svn-id: https://svn.eduke32.com/eduke32@3871 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:49 +00:00
helixhorned
2f29a89368 Lunatic: provide CON-defined labels in read-only table require("CON.DEFS").
git-svn-id: https://svn.eduke32.com/eduke32@3870 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:47 +00:00
helixhorned
e955860950 Lunatic: commit preliminary, unfinished documentation written in AsciiDoc.
Don't (yet?) commit the generated HTML.

git-svn-id: https://svn.eduke32.com/eduke32@3868 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:22 +00:00
helixhorned
224702b619 Lunatic: make require() translate dots to dir separators, make those illegal.
However, from the command line, reverse the situation: dirseps must be passed
as '/', dots are forbidden (except in the trailing ".lua").

git-svn-id: https://svn.eduke32.com/eduke32@3867 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:19 +00:00
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
helixhorned
0d951f0256 LunaCON: bound-check defineprojectile tile/sound members.
Also from Lunatic, make these members read-only and provide methods that
allow setting them to either -1 or a number in [0..MAX{TILES,SOUNDS}-1].

git-svn-id: https://svn.eduke32.com/eduke32@3865 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:16 +00:00
helixhorned
dee8dbe092 Lunatic: rename bitint members to *bits instead of *x.
git-svn-id: https://svn.eduke32.com/eduke32@3864 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:13 +00:00
helixhorned
01770ec720 Fix accessing the wrong animation indices with negative viewtypes.
(I think; untested.)

git-svn-id: https://svn.eduke32.com/eduke32@3863 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:35 +00:00
helixhorned
bd49bc7bbd LunaCON: strip dir prefixes on file-not-found; _getpname, ud.m_player_skill.
git-svn-id: https://svn.eduke32.com/eduke32@3862 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:34 +00:00
helixhorned
16b3cb6a42 LunaCON: showview and showviewunbiased.
git-svn-id: https://svn.eduke32.com/eduke32@3861 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:32 +00:00
helixhorned
5e5f80d61b Lunatic: keep status number symbols in actor.STAT instead of gv.STAT_*.
git-svn-id: https://svn.eduke32.com/eduke32@3860 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 14:26:30 +00:00
helixhorned
a57ce255e7 Allow negating an action's viewtype 5 or 7, meaning to x-flip the shown sprite.
git-svn-id: https://svn.eduke32.com/eduke32@3859 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:21 +00:00
helixhorned
528366da46 Lunatic: add preliminary helper code for local gamevar saving.
git-svn-id: https://svn.eduke32.com/eduke32@3858 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:20 +00:00
helixhorned
34138cdc96 Lunatic: fix current incarnation of gamevar saving/restoration.
git-svn-id: https://svn.eduke32.com/eduke32@3857 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:17 +00:00
helixhorned
a0f00e28c3 Lunatic: prettify listglobals.sh output.
git-svn-id: https://svn.eduke32.com/eduke32@3856 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:16 +00:00
helixhorned
ddb0d3f63d LunaCON: properly generate references to gamevars named like Lua keywords.
git-svn-id: https://svn.eduke32.com/eduke32@3855 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:15 +00:00
helixhorned
7725544ef1 LunaCON: free a couple of file-scope local slots by storing stuff in tables.
git-svn-id: https://svn.eduke32.com/eduke32@3854 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-07 10:18:12 +00:00
helixhorned
335fa81b18 game.c: fix out-of-bounds write in G_GetSubString().
git-svn-id: https://svn.eduke32.com/eduke32@3852 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-06 11:22:38 +00:00
helixhorned
f8c04673b4 Lunatic: tweak sector.STAT.* and other names a little.
git-svn-id: https://svn.eduke32.com/eduke32@3851 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-06 11:22:35 +00:00
hendricks266
6cc62ea2bf Fix the display of numbers with TEXT_GAMETEXTNUMHACK and TEXT_XOFFSETZERO. (Fix level stats, part 2.)
The commit revises the definition of qstrdim when TEXT_[XY]OFFSETZERO are used. With these flags, the offsets the user specifies are now the only dimensions the function cares about in terms of tile placement, so depending on the difference between the offset(s) and the size of the final tile, it may be slightly more or less than the dimensions actually displayed on the screen because tile size is never taken into account. (For example, if your font is nominally 9x7 like the Duke bluefont and you use a TEXT_XOFFSETZERO of 5 with a string five characters long, the total x dimension will be 25 even though the last character will overhang that amount by four pixels. If you use a TEXT_XOFFSETZERO of 12 with the same string, the total x width will be 60 even though there will be three pixels of empty space on the right edge.) This change was made because assigning text an arbitrary constant width in general implies an intent to keep character positions constant even with a variable width font, but returning the visible span of pixels on the screen that the tiles cover would have caused the string to move when alignment options other than the top-left were used. In other words, you can now safely use TEXT_[XY]OFFSETZERO with the alignment options and the text won't jiggle.

Also, with TEXT_GAMETEXTNUMHACK, numerals are now effectively TEXT_XOFFSETZERO text that respect the above paragraph, so number count displays can look nice with alignment options too.

Having to modify the extent/offset code makes me realize that I'm not quite happy with its structure because it gets tangled juggling different concepts like character width, X offset, and spacing, and how they relate when the line wraps or in terms of the final size. Fortunately, it produces correct results as far as I know, and it's not necessarily ugly, just hard to understand. Handle with care.

git-svn-id: https://svn.eduke32.com/eduke32@3850 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-03 05:26:44 +00:00
hendricks266
e74ac19cd2 Fix display of level stats by fixing G_ScreenText() handling of (orientation & 2).
git-svn-id: https://svn.eduke32.com/eduke32@3849 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-03 05:26:24 +00:00
helixhorned
185597d3b3 LunaCON: proper handling of dynamic remappings with weapon defaults.
That is, the gamevars named WEAPONx_* in CON will now have the remapped value
if they were not overridden from CON ('gamevar' at file scope).
For C-CON, everything except signaling an override from the CON parser is in
place.

git-svn-id: https://svn.eduke32.com/eduke32@3848 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-02 14:07:56 +00:00
helixhorned
882eb4cb8b LunaCON: hook up dynamicsoundremap.
git-svn-id: https://svn.eduke32.com/eduke32@3847 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-02 14:07:52 +00:00
helixhorned
229a996d40 Make S_MenuSound() use stack'd array to get rid of S_StaticToDynamicMenuSound().
git-svn-id: https://svn.eduke32.com/eduke32@3846 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:46 +00:00
helixhorned
7fcb577f51 LunaCON: hook up qstrdim and screentext.
Also add some recent keywords to the list in con_lang.lua which I had
forgotten all along.

git-svn-id: https://svn.eduke32.com/eduke32@3845 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:45 +00:00
helixhorned
75313a78c8 Lunatic: sector[].ceiling/.floor gets a reference to a ceiling-or-floor struct.
Also, make sector[].*stat a bitint type.

Now, a piece of code could look like this:
local sec = sector[i]
local ceil = sec.ceiling
ceil.statx:flip(sector.STAT.SMOOSH)

git-svn-id: https://svn.eduke32.com/eduke32@3844 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:43 +00:00
helixhorned
51ad20eda5 Lunatic: fix a couple of oversights, tweak some stuff.
git-svn-id: https://svn.eduke32.com/eduke32@3843 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:42 +00:00
helixhorned
e0433e66fb LunaCON: real user per-player vars.
The previous behavior was to translate them as global gamevars, since LunaCON
currently has no support for multiplayer. However, then some errors would be
missed where such gamevars are accessed in no-player context
(e.g. EVENT_ENTERLEVEL).
On by default, disabled with -fno-playervar.

git-svn-id: https://svn.eduke32.com/eduke32@3842 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:41 +00:00
helixhorned
f0ed046a98 LunaCON: fix mistranslation of CON "else { if" to Lua "elseif".
When encountering a non-empty statement inside braces, emit "do" ... "end".

git-svn-id: https://svn.eduke32.com/eduke32@3840 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:37 +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
899f19155d Make improvements utilizing G_ScreenText().
git-svn-id: https://svn.eduke32.com/eduke32@3838 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:56:28 +00:00
hendricks266
e483dbefcd For all HUD and text shadows that use pal 4, also use shade 127.
git-svn-id: https://svn.eduke32.com/eduke32@3837 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:56:13 +00:00
hendricks266
bf9b91352b Text wrapper conversion.
G_PrintGameText(), minitext_(), G_DrawTXDigiNumZ(), and menutext_() now wrap G_ScreenText().
G_GameTextLen() now wraps G_ScreenTextSize().
G_DrawDigiNum_() now wraps G_DrawTXDigiNumZ().

git-svn-id: https://svn.eduke32.com/eduke32@3836 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:56: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
hendricks266
4375a3c261 Remove an unused variable from startwin.game.c.
git-svn-id: https://svn.eduke32.com/eduke32@3832 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:54:29 +00:00
hendricks266
297dfcdfc7 Update credits.
git-svn-id: https://svn.eduke32.com/eduke32@3831 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-31 05:08:46 +00:00
helixhorned
5bfbfa3c5b Lunatic: also reset per-actor gamevars from spawns originating from C.
Take care not to do it twice. Still untested though.

git-svn-id: https://svn.eduke32.com/eduke32@3830 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:59 +00:00
helixhorned
97f857ec39 Lunatic: split 'replace' option for actor chaining flags into soft/hard.
Hard replacement reassigns the tile flags, while soft replacement bitwise
ORs them, as in CON (since some flags might already have been set using
commands like spritenoshade).

git-svn-id: https://svn.eduke32.com/eduke32@3829 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:54 +00:00
helixhorned
020be8d4b5 Lunatic: reset per-actor gamevars on actor spawn, untested.
git-svn-id: https://svn.eduke32.com/eduke32@3828 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:52 +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
593b82692e Mapster32: allow setting first walls of TROR sectors independently.
In 3D mode, Alt+F now only attempts to set the first wall of the aimed at
wall, not collecting upper/lower neighbors. For this, press Shift+Alt+F.
In 2D mode, they are always collected.

git-svn-id: https://svn.eduke32.com/eduke32@3825 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 18:10:45 +00:00
helixhorned
4457a5fbca Fix potential oob access when flipping the floor [F] in 2D mode.
git-svn-id: https://svn.eduke32.com/eduke32@3824 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 09:13:34 +00:00
helixhorned
560f88b022 Replace inline "qsetmode==200" checks with in3dmode().
Analogously for the negation; remove a couple of redundant decls of "qsetmode".

git-svn-id: https://svn.eduke32.com/eduke32@3823 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-30 09:13:32 +00:00
helixhorned
1715b7631f Make deletion of an ambient sound MUSICANDSFX sprite stop its sound again.
Add a test case source/lunatic/test/delmusicsfx.lua.

git-svn-id: https://svn.eduke32.com/eduke32@3822 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-28 19:52:51 +00:00
helixhorned
360aae414f Lunatic: add actor.delete() and various 'length' methods to geom.vec3/ivec3.
git-svn-id: https://svn.eduke32.com/eduke32@3821 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-28 19:52:48 +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
helixhorned
a02ab83319 With DNCOORDS display, print number of sprites currently on the screen.
Only in debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@3818 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-26 18:42:56 +00:00
helixhorned
13b69711ac LunaCON: add a couple of ud members, gamevars; handle 'dynamicremap' only once.
Also, allow MAXVOLUMES+1 to first arg of 'music'.

git-svn-id: https://svn.eduke32.com/eduke32@3817 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-26 18:42:53 +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
06713baf8d Fix a reference to "RDR_POLYMER" that was missed in startgtk
git-svn-id: https://svn.eduke32.com/eduke32@3814 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-25 06:11:38 +00:00
helixhorned
c366388a9e Lunatic: -Wchained-loadactor option for LunaCON, clear errors on restart.
The last only in release builds.

git-svn-id: https://svn.eduke32.com/eduke32@3813 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:39 +00:00
helixhorned
6f94af7399 LunaCON: implement dragpoint, clipmove*; fix gamearray serialization.
git-svn-id: https://svn.eduke32.com/eduke32@3812 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:37 +00:00
helixhorned
d0f538b283 Engine: don't extern 'clipmovetraceboxnum', add a new func. clipmovex() instead.
The 'x' is for "extended", since its last arg is a switch of whether to disable
sliding. Use that from gameexec.c.

git-svn-id: https://svn.eduke32.com/eduke32@3811 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:36 +00:00
helixhorned
f051e1e229 C-CON: fix 'copy' on 64-bit archs.
git-svn-id: https://svn.eduke32.com/eduke32@3810 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:34 +00:00
helixhorned
f568f34636 LunaCON standalone: don't try default path on file-not-found for root names.
git-svn-id: https://svn.eduke32.com/eduke32@3809 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:33 +00:00
helixhorned
487d54793f For DNCOORDS display, add current sprite count and #inserted sprites / last sec.
Only in debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@3808 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:32 +00:00