fields.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Filename:- fields.h
  2. //
  3. #ifndef FIELDS_H
  4. #define FIELDS_H
  5. //
  6. // fields are needed for spawning from the entity string
  7. // and saving / loading games
  8. //
  9. #define FFL_SPAWNTEMP 1
  10. #define MAX_GHOULINST_SIZE 16384
  11. #ifndef FOFS
  12. #define FOFS(x) ((int)&(((gentity_t *)0)->x)) // usually already defined in qshared.h
  13. #endif
  14. #define STOFS(x) ((int)&(((spawn_temp_t *)0)->x))
  15. #define LLOFS(x) ((int)&(((level_locals_t *)0)->x))
  16. #define CLOFS(x) ((int)&(((gclient_t *)0)->x))
  17. #define NPCOFS(x) ((int)&(((gNPC_t *)0)->x))
  18. #define VHOFS(x) ((int)&(((Vehicle_t *)0)->x))
  19. //
  20. #define strFOFS(x) #x,FOFS(x)
  21. #define strSTOFS(x) #x,STOFS(x)
  22. #define strLLOFS(x) #x,LLOFS(x)
  23. #define strCLOFS(x) #x,CLOFS(x)
  24. #define strNPCOFS(x) #x,NPCOFS(x)
  25. #define strVHICOFS(x) #x,VHOFS(x)
  26. typedef enum
  27. {
  28. // F_INT,
  29. // F_SHORT,
  30. // F_FLOAT,
  31. F_STRING, // string
  32. // F_VECTOR,
  33. F_NULL, // A ptr to null out
  34. F_ITEM, // Item pointer handling
  35. // F_MMOVE, // Mmove pointer handling
  36. F_GCLIENT, // Client pointer handling
  37. F_GENTITY, // gentity_t ptr handling
  38. F_BOOLPTR, // Generic pointer that is recreated later, could be left alone, but clearer if only 0/1 rather than 0/alloc
  39. F_BEHAVIORSET, // special scripting string ptr array handler
  40. F_ALERTEVENT, // special handler for alertevent struct in level_locals_t
  41. F_AIGROUPS, // some AI grouping stuff of Mike's
  42. F_ANIMFILESETS, // animfileset animevent strings
  43. F_GROUP,
  44. F_VEHINFO,
  45. F_IGNORE
  46. } fieldtypeSAVE_t;
  47. typedef struct
  48. {
  49. char *psName;
  50. int iOffset;
  51. fieldtypeSAVE_t eFieldType;
  52. } save_field_t;
  53. #endif // #ifndef FIELDS_H
  54. //////////////////////// eof //////////////////////////