CONST.CPP 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  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\const.cpv 2.17 16 Oct 1995 16:52:24 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 : CONST.CPP *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : September 20, 1993 *
  30. * *
  31. * Last Update : September 20, 1993 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #include "function.h"
  37. char const * SourceName[SOURCE_COUNT] =
  38. {
  39. "North",
  40. "East",
  41. "South",
  42. "West",
  43. "Shipping",
  44. "Beach",
  45. "Air",
  46. "Visible",
  47. "EnemyBase",
  48. "HomeBase",
  49. "Ocean",
  50. };
  51. /***************************************************************************
  52. ** Relative coordinate offsets from the center of a cell for each
  53. ** of the legal positions that an object in a cell may stop at. Only infantry
  54. ** are allowed to stop at other than the center of the cell.
  55. */
  56. COORDINATE const StoppingCoordAbs[5] = {
  57. 0x00800080L, // center
  58. 0x00400040L, // upper left
  59. 0x004000C0L, // upper right
  60. 0x00C00040L, // lower left
  61. 0x00C000C0L // lower right
  62. };
  63. /***************************************************************************
  64. ** These are the various weapons and their characteristics.
  65. **
  66. ** bullet type dmg, rof, range, sound
  67. */
  68. WeaponTypeClass const Weapons[WEAPON_COUNT] = {
  69. {BULLET_SNIPER, 125, 40, 0x0580, VOC_SNIPER, ANIM_NONE}, // WEAPON_RIFLE
  70. {BULLET_SPREADFIRE, 25, 50, 0x0400, VOC_MINI, ANIM_GUN_N}, // WEAPON_CHAIN_GUN
  71. {BULLET_BULLET, 1, 7, 0x01C0, VOC_RIFLE, ANIM_NONE}, // WEAPON_PISTOL
  72. {BULLET_BULLET, 15, 20, 0x0200, VOC_MGUN2, ANIM_NONE}, // WEAPON_M16
  73. {BULLET_TOW, 30, 60, 0x0400, VOC_BAZOOKA,ANIM_NONE}, // WEAPON_DRAGON
  74. {BULLET_FLAME, 35, 50, 0x0200, VOC_FLAMER1,ANIM_FLAME_N}, // WEAPON_FLAMETHROWER
  75. {BULLET_FLAME, 50, 50, 0x0200, VOC_FLAMER1,ANIM_FLAME_N}, // WEAPON_FLAME_TONGUE
  76. {BULLET_CHEMSPRAY, 80, 70, 0x0200, VOC_FLAMER1,ANIM_CHEM_N}, // WEAPON_CHEMSPRAY
  77. {BULLET_GRENADE, 50, 60, 0x0340, VOC_TOSS, ANIM_NONE}, // WEAPON_GRENADE
  78. {BULLET_APDS, 25, 60, 0x0400, VOC_TANK2, ANIM_MUZZLE_FLASH}, // WEAPON_75MM
  79. {BULLET_APDS, 30, 50, 0x04C0, VOC_TANK3, ANIM_MUZZLE_FLASH}, // WEAPON_105MM
  80. {BULLET_APDS, 40, 80, 0x04C0, VOC_TANK4, ANIM_MUZZLE_FLASH}, // WEAPON_120MM
  81. {BULLET_APDS, 40, 60, 0x0600, VOC_TANK4, ANIM_MUZZLE_FLASH}, // WEAPON_TURRET_GUN
  82. {BULLET_SSM, 75, 80, 0x0500, VOC_ROCKET1,ANIM_NONE}, // WEAPON_MAMMOTH_TUSK
  83. {BULLET_SSM2, 75, 80, 0x0600, VOC_ROCKET1,ANIM_NONE}, // WEAPON_MLRS
  84. {BULLET_HE, 150, 65, 0x0600, VOC_TANK1, ANIM_MUZZLE_FLASH}, // WEAPON_155MM
  85. {BULLET_BULLET, 15, 30, 0x0400, VOC_MGUN11, ANIM_GUN_N}, // WEAPON_M60MG
  86. {BULLET_SSM, 60, 35, 0x0780, VOC_ROCKET2,ANIM_NONE}, // WEAPON_TOMAHAWK
  87. {BULLET_SSM, 60, 40, 0x0680, VOC_ROCKET2,ANIM_NONE}, // WEAPON_TOW_TWO
  88. {BULLET_NAPALM, 100, 20, 0x0480, VOC_NONE, ANIM_NONE}, // WEAPON_NAPALM
  89. {BULLET_LASER, 200, 90, 0x0780, VOC_LASER, ANIM_NONE}, // WEAPON_OBELISK_LASER
  90. {BULLET_SAM, 50, 50, 0x0780, VOC_ROCKET2,ANIM_NONE}, // WEAPON_NIKE
  91. {BULLET_HONEST_JOHN, 100, 200, 0x0A00, VOC_ROCKET1,ANIM_NONE}, // WEAPON_HONEST_JOHN
  92. {BULLET_HEADBUTT, 100, 30, 0x0180, VOC_DINOATK1,ANIM_NONE}, // WEAPON_STEG
  93. {BULLET_TREXBITE, 155, 30, 0x0180, VOC_DINOATK1,ANIM_NONE}, // WEAPON_TREX
  94. };
  95. /***************************************************************************
  96. ** These are the various warheads.
  97. **
  98. ** spread factor, destroys walls, destroys wood, destroys Tiberium, {armor defense table}
  99. ** -vs- {none, wood, aluminum, steel, concrete}
  100. */
  101. WarheadTypeClass const Warheads[WARHEAD_COUNT] = {
  102. { 2,false,false,false,{0xFF, 0x80, 0x90, 0x40, 0x40}}, // WARHEAD_SA Small arms -- good against infantry.
  103. { 6,true,true,true,{0xE0, 0xC0, 0x90, 0x40, 0xFF}}, // WARHEAD_HE High explosive -- good against buildings & infantry.
  104. { 6,true,true,false,{0x40, 0xC0, 0xC0, 0xFF, 0x80}}, // WARHEAD_AP Armor piercing -- good against armor.
  105. { 8,false,true,true,{0xE0, 0xFF, 0xB0, 0x40, 0x80}}, // WARHEAD_FIRE Incendiary -- Good against flammables.
  106. { 4,false,false,false,{0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}, // WARHEAD_LASER Light Amplification of Stimulated Emission by Radiation.
  107. { 7,true,true,true,{0xFF, 0xFF, 0xC0, 0xC0, 0xC0}}, // WARHEAD_PB Particle beam (neutron beam).
  108. { 4,false,false,false,{0xFF, 0x20, 0x20, 0x10, 0x10}}, // WARHEAD_FIST Punching in hand-to-hand combat.
  109. { 4,false,false,false,{0xFF, 0x20, 0x20, 0x10, 0x10}}, // WARHEAD_FOOT Kicking in hand-to-hand combat.
  110. { 4,false,false,false,{0xFF, 0x08, 0x08, 0x08, 0x08}}, // WARHEAD_HOLLOW_POINT Sniper bullet type.
  111. {255,false,false,false,{0xFF, 0x01, 0x01, 0x01, 0x01}}, // WARHEAD_SPORE
  112. { 1, true,true,false,{0xFF, 0xC0, 0x80, 0x20, 0x08}}, // WARHEAD_HEADBUTT
  113. { 1, true,true,false,{0xFF, 0xC0, 0x80, 0x20, 0x08}}, // WARHEAD_FEEDME
  114. };
  115. /***************************************************************************
  116. ** Converts pixel values (cell relative) into the appropriate lepton (sub cell)
  117. ** value. This is used to convert pixel (screen) coordinates into the underlying
  118. ** coordinate system.
  119. */
  120. unsigned char const Pixel2Lepton[24] = {
  121. 0x00,0x0B,0x15,0x20,0x2B,0x35,0x40,0x4B,
  122. 0x55,0x60,0x6B,0x75,0x80,0x8B,0x95,0xA0,
  123. 0xAB,0xB5,0xC0,0xCB,0xD5,0xE0,0xEB,0xF5
  124. };
  125. /***************************************************************************
  126. ** This array is used to index a facing in order to retrieve a cell
  127. ** offset that, when added to another cell, will achieve the adjacent cell
  128. ** in the indexed direction.
  129. */
  130. CELL const AdjacentCell[FACING_COUNT] = {
  131. -(MAP_CELL_W), // North
  132. -(MAP_CELL_W-1), // North East
  133. 1, // East
  134. MAP_CELL_W+1, // South East
  135. MAP_CELL_W, // South
  136. MAP_CELL_W-1, // South West
  137. -1, // West
  138. -(MAP_CELL_W+1) // North West
  139. };
  140. COORDINATE const AdjacentCoord[FACING_COUNT] = {
  141. 0xFF000000L,
  142. 0xFF000100L,
  143. 0x00000100L,
  144. 0x01000100L,
  145. 0x01000000L,
  146. 0x0100FF00L,
  147. 0x0000FF00L,
  148. 0xFF00FF00L
  149. };
  150. /***************************************************************************
  151. ** This converts 0..255 facing values into either 8, 16, or 32 facing values.
  152. ** Note: a simple shift won't suffice because 0..255 facing values should
  153. ** be converted to the CLOSEST appropriate facing, NOT rounded down to the
  154. ** nearest facing.
  155. */
  156. unsigned char const Facing8[256] = {
  157. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  158. 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
  159. 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
  160. 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
  161. 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
  162. 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
  163. 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
  164. 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  165. };
  166. #ifdef NEVER
  167. unsigned char const Facing16[256] = {
  168. 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,
  169. 2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,
  170. 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,
  171. 6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,
  172. 8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,
  173. 10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,
  174. 12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,
  175. 14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,0,0,0,0,0,0
  176. };
  177. #endif
  178. /*
  179. ** This table incorporates a compensating factor for the distortion caused
  180. ** by 3D-Studio when it tries to render 45% angles.
  181. */
  182. unsigned char const Facing32[256] = {
  183. 0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,
  184. 3,4,4,4,4,4,4,5,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,
  185. 8,8,8,9,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,
  186. 13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,
  187. 16,16,16,16,16,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,
  188. 19,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,22,22,23,23,23,23,23,23,23,24,24,24,24,
  189. 24,24,24,25,25,25,25,25,25,25,26,26,26,26,26,26,26,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,
  190. 29,29,29,29,29,29,29,29,30,30,30,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31,0,0,0,0,0,0
  191. };
  192. #ifdef OBSOLETE
  193. unsigned char const Facing32[256] = {
  194. 0,0,0,0,
  195. 1,1,1,1,1,1,1,1,
  196. 2,2,2,2,2,2,2,2,
  197. 3,3,3,3,3,3,3,3,
  198. 4,4,4,4,4,4,4,4,
  199. 5,5,5,5,5,5,5,5,
  200. 6,6,6,6,6,6,6,6,
  201. 7,7,7,7,7,7,7,7,
  202. 8,8,8,8,8,8,8,8,
  203. 9,9,9,9,9,9,9,9,
  204. 10,10,10,10,10,10,10,10,
  205. 11,11,11,11,11,11,11,11,
  206. 12,12,12,12,12,12,12,12,
  207. 13,13,13,13,13,13,13,13,
  208. 14,14,14,14,14,14,14,14,
  209. 15,15,15,15,15,15,15,15,
  210. 16,16,16,16,16,16,16,16,
  211. 17,17,17,17,17,17,17,17,
  212. 18,18,18,18,18,18,18,18,
  213. 19,19,19,19,19,19,19,19,
  214. 20,20,20,20,20,20,20,20,
  215. 21,21,21,21,21,21,21,21,
  216. 22,22,22,22,22,22,22,22,
  217. 23,23,23,23,23,23,23,23,
  218. 24,24,24,24,24,24,24,24,
  219. 25,25,25,25,25,25,25,25,
  220. 26,26,26,26,26,26,26,26,
  221. 27,27,27,27,27,27,27,27,
  222. 28,28,28,28,28,28,28,28,
  223. 29,29,29,29,29,29,29,29,
  224. 30,30,30,30,30,30,30,30,
  225. 31,31,31,31,31,31,31,31,
  226. 0,0,0,0
  227. };
  228. #endif
  229. /***************************************************************************
  230. ** These are the movement costs (in ticks at fastest speed) to enter each
  231. ** of the given terrain cells.
  232. */
  233. #define S1 0x00
  234. #define S2 0x40
  235. #define S3 0x70
  236. #define S4 0xA0
  237. #define S5 0xC0
  238. #define S6 0xFF
  239. GroundType const Ground[LAND_COUNT] = {
  240. // Foot
  241. // | Tracked
  242. // | | Harvester
  243. // | | | Wheeled
  244. // | | | | Winged
  245. // | | | | | Hover
  246. // | | | | | | float build
  247. {66, {S3, S3, S3, S4, S6, S5, S1 }, true}, // LAND_CLEAR
  248. {68, {S5, S4, S4, S4, S6, S5, S1 }, true}, // LAND_ROAD
  249. {BLUE, {S1, S1, S1, S1, S6, S5, S6 }, false}, // LAND_WATER
  250. {DKGREY, {S1, S1, S1, S1, S6, S1, S1 }, false}, // LAND_ROCK
  251. {DKGREY, {S1, S1, S1, S1, S6, S1, S1 }, false}, // LAND_WALL
  252. {143, {S3, S3, S3, S4, S6, S5, S1 }, false}, // LAND_TIBERIUM
  253. {66, {S3, S3, S3, S4, S6, S5, S1 }, false}, // LAND_BEACH
  254. };
  255. /***************************************************************************
  256. ** These are the names of the theaters.
  257. */
  258. TheaterDataType const Theaters[THEATER_COUNT] = {
  259. {"DESERT","DESERT","DES"},
  260. {"JUNGLE","JUNGLE","JUN"},
  261. {"TEMPERATE","TEMPERAT","TEM"},
  262. {"WINTER","WINTER","WIN"}
  263. };
  264. /***************************************************************************
  265. ** These are the remap tables that are used to convert the units/buildings
  266. ** into the other color schemes.
  267. */
  268. unsigned char const RemapYellow[256] = {
  269. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, // 0..15
  270. 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
  271. 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
  272. 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
  273. 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
  274. 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
  275. 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
  276. 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
  277. 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
  278. 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
  279. 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
  280. 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // 176..191
  281. 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
  282. 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
  283. 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
  284. 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
  285. };
  286. unsigned char const RemapRed[256] = {
  287. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, // 0..15
  288. 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
  289. 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
  290. 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
  291. 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
  292. 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
  293. 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
  294. 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
  295. 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
  296. 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
  297. 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
  298. 127,126,125,124,122,46,120,47,125,124,123,122,42,121,120,120, // 176..191
  299. 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
  300. 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
  301. 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
  302. 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
  303. };
  304. unsigned char const RemapBlueGreen[256] = {
  305. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, // 0..15
  306. 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
  307. 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
  308. 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
  309. 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
  310. 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
  311. 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
  312. 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
  313. 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
  314. 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
  315. 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
  316. 2,119,118,135,136,138,112,12,118,135,136,137,138,139,114,112, // 176..191
  317. 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
  318. 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
  319. 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
  320. 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
  321. };
  322. unsigned char const RemapOrange[256] = {
  323. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, // 0..15
  324. 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
  325. 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
  326. 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
  327. 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
  328. 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
  329. 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
  330. 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
  331. 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
  332. 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
  333. 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
  334. 24,25,26,27,29,31,46,47,26,27,28,29,30,31,43,47, // 176..191
  335. 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
  336. 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
  337. 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
  338. 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
  339. };
  340. unsigned char const RemapGreen[256] = {
  341. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, // 0..15
  342. 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
  343. 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
  344. 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
  345. 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
  346. 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
  347. 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
  348. 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
  349. 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
  350. 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
  351. 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
  352. 5,165,166,167,159,142,140,199,166,167,157,3,159,143,142,141, // 176..191
  353. 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
  354. 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
  355. 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
  356. 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
  357. };
  358. unsigned char const RemapBlue[256] = {
  359. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, // 0..15
  360. 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
  361. 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
  362. 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
  363. 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
  364. 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
  365. 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
  366. 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
  367. 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
  368. 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
  369. 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
  370. 161,200,201,202,204,205,206,12,201,202,203,204,205,115,198,114, // 176..191
  371. 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
  372. 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
  373. 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
  374. 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
  375. };
  376. unsigned char const RemapNone[256] = {
  377. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, // 0..15
  378. 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, // 16..31
  379. 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, // 32..47
  380. 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, // 48..63
  381. 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, // 64..79
  382. 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, // 80..95
  383. 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, // 96..111
  384. 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, // 112..127
  385. 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 128..143
  386. 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 144..159
  387. 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // 160..175
  388. 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // 176..191
  389. 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // 192..207
  390. 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // 208..223
  391. 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // 224..239
  392. 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // 240..255
  393. };