Commit Graph

147 Commits

Author SHA1 Message Date
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
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 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
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
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
hendricks266 e0a373893a Replace use of preprocessor macro WIN32 with _WIN32. (Blame clang.)
git-svn-id: https://svn.eduke32.com/eduke32@3839 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:57:00 +00:00
hendricks266 4297507c8f Dynamicsoundremap.
git-svn-id: https://svn.eduke32.com/eduke32@3834 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:30 +00:00
helixhorned 3b39a87bd1 Fix a couple of issues identified in the preceding commit.
- In S_PlaySound(), move the sound index bound check above an indexing.
- For A_CheckHitSprite(), and A_FindPlayer(), allow NULL second arg.
- In A_ShootWithZvel(), make some one-letter vars be int32_t, making
  storing safeldist() results in them meaningful.
- In MaybeTrainKillEnemies(), remove two redundant checks and move another
  one further up.
- Comment that SIDEBOLT1 will never be translucent as was probably intended.
- In G_MoveFX(), fix an always-true comparison.

git-svn-id: https://svn.eduke32.com/eduke32@3680 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-15 10:48:13 +00:00
hendricks266 82b6414d92 Add newlines to some diagostic log messages that lack them and need them.
git-svn-id: https://svn.eduke32.com/eduke32@3668 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-13 03:49:35 +00:00
helixhorned e3ae81262e Fix activated MUSICANDSFX wrongly being looped, introduced in r3631.
git-svn-id: https://svn.eduke32.com/eduke32@3632 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 22:29:30 +00:00
helixhorned a6a4e30bbc Fix playing ambient sounds at max volume for split sec on entering their range.
This is done by always calling FX_PlayAuto3D() to play such sounds. It now
additionally takes a third argument 'loophow', permissible values being
FX_ONESHOT and FX_LOOP.

git-svn-id: https://svn.eduke32.com/eduke32@3631 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-31 18:58:17 +00:00
helixhorned c9190e79ae Wrap some ud.camera* and g_camera{Distance,Clock} into CAMERA* macros.
In Lunatic, make it a struct type "camera_t" instead.

git-svn-id: https://svn.eduke32.com/eduke32@3405 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:32 +00:00
helixhorned 898462152c Fix MUSICANDSFX ambient sounds (bit 2) playing only one instance.
This is done by introducing an additional internal bit, meaning
"play only one instance". It is set for all sounds which have bit 1
("repeat in the sound system") set at definesound time, but not those
that set bit 1 temporarily (see r3336).

git-svn-id: https://svn.eduke32.com/eduke32@3393 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:36 +00:00
helixhorned 67cdd9d883 gameexec.c: factor code for "ifnosounds" into sounds.c: A_CheckAnySoundPlaying.
git-svn-id: https://svn.eduke32.com/eduke32@3365 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-02 22:33:32 +00:00
hendricks266 3933471e4b All kneel, king FLAC is here.
FLAC source from git commit 0920bc1ffb07f038b317e7e8056509fe0e4b680e, patched by me.

Windows libFLAC.a built using i686-MinGW-w64 and x86_64-MinGW-w64.

HUGE thanks to rhoenie for building the Mac fat library (ppc, i686, x86_86).

git-svn-id: https://svn.eduke32.com/eduke32@3335 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:57:24 +00:00
helixhorned 9d2260c3c8 Replace outer apScriptGameEvent[...] checks with G_HaveEvent().
git-svn-id: https://svn.eduke32.com/eduke32@3266 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:57 +00:00
hendricks266 5e0ffb93b3 RENDERTYPE=SDL on Windows, part 2.
This introduces winbits.[ch] in the engine, containing layer-independent code migrated from winlayer, including nedmalloc, ebacktrace1, OS version detection, and high-resolution profiling timers.

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

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

git-svn-id: https://svn.eduke32.com/eduke32@3221 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 04:26:37 +00:00
hendricks266 be899ba3af For novelty, add support for RENDERTYPE=SDL under Windows.
This needs improvements to bring it up to par with winlayer, but it is functional. In particular, a good amount of code from winlayer could be used for both layers, including the profiling timers, the version printing code, and the hInstance and hModule sharing.

Known problems: the mouse cursor is not trapped, and the game starts before the startup window shows options.

git-svn-id: https://svn.eduke32.com/eduke32@3219 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:13:29 +00:00
hendricks266 fcf9beae6a Work-in-progress adjustment to the C code to compile under C++. It builds for me without errors using Win32 MinGW-GCC, but it still generates warning soup. No guarantees about MSVC or anything using SDL. Enable C++ by building with CPLUSPLUS=1. C remains the default and should compile with no change in setup.
Credit to Plagman for the idea and doing the work on the game side, which is included in this commit.

(Building as C++ will give us features with which we can make improvements and optimizations on the multiplayer code and Polymer.)

git-svn-id: https://svn.eduke32.com/eduke32@3116 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 02:49:08 +00:00
hendricks266 3366df0dbd Remove unused variable "doretry" from S_PlaySound().
git-svn-id: https://svn.eduke32.com/eduke32@3099 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-29 04:28:50 +00:00
terminx 7e248dcc49 Remove some outdated/incorrect code that was causing some issues when multiple copies of a single sound were playing and just one of them needed to be stopped.
git-svn-id: https://svn.eduke32.com/eduke32@3080 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 22:09:16 +00:00
helixhorned a92d5486c4 Replace all/most literal SE lotags 1/2 with SE_1_ABOVE_WATER or SE_2_UNDERWATER.
Also catch some other literal SEs and statnums.

git-svn-id: https://svn.eduke32.com/eduke32@3073 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-14 20:41:21 +00:00
terminx 084ec632ea The other half of the previous commit.
git-svn-id: https://svn.eduke32.com/eduke32@3066 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-08 07:07:59 +00:00
terminx 5010b17efe Fix issue with explosion sound cutoff in E1L2. This implements functionality to stop playback and free up the voice of a currently playing sound of the same ID when there are already MAXSOUNDINSTANCES (currently 8) of the same sound playing, determined by distance/volume and which sound is oldest.
Initial determination is based purely on distance/volume, and if two qualifying sounds have the same distance/volume the one which started playback first is the one that gets the axe.

Feedback from other developers welcome.


git-svn-id: https://svn.eduke32.com/eduke32@3065 1a8010ca-5511-0410-912e-c29ae57300e0
2012-10-08 07:07:17 +00:00
helixhorned eb4848fe05 Replace most other literal SEs/STs by symbolic enumeration values.
Have fun researching Duke3D's hardcoded weirdness!!!

git-svn-id: https://svn.eduke32.com/eduke32@3008 1a8010ca-5511-0410-912e-c29ae57300e0
2012-09-08 22:18:44 +00:00
helixhorned 772778205b Pack how many players fake multi was started with into g_fakeMultiMode.
git-svn-id: https://svn.eduke32.com/eduke32@2957 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:51:38 +00:00
helixhorned 95de2abb3a splitscreen: don't wrongly change pitch for sounds originating from 2nd player.
For example, if the first one is underwater.

git-svn-id: https://svn.eduke32.com/eduke32@2956 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-22 22:50:32 +00:00
helixhorned 8039db5ff2 Hacks for the splitscreen mod: play sounds from both players.
The sound distance is the minimum of the two.  Both point sources as well
as MUSICANDSFX ambient sound is handled.

git-svn-id: https://svn.eduke32.com/eduke32@2885 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:53 +00:00
helixhorned af05fe18be sounds.c: Factor out duplicate code into S_CalcDistAndAng().
The two instances in S_PlaySound3D() and S_Update() were slightly
different as far as sequencing is concerned.  However, I think making
it the same has only benefits and may fix some popping sounds when
starting to play a sound and updating it with a different distance
value on the second buffer fill.

git-svn-id: https://svn.eduke32.com/eduke32@2884 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:51 +00:00
helixhorned 847c886c14 First round of sounds.c cleanup, no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@2883 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-13 18:25:48 +00:00
terminx 763aceda83 Alternate implementation of EVENT_SOUND that better covers all hard coded sounds (menus, boss recognition sounds, etc)
git-svn-id: https://svn.eduke32.com/eduke32@2659 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-17 17:33:29 +00:00
terminx 2ca8dc1c38 This should hopefully fix the disaster with events caused by my last couple of commits ;)
git-svn-id: https://svn.eduke32.com/eduke32@2656 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-16 00:45:10 +00:00
terminx 4ba6da5007 Addition of 3 events:
EVENT_SOUND: triggered upon playback of any sound, this allows the "hard coded" sounds to be altered in a context-aware fashion instead of having to resort to clunky hacks like replacing them with a blank sound effect.  RETURN var
iable is set to the sound effect # of the sound to be played, or -1 to cancel playback.

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

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

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


git-svn-id: https://svn.eduke32.com/eduke32@2652 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-14 18:12:27 +00:00
hendricks266 9f61e6e2d5 Superficial text changes:
- Help window text cleaned and made more consistent between game and editor
 - Added help entry for "-clipmap"
 - Log text for using CON, DEF, and RTS files has been made consistent
 - All instances of '%s' have been replaced with \"%s\" because ' is a valid filename character. (At least on Windows.)

git-svn-id: https://svn.eduke32.com/eduke32@2538 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-26 05:05:57 +00:00
helixhorned 26dfddfaf0 Trivial stuff that got accumulated and not committed.
git-svn-id: https://svn.eduke32.com/eduke32@2471 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-13 20:07:40 +00:00
helixhorned 95cbdbd1be Rename SOUNDOWNER's (used in sound_t) member .i to .ow for easier grepping.
git-svn-id: https://svn.eduke32.com/eduke32@2442 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-10 21:22:44 +00:00
helixhorned a2328cd597 With dndebug, show the currently playing sounds.
The format is
 snd #<sound number>
 inst <instance of that sound>:
 voice <internal voice handle>,
 ow <owner's sprite ID/-1>  (this is the interesting part)

git-svn-id: https://svn.eduke32.com/eduke32@2441 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-10 21:22:22 +00:00
helixhorned 4659b691e6 Some sound source cleanup, no functional changes.
- make a couple variables static in sounds_mapster32.c
- KHz --> Hz in initialization text

git-svn-id: https://svn.eduke32.com/eduke32@2439 1a8010ca-5511-0410-912e-c29ae57300e0
2012-03-10 21:21:42 +00:00
helixhorned d83ff63607 sounds.c: check the sound number before accessing arrays with it; always do
this in "(unsigned)i < bound" fashion.

git-svn-id: https://svn.eduke32.com/eduke32@2245 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-10 23:44:49 +00:00
helixhorned e94243d7db New CON command
setactorsoundpitch <actor#> <sound#> <pitchoffset>
which can be used to change the pitch of a playing sound.

The pitch offset has the same meaning as the definesound pitch range endpoints,
i.e. the units are 1/100th of a seminote.  Note that just like the random pitch
offset, increasing the pitch makes the sound duration shorter (and vice versa).

git-svn-id: https://svn.eduke32.com/eduke32@2104 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-03 23:08:54 +00:00
helixhorned 3a089f894c Increase MAXSOUNDS to 4096, making the maximum valid sound ID be 4093.
Keep in mind that MUSICANDSFXs with ambient sounds must still have lotags
less than 999 because values >=1000 are used for the amount of reverb.
(999 can't be used because the original code reads '< 999' and I'm not
sure whether it has any special significance... probably not though)

git-svn-id: https://svn.eduke32.com/eduke32@2093 1a8010ca-5511-0410-912e-c29ae57300e0
2011-10-30 19:48:46 +00:00
terminx ef61e48c25 Patch from Hendricks266 and whatever changes happened to be in my tree. I hope they work ;)
"The most noticeable change is the addition of the "includedefault" CON and DEF command, which will attempt to include eduke.con (or nam.con, or ww2gi.con), then game.con, or duke3d.def, or nam.def, or ww2gi.def. This is useful for TCs like my add-ons, where for my pseudo-mutators I currently say "include EDUKE.CON", but I also have to juggle this terrible order of paths, so that I can have an EDUKE.CON file in my HRP which says "include GAME.CON" to allow the mainline game to actually run, but also allow DukePlus to load its EDUKE.CON file (since it uses that and not an -x switch), and also allow any custom EDUKE.CON files in the root to be used."


git-svn-id: https://svn.eduke32.com/eduke32@1909 1a8010ca-5511-0410-912e-c29ae57300e0
2011-06-19 00:11:52 +00:00
helixhorned 61117d4e7b fix crash with RTS playback
git-svn-id: https://svn.eduke32.com/eduke32@1898 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-28 14:15:41 +00:00
terminx 323008432a Consolidate POLYMOST preprocessor define into USE_OPENGL, remove SUPERBUILD preprocessor define, add additional mode to neartag() to skip sprite searches and speed up processing (and enable for CON_OPERATE), fix issue with nearby single instance sounds not playing due to out of range sounds blocking their playback, fix issue with settings.cfg being reset to default bindings when running a mod that specifies its own cfg base name, improve CON structure member interface read/write performance, fix a bug with CON "move" pointer validation
git-svn-id: https://svn.eduke32.com/eduke32@1820 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-04 08:50:58 +00:00
terminx eb2070e9c9 Make audio initialization failures non-fatal
git-svn-id: https://svn.eduke32.com/eduke32@1779 1a8010ca-5511-0410-912e-c29ae57300e0
2011-01-23 04:59:04 +00:00
helixhorned 92223c2c85 Atrributify various function declarations. Right now the attributes used are noreturn, nonnull and format, the latter allowing us to catch silly printf errors. Again, these range from relatively benign to disastrous.
git-svn-id: https://svn.eduke32.com/eduke32@1740 1a8010ca-5511-0410-912e-c29ae57300e0
2010-12-19 22:47:10 +00:00
terminx a7eb0418d1 Global thermonuclear code rape
git-svn-id: https://svn.eduke32.com/eduke32@1677 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-02 08:13:51 +00:00
terminx 1102b74a35 mostly multiplayer fixes among other things
git-svn-id: https://svn.eduke32.com/eduke32@1672 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-19 15:14:00 +00:00
terminx d62c6117fe Sound fixes... again. Also fixes SPINNINGNUKEICON visible in the upper left corner in widescreen.
git-svn-id: https://svn.eduke32.com/eduke32@1667 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-05 04:37:28 +00:00
terminx 013ac85e2d Emit RPG_EXPLODE, PIPEBOMB_EXPODE and LASERTRIP_EXPLODE from the actual EXPLOSION2 sprite instead of whatever spawned EXPLOSION2, to prevent the sound from being owned by whatever sprite happens to spawn with the ID the RPG/pipebomb/whatever had before it was removed
Add brightness/gamma/contrast cvars to Mapster32

Fix bug with WEAPON_SEMIAUTO flag for custom weapons

Fix VM error with starttrack when specifying an invalid music track

Fix detection of 0x1a EOF characters in CON files

Fix a couple of additional sound issues

Fix crash in pushmove()

Fix Mapster32 textured 2D mode display being a few pixels off from the actual lines drawn

Fix crash when clicking "cancel" in Mapster32 startup window

Add Makefile detection to build with -march=pentium3 -mtune=generic on i686


git-svn-id: https://svn.eduke32.com/eduke32@1665 1a8010ca-5511-0410-912e-c29ae57300e0
2010-07-03 08:53:57 +00:00