aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-15 16:37:01 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit9f7bea156aa4c763fd637a9a12ff89e124b51a6c (patch)
tree6d36e37fe0febcd8afdfed088f1ca9e5c2ae0d92 /backends
parente2b3a9366eaad23549ad8be9316872e48a9ac11b (diff)
downloadscummvm-rg350-9f7bea156aa4c763fd637a9a12ff89e124b51a6c.tar.gz
scummvm-rg350-9f7bea156aa4c763fd637a9a12ff89e124b51a6c.tar.bz2
scummvm-rg350-9f7bea156aa4c763fd637a9a12ff89e124b51a6c.zip
CLOUD: Init SDL_Net
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/sdl/sdl.cpp22
-rw-r--r--backends/platform/sdl/sdl.h3
2 files changed, 25 insertions, 0 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index dca6891fef..9f7b29233d 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -60,6 +60,10 @@
#endif // !WIN32
#endif
+#ifdef USE_SDL_NET
+#include <SDL/SDL_net.h>
+#endif
+
OSystem_SDL::OSystem_SDL()
:
#ifdef USE_OPENGL
@@ -73,6 +77,9 @@ OSystem_SDL::OSystem_SDL()
#endif
_inited(false),
_initedSDL(false),
+#ifdef USE_SDL_NET
+ _initedSDLnet(false),
+#endif
_logger(0),
_mixerManager(0),
_eventSource(0),
@@ -120,6 +127,10 @@ OSystem_SDL::~OSystem_SDL() {
delete _logger;
_logger = 0;
+#ifdef USE_SDL_NET
+ if (_initedSDLnet) SDLNet_Quit();
+#endif
+
SDL_Quit();
}
@@ -294,6 +305,17 @@ void OSystem_SDL::initSDL() {
_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) {
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 1fe670c5c3..f440cd77bb 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -81,6 +81,9 @@ public:
protected:
bool _inited;
bool _initedSDL;
+#ifdef USE_SDL_NET
+ bool _initedSDLnet;
+#endif
/**
* Mixer manager that configures and setups SDL for