1 /**
2  * @file
3  * @brief Share stuff between the different cgame implementations
4  */
5 
6 /*
7 All original material Copyright (C) 2002-2013 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
28 #include "../common/common.h"
29 
30 #ifdef NO_I18N
31 #define bindtextdomain(IGNORE1, IGNORE2)
32 #define bind_textdomain_codeset(IGNORE1, IGNORE2)
33 #define textdomain(IGNORE1)
34 #define gettext(String) gettext_noop(String)
35 #else
36 /* i18n support via gettext */
37 #include <libintl.h>
38 #endif
39 #include <locale.h>
40 
41 /* the used textdomain for gettext */
42 #define TEXT_DOMAIN "ufoai"
43 #define _(String) gettext(String)
44 #define gettext_noop(String) String
45 #define N_(String) gettext_noop (String)
46 
47 #define INVDEF(containerID) (&csi.ids[(containerID)])
48 
49 #define OVERLAY_NATION		(1<<0)
50 #define OVERLAY_XVI			(1<<1)
51 #define OVERLAY_RADAR		(1<<2)
52 
53 #define XVI_WIDTH		512
54 #define XVI_HEIGHT		256
55 #define RADAR_WIDTH		512
56 #define RADAR_HEIGHT	256
57 
58 typedef struct geoscapeData_s {
59 	bool active;
60 	bool nationOverlay;
61 	bool xviOverlay;
62 	bool radarOverlay;
63 	const char* map;
64 	date_t date;
65 
66 	/** this is the data that is used with r_xviTexture */
67 	byte r_xviAlpha[XVI_WIDTH * XVI_HEIGHT];
68 
69 	/** this is the data that is used with r_radarTexture */
70 	byte r_radarPic[RADAR_WIDTH * RADAR_HEIGHT];
71 
72 	/** this is the data that is used with r_radarTexture */
73 	byte r_radarSourcePic[RADAR_WIDTH * RADAR_HEIGHT];
74 
75 	void* geoscapeNode;
76 } geoscapeData_t;
77 
78 typedef enum {
79 	ca_uninitialized,
80 	ca_disconnected,			/**< not talking to a server */
81 	ca_connecting,				/**< sending request packets to the server */
82 	ca_connected,				/**< netchan_t established, waiting for svc_serverdata */
83 	ca_active					/**< game views should be displayed */
84 } connstate_t;
85 
86 #define MapDef_ForeachSingleplayer(var) MapDef_ForeachCondition(var, (var)->singleplayer)
87 #define MapDef_ForeachSingleplayerCampaign(var) MapDef_ForeachCondition(var, (var)->singleplayer && (var)->campaign)
88 
89 mapDef_t* Com_GetMapDefinitionByID(const char* mapDefID);
90 
91 extern memPool_t* cl_genericPool;
92