Codechange: Use std::string in the driver and blitter selection code.

This commit is contained in:
Michael Lutz
2020-05-17 23:32:08 +02:00
parent a49fdb7ebb
commit 37bc2f8064
51 changed files with 126 additions and 166 deletions

View File

@@ -50,7 +50,7 @@ void SoundDriver_Allegro::MainLoop()
*/
extern int _allegro_instance_count;
const char *SoundDriver_Allegro::Start(const char * const *parm)
const char *SoundDriver_Allegro::Start(const StringList &parm)
{
if (_allegro_instance_count == 0 && install_allegro(SYSTEM_AUTODETECT, &errno, nullptr)) {
DEBUG(driver, 0, "allegro: install_allegro failed '%s'", allegro_error);

View File

@@ -15,7 +15,7 @@
/** Implementation of the allegro sound driver. */
class SoundDriver_Allegro : public SoundDriver {
public:
const char *Start(const char * const *param);
const char *Start(const StringList &param);
void Stop();

View File

@@ -44,7 +44,7 @@ static OSStatus audioCallback(void *inRefCon, AudioUnitRenderActionFlags *inActi
}
const char *SoundDriver_Cocoa::Start(const char * const *parm)
const char *SoundDriver_Cocoa::Start(const StringList &parm)
{
struct AURenderCallbackStruct callback;
AudioStreamBasicDescription requestedDesc;

View File

@@ -14,7 +14,7 @@
class SoundDriver_Cocoa : public SoundDriver {
public:
const char *Start(const char * const *param) override;
const char *Start(const StringList &param) override;
void Stop() override;
const char *GetName() const override { return "cocoa"; }

View File

@@ -15,7 +15,7 @@
/** Implementation of the null sound driver. */
class SoundDriver_Null : public SoundDriver {
public:
const char *Start(const char * const *param) override { return nullptr; }
const char *Start(const StringList &param) override { return nullptr; }
void Stop() override { }
const char *GetName() const override { return "null"; }

View File

@@ -31,7 +31,7 @@ static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len)
MxMixSamples(stream, len / 4);
}
const char *SoundDriver_SDL::Start(const char * const *parm)
const char *SoundDriver_SDL::Start(const StringList &parm)
{
SDL_AudioSpec spec;
SDL_AudioSpec spec_actual;

View File

@@ -31,7 +31,7 @@ static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len)
MxMixSamples(stream, len / 4);
}
const char *SoundDriver_SDL::Start(const char * const *parm)
const char *SoundDriver_SDL::Start(const StringList &parm)
{
SDL_AudioSpec spec;

View File

@@ -15,7 +15,7 @@
/** Implementation of the SDL sound driver. */
class SoundDriver_SDL : public SoundDriver {
public:
const char *Start(const char * const *param) override;
const char *Start(const StringList &param) override;
void Stop() override;
const char *GetName() const override { return "sdl"; }

View File

@@ -26,6 +26,6 @@ public:
}
};
extern char *_ini_sounddriver;
extern std::string _ini_sounddriver;
#endif /* SOUND_SOUND_DRIVER_HPP */

View File

@@ -58,7 +58,7 @@ static DWORD WINAPI SoundThread(LPVOID arg)
return 0;
}
const char *SoundDriver_Win32::Start(const char * const *parm)
const char *SoundDriver_Win32::Start(const StringList &parm)
{
WAVEFORMATEX wfex;
wfex.wFormatTag = WAVE_FORMAT_PCM;

View File

@@ -15,7 +15,7 @@
/** Implementation of the sound driver for Windows. */
class SoundDriver_Win32 : public SoundDriver {
public:
const char *Start(const char * const *param) override;
const char *Start(const StringList &param) override;
void Stop() override;
const char *GetName() const override { return "win32"; }

View File

@@ -126,7 +126,7 @@ static StreamingVoiceContext* _voice_context = nullptr;
* @return An error message if unsuccessful, or nullptr otherwise.
*
*/
const char *SoundDriver_XAudio2::Start(const char * const *parm)
const char *SoundDriver_XAudio2::Start(const StringList &parm)
{
HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);

View File

@@ -15,7 +15,7 @@
/** Implementation of the XAudio2 sound driver. */
class SoundDriver_XAudio2 : public SoundDriver {
public:
const char *Start(const char * const *param) override;
const char *Start(const StringList &param) override;
void Stop() override;
const char *GetName() const override { return "xaudio2"; }