WSA.H 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. /***************************************************************************
  19. ** C O N F I D E N T I A L --- W E S T W O O D A S S O C I A T E S **
  20. ***************************************************************************
  21. * *
  22. * Project Name : WSA 32bit LIbrary *
  23. * *
  24. * File Name : WSA.H *
  25. * *
  26. * Programmer : Scott K. Bowen *
  27. * *
  28. * Start Date : May 23, 1994 *
  29. * *
  30. * Last Update : May 25, 1994 [SKB] *
  31. * *
  32. *-------------------------------------------------------------------------*
  33. * Functions: *
  34. * Open_Animation -- file name and flags, system allocates buffer. *
  35. * Open_Animation -- file name, flags, palette, system allocates buffer. *
  36. * Open_Animation -- file_name, graphic buffer, flags. *
  37. * Open_Animation -- file name, bufferclass, flags, palette. *
  38. * Open_Animation -- filename, ptr, size, flags, no palette. *
  39. * Animate_Frame -- Animate a frame to a page with magic colors. *
  40. * Animate_Frame -- Animate a frame to a viewport with magic colors. *
  41. * Animate_Frame -- Animate a frame to a page. *
  42. * Animate_Frame -- Animate a frame to a viewport. *
  43. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  44. #ifndef WSA_H
  45. #define WSA_H
  46. #ifndef WWSTD_H
  47. #include "wwstd.h"
  48. #endif
  49. #ifndef GBUFFER_H
  50. #include "gbuffer.h"
  51. #endif
  52. //lint -strong(AJX,WSAType)
  53. typedef enum {
  54. WSA_NORMAL, // Normal WSA animation
  55. WSA_GHOST = 0x1000, // Or'd with the above flags to get ghosting
  56. WSA_PRIORITY2 = 0x2000, // Copy using a priority (or in the priority)
  57. WSA_TRANS = 0x4000, // Copy frame, ignoring transparent colors
  58. WSA_PRIORITY = 0x8000 // Copy using a priority (or in the priority)
  59. } WSAType;
  60. //lint -strong(AJX,WSAOpenType)
  61. typedef enum {
  62. WSA_OPEN_FROM_MEM = 0x0000, // Try to load entire anim into memory.
  63. WSA_OPEN_INDIRECT = 0x0000, // First animate to internal buffer, then copy to page/viewport.
  64. WSA_OPEN_FROM_DISK = 0x0001, // Force the animation to be disk based.
  65. WSA_OPEN_DIRECT = 0x0002, // Animate directly to page or viewport.
  66. // These next two have been added for the 32 bit library to give a better idea of what is
  67. // happening. You may want to animate directly to the destination or indirectly to the
  68. // destination by using the animations buffer. Indirecly is best if the dest is a seenpage
  69. // and the animation is not linear or if the destination is modified between frames.
  70. WSA_OPEN_TO_PAGE = WSA_OPEN_DIRECT ,
  71. WSA_OPEN_TO_BUFFER= WSA_OPEN_INDIRECT ,
  72. } WSAOpenType;
  73. /*=========================================================================*/
  74. /* The following prototypes are for the file: WSA.CPP */
  75. /*=========================================================================*/
  76. void * __cdecl Open_Animation(char const *file_name, char *user_buffer, long user_buffer_size, WSAOpenType user_flags, unsigned char *palette=NULL);
  77. void __cdecl Close_Animation( void *handle );
  78. BOOL __cdecl Animate_Frame(void *handle, GraphicViewPortClass& view,
  79. int frame_number, int x_pixel=0, int y_pixel=0,
  80. WSAType flags_and_prio = WSA_NORMAL, void *magic_cols=NULL, void *magic=NULL);
  81. int __cdecl Get_Animation_Frame_Count(void *handle);
  82. BOOL __cdecl Animate_Frame(void *handle, VideoViewPortClass& view,
  83. int frame_number, int x_pixel=0, int y_pixel=0,
  84. WSAType flags_and_prio = WSA_NORMAL, void *magic_cols=NULL, void *magic=NULL);
  85. int __cdecl Get_Animation_Frame_Count(void *handle);
  86. int __cdecl Get_Animation_X(void const *handle);
  87. int __cdecl Get_Animation_Y(void const *handle);
  88. int __cdecl Get_Animation_Width(void const *handle);
  89. int __cdecl Get_Animation_Height(void const *handle);
  90. int __cdecl Get_Animation_Palette(void const *handle);
  91. unsigned long __cdecl Get_Animation_Size(void const *handle);
  92. /***************************************************************************
  93. * OPEN_ANIMATION -- file name, flags, palette, system allocates buffer. *
  94. * *
  95. * *
  96. * INPUT: char *file_name - name of file to open. *
  97. * WSAOpenType user_flags - flags on how to open. *
  98. * unsigned char *palette - pointer to a palette buffer to fill. *
  99. * *
  100. * OUTPUT: void *pointer to animation data. Must be used for all *
  101. * other WSA calls. *
  102. * *
  103. * WARNINGS: *
  104. * *
  105. * HISTORY: *
  106. * 05/24/1994 SKB : Created. *
  107. *=========================================================================*/
  108. inline void * __cdecl Open_Animation(char *file_name, WSAOpenType user_flags, unsigned char *palette=NULL)
  109. {
  110. return (Open_Animation(file_name, NULL, 0L, user_flags, palette));
  111. }
  112. /***************************************************************************
  113. * OPEN_ANIMATION -- file_name, bufferclass, flags. *
  114. * *
  115. * *
  116. * INPUT: char *file_name - name of file to open. *
  117. * GraphicBufferClass - pointer to a buffer. *
  118. * WSAOpenType user_flags - flags on how to open. *
  119. * unsigned char *palette - pointer to a palette buffer to fill. *
  120. * *
  121. * OUTPUT: void *pointer to animation data. Must be used for all *
  122. * other WSA calls. *
  123. * *
  124. * WARNINGS: *
  125. * *
  126. * HISTORY: *
  127. * 05/24/1994 SKB : Created. *
  128. *=========================================================================*/
  129. inline void * __cdecl Open_Animation(char *file_name, BufferClass& buffer, WSAOpenType user_flags, unsigned char *palette=NULL)
  130. {
  131. return (Open_Animation(file_name, (char *)buffer.Get_Buffer(), buffer.Get_Size(), user_flags, palette));
  132. }
  133. /*=========================================================================*/
  134. /* The following prototypes are for the file: LP_ASM.ASM */
  135. /*=========================================================================*/
  136. extern "C" {
  137. unsigned int __cdecl Apply_XOR_Delta(char *source_ptr, char *delta_ptr);
  138. void __cdecl Apply_XOR_Delta_To_Page_Or_Viewport(void *target, void *delta, int width, int nextrow, int copy);
  139. }
  140. #endif // WSA_H