CLOUD: Init SDL_Net
This commit is contained in:
parent
e2b3a9366e
commit
9f7bea156a
2 changed files with 25 additions and 0 deletions
|
@ -60,6 +60,10 @@
|
||||||
#endif // !WIN32
|
#endif // !WIN32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_SDL_NET
|
||||||
|
#include <SDL/SDL_net.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
OSystem_SDL::OSystem_SDL()
|
OSystem_SDL::OSystem_SDL()
|
||||||
:
|
:
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
|
@ -73,6 +77,9 @@ OSystem_SDL::OSystem_SDL()
|
||||||
#endif
|
#endif
|
||||||
_inited(false),
|
_inited(false),
|
||||||
_initedSDL(false),
|
_initedSDL(false),
|
||||||
|
#ifdef USE_SDL_NET
|
||||||
|
_initedSDLnet(false),
|
||||||
|
#endif
|
||||||
_logger(0),
|
_logger(0),
|
||||||
_mixerManager(0),
|
_mixerManager(0),
|
||||||
_eventSource(0),
|
_eventSource(0),
|
||||||
|
@ -120,6 +127,10 @@ OSystem_SDL::~OSystem_SDL() {
|
||||||
delete _logger;
|
delete _logger;
|
||||||
_logger = 0;
|
_logger = 0;
|
||||||
|
|
||||||
|
#ifdef USE_SDL_NET
|
||||||
|
if (_initedSDLnet) SDLNet_Quit();
|
||||||
|
#endif
|
||||||
|
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,6 +305,17 @@ void OSystem_SDL::initSDL() {
|
||||||
|
|
||||||
_initedSDL = true;
|
_initedSDL = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_SDL_NET
|
||||||
|
// Check if SDL_net has not been initialized
|
||||||
|
if (!_initedSDLnet) {
|
||||||
|
// Initialize SDL_net
|
||||||
|
if (SDLNet_Init() == -1)
|
||||||
|
error("Could not initialize SDL_net: %s", SDLNet_GetError());
|
||||||
|
|
||||||
|
_initedSDLnet = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
|
void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
|
||||||
|
|
|
@ -81,6 +81,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
bool _inited;
|
bool _inited;
|
||||||
bool _initedSDL;
|
bool _initedSDL;
|
||||||
|
#ifdef USE_SDL_NET
|
||||||
|
bool _initedSDLnet;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mixer manager that configures and setups SDL for
|
* Mixer manager that configures and setups SDL for
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue