CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

WSA.H (8902B)


      1 //
      2 // Copyright 2020 Electronic Arts Inc.
      3 //
      4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 
      5 // software: you can redistribute it and/or modify it under the terms of 
      6 // the GNU General Public License as published by the Free Software Foundation, 
      7 // either version 3 of the License, or (at your option) any later version.
      8 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 /***************************************************************************
     17  **   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   **
     18  ***************************************************************************
     19  *                                                                         *
     20  *                 Project Name : WSA 32bit LIbrary                        *
     21  *                                                                         *
     22  *                    File Name : WSA.H                                    *
     23  *                                                                         *
     24  *                   Programmer : Scott K. Bowen                           *
     25  *                                                                         *
     26  *                   Start Date : May 23, 1994                             *
     27  *                                                                         *
     28  *                  Last Update : May 25, 1994   [SKB]                     *
     29  *                                                                         *
     30  *-------------------------------------------------------------------------*
     31  * Functions:                                                              *
     32  *   Open_Animation -- file name and flags, system allocates buffer.       *
     33  *   Open_Animation -- file name, flags, palette, system allocates buffer. *
     34  *   Open_Animation -- file_name, graphic buffer, flags.                   *
     35  *   Open_Animation -- file name, bufferclass, flags, palette.             *
     36  *   Open_Animation -- filename, ptr, size, flags, no palette.             *
     37  *   Animate_Frame -- Animate a frame to a page with magic colors.         *
     38  *   Animate_Frame -- Animate a frame to a viewport with magic colors.     *
     39  *   Animate_Frame -- Animate a frame to a page.                           *
     40  *   Animate_Frame -- Animate a frame to a viewport.                       *
     41  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     42 
     43 #ifndef WSA_H
     44 #define WSA_H
     45 
     46 #ifndef WWSTD_H
     47 #include "wwstd.h"
     48 #endif
     49 
     50 #ifndef GBUFFER_H
     51 #include "gbuffer.h"
     52 #endif
     53 
     54 //lint -strong(AJX,WSAType)
     55 typedef enum {
     56 	WSA_NORMAL,								// Normal WSA animation
     57 	WSA_GHOST	 	= 0x1000,			// Or'd with the above flags to get ghosting
     58 	WSA_PRIORITY2 	= 0x2000,			// Copy using a priority (or in the priority)
     59 	WSA_TRANS    	= 0x4000,			// Copy frame, ignoring transparent colors
     60 	WSA_PRIORITY 	= 0x8000				// Copy using a priority (or in the priority)
     61 } WSAType;
     62 
     63 
     64 //lint -strong(AJX,WSAOpenType)
     65 typedef enum {
     66 	WSA_OPEN_FROM_MEM		= 0x0000,	// Try to load entire anim into memory.
     67 	WSA_OPEN_INDIRECT		= 0x0000,	// First animate to internal buffer, then copy to page/viewport.
     68 	WSA_OPEN_FROM_DISK	= 0x0001,	// Force the animation to be disk based.
     69 	WSA_OPEN_DIRECT		= 0x0002,	// Animate directly to page or viewport.
     70 
     71 	// These next two have been added for the 32 bit library to give a better idea of what is
     72 	// happening.  You may want to animate directly to the destination or indirectly to the
     73 	// destination by using the animations buffer.  Indirecly is best if the dest is a seenpage
     74 	// and the animation is not linear or if the destination is modified between frames.
     75 	WSA_OPEN_TO_PAGE  = WSA_OPEN_DIRECT ,
     76 	WSA_OPEN_TO_BUFFER= WSA_OPEN_INDIRECT ,
     77 
     78 } WSAOpenType;
     79 
     80 /*=========================================================================*/
     81 /* The following prototypes are for the file: WSA.CPP								*/
     82 /*=========================================================================*/
     83 
     84 void * __cdecl Open_Animation(char const *file_name, char *user_buffer, long user_buffer_size, WSAOpenType user_flags, unsigned char *palette=NULL);
     85 void __cdecl Close_Animation( void *handle );
     86 BOOL __cdecl Animate_Frame(void *handle, GraphicViewPortClass& view,
     87                          int frame_number, int x_pixel=0, int y_pixel=0,
     88                          WSAType flags_and_prio = WSA_NORMAL, void *magic_cols=NULL, void *magic=NULL);
     89 int __cdecl Get_Animation_Frame_Count(void *handle);
     90 BOOL __cdecl Animate_Frame(void *handle, VideoViewPortClass& view,
     91                          int frame_number, int x_pixel=0, int y_pixel=0,
     92                          WSAType flags_and_prio = WSA_NORMAL, void *magic_cols=NULL, void *magic=NULL);
     93 int __cdecl Get_Animation_Frame_Count(void *handle);
     94 int __cdecl Get_Animation_X(void const *handle);
     95 int __cdecl Get_Animation_Y(void const *handle);
     96 int __cdecl Get_Animation_Width(void const *handle);
     97 int __cdecl Get_Animation_Height(void const *handle);
     98 int __cdecl Get_Animation_Palette(void const *handle);
     99 unsigned long __cdecl Get_Animation_Size(void const *handle);
    100 
    101 
    102 /***************************************************************************
    103  * OPEN_ANIMATION -- file name, flags, palette, system allocates buffer.   *
    104  *                                                                         *
    105  *                                                                         *
    106  * INPUT:   char *file_name - name of file to open.                        *
    107  *          WSAOpenType user_flags - flags on how to open.                 *
    108  *          unsigned char *palette - pointer to a palette buffer to fill.          *
    109  *                                                                         *
    110  * OUTPUT:  void *pointer to animation data.  Must be used for all 			*
    111  *               other WSA calls.                                          *
    112  *                                                                         *
    113  * WARNINGS:                                                               *
    114  *                                                                         *
    115  * HISTORY:                                                                *
    116  *   05/24/1994 SKB : Created.                                             *
    117  *=========================================================================*/
    118 inline void  * __cdecl Open_Animation(char *file_name, WSAOpenType user_flags, unsigned char *palette=NULL)
    119 {
    120 	return (Open_Animation(file_name, NULL, 0L, user_flags,  palette));
    121 }
    122 
    123 
    124 /***************************************************************************
    125  * OPEN_ANIMATION -- file_name, bufferclass, flags. 								*
    126  *                                                                         *
    127  *                                                                         *
    128  * INPUT:   char *file_name - name of file to open.                        *
    129  *          GraphicBufferClass - pointer to a buffer.                      *
    130  *          WSAOpenType user_flags - flags on how to open.                 *
    131  *          unsigned char *palette - pointer to a palette buffer to fill.          *
    132  *                                                                         *
    133  * OUTPUT:  void *pointer to animation data.  Must be used for all 			*
    134  *               other WSA calls.                                          *
    135  *                                                                         *
    136  * WARNINGS:                                                               *
    137  *                                                                         *
    138  * HISTORY:                                                                *
    139  *   05/24/1994 SKB : Created.                                             *
    140  *=========================================================================*/
    141 inline void * __cdecl Open_Animation(char *file_name, BufferClass& buffer, WSAOpenType user_flags,  unsigned char *palette=NULL)
    142 {
    143 	return (Open_Animation(file_name, (char *)buffer.Get_Buffer(), buffer.Get_Size(), user_flags, palette));
    144 }
    145 
    146 
    147 /*=========================================================================*/
    148 /* The following prototypes are for the file: LP_ASM.ASM							*/
    149 /*=========================================================================*/
    150 
    151 
    152 extern "C" {
    153 unsigned int __cdecl Apply_XOR_Delta(char *source_ptr, char *delta_ptr);
    154 void  __cdecl Apply_XOR_Delta_To_Page_Or_Viewport(void *target, void *delta, int width, int nextrow, int copy);
    155 }
    156 
    157 
    158 
    159 #endif // WSA_H
    160