]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/camera/misc.h
eol style
[xonotic/netradiant.git] / contrib / camera / misc.h
index 6c56dc73073e2df67ec670596bc988642b19298e..52062c884f424627ff44ec212620c0fbaaabe7be 100644 (file)
@@ -1,91 +1,91 @@
-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
-*/\r
-\r
-/*\r
-Camera plugin for GtkRadiant\r
-Copyright (C) 2002 Splash Damage Ltd.\r
-*/\r
-\r
-void Sys_ERROR( char* text, ... );\r
-char* UnixToDosPath( char* path );\r
-void ExtractFilePath( const char *path, char *dest );\r
-const char* ExtractFilename( const char* path );\r
-bool FileExists (const char *filename);\r
-int Q_stricmp (const char *s1, const char *s2);\r
-\r
-typedef int fileHandle_t;\r
-\r
-#define qfalse false\r
-#define qtrue true\r
-\r
-extern "C" {\r
-// command buffer\r
-void Cbuf_AddText( const char *text );\r
-void Cbuf_Execute (void);\r
-\r
-// common\r
-#ifndef CDECL\r
-#ifdef _WIN32\r
-       #define CDECL __cdecl\r
-#else\r
-       #define CDECL\r
-#endif\r
-#endif\r
-\r
-void CDECL Com_Error( int level, const char *error, ... );\r
-void CDECL Com_Printf( const char *msg, ... );\r
-void CDECL Com_DPrintf( const char *msg, ... );\r
-void *Com_Allocate( int bytes );\r
-void Com_Dealloc( void *ptr );\r
-\r
-// filesystem\r
-int FS_Read( void *buffer, int len, fileHandle_t f );\r
-int FS_Write( const void *buffer, int len, fileHandle_t h );\r
-int FS_ReadFile( const char *qpath, void **buffer );\r
-void FS_FreeFile( void *buffer );\r
-int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueFILE );\r
-fileHandle_t FS_FOpenFileWrite( const char *filename );\r
-void FS_FCloseFile( fileHandle_t f );\r
-}\r
-\r
-// vectors\r
-#define DotProduct(a,b)                        ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])\r
-#define VectorSubtract(a,b,c)  ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])\r
-#define VectorAdd(a,b,c)               ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2])\r
-#define VectorCopy(a,b)                        ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2])\r
-\r
-#define        VectorScale(v, s, o)    ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s))\r
-#define        VectorMA(v, s, b, o)    ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s))\r
-#define CrossProduct(a,b,c)            ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0])\r
-\r
-#define DotProduct4(x,y)               ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]+(x)[3]*(y)[3])\r
-#define VectorSubtract4(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2],(c)[3]=(a)[3]-(b)[3])\r
-#define VectorAdd4(a,b,c)              ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2],(c)[3]=(a)[3]+(b)[3])\r
-#define VectorCopy4(a,b)               ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])\r
-#define        VectorScale4(v, s, o)   ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s),(o)[3]=(v)[3]*(s))\r
-#define        VectorMA4(v, s, b, o)   ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s),(o)[3]=(v)[3]+(b)[3]*(s))\r
-\r
-#define VectorClear(a)                 ((a)[0]=(a)[1]=(a)[2]=0)\r
-#define VectorNegate(a,b)              ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2])\r
-#define VectorSet(v, x, y, z)  ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z))\r
-#define Vector4Copy(a,b)               ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])\r
-\r
-#define        SnapVector(v) {v[0]=(int)v[0];v[1]=(int)v[1];v[2]=(int)v[2];}\r
+/*
+Copyright (C) 1999-2007 id Software, Inc. and contributors.
+For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+This file is part of GtkRadiant.
+
+GtkRadiant is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+GtkRadiant is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GtkRadiant; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+/*
+Camera plugin for GtkRadiant
+Copyright (C) 2002 Splash Damage Ltd.
+*/
+
+void Sys_ERROR( char* text, ... );
+char* UnixToDosPath( char* path );
+void ExtractFilePath( const char *path, char *dest );
+const char* ExtractFilename( const char* path );
+bool FileExists (const char *filename);
+int Q_stricmp (const char *s1, const char *s2);
+
+typedef int fileHandle_t;
+
+#define qfalse false
+#define qtrue true
+
+extern "C" {
+// command buffer
+void Cbuf_AddText( const char *text );
+void Cbuf_Execute (void);
+
+// common
+#ifndef CDECL
+#ifdef _WIN32
+       #define CDECL __cdecl
+#else
+       #define CDECL
+#endif
+#endif
+
+void CDECL Com_Error( int level, const char *error, ... );
+void CDECL Com_Printf( const char *msg, ... );
+void CDECL Com_DPrintf( const char *msg, ... );
+void *Com_Allocate( int bytes );
+void Com_Dealloc( void *ptr );
+
+// filesystem
+int FS_Read( void *buffer, int len, fileHandle_t f );
+int FS_Write( const void *buffer, int len, fileHandle_t h );
+int FS_ReadFile( const char *qpath, void **buffer );
+void FS_FreeFile( void *buffer );
+int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueFILE );
+fileHandle_t FS_FOpenFileWrite( const char *filename );
+void FS_FCloseFile( fileHandle_t f );
+}
+
+// vectors
+#define DotProduct(a,b)                        ((a)[0]*(b)[0]+(a)[1]*(b)[1]+(a)[2]*(b)[2])
+#define VectorSubtract(a,b,c)  ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
+#define VectorAdd(a,b,c)               ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2])
+#define VectorCopy(a,b)                        ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2])
+
+#define        VectorScale(v, s, o)    ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s))
+#define        VectorMA(v, s, b, o)    ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s))
+#define CrossProduct(a,b,c)            ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0])
+
+#define DotProduct4(x,y)               ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]+(x)[3]*(y)[3])
+#define VectorSubtract4(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2],(c)[3]=(a)[3]-(b)[3])
+#define VectorAdd4(a,b,c)              ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2],(c)[3]=(a)[3]+(b)[3])
+#define VectorCopy4(a,b)               ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
+#define        VectorScale4(v, s, o)   ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s),(o)[3]=(v)[3]*(s))
+#define        VectorMA4(v, s, b, o)   ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s),(o)[3]=(v)[3]+(b)[3]*(s))
+
+#define VectorClear(a)                 ((a)[0]=(a)[1]=(a)[2]=0)
+#define VectorNegate(a,b)              ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2])
+#define VectorSet(v, x, y, z)  ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z))
+#define Vector4Copy(a,b)               ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
+
+#define        SnapVector(v) {v[0]=(int)v[0];v[1]=(int)v[1];v[2]=(int)v[2];}