Commit 5421b4d6 authored by alistert's avatar alistert

Made networking optional at compile time.

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