]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - plugins/map/plugin.h
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / plugins / map / plugin.h
1 /*\r
2 Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.\r
4 \r
5 This file is part of GtkRadiant.\r
6 \r
7 GtkRadiant is free software; you can redistribute it and/or modify\r
8 it under the terms of the GNU General Public License as published by\r
9 the Free Software Foundation; either version 2 of the License, or\r
10 (at your option) any later version.\r
11 \r
12 GtkRadiant is distributed in the hope that it will be useful,\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15 GNU General Public License for more details.\r
16 \r
17 You should have received a copy of the GNU General Public License\r
18 along with GtkRadiant; if not, write to the Free Software\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
20 */\r
21 \r
22 #ifndef _PLUGIN_H_\r
23 #define _PLUGIN_H_\r
24 \r
25 #include <stdlib.h>\r
26 #include <stdio.h>\r
27 \r
28 #include "synapse.h"\r
29 \r
30 #define USE_QERTABLE_DEFINE\r
31 #include "qerplugin.h"\r
32 #define USE_VFSTABLE_DEFINE\r
33 #define USE_SCRIPLIBTABLE_DEFINE\r
34 #include "iscriplib.h"\r
35 #include "imap.h"\r
36 #include "ishaders.h"\r
37 #define USE_ENTITYTABLE_DEFINE\r
38 #include "ientity.h"\r
39 #define USE_BRUSHTABLE_DEFINE\r
40 #include "ibrush.h"\r
41 #define USE_PATCHTABLE_DEFINE\r
42 #include "ipatch.h"\r
43 #define USE_VFSTABLE_DEFINE\r
44 #include "ifilesystem.h"\r
45 \r
46 extern _QERFuncTable_1 g_FuncTable;\r
47 extern _QERScripLibTable g_ScripLibTable;\r
48 extern _QERShadersTable g_ShadersTable;\r
49 extern _QEREntityTable __ENTITYTABLENAME;\r
50 extern _QERBrushTable g_BrushTable;\r
51 extern _QERPatchTable g_PatchTable;\r
52 extern _QERFileSystemTable g_FileSystemTable;\r
53 \r
54 #define Error g_FuncTable.m_pfnError\r
55 #define QERApp_Shader_ForName g_ShadersTable.m_pfnShader_ForName\r
56 \r
57 // a bunch of globals to the module\r
58 extern void *g_pRadiantWnd;\r
59 \r
60 #define MAPVERSION_Q3 1\r
61 #define MAPVERSION_HL 2\r
62 #define MAPVERSION_Q2 3\r
63 //#define MAPVERSION_Q1\r
64 \r
65 #define MAP_NOERROR 0\r
66 #define MAP_ABORTED 1\r
67 #define MAP_WRONGVERSION 2\r
68 \r
69 void Map_ReadQ3 (IDataStream *in, CPtrArray *map);\r
70 void Map_WriteQ3 (CPtrArray *map, IDataStream *out);\r
71 void Map_ReadHL (IDataStream *in, CPtrArray *map);\r
72 void Map_WriteHL (CPtrArray *map, IDataStream *out);\r
73 void Map_ReadQ2 (IDataStream *in, CPtrArray *map);\r
74 void Map_WriteQ2 (CPtrArray *map, IDataStream *out);\r
75 \r
76 extern CSynapseServer* g_pSynapseServer;\r
77 \r
78 class CSynapseClientMap : public CSynapseClient\r
79 {\r
80   bool mbMapHL;\r
81 public:\r
82   // CSynapseClient API\r
83   bool RequestAPI(APIDescriptor_t *pAPI);\r
84   const char* GetInfo();\r
85   const char* GetName(); ///< required for runtime configuration\r
86   bool OnActivate();\r
87   \r
88   CSynapseClientMap() { mbMapHL = false; }\r
89   virtual ~CSynapseClientMap() { }\r
90 };\r
91 \r
92 #endif // _PLUGIN_H_\r