Commit graph

281 commits

Author SHA1 Message Date
Christoph Oelckers
358718de05 - removed the playernum parameter from CheckLocalView
This was always used with 'consoleplayer' which really is the only thing making sense here. But this is a part of the global state which should be avoided in play code.

In particular, this makes no real sense in case of secondary maps where it should always return false.

# Conflicts:
#	src/fragglescript/t_func.cpp
#	src/g_inventory/a_keys.cpp
#	src/p_acs.cpp
#	src/p_mobj.cpp
#	src/p_user.cpp
#	src/r_data/r_interpolate.cpp
#	src/r_data/r_interpolate.h
2019-09-02 21:17:19 +02:00
Major Cooke
7f5a2d3a11 Added A_SoundPitch and an optional pitch parameter to A_PlaySound and S_Sound.
- Note: Because sound channels are not in zscript, there's no way to modify a sound made by S_Sound.

# Conflicts:
#	src/s_sound.cpp
#	wadsrc/static/zscript/base.zs
2019-07-25 00:06:12 +02:00
Christoph Oelckers
9c25d75f65 - removed a few obsolete definitions from basictypes.h
# Conflicts:
#	src/win32/i_specialpaths.cpp
2019-07-17 17:54:30 +02:00
Christoph Oelckers
b473fc936c - consolidated the 3 atterm implementations.
Each platform had its own copy. Why?

# Conflicts:
#	src/CMakeLists.txt
#	src/dobjtype.cpp
#	src/g_mapinfo.cpp
#	src/g_statusbar/sbarinfo.cpp
#	src/i_net.cpp
#	src/menu/menudef.cpp
#	src/p_setup.cpp
#	src/posix/cocoa/i_video.mm
#	src/posix/i_system.h
#	src/posix/sdl/i_main.cpp
#	src/r_utility.cpp
#	src/s_advsound.cpp
#	src/s_sound.cpp
#	src/v_video.cpp
#	src/win32/i_input.cpp
#	src/win32/i_system.h

# Conflicts:
#	src/CMakeLists.txt
#	src/doomtype.h
#	src/i_net.cpp
#	src/posix/sdl/i_system.cpp
#	src/win32/i_system.cpp
#	src/win32/win32video.cpp
2019-06-10 20:52:02 +02:00
alexey.lysiuk
8c81888471 - removed obsolete snd_flipstereo CVAR
https://forum.zdoom.org/viewtopic.php?t=64630
2019-05-09 16:27:40 +02:00
Christoph Oelckers
06f84d2420 - reject all DMX sounds shorter than or equal 8 bytes.
8 bytes is the minimum header size for DMX, so for one byte of sample data it has to be 9 bytes.
This was causing access to invalid memory when trying to read the header of something too short.
For other file formats this is of no concern because none has a header this short.
2019-04-28 22:50:21 +02:00
Major Cooke
d34108f0e9 Renamed to musplaying.
# Conflicts:
#	wadsrc/static/zscript/base.zs
2019-04-28 22:38:25 +02:00
Major Cooke
43eaa03654 Exported MusPlayingInfo to ZScript.
- Allows grabbing the currently playing song, base order, and loop properties.

# Conflicts:
#	wadsrc/static/zscript/base.zs

# Conflicts:
#	wadsrc/static/zscript/base.zs
2019-04-28 22:37:08 +02:00
alexey.lysiuk
494dc20088 - increased range of valid sound positions and velocities
https://forum.zdoom.org/viewtopic.php?t=61420
2019-04-26 17:20:37 +02:00
Christoph Oelckers
cf4f573a25 - more direct native entry points.
- disallow bool as a return value for direct native calls because it only sets the lowest 8 bits of the return register.
- changed return type for several functions from bool to int where the return type was the only thing blocking use as direct native call.
2019-04-17 17:27:39 +02:00
Christoph Oelckers
792aaa5b88 Added direct native entry points to a larger number of functions.
# Conflicts:
#	src/scripting/vmthunks_actors.cpp
2019-04-17 15:11:22 +02:00
Christoph Oelckers
94424aeed8 - Changed a few allocations into usin TArrays
S_SoundCurve in particular looked like a candidate for leaking memory.
2019-04-16 17:28:30 +02:00
Christoph Oelckers
3f1c7bdbe8 - added a direct native variant for A_PlaySound because this function is relatively easy to test. 2019-04-16 14:58:15 +02:00
Christoph Oelckers
7caa6a922d - moved MarkPrecacheSounds completely to the script side and added native support to make this a usable feature.
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 22:29:35 +02:00
Christoph Oelckers
9d126954d1 - removed the default parameter handling from all native script functions because it is no longer needed.
# Conflicts:
#	src/p_actionfunctions.cpp

# Conflicts:
#	src/hwrenderer/postprocessing/hw_postprocessshader.cpp
#	src/v_2ddrawer.cpp
2019-04-15 14:59:00 +02:00
alexey.lysiuk
063efa1ccd - fixed default values for S_ChangeMusic
https://forum.zdoom.org/viewtopic.php?t=62323#p1076849
2018-10-22 10:28:22 +02:00
Rachael Alexanderson
342b476781 - fixed: sound from poly objects through portals will now propegate properly 2018-08-26 13:52:25 +02:00
alexey.lysiuk
807695783f - fixed portal restoration on revisiting level in hub
Added function to FLevelLocals to test if map is being reentered

https://forum.zdoom.org/viewtopic.php?t=60455
(cherry picked from commit 29d2e77840)
2018-06-11 12:25:30 +02:00
Rachael Alexanderson
4d238beb7b - fixed - sector sounds were not translated through portal groups properly
(cherry picked from commit 780ddd21bd)
2018-06-05 00:04:04 +02:00
alexey.lysiuk
c06501d7ca - use map axes in bad sound position/velocity warning
https://forum.zdoom.org/viewtopic.php?t=60578
(cherry picked from commit 8a6ae503be)
2018-05-13 19:14:01 +02:00
alexey.lysiuk
140ad241c4 Adjusted validation limit for sound velocity again :(
https://forum.zdoom.org/viewtopic.php?t=59979
2018-03-30 10:42:22 +03:00
alexey.lysiuk
b952653303 Set more suitable limit for sound velocity validation
https://forum.zdoom.org/viewtopic.php?t=59979
2018-03-29 17:37:36 +03:00
alexey.lysiuk
4f6a853bfb Added validation of sound position and velocity
https://forum.zdoom.org/viewtopic.php?t=57632
2018-03-24 13:09:55 +01:00
Christoph Oelckers
b939836846 - renamed FileRdr back to FileReader. 2018-03-11 19:29:37 +01:00
Christoph Oelckers
5fa63c396d - sound code and most of texture code converted to FileRdr.
This allowed to remove a lot of bad pointer voodoo in the music loader, because the new class does not allow duplication of the reader object
2018-03-10 18:45:11 +01:00
Christoph Oelckers
adebd644f2 Rewroter 'writemidi' CCMD to work independently of the currently playing song's data.
The first benefit of separating the MIDI data sources from the playback classes. :)
2018-02-23 14:26:29 +01:00
alexey.lysiuk
f4191f27cf Marked two more CCMDs as unsafe 2018-01-30 15:42:03 +02:00
Rachael Alexanderson
5716dfe050 - put limits on A_SoundVolume 2017-11-10 08:21:28 -05:00
Chris Robinson
60cc91e000 Properly unload the backend sound buffers 2017-05-09 19:13:52 +02:00
alexey.lysiuk
be496a89d9 Fixed silent sounds on first play, stereo and precached only
https://mantis.zdoom.org/view.php?id=637
2017-04-29 11:44:13 +03:00
Christoph Oelckers
21af612224 - avoid double loading sound data for monoization. 2017-04-26 20:51:06 +02:00
Chris Robinson
78231d5ba1 Remove unused URLSong functionality
This isn't supported with the OpenAL backend, and instead of trying to make a
workaround for it, a better approach would probably be to make a FileReader
implementation that handles URLs.
2017-04-24 13:12:43 +02:00
Christoph Oelckers
8180d34765 - added user configurable menus where soundfonts, patch sets or Timidity EXEs can be selected from lists being stored in the config file to reduce the hassle of testing MIDIs with different settings. 2017-04-18 16:43:07 +02:00
Christoph Oelckers
96d328de9b - removed all Doom Source license and all default Raven copyright headers and replaced them with GPLv3. Also fixed the license in a few other files.
For some files that had the Doom Source license attached but saw heavy external contributions over the years I added a special note to license all original ZDoom code under BSD.
2017-04-17 13:33:19 +02:00
Christoph Oelckers
c219811a54 - removed FMod as the last remaining piece of code that is not GPL compatible.
Please consider GZDoom as licensed under the GPL starting with this commit, even though the license headers have not been changed yet.
2017-04-17 01:06:54 +02:00
Christoph Oelckers
6599e2c425 - moved the VM types into their own file and only include it where really needed. 2017-04-13 01:12:04 +02:00
Christoph Oelckers
ea1d6634f7 - moved the Zones array into FLevelLocals.
- replaced TStaticArray with regular TArrays.

They had incomplete implementations preventing proper cleanup of the level loading code. It makes more sense to add the missing methods to the regular TArray and use that.
This also makes some changes to how the game nodes are used to avoid creating a copy: If the head node's pointer is stored in a separate variable, no code needs to check which of the two arrays gets used.
2017-03-17 12:11:37 +01:00
Christoph Oelckers
005e6871f9 - increased the snd_channels default and minimum.
The values were still 8 and 32 respectively which applied to hardware from last decade, but for modern mods these are simply too low. New values are 64 as minimum and 128 as default.

- added script access to a sector's colormap and specialcolors fields. (Writing only through dedicated functions because these fields are render state which may need to trigger some form of refresh if the renderer changes.)
2017-03-16 10:38:56 +01:00
Christoph Oelckers
a4710bcdb0 - did a bit of header cleanup to reduce the dependency on dobject.h. 2017-03-09 23:30:42 +01:00
Christoph Oelckers
d2beacfc5f - except for DWORD, all homegrown integer types are gone - a handful were left where they represent genuine Windows types. 2017-03-09 19:54:41 +01:00
Christoph Oelckers
8ab562ef13 - the fourth. 2017-03-08 18:55:54 +01:00
Christoph Oelckers
c630b07011 - replaced SDWORD with int32_t globally.
This type wasn't used in the software rendering code so it could be removed already. The other homegrown types will have to be dealt with later.
2017-03-03 19:35:08 +01:00
alexey.lysiuk
59db1a882f Fixed compilation warnings reported by MSVC
src\s_sound.cpp(1259): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
src\c_bind.cpp(479): warning C4101: 'c': unreferenced local variable
2017-02-16 11:01:06 +02:00
Christoph Oelckers
2e11b4f346 - fixed: The S_Sound script export did not call the actual function. 2017-02-14 17:03:31 +01:00
alexey.lysiuk
c01107181a Reset sound position only when there is no listener
https://mantis.zdoom.org/view.php?id=206
https://mantis.zdoom.org/view.php?id=248
2017-02-12 11:26:25 +02:00
Christoph Oelckers
4e685f2b78 - fixed: for unpositioned sounds the play position was never initialized and depended on random memory contents. 2017-02-08 23:29:52 +01:00
Christoph Oelckers
96777273c4 - scriptified ASoundSequence.
- exported virtual Actor.MarkPrecacheSounds function.
2017-01-14 14:37:29 +01:00
Christoph Oelckers
46179936ec - added global per-mod precaching lists, to be defined in MAPINFO's Gameinfo section. 2017-01-10 01:00:06 +01:00
Christoph Oelckers
cd7986b1b1 - refactored global sides array to be more VM friendly.
- moved FLevelLocals to its own header to resolve some circular include conflicts.
2017-01-08 18:46:17 +01:00
Christoph Oelckers
15f30886cd - scriptified the TimeFreezer powerup. 2017-01-03 20:06:20 +01:00