974
|
1 #include <math.h>
|
|
2 #include <stdlib.h>
|
|
3 #include "SceneGraphRoot.h"
|
|
4 #include "Application.h"
|
|
5 #include "MainLoop.h"
|
|
6 typedef struct {
|
|
7 const char *hostname;
|
|
8 int port;
|
|
9 } linda_t;
|
|
10
|
|
11 class NetworkGame : public Application {
|
|
12 public:
|
|
13 static int last_player_id;
|
|
14
|
|
15 static Viewer *sgroot;
|
|
16 static linda_t linda_addr;
|
|
17 static int linda;
|
|
18 static int serial_id;
|
|
19 static int start_x;
|
|
20 static int width;
|
|
21 static char *xml_file_name;
|
|
22 static void linda_connect();
|
|
23 static void update_screen_scope();
|
|
24 static void send_position(SceneGraphPtr node);
|
|
25 static void set_position(SceneGraphPtr node, unsigned char *reply);
|
|
26 static void update_last_player_id();
|
|
27 void create_my_sg(Viewer *sgroot, SceneGraphPtr parent, int screen_w, int screen_h);
|
|
28 MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
|
|
29 };
|