| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
#ifndef _CAMERA_H_ |
| 28 |
#define _CAMERA_H_ |
| 29 |
|
| 30 |
#define PLUGIN_NAME "Camera" |
| 31 |
#define PLUGIN_VERSION "1.0" |
| 32 |
|
| 33 |
typedef unsigned char byte; |
| 34 |
|
| 35 |
#include "mathlib.h" |
| 36 |
#include <string.h> |
| 37 |
#include "qertypes.h" |
| 38 |
#include <stdio.h> |
| 39 |
|
| 40 |
#define USE_QERTABLE_DEFINE |
| 41 |
#include "iscenegraph.h" |
| 42 |
#include "qerplugin.h" |
| 43 |
|
| 44 |
#define USE_QGLTABLE_DEFINE |
| 45 |
#include "igl.h" |
| 46 |
extern _QERQglTable __QGLTABLENAME; |
| 47 |
|
| 48 |
#include "iui.h" |
| 49 |
#include "icamera.h" |
| 50 |
|
| 51 |
#include "bytebool.h" |
| 52 |
|
| 53 |
class CCamera; |
| 54 |
|
| 55 |
#include "str.h" |
| 56 |
|
| 57 |
|
| 58 |
#include "misc.h" |
| 59 |
#include "dialogs.h" |
| 60 |
#include "funchandlers.h" |
| 61 |
#include "renderer.h" |
| 62 |
#include "listener.h" |
| 63 |
|
| 64 |
extern _QERFuncTable_1 g_FuncTable; |
| 65 |
extern _QERQglTable g_QglTable; |
| 66 |
extern _QERUITable g_UITable; |
| 67 |
extern _QERCameraTable g_CameraTable; |
| 68 |
|
| 69 |
extern CRenderer *Renderer; |
| 70 |
extern CListener *Listener; |
| 71 |
|
| 72 |
|
| 73 |
#define CAMERA_PLUGIN |
| 74 |
#define DotProduct( a,b ) ( ( a )[0] * ( b )[0] + ( a )[1] * ( b )[1] + ( a )[2] * ( b )[2] ) |
| 75 |
|
| 76 |
#include "splines/splines.h" |
| 77 |
|
| 78 |
|
| 79 |
#define MAX_CAMERAS 64 |
| 80 |
extern idCameraDef camera[MAX_CAMERAS]; |
| 81 |
|
| 82 |
extern "C" qboolean loadCamera( int camNum, const char *name ); |
| 83 |
|
| 84 |
#ifndef PATH_MAX |
| 85 |
#define PATH_MAX 260 |
| 86 |
#endif |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
class CCamera { |
| 93 |
public: |
| 94 |
CCamera( int i ) { |
| 95 |
cam = &camera[i]; |
| 96 |
camnum = i; |
| 97 |
Init(); |
| 98 |
} |
| 99 |
~CCamera(); |
| 100 |
|
| 101 |
void Init() { |
| 102 |
next = prev = NULL; |
| 103 |
fileName[0] = '\0'; |
| 104 |
hasbeensaved = 0; |
| 105 |
} |
| 106 |
|
| 107 |
idCameraDef *GetCam() { |
| 108 |
return( cam ); |
| 109 |
} |
| 110 |
int GetCamNum() { |
| 111 |
return( camnum ); |
| 112 |
} |
| 113 |
|
| 114 |
char *GetFileName() { |
| 115 |
return( fileName ); |
| 116 |
} |
| 117 |
void SetFileName( const char *name, bool save ) { |
| 118 |
strcpy( fileName, name ); |
| 119 |
if ( save ) { |
| 120 |
hasbeensaved = 1; |
| 121 |
} |
| 122 |
} |
| 123 |
|
| 124 |
CCamera *GetNext() { |
| 125 |
return( next ); |
| 126 |
} |
| 127 |
|
| 128 |
CCamera *GetPrev() { |
| 129 |
return( prev ); |
| 130 |
} |
| 131 |
|
| 132 |
void SetNext( CCamera *camera ) { |
| 133 |
next = camera; |
| 134 |
} |
| 135 |
void SetPrev( CCamera *camera ) { |
| 136 |
prev = camera; |
| 137 |
} |
| 138 |
|
| 139 |
int HasBeenSaved() { |
| 140 |
return( hasbeensaved ); |
| 141 |
} |
| 142 |
void HasBeenModified() { |
| 143 |
if ( hasbeensaved ) { |
| 144 |
hasbeensaved = 2; |
| 145 |
} |
| 146 |
} |
| 147 |
|
| 148 |
protected: |
| 149 |
idCameraDef *cam; |
| 150 |
int camnum; |
| 151 |
CCamera *next, *prev; |
| 152 |
char fileName[PATH_MAX]; |
| 153 |
int hasbeensaved; |
| 154 |
}; |
| 155 |
|
| 156 |
CCamera *AllocCam(); |
| 157 |
void FreeCam( CCamera *cam ); |
| 158 |
void SetCurrentCam( CCamera *cam ); |
| 159 |
CCamera *GetCurrentCam(); |
| 160 |
|
| 161 |
|
| 162 |
extern ui::Window g_pRadiantWnd; |
| 163 |
extern ui::Window g_pCameraInspectorWnd; |
| 164 |
extern CCamera *firstCam; |
| 165 |
extern bool g_bEditOn; |
| 166 |
extern int g_iEditMode; |
| 167 |
extern int g_iActiveTarget; |
| 168 |
extern int g_iPreviewRunning; |
| 169 |
extern CCamera *g_pCurrentEditCam; |
| 170 |
|
| 171 |
#endif |