CAPTION.H 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef VQACAPTION_H
  19. #define VQACAPTION_H
  20. /****************************************************************************
  21. *
  22. * C O N F I D E N T I A L -- W E S T W O O D S T U D I O S
  23. *
  24. *----------------------------------------------------------------------------
  25. *
  26. * PROJECT
  27. * VQA player library (32 bit protected mode)
  28. *
  29. * FILE
  30. * caption.h
  31. *
  32. * DESCRIPTION
  33. * Text caption definitions.
  34. *
  35. * PROGRAMMER
  36. * Denzil E. Long, Jr.
  37. *
  38. * DATE
  39. * July 26, 1995
  40. *
  41. ****************************************************************************/
  42. /*---------------------------------------------------------------------------
  43. * STRUCTURES AND RELATED DEFINITIONS
  44. *-------------------------------------------------------------------------*/
  45. /* CaptionNode: Node describing a caption to process.
  46. *
  47. * Succ - Pointer to the next node in the list (successor).
  48. * Pred - Pointer to the previous node in the list (predecessor).
  49. * Flags - Status flags.
  50. * CapText - Pointer to the CaptionText being processed.
  51. * Char - Pointer to current character in the string.
  52. * CurX - Current X position.
  53. * CurY - Current Y position.
  54. * BoundW - Bounding width of text.
  55. * BoundH - Bounding height of text.
  56. */
  57. typedef struct _CaptionNode {
  58. struct _CaptionNode *Succ;
  59. struct _CaptionNode *Pred;
  60. unsigned short Flags;
  61. CaptionText *Captext;
  62. char *Char;
  63. unsigned short CurX;
  64. unsigned short CurY;
  65. unsigned short BoundW;
  66. unsigned short BoundH;
  67. } CaptionNode;
  68. /* CaptionNode flag definitions. */
  69. #define CNB_USED 0 /* This node is being used. */
  70. #define CNF_USED (1<<CNB_USED)
  71. /* CaptionList: Double linked list of outstanding captions to process.
  72. *
  73. * Head - Pointer to the first node in the list.
  74. * Tail - Always NULL
  75. * TailPred - Pointer to the last node in the list.
  76. */
  77. typedef struct _CaptionList {
  78. CaptionNode *Head;
  79. CaptionNode *Tail;
  80. CaptionNode *TailPred;
  81. } CaptionList;
  82. /* CaptionInfo:
  83. *
  84. * Next - Pointer to the next caption to be processed.
  85. * List - List of pending captions to process.
  86. * Font - Font to use for this caption.
  87. * BoundX - X position of bounding box.
  88. * BoundY - Y position of bounding box.
  89. * BoundW - Width of bounding box.
  90. * BoundH - Height of bounding box.
  91. * Buffer - Caption chunk buffer.
  92. */
  93. typedef struct _CaptionInfo {
  94. CaptionText *Next;
  95. CaptionList List;
  96. void *Font;
  97. char FontHeight;
  98. char FontWidth;
  99. void *Buffer;
  100. } CaptionInfo;
  101. /*---------------------------------------------------------------------------
  102. * FUNCTION PROTOTYPES
  103. *-------------------------------------------------------------------------*/
  104. CaptionInfo *OpenCaptions(void *captions, void *font);
  105. void CloseCaptions(CaptionInfo *cap);
  106. void DoCaptions(CaptionInfo *cap, unsigned long frame);
  107. #endif /* VQACAPTION_H */