COMPAT.H 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. ** Command & Conquer(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. /* $Header: F:\projects\c&c\vcs\code\compat.h_v 2.19 16 Oct 1995 16:46:02 JOE_BOSTIC $ */
  19. /***********************************************************************************************
  20. *** 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 ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : COMPAT.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : 03/02/95 *
  30. * *
  31. * Last Update : March 2, 1995 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef COMPAT_H
  37. #define COMPAT_H
  38. #include "i86.h"
  39. #define KeyNumType int
  40. #define KeyASCIIType int
  41. #define BuffType BufferClass
  42. #define movmem(a,b,c) memmove(b,a,c)
  43. #define ShapeBufferSize _ShapeBufferSize
  44. extern "C" {
  45. extern long ShapeBufferSize;
  46. extern char *ShapeBuffer;
  47. }
  48. /*=========================================================================*/
  49. /* Define some equates for the different graphic routines we will install */
  50. /* later. */
  51. /*=========================================================================*/
  52. #define HIDBUFF ((void *)(0xA0000))
  53. //#define Size_Of_Region(a, b) a*b
  54. /*=========================================================================*/
  55. /* Define some Graphic Routines which will only be fixed by these defines */
  56. /*=========================================================================*/
  57. #define Set_Font_Palette(a) Set_Font_Palette_Range(a, 0, 15)
  58. /*
  59. ** These are the Open_File, Read_File, and Seek_File constants.
  60. */
  61. #define READ 1 // Read access.
  62. #define WRITE 2 // Write access.
  63. #ifndef SEEK_SET
  64. #define SEEK_SET 0 // Seek from start of file.
  65. #define SEEK_CUR 1 // Seek relative from current location.
  66. #define SEEK_END 2 // Seek from end of file.
  67. #endif
  68. #define ERROR_WINDOW 1
  69. #define ErrorWindow 1
  70. extern unsigned char *Palette;
  71. extern unsigned char MDisabled; // Is mouse disabled?
  72. extern WORD Hard_Error_Occured;
  73. /*
  74. ** This is the menu control structures.
  75. */
  76. typedef enum MenuIndexType {
  77. MENUX,
  78. MENUY,
  79. ITEMWIDTH,
  80. ITEMSHIGH,
  81. MSELECTED,
  82. NORMCOL,
  83. HILITE,
  84. MENUPADDING=0x1000
  85. } MenuIndexType;
  86. #define BITSPERBYTE 8
  87. #define MAXSHORT 0x7fff
  88. #define HIBITS 0x8000
  89. //#define MAXLONG 0x7fffffffL
  90. #define HIBITL 0x80000000
  91. #define MAXINT MAXLONG
  92. #define HIBITI HIBITL
  93. #define DMAXEXP 308
  94. #define FMAXEXP 38
  95. #define DMINEXP -307
  96. #define FMINEXP -37
  97. #define MAXDOUBLE 1.797693E+308
  98. #define MAXFLOAT 3.37E+38F
  99. #define MINDOUBLE 2.225074E-308
  100. #define MINFLOAT 8.43E-37F
  101. #define DSIGNIF 53
  102. #define FSIGNIF 24
  103. #define DMAXPOWTWO 0x3FF
  104. #define FMAXPOWTWO 0x7F
  105. #define DEXPLEN 11
  106. #define FEXPLEN 8
  107. #define EXPBASE 2
  108. #define IEEE 1
  109. #define LENBASE 1
  110. #define HIDDENBIT 1
  111. #define LN_MAXDOUBLE 7.0978E+2
  112. #define LN_MINDOUBLE -7.0840E+2
  113. /* These defines handle the various names given to the same color. */
  114. #define DKGREEN GREEN
  115. #define DKBLUE BLUE
  116. #define GRAY GREY
  117. #define DKGREY GREY
  118. #define DKGRAY GREY
  119. #define LTGRAY LTGREY
  120. #if 0
  121. typedef struct {
  122. short Width; // Width of icons (pixels).
  123. short Height; // Height of icons (pixels).
  124. short Count; // Number of (logical) icons in this set.
  125. short Allocated; // Was this iconset allocated?
  126. long Size; // Size of entire iconset memory block.
  127. unsigned char * Icons; // Offset from buffer start to icon data.
  128. long Palettes; // Offset from buffer start to palette data.
  129. long Remaps; // Offset from buffer start to remap index data.
  130. long TransFlag; // Offset for transparency flag table.
  131. unsigned char * Map; // Icon map offset (if present).
  132. } IControl_Type;
  133. #endif
  134. void Stuff_Key_Num ( int );
  135. extern "C"{
  136. extern int MouseQX;
  137. extern int MouseQY;
  138. }
  139. #endif