| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- /*
- ** Command & Conquer Red Alert(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /* $Header: /CounterStrike/COMPAT.H 1 3/03/97 10:24a Joe_bostic $ */
- /***********************************************************************************************
- *** 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 ***
- ***********************************************************************************************
- * *
- * Project Name : Command & Conquer *
- * *
- * File Name : COMPAT.H *
- * *
- * Programmer : Joe L. Bostic *
- * *
- * Start Date : 03/02/95 *
- * *
- * Last Update : March 2, 1995 [JLB] *
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #ifndef COMPAT_H
- #define COMPAT_H
- #define BuffType BufferClass
- //#define movmem(a,b,c) memmove(b,a,c)
- #define ShapeBufferSize _ShapeBufferSize
- /*=========================================================================*/
- /* Define some equates for the different graphic routines we will install */
- /* later. */
- /*=========================================================================*/
- #define HIDBUFF ((void *)(0xA0000))
- #define Size_Of_Region(a, b) ((a)*(b))
- /*=========================================================================*/
- /* Define some Graphic Routines which will only be fixed by these defines */
- /*=========================================================================*/
- #define Set_Font_Palette(a) Set_Font_Palette_Range(a, 0, 15)
- /*
- ** These are the Open_File, Read_File, and Seek_File constants.
- */
- #define READ 1 // Read access.
- #define WRITE 2 // Write access.
- #ifndef SEEK_SET
- #define SEEK_SET 0 // Seek from start of file.
- #define SEEK_CUR 1 // Seek relative from current location.
- #define SEEK_END 2 // Seek from end of file.
- #endif
- #define ERROR_WINDOW 1
- #define ErrorWindow 1
- //extern unsigned char *Palette;
- extern unsigned char MDisabled; // Is mouse disabled?
- extern WORD Hard_Error_Occured;
- /*
- ** This is the menu control structures.
- */
- typedef enum MenuIndexType {
- MENUX,
- MENUY,
- ITEMWIDTH,
- ITEMSHIGH,
- MSELECTED,
- NORMCOL,
- HILITE,
- MENUPADDING=0x1000
- } MenuIndexType;
- #ifdef NEVER
- #define BITSPERBYTE 8
- #define MAXSHORT 0x7FFF
- #define HIBITS 0x8000
- #define MAXLONG 0x7FFFFFFFL
- #define HIBITL 0x80000000
- #define MAXINT MAXLONG
- #define HIBITI HIBITL
- #define DMAXEXP 308
- #define FMAXEXP 38
- #define DMINEXP -307
- #define FMINEXP -37
- #define MAXDOUBLE 1.797693E+308
- #define MAXFLOAT 3.37E+38F
- #define MINDOUBLE 2.225074E-308
- #define MINFLOAT 8.43E-37F
- #define DSIGNIF 53
- #define FSIGNIF 24
- #define DMAXPOWTWO 0x3FF
- #define FMAXPOWTWO 0x7F
- #define DEXPLEN 11
- #define FEXPLEN 8
- #define EXPBASE 2
- #define IEEE 1
- #define LENBASE 1
- #define HIDDENBIT 1
- #define LN_MAXDOUBLE 7.0978E+2
- #define LN_MINDOUBLE -7.0840E+2
- #endif
- /* These defines handle the various names given to the same color. */
- #define DKGREEN GREEN
- #define DKBLUE BLUE
- #define GRAY GREY
- #define DKGREY GREY
- #define DKGRAY GREY
- #define LTGRAY LTGREY
- class IconsetClass;
- #ifndef WIN32
- typedef struct {
- short Width; // Width of icons (pixels).
- short Height; // Height of icons (pixels).
- short Count; // Number of (logical) icons in this set.
- short Allocated; // Was this iconset allocated?
- short MapWidth; // Width of map (in icons).
- short MapHeight; // Height of map (in icons).
- long Size; // Size of entire iconset memory block.
- long Icons; // Offset from buffer start to icon data.
- // unsigned char * Icons; // Offset from buffer start to icon data.
- long Palettes; // Offset from buffer start to palette data.
- long Remaps; // Offset from buffer start to remap index data.
- long TransFlag; // Offset for transparency flag table.
- long ColorMap; // Offset for color control value table.
- long Map; // Icon map offset (if present).
- // unsigned char * Map; // Icon map offset (if present).
- } IControl_Type;
- #endif
- inline int Get_IconSet_MapWidth(void const * data)
- {
- if (data) {
- return(((IControl_Type *)data)->MapWidth);
- }
- return(0);
- }
- inline int Get_IconSet_MapHeight(void const * data)
- {
- if (data) {
- return(((IControl_Type *)data)->MapHeight);
- }
- return(0);
- }
- inline unsigned char const * Get_IconSet_ControlMap(void const * data)
- {
- if (data) {
- return((unsigned char const *)((char *)data + ((IControl_Type *)data)->ColorMap));
- }
- return(0);
- }
- class IconsetClass : protected IControl_Type
- {
- public:
- /*
- ** Query functions.
- */
- int Map_Width(void) const {return(MapWidth);};
- int Map_Height(void) const {return(MapHeight);};
- unsigned char * Control_Map(void) {return((unsigned char *)this + ColorMap);};
- unsigned char const * Control_Map(void) const {return((unsigned char const *)this + ColorMap);};
- int Icon_Count(void) const {return(Count);};
- int Pixel_Width(void) const {return(Width);};
- int Pixel_Height(void) const {return(Height);};
- int Total_Size(void) const {return(Size);};
- unsigned char const * Palette_Data(void) const {return((unsigned char const *)this + Palettes);};
- unsigned char * Palette_Data(void) {return((unsigned char *)this + Palettes);};
- unsigned char const * Icon_Data(void) const {return((unsigned char const *)this + Icons);};
- unsigned char * Icon_Data(void) {return((unsigned char *)this + Icons);};
- unsigned char const * Map_Data(void) const {return((unsigned char const *)this + Map);};
- unsigned char * Map_Data(void) {return((unsigned char *)this + Map);};
- unsigned char const * Remap_Data(void) const {return((unsigned char const *)this + Remaps);};
- unsigned char * Remap_Data(void) {return((unsigned char *)this + Remaps);};
- unsigned char const * Trans_Data(void) const {return((unsigned char const *)this + TransFlag);};
- unsigned char * Trans_Data(void) {return((unsigned char *)this + TransFlag);};
- /*
- ** Disallow these operations with an IconsetClass object.
- */
- private:
- IconsetClass & operator = (IconsetClass const &);
- IconsetClass(void);
- static void * operator new(size_t);
- };
- #endif
|