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