Commit Graph

51 Commits

Author SHA1 Message Date
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
pizza2004 156be224f9
Close #12399: Refactor MIXER_GROUP to strong enum (#12531) 2020-08-03 20:51:12 -03:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Tom Lankhorst 2d0e7bdfd8
openrct2-ui Audio clean-up and style/usage fixes (#10115)
* openrct2-ui Audio clean-up and style/usage fixes



Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-05-10 10:05:26 -03:00
Tom Lankhorst da0c586fad
Mark getters in audio layer as [[nodiscard]] 2020-04-24 18:38:11 +02:00
Michał Janiszewski 5f97637d5e Only suggest final when using non-LTO builds
In LTO builds GCC issues the suggestion-warning from linking stage,
when pragmas are already gone and do nothing.
2020-04-21 13:31:01 +02:00
Tulio Leao 57886ad0c7 Use named casts in openrct2-ui/audio/ 2020-03-28 17:18:15 -03:00
Tulio Leao fe6ff2ac94 Use named casts in openrct2-ui/audio/AudioChannel.cpp 2020-03-28 17:18:07 -03:00
Tulio Leao bb052a784a Use named casts in openrct2-ui/audio/AudioMixer 2020-03-28 17:17:57 -03:00
Tulio Leao 2bb3a34274 Convert C-style pointer casts to named casts 2020-03-28 16:41:23 -03:00
r0 9f6a944174 Fix #9603: Don't render audio when master volume is turned off (#9907) 2019-08-21 23:36:07 +02:00
Duncan ab5f5b20cd
Use enum class for RCT2_SOUND (#9618)
* Use enum class for RCT2_SOUND

* Fix formatting. Fix mistaken declaration.

* Change name of enum to SoundId

* Fix clang format
2019-07-22 19:02:45 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Michał Janiszewski ecfbf60cc4 Drop SDL2/ prefix on includes
pkg-config, cmake, all demos and tests define the path with SDL2/
already included.
2019-01-06 17:29:29 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Sijmen Schoon 0cdd7c8cc8 Add master sound checkbox and master volume slider
Also includes some rewriting of rct_scroll code that I did while
debugging the issue with more than two rct_scrolls in one window. I
decided to leave it in.
2018-08-17 22:14:11 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format ebb17929a7 clang-format UI audio 2018-07-23 16:00:12 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek ec3a1e575e
Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Michał Janiszewski 320eee0d59
Fix -Wunreachable-code-break and add it to deafult warnings (#7634) 2018-06-06 22:30:21 +02:00
Hielke Morsink 8aa122f54e Use empty initializer lists in the openrct2ui project 2018-06-05 14:37:24 +02:00
Ted John 7dc170ef85 Use shared_ptr for long-life objects
Use unique_ptr and shared_ptr for IContext, IPlatformEnvironment, IUiContext, and IAudioContext.
2018-05-11 20:37:48 +01:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Hielke Morsink bc44792da9 Pack nested namespaces together 2018-05-04 22:54:43 +02:00
Ted John 39a38dc193 Include SDL2 using sub directory 2018-03-09 16:28:47 +01:00
Ted John 0ee3c45d37 Fix #7196: Crowd Noises Absent
Sounds loaded into memory that matched the target audio format were returning a failed result.
2018-02-25 02:40:36 +00:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
ZehMatt 4f011163d0 Fix #6667: Match sample rate to games audio content. 2018-02-11 12:51:33 +01:00
Ted John cebe13984f Remove most of remaining memory functions from libopenrct2ui 2018-01-21 11:17:41 +00:00
Ted John 0b8575270c Refactor memory handling in audio sources 2018-01-21 11:17:40 +00:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Michał Janiszewski b2bc974fe7
Use nullptr where possible 2018-01-04 06:58:44 +01:00
Michael Steenbeek b2968ce8b0 Fix #6320: Crash when CSS1.DAT is absent 2017-09-29 10:43:47 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
Ted John 6699d0885b Merge pull request #6065 from IntelOrca/refactor/remove-rct2.c
Move remaining functions out rct2.c
2017-07-30 18:09:26 +01:00
Michał Janiszewski d5e6ab3111 Properly dispose of AudioMixer to plug memleak 2017-07-30 17:21:36 +02:00
Ted John 8b2eb8a13e Move screen variables to OpenRCT2.h 2017-07-29 20:29:29 +01:00
Ted John e6e503a853 Move path related functions to Context.cpp
- rct2_init_directories
- get_file_path
2017-07-29 20:29:26 +01:00
zsilencer 2385ef1059 Fix incorrect arguments to resampler. 2017-06-29 16:40:00 -06:00
zsilencer bde3197e79 Fix incorrect resampling rate when at the end of a sound. 2017-06-29 15:43:40 -06:00
Michael Steenbeek 1f00469b26 Replace free+null with SafeFree, allow freeing NULL
free(NULL) is perfectly fine, no need to check
2017-06-22 12:49:33 +02:00
Ted John 47e6f1d139 Rename our version of SDL_MIX_MAXVOLUME to MIXER_VOLUME_MAX
Keep an assert to make sure its the same as SDL in the mixer. If SDL changes it, we can either change ours or convert the number proportionally.
2017-06-10 17:14:07 +01:00
Michał Janiszewski 79d76759bb Fix #5516: Update copyrights for 2017
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
Ted John 0440c3deea Clean up audio.cpp 2017-05-29 22:38:43 +02:00
Ted John e426c70bbc Get moved audio code linking 2017-05-29 22:38:43 +02:00
Ted John d206d181f2 Move audio code to UI project 2017-05-29 22:38:43 +02:00