g_roff.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef __G_ROFF_H__
  2. #define __G_ROFF_H__
  3. #include "q_shared.h"
  4. // ROFF Defines
  5. //-------------------
  6. #define ROFF_VERSION 1 // ver # for the (R)otation (O)bject (F)ile (F)ormat
  7. #define ROFF_VERSION2 2 // ver # for the (R)otation (O)bject (F)ile (F)ormat
  8. #define MAX_ROFFS 32 // hard coded number of max roffs per level, sigh..
  9. #define ROFF_SAMPLE_RATE 20 // 10hz
  10. // ROFF Header file definition
  11. //-------------------------------
  12. typedef struct roff_hdr_s
  13. {
  14. char mHeader[4]; // should be "ROFF" (Rotation, Origin File Format)
  15. long mVersion;
  16. float mCount; // There isn't any reason for this to be anything other than an int, sigh...
  17. //
  18. // Move - Rotate data follows....vec3_t delta_origin, vec3_t delta_rotation
  19. //
  20. } roff_hdr_t;
  21. // ROFF move rotate data element
  22. //--------------------------------
  23. typedef struct move_rotate_s
  24. {
  25. vec3_t origin_delta;
  26. vec3_t rotate_delta;
  27. } move_rotate_t;
  28. typedef struct roff_hdr2_s
  29. //-------------------------------
  30. {
  31. char mHeader[4]; // should match roff_string defined above
  32. long mVersion; // version num, supported version defined above
  33. int mCount; // I think this is a float because of a limitation of the roff exporter
  34. int mFrameRate; // Frame rate the roff should be played at
  35. int mNumNotes; // number of notes (null terminated strings) after the roff data
  36. } roff_hdr2_t;
  37. typedef struct move_rotate2_s
  38. //-------------------------------
  39. {
  40. vec3_t origin_delta;
  41. vec3_t rotate_delta;
  42. int mStartNote, mNumNotes; // note track info
  43. } move_rotate2_t;
  44. // a precached ROFF list
  45. //-------------------------
  46. typedef struct roff_list_s
  47. {
  48. int type; // roff type number, 1-old, 2-new
  49. char *fileName; // roff filename
  50. int frames; // number of roff entries
  51. void *data; // delta move and rotate vector list
  52. int mFrameTime; // frame rate
  53. int mLerp; // Lerp rate (FPS)
  54. int mNumNoteTracks;
  55. char **mNoteTrackIndexes;
  56. } roff_list_t;
  57. extern roff_list_t roffs[];
  58. extern int num_roffs;
  59. // Function prototypes
  60. //-------------------------
  61. int G_LoadRoff( const char *fileName );
  62. void G_Roff( gentity_t *ent );
  63. void G_SaveCachedRoffs();
  64. void G_LoadCachedRoffs();
  65. #endif`