FS2_Open
Open source remastering of the Freespace 2 engine
pstypes.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _PSTYPES_H
13 #define _PSTYPES_H
14 
15 
16 #include <stdio.h> // For NULL, etc
17 #include <stdlib.h>
18 #include <memory.h>
19 #include <string.h>
20 #include "globalincs/toolchain.h"
21 
22 #if defined( __x86_64__ ) || defined( _WIN64 )
23 #define IAM_64BIT 1
24 #endif
25 
26 
27 #include "windows_stub/config.h"
28 
29 // value to represent an uninitialized state in any int or uint
30 #define UNINITIALIZED 0x7f8e6d9c
31 
32 #define MAX_PLAYERS 12
33 
34 #define USE_INLINE_ASM 1 // Define this to use inline assembly
35 #define STRUCT_CMP(a, b) memcmp((void *) &a, (void *) &b, sizeof(a))
36 
37 #define LOCAL static // make module local varilable static.
38 
39 #ifdef _WIN32
40 #define DIR_SEPARATOR_CHAR '\\'
41 #define DIR_SEPARATOR_STR "\\"
42 #else
43 #define DIR_SEPARATOR_CHAR '/'
44 #define DIR_SEPARATOR_STR "/"
45 #endif
46 
47 #ifdef IAM_64BIT
48 typedef __int32 _fs_time_t; // time_t here is 64-bit and we need 32-bit
49 typedef __int32 fix;
50 // PTR compatible sizes
51 typedef __int64 ptr_s;
52 typedef unsigned __int64 ptr_u;
53 #else
54 typedef long fix;
55 typedef long _fs_time_t;
56 typedef int ptr_s;
57 typedef unsigned int ptr_u;
58 #endif // 64-bit
59 
60 typedef __int64 longlong;
61 typedef unsigned __int64 ulonglong;
62 typedef unsigned char ubyte;
63 typedef unsigned short ushort;
64 typedef unsigned int uint;
65 typedef unsigned long ulong;
66 
67 #define HARDWARE_ONLY
68 
69 //Stucture to store clipping codes in a word
70 typedef struct ccodes {
71  ubyte cc_or, cc_and; //or is low byte, and is high byte
72 } ccodes;
73 
74 struct vertex;
75 
76 typedef struct vec4 {
77  union {
78  struct {
79  float x,y,z,w;
80  } xyzw;
81  float a1d[4];
82  };
83 } vec4;
84 
88 typedef struct vec3d {
89  union {
90  struct {
91  float x,y,z;
92  } xyz;
93  float a1d[3];
94  };
95 } vec3d;
96 
98 inline bool operator==(const vec3d &self, const vec3d &other)
99 {
100  return (self.xyz.x == other.xyz.x
101  && self.xyz.y == other.xyz.y
102  && self.xyz.z == other.xyz.z
103  );
104 }
105 
106 typedef struct vec2d {
107  float x, y;
108 } vec2d;
109 
110 typedef struct angles {
111  float p, b, h;
112 } angles_t;
113 
114 typedef struct matrix {
115  union {
116  struct {
118  } vec;
119  float a2d[3][3];
120  float a1d[9];
121  };
122 } matrix;
123 
124 typedef struct matrix4 {
125  union {
126  struct {
128  } vec;
129  float a2d[4][4];
130  float a1d[16];
131  };
132 } matrix4;
133 
134 typedef struct uv_pair {
135  float u,v;
136 } uv_pair;
137 
139 inline bool operator==(const uv_pair &left, const uv_pair &right)
140 {
141  return (left.u == right.u) && (left.v == right.v);
142 }
143 
149 typedef struct screen3d
150 {
151  union {
152  struct {
153  float x,y,w;
154  } xyw;
155  float a1d[3];
156  };
157 } screen3d;
158 
160 inline bool operator==(const screen3d &self, const screen3d &other)
161 {
162  return (self.xyw.x == other.xyw.x
163  && self.xyw.y == other.xyw.y
164  && self.xyw.w == other.xyw.w
165  );
166 }
167 
171 typedef struct vertex {
172  vec3d world; // world space position
173  screen3d screen; // screen space position (sw == 1/z)
174  uv_pair texture_position; // texture position
175  ubyte r, g, b, a; // color. Use b for darkening;
176  ubyte spec_r, spec_g, spec_b, spec_a; //specular highlights -Bobboau
177  ubyte codes; // what sides of view pyramid this point is on/off. 0 = Inside view pyramid.
178  ubyte flags; // Projection flags. Indicates whether it is projected or not or if projection overflowed.
179  ubyte pad[2]; // pad structure to be 4 byte aligned.
180 } vertex;
181 
182 typedef struct effect_vertex {
185  float radius;
186  ubyte r, g, b, a;
187 } effect_vertex;
188 
189 struct particle_pnt {
191  float size;
193 };
194 
198 
199  float intensity;
200  float width;
202 };
203 
204 //def_list
205 typedef struct flag_def_list {
206  char *name;
207  int def;
209 } def_list;
210 
211 // weapon count list (mainly for pilot files)
212 typedef struct wep_t {
213  int index;
214  int count;
215 } wep_t;
216 
217 typedef struct coord2d {
218  int x,y;
219 } coord2d;
220 
221 //This are defined in MainWin.c
222 extern void _cdecl WinAssert(char * text,char *filename, int line);
223 void _cdecl WinAssert(char * text, char * filename, int linenum, SCP_FORMAT_STRING const char * format, ... ) SCP_FORMAT_STRING_ARGS(4, 5);
224 extern void LuaError(struct lua_State *L, SCP_FORMAT_STRING const char *format=NULL, ...) SCP_FORMAT_STRING_ARGS(2, 3);
225 extern void _cdecl Error( const char * filename, int line, SCP_FORMAT_STRING const char * format, ... ) SCP_FORMAT_STRING_ARGS(3, 4);
226 extern void _cdecl Warning( char * filename, int line, SCP_FORMAT_STRING const char * format, ... ) SCP_FORMAT_STRING_ARGS(3, 4);
227 extern void _cdecl WarningEx( char *filename, int line, SCP_FORMAT_STRING const char *format, ... ) SCP_FORMAT_STRING_ARGS(3, 4);
228 extern void _cdecl ReleaseWarning(char *filename, int line, SCP_FORMAT_STRING const char *format, ...) SCP_FORMAT_STRING_ARGS(3, 4);
229 
230 extern int Global_warning_count;
231 extern int Global_error_count;
232 
233 #include "osapi/outwnd.h"
234 
235 // To debug printf do this:
236 // mprintf(( "Error opening %s\n", filename ));
237 #ifndef NDEBUG
238 #define mprintf(args) outwnd_printf2 args
239 #define nprintf(args) outwnd_printf args
240 #else
241 #define mprintf(args)
242 #define nprintf(args)
243 #endif
244 
245 #define LOCATION __FILE__,__LINE__
246 
247 // To flag an error, you can do this:
248 // Error( __FILE__, __LINE__, "Error opening %s", filename );
249 // or,
250 // Error( LOCATION, "Error opening %s", filename );
251 
252 /*******************NEVER UNCOMMENT Assert ************************************************/
253 // Please never uncomment the functionality of Assert in debug
254 // The code, as with all development like this is littered with Asserts which are designed to throw
255 // up an error message if variables are out of range.
256 // Disabling this functionality is dangerous, crazy values can run rampent unchecked and the longer its disabled
257 // the more likely you are to have problems getting it working again.
258 #if defined(NDEBUG)
259 # define Assert(expr) do { ASSUME(expr); } while (0)
260 #else
261  void gr_activate(int);
262 # define Assert(expr) do {\
263  if (!(expr)) {\
264  WinAssert(#expr,__FILE__,__LINE__);\
265  }\
266  ASSUME( expr );\
267  } while (0)
268 #endif
269 /*******************NEVER COMMENT Assert ************************************************/
270 
271 // Goober5000 - define Verify for use in both release and debug mode
272 #define Verify(x) do { if (!(x)){ Error(LOCATION, "Verify failure: %s\n", #x); } ASSUME(x); } while(0)
273 
274 // VerifyEx
275 #ifndef _MSC_VER // non MS compilers
276 # define VerifyEx(x, y, ...) do { if (!(x)) { Error(LOCATION, "Verify failure: %s with help text " #y "\n", #x, ##__VA_ARGS__); } ASSUME(x); } while(0)
277 #else
278 # if _MSC_VER >= 1400 // VC 2005 or greater
279 # define VerifyEx(x, y, ...) do { if (!(x)) { Error(LOCATION, "Verify failure: %s with help text " #y "\n", #x, __VA_ARGS__); } ASSUME(x); } while(0)
280 # else // everything else
281 # define VerifyEx(x, y) Verify(x)
282 # endif
283 #endif
284 
285 #if defined(NDEBUG)
286  // No debug version of Int3
287  #define Int3() do { } while (0)
288 #else
289  void debug_int3(char *file, int line);
290 
291  // Debug version of Int3
292  #define Int3() debug_int3(__FILE__, __LINE__)
293 #endif // NDEBUG
294 
295 #ifndef MIN
296 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
297 #endif
298 #ifndef MAX
299 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
300 #endif
301 
302 
303 #define PI 3.141592654f
304 // twice values
305 const float PI2 = (PI*2.0f);
306 // half values
307 const float PI_2 = (PI/2.0f);
308 const int RAND_MAX_2 = (RAND_MAX/2);
309 const float RAND_MAX_1f = (1.0f / RAND_MAX);
310 
311 
312 extern int Fred_running; // Is Fred running, or FreeSpace?
313 
314 
315 //======================================================================================
316 //======================================================================================
317 //======================================================================================
318 
319 
320 #include "math/fix.h"
321 #include "math/floating.h"
322 
323 // Some constants for stuff
324 #define MAX_FILENAME_LEN 32 // Length for filenames, ie "title.pcx"
325 #define MAX_PATH_LEN 256 // Length for pathnames, ie "c:\bitmaps\title.pcx"
326 
327 // contants and defined for byteswapping routines (useful for mac)
328 
329 #define SWAPSHORT(x) ( \
330  ((ubyte)x << 8) | \
331  (((ushort)x) >> 8) \
332  )
333 
334 #define SWAPINT(x) ( \
335  (x << 24) | \
336  (((ulong)x) >> 24) | \
337  ((x & 0x0000ff00) << 8) | \
338  ((x & 0x00ff0000) >> 8) \
339  )
340 
341 #ifdef SCP_UNIX
342 #include "SDL_endian.h"
343 #endif
344 
345 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
346 #ifndef BYTE_ORDER
347 #define BYTE_ORDER BIG_ENDIAN
348 #endif // !BYTE_ORDER
349 #endif // SDL_BYTEORDER
350 
351 #ifdef SCP_SOLARIS // Solaris
352 #define INTEL_INT(x) x
353 #define INTEL_SHORT(x) x
354 #define INTEL_FLOAT(x) (*x)
355 #elif BYTE_ORDER == BIG_ENDIAN
356 // turn off inline asm
357 #undef USE_INLINE_ASM
358 
359 // tigital -
360 inline float SWAPFLOAT(float *x)
361 {
362 #if !defined(__MWERKS__)
363  // Usage: void __stwbrx( unsigned int, unsigned int *address, int byteOffsetFromAddress );
364 #define __stwbrx(value, base, index) \
365  __asm__ ( "stwbrx %0, %1, %2" : : "r" (value), "b%" (index), "r" (base) : "memory" )
366 #endif
367 
368  union
369  {
370  int i;
371  float f;
372  } buf;
373 
374  // load the float into the integer unit
375  register int a = ((int*) x)[0];
376 
377  // store it to the transfer union, with byteswapping
378  __stwbrx(a, 0, &buf.i);
379 
380  // load it into the FPU and return it
381  return buf.f;
382 }
383 
384 #ifdef SCP_UNIX
385 #define INTEL_INT(x) SDL_Swap32(x)
386 #define INTEL_SHORT(x) SDL_Swap16(x)
387 #else
388 #define INTEL_INT(x) SWAPINT(x)
389 #define INTEL_SHORT(x) SWAPSHORT(x)
390 #endif // (unix)
391 #define INTEL_FLOAT(x) SWAPFLOAT(x)
392 
393 #else // Little Endian -
394 #define INTEL_INT(x) x
395 #define INTEL_SHORT(x) x
396 #define INTEL_FLOAT(x) (*x)
397 #endif // BYTE_ORDER
398 
399 #define TRUE 1
400 #define FALSE 0
401 
402 int myrand();
403 int rand32(); // returns a random number between 0 and 0x7fffffff
404 
405 
406 // lod checker for (modular) table parsing
407 typedef struct lod_checker {
408  char filename[MAX_FILENAME_LEN];
409  int num_lods;
410  int override;
411 } lod_checker;
412 
413 
414 // check to see that a passed sting is valid, ie:
415 // - has >0 length
416 // - is not "none"
417 // - is not "<none>"
418 #define VALID_FNAME(x) ( strlen((x)) && stricmp((x), "none") && stricmp((x), "<none>") )
419 
420 
421 // Callback Loading function.
422 // If you pass a function to this, that function will get called
423 // around 10x per second, so you can update the screen.
424 // Pass NULL to turn it off.
425 // Call this with the name of a function. That function will
426 // then get called around 10x per second. The callback function
427 // gets passed a 'count' which is how many times game_busy has
428 // been called since the callback was set. It gets called
429 // one last time with count=-1 when you turn off the callback
430 // by calling game_busy_callback(NULL). Game_busy_callback
431 // returns the current count, so you can tell how many times
432 // game_busy got called.
433 // If delta_step is above 0, then it will also make sure it
434 // calls the callback each time count steps 'delta_step' even
435 // if 1/10th of a second hasn't elapsed.
436 extern int game_busy_callback( void (*callback)(int count), int delta_step = -1 );
437 
438 // Call whenever loading to display cursor
439 extern void game_busy(const char *filename = NULL);
440 
441 //=========================================================
442 // Functions to monitor performance
443 #ifndef NDEBUG
444 
445 class monitor {
446  public:
447  char *name;
448  int value; // Value that gets cleared to 0 each frame.
449  int min, max, sum, cnt; // Min & Max of value. Sum is used to calculate average
450  monitor(char *name); // constructor
451 };
452 
453 // Creates a monitor variable
454 #define MONITOR(function_name) monitor mon_##function_name(#function_name);
455 
456 // Increments a monitor variable
457 #define MONITOR_INC(function_name,inc) do { mon_##function_name.value+=(inc); } while(0)
458 
459 // Call this once per frame to update monitor file
460 void monitor_update();
461 
462 #else
463 
464 #define MONITOR(function_name)
465 
466 #define MONITOR_INC(function_name,inc) do { } while(0)
467 
468 // Call this once per frame to update monitor file
469 #define monitor_update() do { } while(0)
470 
471 #endif
472 
473 #define NOX(s) s
474 
475 const char *XSTR(const char *str, int index);
476 
477 // Caps V between MN and MX.
478 template <class T> void CAP( T& v, T mn, T mx )
479 {
480  if ( v < mn ) {
481  v = mn;
482  } else if ( v > mx ) {
483  v = mx;
484  }
485 }
486 
487 // faster version of CAP()
488 #define CLAMP(x, min, max) do { if ( (x) < (min) ) (x) = (min); else if ((x) > (max)) (x) = (max); } while(0)
489 
490 // ========================================================
491 // stamp checksum stuff
492 // ========================================================
493 
494 // here is the define for the stamp for this set of code
495 #define STAMP_STRING "\001\001\001\001\002\002\002\002Read the Foundation Novels from Asimov. I liked them."
496 #define STAMP_STRING_LENGTH 80
497 #define DEFAULT_CHECKSUM_STRING "\001\001\001\001"
498 #define DEFAULT_TIME_STRING "\002\002\002\002"
499 
500 // macro to calculate the checksum for the stamp. Put here so that we can use different methods
501 // for different applications. Requires the local variable 'checksum' to be defined!!!
502 #define CALCULATE_STAMP_CHECKSUM() do { \
503  int i, found; \
504  \
505  checksum = 0; \
506  for ( i = 0; i < (int)strlen(ptr); i++ ) { \
507  found = 0; \
508  checksum += ptr[i]; \
509  if ( checksum & 0x01 ) \
510  found = 1; \
511  checksum = checksum >> 1; \
512  if (found) \
513  checksum |= 0x80000000; \
514  } \
515  checksum |= 0x80000000; \
516  } while (0) ;
517 
518 //=========================================================
519 // Memory management functions
520 //=========================================================
521 
522 // Returns 0 if not enough RAM.
523 int vm_init(int min_heap_size);
524 
525 // Frees all RAM.
526 void vm_free_all();
527 
528 #ifndef NDEBUG
529  // Debug versions
530 
531  // Allocates some RAM.
532  void *_vm_malloc( int size, char *filename = NULL, int line = -1, int quiet = 0 );
533 
534  // allocates some RAM for a string
535  char *_vm_strdup( const char *ptr, char *filename, int line );
536 
537  // allocates some RAM for a string of a certain length
538  char *_vm_strndup( const char *ptr, int size, char *filename, int line );
539 
540  // Frees some RAM.
541  void _vm_free( void *ptr, char *filename = NULL, int line= -1 );
542 
543  // reallocates some RAM
544  void *_vm_realloc( void *ptr, int size, char *filename = NULL, int line= -1, int quiet = 0 );
545 
546  // Easy to use macros
547  #define vm_malloc(size) _vm_malloc((size),__FILE__,__LINE__,0)
548  #define vm_free(ptr) _vm_free((ptr),__FILE__,__LINE__)
549  #define vm_strdup(ptr) _vm_strdup((ptr),__FILE__,__LINE__)
550  #define vm_strndup(ptr, size) _vm_strndup((ptr),(size),__FILE__,__LINE__)
551  #define vm_realloc(ptr, size) _vm_realloc((ptr),(size),__FILE__,__LINE__,0)
552 
553  // quiet macro versions which don't report errors
554  #define vm_malloc_q(size) _vm_malloc((size),__FILE__,__LINE__,1)
555  #define vm_realloc_q(ptr, size) _vm_realloc((ptr),(size),__FILE__,__LINE__,1)
556 #else
557  // Release versions
558 
559  // Allocates some RAM.
560  void *_vm_malloc( int size, int quiet = 0 );
561 
562  // allocates some RAM for a string
563  char *_vm_strdup( const char *ptr );
564 
565  // allocates some RAM for a strings of a certain length
566  char *_vm_strndup( const char *ptr, int size );
567 
568  // Frees some RAM.
569  void _vm_free( void *ptr );
570 
571  // reallocates some RAM
572  void *_vm_realloc( void *ptr, int size, int quiet = 0 );
573 
574  // Easy to use macros
575  #define vm_malloc(size) _vm_malloc((size),0)
576  #define vm_free(ptr) _vm_free(ptr)
577  #define vm_strdup(ptr) _vm_strdup(ptr)
578  #define vm_strndup(ptr, size) _vm_strndup((ptr),(size))
579  #define vm_realloc(ptr, size) _vm_realloc((ptr),(size),0)
580 
581  // quiet macro versions which don't report errors
582  #define vm_malloc_q(size) _vm_malloc((size),1)
583  #define vm_realloc_q(ptr, size) _vm_realloc((ptr),(size),1)
584 
585 #endif
586 
587 #include "globalincs/fsmemory.h"
588 
589 //=========================================================
590 // Scripting
591 //=========================================================
592 //-WMC
593 typedef struct script_hook
594 {
595  //Override
597  int o_index;
598  //Actual hook
600  int h_index;
601 } script_hook;
602 
603 extern void script_hook_init(script_hook *hook);
604 extern bool script_hook_valid(script_hook *hook);
605 
606 class camid
607 {
608 private:
609  int sig;
610  uint idx;
611 public:
612  camid();
613  camid(int n_idx, int n_sig);
614 
615  class camera *getCamera();
616  uint getIndex();
617  int getSignature();
618  bool isValid();
619 };
620 
621 #include "globalincs/vmallocator.h"
622 #include "globalincs/safe_strings.h"
623 
624 // DEBUG compile time catch for dangerous uses of memset/memcpy/memmove
625 // would prefer std::is_trivially_copyable but it's not supported by gcc yet
626 // ref: http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html
627 #ifndef NDEBUG
628  #if defined(HAVE_CXX11)
629  // feature support seems to be: gcc clang msvc
630  // auto 4.4 2.9 2010
631  // std::is_trivial 4.5 ? 2012 (2010 only duplicates std::is_pod)
632  // static_assert 4.3 2.9 2010
633  #include <type_traits>
634  #include <cstring>
635 
636  // MEMSET!
637  const auto ptr_memset = std::memset;
638  #define memset memset_if_trivial_else_error
639 
640  template<typename T>
641  void *memset_if_trivial_else_error(T *memset_data, int ch, size_t count)
642  {
643  static_assert(std::is_trivial<T>::value, "memset on non-trivial object");
644  return ptr_memset(memset_data, ch, count);
645  }
646 
647  // assume memset on a void* is "safe"
648  // only used in cutscene/mveplayer.cpp:mve_video_createbuf()
649  inline void *memset_if_trivial_else_error(void *memset_data, int ch, size_t count)
650  {
651  return ptr_memset(memset_data, ch, count);
652  }
653 
654  // MEMCPY!
655  const auto ptr_memcpy = std::memcpy;
656  #define memcpy memcpy_if_trivial_else_error
657 
658  template<typename T, typename U>
659  void *memcpy_if_trivial_else_error(T *memcpy_dest, U *src, size_t count)
660  {
661  static_assert(std::is_trivial<T>::value, "memcpy on non-trivial object T");
662  static_assert(std::is_trivial<U>::value, "memcpy on non-trivial object U");
663  return ptr_memcpy(memcpy_dest, src, count);
664  }
665 
666  // assume memcpy with void* is "safe"
667  // used in:
668  // globalincs/systemvars.cpp:insertion_sort()
669  // network/chat_api.cpp:AddChatCommandToQueue()
670  // network/multi_obj.cpp:multi_oo_sort_func()
671  // parse/lua.cpp:ade_get_args() && ade_set_args()
672  //
673  // probably should setup a static_assert on insertion_sort as well
674  template<typename U>
675  void *memcpy_if_trivial_else_error(void *memcpy_dest, U *memcpy_src, size_t count)
676  {
677  static_assert(std::is_trivial<U>::value, "memcpy on non-trivial object U");
678  return ptr_memcpy(memcpy_dest, memcpy_src, count);
679  }
680 
681  template<typename T>
682  void *memcpy_if_trivial_else_error(T *memcpy_dest, void *memcpy_src, size_t count)
683  {
684  static_assert(std::is_trivial<T>::value, "memcpy on non-trivial object T");
685  return ptr_memcpy(memcpy_dest, memcpy_src, count);
686  }
687  template<typename T>
688  void *memcpy_if_trivial_else_error(T *memcpy_dest, const void *memcpy_src, size_t count)
689  {
690  static_assert(std::is_trivial<T>::value, "memcpy on non-trivial object T");
691  return ptr_memcpy(memcpy_dest, memcpy_src, count);
692  }
693 
694  inline void *memcpy_if_trivial_else_error(void *memcpy_dest, void *memcpy_src, size_t count)
695  {
696  return ptr_memcpy(memcpy_dest, memcpy_src, count);
697  }
698 
699  // MEMMOVE!
700  const auto ptr_memmove = std::memmove;
701  #define memmove memmove_if_trivial_else_error
702 
703  template<typename T, typename U>
704  void *memmove_if_trivial_else_error(T *memmove_dest, U *memmove_src, size_t count)
705  {
706  static_assert(std::is_trivial<T>::value, "memmove on non-trivial object T");
707  static_assert(std::is_trivial<U>::value, "memmove on non-trivial object U");
708  return ptr_memmove(memmove_dest, memmove_src, count);
709  }
710  #endif // HAVE_CXX11
711 #endif // NDEBUG
712 
713 #endif // PS_TYPES_H
GLenum GLsizei GLenum format
Definition: Gl.h:1509
#define MAX_FILENAME_LEN
Definition: pstypes.h:324
struct screen3d::@234::@236 xyw
int i
Definition: multi_pxo.cpp:466
float p
Definition: pstypes.h:111
ubyte var
Definition: pstypes.h:208
struct vertex vertex
ubyte spec_g
Definition: pstypes.h:176
#define __int64
Definition: config.h:113
#define SCP_FORMAT_STRING_ARGS(x, y)
Definition: clang.h:21
struct vec4::@222::@224 xyzw
bool operator==(const vec3d &self, const vec3d &other)
Definition: pstypes.h:98
float x
Definition: pstypes.h:153
ubyte cc_or
Definition: pstypes.h:71
Macros to abstract compiler capabilities for various toolchains.
char * name
Definition: pstypes.h:447
int max
Definition: pstypes.h:449
float v
Definition: pstypes.h:135
float a2d[3][3]
Definition: pstypes.h:119
ubyte g
Definition: pstypes.h:175
float a1d[4]
Definition: pstypes.h:81
GLsizei const GLfloat * value
Definition: Glext.h:5646
GLuint index
Definition: Glext.h:5608
void debug_int3(char *file, int line)
Definition: osapi.cpp:769
int sum
Definition: pstypes.h:449
int index
Definition: pstypes.h:213
vec3d rvec
Definition: pstypes.h:117
void _cdecl void void _cdecl void _cdecl Warning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
float a1d[16]
Definition: pstypes.h:130
float y
Definition: pstypes.h:153
void _cdecl void void _cdecl void _cdecl void _cdecl WarningEx(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
Definition: pstypes.h:88
struct coord2d coord2d
struct vec3d vec3d
struct vec3d::@225::@227 xyz
vec4 pos
Definition: pstypes.h:127
GLclampf f
Definition: Glext.h:7097
float y
Definition: pstypes.h:107
long _fs_time_t
Definition: pstypes.h:55
ubyte spec_b
Definition: pstypes.h:176
const int RAND_MAX_2
Definition: pstypes.h:308
camid()
Definition: camera.cpp:821
int value
Definition: pstypes.h:448
int x
Definition: pstypes.h:218
GLsizeiptr size
Definition: Glext.h:5496
int rand32()
Definition: systemvars.cpp:112
struct matrix4 matrix4
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: Glext.h:7308
void _vm_free(void *ptr, char *filename=NULL, int line=-1)
Definition: windebug.cpp:1973
int y
Definition: pstypes.h:218
int game_busy_callback(void(*callback)(int count), int delta_step=-1)
Definition: systemvars.cpp:144
ubyte spec_r
Definition: pstypes.h:176
void game_busy(const char *filename=NULL)
Definition: systemvars.cpp:173
bool isValid()
Definition: camera.cpp:851
struct wep_t wep_t
uv_pair texture_position
Definition: pstypes.h:174
uv_pair tex_coord
Definition: pstypes.h:201
struct vec4 vec4
ubyte a
Definition: pstypes.h:175
int getSignature()
Definition: camera.cpp:846
struct vec2d vec2d
ubyte spec_a
Definition: pstypes.h:176
float a1d[3]
Definition: pstypes.h:93
const float PI2
Definition: pstypes.h:305
Definition: pstypes.h:76
vec4 fvec
Definition: pstypes.h:127
vec3d uvec
Definition: pstypes.h:117
struct matrix::@228::@230 vec
Definition: pstypes.h:70
unsigned int uint
Definition: pstypes.h:64
screen3d screen
Definition: pstypes.h:173
struct screen3d screen3d
int o_index
Definition: pstypes.h:597
void monitor_update()
Definition: systemvars.cpp:328
GLboolean GLboolean GLboolean GLboolean a
Definition: Glext.h:5781
int vm_init(int min_heap_size)
Definition: windebug.cpp:1657
vec3d position
Definition: pstypes.h:183
char * filename
int cnt
Definition: pstypes.h:449
int o_language
Definition: pstypes.h:596
#define SCP_FORMAT_STRING
Definition: clang.h:20
float SWAPFLOAT(float *x)
Definition: pstypes.h:360
uint getIndex()
Definition: camera.cpp:841
unsigned __int64 ulonglong
Definition: pstypes.h:61
const float RAND_MAX_1f
Definition: pstypes.h:309
struct matrix matrix
char * _vm_strndup(const char *ptr, int size, char *filename, int line)
Definition: windebug.cpp:1953
float u
Definition: pstypes.h:135
float z
Definition: pstypes.h:91
struct script_hook script_hook
bool script_hook_valid(script_hook *hook)
Definition: scripting.cpp:107
unsigned long ulong
Definition: pstypes.h:65
float size
Definition: pstypes.h:191
void vm_free_all()
Definition: windebug.cpp:1996
struct ccodes ccodes
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
long fix
Definition: pstypes.h:54
void * _vm_realloc(void *ptr, int size, char *filename=NULL, int line=-1, int quiet=0)
Definition: windebug.cpp:2001
unsigned char ubyte
Definition: pstypes.h:62
const char * XSTR(const char *str, int index)
Definition: localize.cpp:851
ubyte pad[2]
Definition: pstypes.h:179
ubyte cc_and
Definition: pstypes.h:71
float a1d[3]
Definition: pstypes.h:155
int Global_error_count
Definition: windebug.cpp:47
ubyte b
Definition: pstypes.h:175
#define __int32
Definition: config.h:115
float w
Definition: pstypes.h:79
void _cdecl void void _cdecl Error(const char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
struct angles angles_t
ubyte flags
Definition: pstypes.h:178
vec3d up
Definition: pstypes.h:192
vec3d position
Definition: pstypes.h:190
float x
Definition: pstypes.h:91
GLdouble GLdouble right
Definition: Glext.h:10330
float x
Definition: pstypes.h:107
char * name
Definition: pstypes.h:206
float radius
Definition: pstypes.h:185
char * _vm_strdup(const char *ptr, char *filename, int line)
Definition: windebug.cpp:1935
void CAP(T &v, T mn, T mx)
Definition: pstypes.h:478
Definition: pstypes.h:606
vec4 rvec
Definition: pstypes.h:127
void * _vm_malloc(int size, char *filename=NULL, int line=-1, int quiet=0)
Definition: windebug.cpp:1906
Definition: pstypes.h:106
unsigned int ptr_u
Definition: pstypes.h:57
int h_language
Definition: pstypes.h:599
int min
Definition: pstypes.h:449
float y
Definition: pstypes.h:91
class camera * getCamera()
Definition: camera.cpp:833
__int64 longlong
Definition: pstypes.h:60
unsigned short ushort
Definition: pstypes.h:63
vec4 uvec
Definition: pstypes.h:127
struct flag_def_list def_list
float w
Definition: pstypes.h:153
int num_lods
Definition: pstypes.h:409
GLenum src
Definition: Glext.h:5917
Definition: pstypes.h:212
int count
Definition: pstypes.h:214
#define PI
Definition: pstypes.h:303
struct effect_vertex effect_vertex
float z
Definition: pstypes.h:79
int h_index
Definition: pstypes.h:600
float a2d[4][4]
Definition: pstypes.h:129
float a1d[9]
Definition: pstypes.h:120
GLint GLsizei count
Definition: Gl.h:1491
const float PI_2
Definition: pstypes.h:307
void _cdecl void void _cdecl void _cdecl void _cdecl void _cdecl ReleaseWarning(char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
void _cdecl WinAssert(char *text, char *filename, int line)
Definition: windebug.cpp:911
vec3d world
Definition: pstypes.h:172
void gr_activate(int)
Definition: 2d.cpp:1122
struct lod_checker lod_checker
Definition: camera.h:18
ubyte codes
Definition: pstypes.h:177
#define __stwbrx(value, base, index)
int ptr_s
Definition: pstypes.h:56
struct matrix4::@231::@233 vec
struct uv_pair uv_pair
float h
Definition: pstypes.h:111
float x
Definition: pstypes.h:79
void _cdecl void void _cdecl void _cdecl void _cdecl void _cdecl int Global_warning_count
Definition: windebug.cpp:46
int Fred_running
Definition: fred.cpp:44
float y
Definition: pstypes.h:79
monitor(char *name)
Definition: systemvars.cpp:208
void _cdecl void LuaError(struct lua_State *L, SCP_FORMAT_STRING const char *format=NULL,...) SCP_FORMAT_STRING_ARGS(2
void script_hook_init(script_hook *hook)
Definition: scripting.cpp:97
#define _cdecl
Definition: config.h:71
const GLdouble * v
Definition: Glext.h:5322
vec3d fvec
Definition: pstypes.h:117
int myrand()
Definition: systemvars.cpp:102
uv_pair tex_coord
Definition: pstypes.h:184
ubyte r
Definition: pstypes.h:175
float b
Definition: pstypes.h:111
GLint left
Definition: Glext.h:7283