SAFE_DELETE -> RageUtil::SafeDelete
SAFE_DELETE_ARRAY -> RageUtil::SafeDeleteArray
Update JsonUtil.h to include RageUtil.h - MSVC doesn't need it included for some reason, but GCC and XCode does.
Currently we are storing the default driver lists as a macro, and splitting them into RString vectors every time they are needed. This commit changes the macros in `arch_default.h` into vectors of RStrings, so that they do not need to be split each time.
I have updated all references where the default driver lists are being called so that the vector is used directly.
A new function is added to RageUtil to make a compatible vector of RStrings from user input which may be separated with a comma.
RageSoundDriver was refactored to check user input in Preferences.ini against the default driver list, and in case of incorrect spelling or failure, provides a detailed error message (including a list of valid options) in logs so the user can resolve the problem.
`fix_bogus_sound_driver_pref` is no longer needed, since we are now telling the user what their valid options are if the user provides an incorrect entry for the `SoundDrivers` preference, instead of silently attempting to guess what the user wanted. Since I think it's rare that someone wants to specify a driver to begin with, we should let them know their exact options if they put something wrong here, instead of silently failing or using an unwanted driver.
I tested this on Windows by specifying `DirectSound-sw` in Preferences.ini, and it worked as expected. I also tried putting an unusable value in, and got the error in logs letting me know what my valid driver options were. Of course, input and movies all work as expected too.
Nothing major here - updating C style casts, moving repeated function calls into variables, changing lrint's...
**RageSound.cpp**
- Initialize m_pSource to nullptr in the member initializer list, rather than in the body of the constructor
- Define an undefined variable `iSourceFrame`
- Change a `lrint` to a `static_cast<int>+0.5`
- Implement missing error handling in `SetStopModeFromString` with a log message
**RageSoundManager**
- Combined the iterator increment and the erase operation for `Update` into one line to prevent needing to create the `next` variable, since GameLoop calls this method frequently
**RageSoundReader**
- This method is called from RageSound just after making sure iFrames isn't equal to 0, so it's not needed for RageSoundReader to do it again.
- We will never fail to read a file 100 times. If we do, it's because of I/O errors, so make that more clear.
This is meant to be a safer alternative since
NULL can often be 0. Let's not rely on that.
And yes, I know this is a lot of files. This is
a safer thing to do in big commits vs for loops.