Commit graph

4250 commits

Author SHA1 Message Date
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
6c00f0e822 a.m32: don't clamp SE50 extra (=horiz) to [-500 500] with KP8/KP5.
git-svn-id: https://svn.eduke32.com/eduke32@4197 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-12 19:22:11 +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
a7ed1a6fe9 Makefile: add target 'print-compiler-options'.
May come in handy at times. BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4194 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-06 18:56:46 +00:00
helixhorned
1628debd7c Really fix the Pause key on Windows/SDL2.
This requires enabling the same workaround as for Linux. Maybe it's not
system-dependent at all.

git-svn-id: https://svn.eduke32.com/eduke32@4193 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-06 18:56:44 +00:00
helixhorned
19da43d23b Polymer: invalidate a wall when its sector's visibility has changed.
git-svn-id: https://svn.eduke32.com/eduke32@4192 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-06 18:56: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
9a397a01c1 Fix mouse buttons 4 and 5 on SDL2/Windows.
git-svn-id: https://svn.eduke32.com/eduke32@4190 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-01 18:28:03 +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
2a43511c70 cache1d: add FIND_NOCURDIR option to klistpath().
git-svn-id: https://svn.eduke32.com/eduke32@4188 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-01 18:27:59 +00:00
helixhorned
a783933726 Fix building stand-alone libcache1d.so.
git-svn-id: https://svn.eduke32.com/eduke32@4187 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-01 18:27:57 +00:00
helixhorned
4d8071e6b3 defs.c: in check_tile(), pass 'tile' by value.
git-svn-id: https://svn.eduke32.com/eduke32@4186 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-01 18:27:55 +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
a68ef20182 a-c.c: Make vector extensions also be compiled with Clang.
I was checking for GCC >= 4.7, while Clangs pretends to be GCC 4.2. Use a
feature test macro instead. The comment I made in r4161 regarding GCC vs.
Clang code was wrong. Now, Clang generates slightly faster code for these cases
(solid and masked 4-pixel wide vlines).

git-svn-id: https://svn.eduke32.com/eduke32@4182 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-28 21:18:07 +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
82e50a14c7 In fullscreen_tint_gl() disable GL_FOG, preventing nasty flickering.
Which was especially noticeable in the Lunatic build. Also, use
glPushAttrib/glPopAttrib there.

git-svn-id: https://svn.eduke32.com/eduke32@4176 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:54 +00:00
helixhorned
198ba2d697 Give rotatesprite 'orientation' bits enum names, too.
git-svn-id: https://svn.eduke32.com/eduke32@4175 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:52 +00:00
helixhorned
9aa8bc7c82 Use named enum constants for the HUD flags instead of literal numbers.
git-svn-id: https://svn.eduke32.com/eduke32@4174 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:50 +00:00
helixhorned
9209b946bb Polymodes: bump the allowed range for 'r_pr_hudangadd' to [-1024 .. 1024].
git-svn-id: https://svn.eduke32.com/eduke32@4173 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:48 +00:00
helixhorned
9e3e2baa4d Polymost: handle HUD model 'fov' DEF token.
This "simply" requires an appropriate factor in the projection matrix.
Also, get rid of a special-case factor for >=1.6 aspects (making HUD models
wider then, I think).

git-svn-id: https://svn.eduke32.com/eduke32@4172 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:46 +00:00
helixhorned
7182f0a7f2 A couple of trivial changes.
git-svn-id: https://svn.eduke32.com/eduke32@4171 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-22 19:26:44 +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
85df1181fc Mapster32: show a message when setting the initial position with SCROLL LOCK.
git-svn-id: https://svn.eduke32.com/eduke32@4164 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:16 +00:00
helixhorned
5b53725c43 SDL2: fix Ctrl-F/Ctrl-G as "key FIFO" keys, used in Mapster32.
By detecting them in the SDL_KEYDOWN events. This list is getting a bit
ridiculous...

git-svn-id: https://svn.eduke32.com/eduke32@4163 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:15 +00:00
helixhorned
559c31159a a-c.c: use GCC vector extensions only on 64-bit targets.
Compiling a 32-bit NOASM build resulted in code containing a MOVAPS instruction
that accessed a memory location not aligned to 16 bytes (MinGW, GCC 4.8).

git-svn-id: https://svn.eduke32.com/eduke32@4162 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:12 +00:00
helixhorned
3753d45601 a-c.c: prevent stray lines on bottom of sprites by saturating v. tex coords.
The functions mvlineasm1, mvlineasm4 and tvlineasm2 can now be set to clamp
the vertical texture coordinate (vplc), preventing the unsightly stray lines
on the bottom of non-y-flipped sprites. (The first part of this effort, r3483,
handled their top).

However, this is only enabled for the mvlineasm ones: the vectorized variants
suffered almost no slowdown (even though a PADDUSD SSE instruction would be a
nice thing to have), while it was pretty significant for the sequential
translucent ones.

Summarizing, this leaves two cases where stray lines may appear in the non-ASM
build (the saturation is NYI for a.nasm):
- at the bottom of y-flipped sprites
- at the bottom of translucent sprites (can be toggled by #define)

Another observation is that recent GCC generates much faster code for this
stuff than Clang from SVN.

git-svn-id: https://svn.eduke32.com/eduke32@4161 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:11 +00:00
helixhorned
ca22bf8185 a-c.c: in {v,mv}lineasm4, use vector types for vplc/vinc with GCC >=4.7.
For a full 1680x1050 screen drawing a solid/masked wall, the FPS increases
from 118 to 133 and from 114 to 116 (respectively) for me.
Guarded by the macro USE_VECTOR_EXT in the source.

git-svn-id: https://svn.eduke32.com/eduke32@4160 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-16 18:47:07 +00:00
hendricks266
02507d76e4 Synthesis: Augment changelogs a little bit. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4159 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-15 20:05:20 +00:00
hendricks266
478ef6eef8 At least now I know exactly what this is doing. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4158 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-15 19:41:02 +00:00
hendricks266
58758dca39 BUILD_LUNATIC. Right now.
git-svn-id: https://svn.eduke32.com/eduke32@4157 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-15 19:18:10 +00:00
hendricks266
bef8939c95 This one better work. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4156 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-15 19:02:52 +00:00
hendricks266
40c2b8614b This should fix Synthesis for real. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4155 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-15 07:24:33 +00:00
hendricks266
dc664fd5c6 A stab in the dark at fixing the Synthesis problems. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@4154 1a8010ca-5511-0410-912e-c29ae57300e0
2013-11-15 05:45:22 +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