Commit Graph

82 Commits

Author SHA1 Message Date
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
7c21a0cf8e Header cleanup: profile.h is no longer unnecessarily included in scriptinterface.h but rather in the required .cpp files
This was SVN commit r18417.
2016-06-21 10:33:11 +00:00
01d41cc8a5 Actually update the sound gain after changing the setting. Patch by dpiquet, fixes #3901.
This was SVN commit r18193.
2016-05-17 16:40:36 +00:00
6c3964f52a Cleanup of SoundGroup XML files.
Remove some useless settings using the default values.
Remove the obsolete <Replacement> tag.
Update some documentation in the code, fix whitespace and unify line
endings.

Patch by otero, fixes #3268

This was SVN commit r17976.
2016-04-04 20:54:48 +00:00
1a66f510d0 Use const T& for parameters of some types in script-exposed native functions
Using references matches the C++ coding style better and should improve
performance a bit in theory. It avoids 2 copies of T in case of the
functions registered with RegisterFunction (mainy used in the GUI). It
should also avoid one or two copies in case of
DEFINE_INTERFACE_METHOD_X, which is used in the simulation, but I
haven't bothered to count it there exactly.
It is now predefined which types have to be passed by const reference
and which are passed by value. Note that references can't be used as
out-parameters (to return multiple values to JS). This hasn't worked
before either and probably never will.

This was SVN commit r17696.
2016-01-23 15:17:56 +00:00
f7a262fa4a Remove trailing whitespace. Based on patch by otero, refs #3268.
This was SVN commit r17576.
2015-12-31 11:45:13 +00:00
a07add11c6 Some range-based for loops and some style cleanup.
This was SVN commit r16888.
2015-07-29 01:07:23 +00:00
a18fbd12ec XML validation. Based on patch by historic_bruno. Refs #245.
This was SVN commit r16733.
2015-06-07 21:56:52 +00:00
e06a7b37d8 Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.

Fixes #3021.

This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
ec7c8f2d65 Move gain config setting retrieval to the sound manager. Fixes #3030.
Also clean up the sound manager a bit.

This was SVN commit r16257.
2015-02-02 13:44:06 +00:00
568c415d0a Convert wchar_t*/wstring arguments to UTF-8 strings in CLogger messages.
This was SVN commit r16188.
2015-01-22 20:37:38 +00:00
e02d7ad949 Automatically replace %hs/%ls with %s in CLogger format strings.
Everything is char* now, so we don't need to mess around with different
string types.

Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl
-pi -e'1 while
s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g'

This was SVN commit r16187.
2015-01-22 20:36:24 +00:00
38a8e2e0d6 Automatically convert most path.string().c_str() to path.string8()
Done with:

  ag -l 'LOG.*string\(\).c_str\(\)' source | xargs perl -pi -e'1 while
s/(LOG.*string)\(\)\.c_str\(\)/${1}8()/g'

This was SVN commit r16186.
2015-01-22 20:35:17 +00:00
e9a33b71ae Manually fix the less trivial CLogger format strings.
This was SVN commit r16184.
2015-01-22 20:32:06 +00:00
49e2ecea63 Automatically convert all CLogger format strings from wchar_t* to char*.
Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed
-i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g'

This was SVN commit r16183.
2015-01-22 20:31:30 +00:00
006bf42809 Fix segmentation fault in the sound destructor. Happened when the sound file doesn't exist. Errors are shown by other code.
This was SVN commit r15437.
2014-06-24 11:07:39 +00:00
a63ed4e4c4 Fixes rare crash in sound manager, due to worker thread dereferencing global pointer before it had been assigned. Fixes #2333, refs #2387, #2317.
Fixes potential infinite loop if worker thread was running but not
enabled.
Fixes apparent bug in fading sound smoothness.
Cleans up worker class slightly.
Cleans up weird and inconsistent whitespace.

This was SVN commit r15269.
2014-06-02 02:09:58 +00:00
a725266337 Slightly better options menu.
This was SVN commit r14766.
2014-02-20 22:45:43 +00:00
4be80f9322 Improves error handling in sound manager. Fixes some crashes and errors that could occur when OpenAL failed to init properly, fixes #2183, #2345
This was SVN commit r14725.
2014-02-02 05:58:27 +00:00
4b1297b328 Removes g_ScriptingHost and implements global to compartment 1 to 1 relation.
Each GUI Page gets its own compartment and all ScriptInterfaces in the
same thread should now use the same JS Runtime.
This is required for the SpiderMonkey upgrade.
Check the ticket for details.

Closes #2241
Refs #1886
Refs #1966

This was SVN commit r14496.
2014-01-04 10:14:53 +00:00
d6f6d2b145 Remove useless error messages.
This was SVN commit r14034.
2013-10-20 01:47:16 +00:00
fbee618ac8 Fixes memory leak in sound manager
This was SVN commit r13915.
2013-09-30 01:09:16 +00:00
b1bd61938e add file notification to Mac ticket 514, also change name of class FileInfo to CFileInfo to ease Mac development
This was SVN commit r13821.
2013-09-10 14:17:04 +00:00
e19b470a42 fix music glitchyness when game loses focus trac #2090
This was SVN commit r13799.
2013-09-06 02:46:13 +00:00
df190cbbd1 fix issues with menu mode and playlist, harden code and clear out ambient noises at game end, fixes #2066
This was SVN commit r13784.
2013-08-29 13:20:55 +00:00
00e21a9898 change 'restricted' flag to 'heardby' in SoundGroup xml files
This was SVN commit r13487.
2013-06-17 15:46:28 +00:00
36dec0e789 add restricted flag to SoundGroup xml for sounds thatonly the owning player should hear
This was SVN commit r13486.
2013-06-17 02:30:40 +00:00
26dbac8d57 fixes to SoundManager external interface, clean up ifdef situation, and SoundGroup playin
This was SVN commit r13474.
2013-06-13 12:12:44 +00:00
b3391ebe39 Fix build warnings. Patch by Markus. Refs #1851.
This was SVN commit r13469.
2013-06-11 00:05:57 +00:00
ada7702bec add UI sound channel, clean up external interface and javascript calls
This was SVN commit r13467.
2013-06-10 13:58:43 +00:00
71b25d5bd4 big SoundManager checkin,futureproof javascript interface, isolate external calls to remove OpenAL references
This was SVN commit r13455.
2013-06-06 11:13:57 +00:00
d20849d1c4 Add some checks for the sound manager. Fixes the segfault when using -quickstart.
This was SVN commit r13453.
2013-06-05 22:10:11 +00:00
004eaf9e75 log warning when stereo sounds are played at position
This was SVN commit r13442.
2013-06-01 01:52:05 +00:00
b21de66e40 address issue 1929 Ubiquitous Sound Effects, fixes a bug in determining which units are onscreen, also plays distant items softly if at all
This was SVN commit r13439.
2013-05-31 01:03:07 +00:00
93d0084266 incorporate patch from ticket 1937, fix memory leak in SoundManager
This was SVN commit r13430.
2013-05-27 13:36:17 +00:00
94c57085e9 Makes some classes NONCOPYABLE, based on patch by Markus, refs #1852
This was SVN commit r13419.
2013-05-22 21:40:56 +00:00
d7dcd3b26c Use prefix increment operator for iterators (for consistency), refs #1852, #1064
This was SVN commit r13418.
2013-05-22 18:41:13 +00:00
3ce14e3f4b fix memory leak in SoundManager, patch taken from ticket #1934
This was SVN commit r13417.
2013-05-22 12:13:21 +00:00
3f00d4d997 Change some size() > 0 to Based on patches by kuranes and Markus. Refs #1852, #1923.
This was SVN commit r13413.
2013-05-21 22:11:47 +00:00
bf959e1c46 fix build when using --without-audio
This was SVN commit r13389.
2013-05-02 13:58:28 +00:00
092108b304 Must notify sound manager sources are now available
This was SVN commit r13372.
2013-04-26 23:13:11 +00:00
c30f7a40e0 no need to check errors after destroying context, clean up some OpenAL interface calls
This was SVN commit r13371.
2013-04-25 10:48:34 +00:00
8324e0f665 add missing music list files
This was SVN commit r13369.
2013-04-24 19:27:16 +00:00
71486bd57d SoundManager supports playlists
This was SVN commit r13368.
2013-04-24 12:03:42 +00:00
503b481468 handle initialization errors cleanly, clean stuff up
This was SVN commit r13359.
2013-04-18 03:24:20 +00:00
2a3f1cb412 eliminate most warnings produced by Cppcheck
This was SVN commit r13356.
2013-04-12 03:10:54 +00:00
b301d5c84d fades music in and out when switching to background, also honors g_PauseOnFocusLoss
This was SVN commit r13352.
2013-04-10 11:51:42 +00:00
c9a5d5cee5 pause music and ambient sounds when game pauses
This was SVN commit r13347.
2013-04-07 04:13:15 +00:00
4edbd21714 elimate small memory leaks in SoundManager
This was SVN commit r13283.
2013-03-14 02:59:31 +00:00