Commit 5421b4d6 authored by alistert's avatar alistert

Made networking optional at compile time.

parent 943294c8
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Part of the OpenJazz project * Part of the OpenJazz project
* *
* *
* Copyright (c) 2005-2009 Alister Thomson * Copyright (c) 2005-2010 Alister Thomson
* *
* OpenJazz is distributed under the terms of * OpenJazz is distributed under the terms of
* the GNU General Public License, version 2.0 * the GNU General Public License, version 2.0
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "OpenJazz.h" #include "OpenJazz.h"
#ifdef USE_SDL_NET #ifdef USE_SDL_NET
#include <SDL_net.h> #include <SDL_net.h>
#endif #endif
...@@ -46,6 +47,13 @@ ...@@ -46,6 +47,13 @@
class Network { class Network {
public: public:
#ifdef USE_SDL_NET
TCPsocket socket;
TCPsocket clientSocket;
IPaddress ipAddress;
SDLNet_SocketSet socketset;
#endif
Network (); Network ();
~Network (); ~Network ();
...@@ -57,12 +65,6 @@ class Network { ...@@ -57,12 +65,6 @@ class Network {
int recv (int sock, unsigned char *buffer, int length); int recv (int sock, unsigned char *buffer, int length);
bool isConnected (int sock); bool isConnected (int sock);
int getError (); int getError ();
#ifdef USE_SDL_NET
TCPsocket socket;
TCPsocket clientSocket;
IPaddress ipAddress;
SDLNet_SocketSet socketset;
#endif
}; };
......
...@@ -63,18 +63,20 @@ int loadMain (int argc, char *argv[]) { ...@@ -63,18 +63,20 @@ int loadMain (int argc, char *argv[]) {
// Determine paths // Determine paths
// Use the hard-coded path, if available // Use hard-coded paths, if available
#ifdef DATAPATH #ifdef DATAPATH
firstPath = new Path(NULL, createString(DATAPATH)); firstPath = new Path(NULL, createString(DATAPATH));
#elseifdef __SYMBIAN32__ #else
firstPath = NULL;
#endif
#ifdef __SYMBIAN32__
#ifdef UIQ3 #ifdef UIQ3
firstPath = new Path(NULL, createString("c:\\shared\\openjazz\\")); firstPath = new Path(firstPath, createString("c:\\shared\\openjazz\\"));
#else #else
firstPath = new Path(NULL, createString("c:\\data\\openjazz\\")); firstPath = new Path(firstPath, createString("c:\\data\\openjazz\\"));
#endif #endif
#else
firstPath = NULL;
#endif #endif
......
...@@ -40,13 +40,15 @@ ...@@ -40,13 +40,15 @@
int Menu::main () { int Menu::main () {
#if (defined USE_SOCKETS) || (defined USE_SDL_NET)
const char *newGameOptions[6] = {"new single player game", "new co-op game", const char *newGameOptions[6] = {"new single player game", "new co-op game",
"new battle", "new team battle", "new race", "join game"}; "new battle", "new team battle", "new race", "join game"};
int ret;
#endif
Scene *scene; Scene *scene;
SDL_Rect src, dst; SDL_Rect src, dst;
int option, suboption; int option, suboption;
unsigned int idleTime; unsigned int idleTime;
int ret;
option = suboption = 0; option = suboption = 0;
...@@ -73,6 +75,7 @@ int Menu::main () { ...@@ -73,6 +75,7 @@ int Menu::main () {
case 0: // New game case 0: // New game
#if (defined USE_SOCKETS) || (defined USE_SDL_NET)
while (true) { while (true) {
ret = generic(newGameOptions, 6, &suboption); ret = generic(newGameOptions, 6, &suboption);
...@@ -92,6 +95,9 @@ int Menu::main () { ...@@ -92,6 +95,9 @@ int Menu::main () {
} }
} }
#else
if (newGameEpisode(suboption) == E_QUIT) return E_QUIT;
#endif
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment