2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
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.
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.
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
23 Camera plugin for GtkRadiant
24 Copyright (C) 2002 Splash Damage Ltd.
31 #pragma warning(disable : 4267)
33 typedef unsigned char byte;
42 #define USE_QERTABLE_DEFINE
43 #include "qerplugin.h"
51 #include "funchandlers.h"
55 extern _QERFuncTable_1 g_FuncTable;
56 extern _QERQglTable g_QglTable;
57 extern _QERUITable g_UITable;
58 extern _QERCameraTable g_CameraTable;
60 extern CRenderer *Renderer;
61 extern CListener *Listener;
65 #define DotProduct(a,b) ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])
67 extern void ( APIENTRY * qglBegin )(GLenum mode);
68 extern void ( APIENTRY * qglEnd )(void);
69 extern void ( APIENTRY * qglVertex3fv )(const GLfloat *v);
71 extern "C" void InitIglToQgl( _QERQglTable *g_QglTable );
73 #include "splines/splines.h"
75 // this needs to match splines.cpp
76 #define MAX_CAMERAS 64
77 extern idCameraDef camera[MAX_CAMERAS];
79 extern "C" qboolean loadCamera(int camNum, const char *name);
100 idCameraDef *GetCam() {
107 char *GetFileName() {
110 void SetFileName( const char *name, bool save ) {
111 strcpy( fileName, name );
124 void SetNext( CCamera *camera ) {
127 void SetPrev( CCamera *camera ) {
132 return( hasbeensaved );
134 void HasBeenModified() {
142 CCamera *next, *prev;
143 char fileName[PATH_MAX];
144 int hasbeensaved; // 0:never saved 1:saved 2:saved, but modified
148 void FreeCam( CCamera *cam );
149 void SetCurrentCam( CCamera *cam );
150 CCamera *GetCurrentCam();
153 extern GtkWidget *g_pRadiantWnd;
154 extern GtkWidget *g_pCameraInspectorWnd;
155 extern CCamera *firstCam;
156 extern bool g_bEditOn;
157 extern int g_iEditMode;
158 extern int g_iActiveTarget;
159 extern int g_iPreviewRunning;
160 extern CCamera *g_pCurrentEditCam;