Changes for mingw32 compatibility. Gave up using GetAddrInfoW. getaddrinfo is dynamically bound, gethostbyname is used if it is not available.
VC compilation is broken. Make sure to use the dynamic boost-thread lib with mingw, as thread specific pointers are used!
This commit is contained in:
@@ -11,6 +11,16 @@
|
||||
//
|
||||
#include "sdlplayer.h"
|
||||
|
||||
// Include SDL here and not in headers to prevent
|
||||
// conflicts with QT includes.
|
||||
#if (defined _WIN32) || (defined __APPLE__)
|
||||
#include <SDL.h>
|
||||
#include <SDL_mixer.h>
|
||||
#else
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL/SDL_mixer.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
@@ -35,10 +45,10 @@ void SDLPlayer::initAudio() {
|
||||
|
||||
if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects"))
|
||||
{
|
||||
audio_rate = 44100;
|
||||
audio_format = AUDIO_S16; /* 16-bit stereo */
|
||||
audio_channels = 2;
|
||||
audio_buffers = 4096;
|
||||
int audio_rate = 44100;
|
||||
Uint16 audio_format = AUDIO_S16; /* 16-bit stereo */
|
||||
int audio_channels = 2;
|
||||
int audio_buffers = 4096;
|
||||
sound = NULL;
|
||||
|
||||
if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) == 0) {
|
||||
|
||||
@@ -14,23 +14,12 @@
|
||||
#ifndef SDLPLAYER_H
|
||||
#define SDLPLAYER_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <SDL.h>
|
||||
#include <SDL_mixer.h>
|
||||
#else
|
||||
#ifdef __APPLE__
|
||||
#include <SDL.h>
|
||||
#include <SDL_mixer.h>
|
||||
#else
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL/SDL_mixer.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include "configfile.h"
|
||||
#include "qthelper.h"
|
||||
|
||||
struct Mix_Chunk;
|
||||
|
||||
/**
|
||||
@author FThauer FHammer <webmaster@pokerth.net>
|
||||
*/
|
||||
@@ -49,12 +38,8 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
int audio_rate;
|
||||
Uint16 audio_format;
|
||||
int audio_channels;
|
||||
int audio_buffers;
|
||||
Mix_Chunk *sound;
|
||||
Uint8 *soundData;
|
||||
unsigned char *soundData;
|
||||
int currentChannel;
|
||||
|
||||
bool audioEnabled;
|
||||
|
||||
Reference in New Issue
Block a user