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