39 Commits

Author SHA1 Message Date
MoNTE48
e98d421aff Merge remote-tracking branch 'upstream/stable-0.4' into sync 2019-04-01 20:18:54 +02:00
SmallJoker
f6286e636b C++03 oldify in various source files 2018-06-03 17:32:00 +02:00
Paramat
50e0121d49 Fix recent commit: std::max -> std::fmax for floats (#6469)
Fixes commit a455297d297c0819a7eff89e51e5f01a5ac731c3
<cmath> header was already present in commit.
2018-06-03 17:31:59 +02:00
paramat
4402674ae6 Positional sound: Limit volume when closer than 1 node
Change OpenAL distance model from AL_INVERSE_DISTANCE to
AL_INVERSE_DISTANCE_CLAMPED to avoid excessive volume when very close
to the sound location, for example MTG doors, and MTG fire sounds which
are combined at an average position and often located in air nodes.

Because AL_REFERENCE_DISTANCE has been reduced to 1 node (the distance
under which gain is clamped), multiply volume by the same factor to keep
sound gains the same as before, since the gain is calculated as:

gain = (AL_REFERENCE_DISTANCE / distance)
2018-06-03 17:31:59 +02:00
Maksim Gamarnik
35770f4abb Merge Minetest 0.4.16 2017-06-06 23:03:34 +03:00
Brandon
893c2dfb5e Sound API: Add fading sounds 2017-05-03 03:12:45 +01:00
paramat
3e350d23b8 OpenAL sound: Use a simpler distance model
In createPlayingSoundAt(), AL_ROLLOFF_FACTOR is not set, so it has
the default value of 1.0, this makes the equation of the currently
used AL_EXPONENT_DISTANCE distance model identical to the equation
of the simpler AL_INVERSE_DISTANCE distance model.

Using AL_INVERSE_DISTANCE means an exponent is not processed,
exponents are quite intensive to process.
There is no change in sound attenuation behaviour.

The commented-out AL_ROLLOFF_FACTOR value is removed as it would
now have a different effect if used.
2017-02-09 00:10:35 +00:00
Maksim Gamarnik
e05f7db82f Updated to Minetest ver. 0.4.15 2017-01-30 00:44:07 +02:00
Loic Blot
0df837698f Make some maps unordered to improve performance
* This permit to improve performance on C++11 builds
* use some existing typedefs in tools maps
* minor code style changes
2016-10-05 07:30:32 +02:00
David Carlier
443165b7b9 couple of memory leaks fixes. 2016-08-10 16:59:32 +02:00
Maksim Gamarnik
1797862bf9 Merge 2015-12-06 15:00:12 +02:00
Jay Arndt
5ca0373713 Remove unused OpenALSoundManager::m_can_vorbis and EXT_vorbis check 2015-12-01 00:36:11 +00:00
Maksim Gamarnik
b3726345ff Merge last minetest commits 2015-11-27 12:57:52 +02:00
est31
87c4b5b49d sound_openal.cpp: remove unused header 2015-11-15 08:17:32 +01:00
est31
792446f426 Load sound from memory
* Remove trailing lines from src/sound_openal.cpp
* Don't do a horribly ugly copy of the file's path, allocating and deallocating a
	10 kb buffer in the process. This copy was needed for backwards compatibility
	with libvorbis 1.3.1 and earlier, as the removed comment explains.
	However, even Ubuntu precise has 1.3.2 already. Dropping support and sparing
	the ugly copy can therefore be considered safe.
* Actually load sounds from the memory, not caching them at the disk first,
	removing the old hack. This is the main motivation for the commit.
2015-11-14 18:17:32 +01:00
Maksim Gamarnik
919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
ShadowNinja
29e8adeadc Use warningstream for log messages with WARNING
Remove DTIME macro and its uses, too
2015-10-14 01:36:48 -04:00
David Jones
9d1284b324 Change i++ to ++i 2015-08-25 18:33:52 -04:00
Maksim Gamarnik
9247f32e0e LGPL 2.1 to 3.0 on all files 2015-08-14 01:26:28 +03:00
Craig Robbins
27791ee1aa For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00
Anton
420b5ec08c Use std::string::empty() instead of size() where applicable 2014-12-12 15:16:24 -05:00
Selat
a83693c5c3 Pass arguments by reference 2014-03-12 17:34:48 -04:00
sapier
311815d3f6 fix memory leak on sound shutdown 2013-04-07 23:43:34 -04:00
Sfan5
3fab3825aa Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam
269f01224b Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
Thomas Lauro
ea4fd9b1a0 Fix issue with openal mac os x compile 2012-09-01 18:19:59 +03:00
Perttu Ahola
ec937ecdd8 Properly and efficiently use split utility headers 2012-06-17 02:40:36 +03:00
Perttu Ahola
e05f1af484 Initially split utility.h to multiple files in util/ 2012-06-17 01:29:13 +03:00
Perttu Ahola
e70b6545b1 Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2/later, by agreement of major contributors 2012-06-05 18:54:07 +03:00
Perttu Ahola
8ba0f2deb1 Handle failing openal init properly, add enable_sound and sound_volume settings 2012-04-06 15:30:36 +03:00
Perttu Ahola
35e62fb3eb Attempt to fix sound left-right channels 2012-04-06 00:39:37 +03:00
Perttu Ahola
2ed270a8ed Do a dumb-ass static string copy for const-incorrect old versions of ov_fopen 2012-03-27 00:06:26 +03:00
Perttu Ahola
809798690d Sound loading from memory (by using a quick hack) 2012-03-25 15:52:43 +03:00
Perttu Ahola
4be45a2c43 Almost support loading sounds from server 2012-03-25 14:48:22 +03:00
Perttu Ahola
8a9e0e6746 Fix build on MinGW (as compared to Linux) 2012-03-24 23:16:09 +02:00
Perttu Ahola
026f4f2fc8 Lua API for playing sounds 2012-03-24 19:01:26 +02:00
Perttu Ahola
c602655b31 Add sounds, tune things 2012-03-24 04:24:26 +02:00
Perttu Ahola
cb281450b1 c55sound continued 2012-03-24 04:24:25 +02:00
Perttu Ahola
48359ec57f celeron55's sound system initial framework 2012-03-24 04:24:23 +02:00