CONST.CPP 21 KB

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