defpal.cpp 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. ** Command & Conquer Renegade(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. #include "stdafx.h"
  19. #include <convert.h>
  20. #include <bsurface.h>
  21. // Define a default palette for the product in case one hasn't been loaded
  22. // from disk.
  23. char DefaultPaletteData[768] = {
  24. 0, 0, 0, 42, 0, 42, 0, 42, 42, 0, 42, 0, 22, 63, 21, 63,
  25. 63, 21, 63, 21, 21, 42, 21, 0, 42, 0, 0, 21, 63, 63, 20, 20,
  26. 63, 0, 0, 42, 0, 0, 0, 21, 21, 21, 42, 42, 42, 63, 63, 63,
  27. 4, 3, 3, 3, 4, 5, 5, 5, 6, 8, 7, 7, 7, 8, 9, 9,
  28. 9, 10, 12, 10, 10, 10, 12, 11, 11, 13, 13, 17, 14, 14, 10, 17,
  29. 10, 13, 16, 10, 11, 16, 14, 14, 17, 14, 14, 20, 15, 17, 17, 15,
  30. 25, 20, 14, 14, 14, 17, 13, 17, 27, 21, 18, 18, 18, 21, 18, 21,
  31. 22, 18, 25, 22, 21, 21, 25, 19, 18, 25, 21, 25, 25, 19, 29, 25,
  32. 19, 25, 26, 22, 29, 26, 22, 29, 29, 23, 22, 29, 24, 22, 29, 29,
  33. 26, 30, 25, 30, 29, 29, 34, 22, 20, 34, 28, 22, 34, 30, 27, 27,
  34. 33, 23, 29, 33, 25, 30, 37, 29, 33, 34, 26, 37, 34, 26, 37, 38,
  35. 29, 42, 37, 29, 36, 41, 29, 42, 42, 30, 23, 30, 41, 34, 30, 42,
  36. 22, 33, 36, 30, 35, 34, 30, 34, 43, 26, 37, 49, 34, 34, 33, 37,
  37. 37, 33, 41, 37, 35, 43, 43, 35, 34, 34, 45, 38, 37, 46, 41, 37,
  38. 42, 41, 38, 46, 49, 45, 35, 44, 43, 50, 50, 45, 50, 57, 54, 57,
  39. 61, 53, 30, 57, 50, 28, 53, 47, 26, 49, 44, 24, 45, 41, 22, 42,
  40. 38, 21, 36, 34, 19, 36, 29, 16, 33, 28, 14, 27, 25, 14, 22, 21,
  41. 11, 21, 19, 9, 18, 17, 8, 14, 13, 7, 13, 11, 5, 10, 8, 2,
  42. 23, 49, 55, 23, 41, 50, 23, 35, 45, 23, 29, 41, 23, 35, 45, 23,
  43. 41, 50, 23, 45, 55, 47, 0, 0, 52, 48, 40, 49, 45, 37, 46, 42,
  44. 33, 44, 39, 30, 41, 36, 27, 37, 32, 24, 34, 27, 20, 31, 24, 18,
  45. 59, 56, 54, 55, 51, 49, 51, 46, 44, 46, 41, 38, 41, 36, 33, 37,
  46. 31, 28, 33, 28, 25, 28, 22, 20, 23, 18, 16, 20, 15, 13, 15, 11,
  47. 10, 11, 7, 6, 0, 63, 0, 0, 49, 0, 0, 35, 0, 0, 22, 0,
  48. 59, 59, 59, 57, 57, 57, 52, 52, 52, 47, 47, 47, 43, 43, 43, 40,
  49. 40, 40, 37, 37, 37, 34, 34, 34, 31, 31, 31, 28, 28, 28, 25, 25,
  50. 25, 23, 23, 23, 19, 19, 19, 14, 14, 14, 9, 9, 9, 5, 5, 5,
  51. 49, 57, 33, 44, 52, 31, 39, 47, 29, 34, 43, 27, 30, 38, 25, 26,
  52. 34, 23, 22, 29, 19, 19, 25, 15, 15, 21, 12, 12, 17, 9, 9, 13,
  53. 6, 6, 9, 4, 63, 63, 39, 63, 53, 0, 63, 45, 0, 63, 34, 0,
  54. 56, 57, 61, 51, 52, 58, 45, 47, 55, 40, 42, 50, 35, 37, 46, 31,
  55. 33, 43, 26, 29, 40, 22, 26, 37, 17, 21, 34, 14, 18, 31, 12, 16,
  56. 29, 10, 14, 27, 8, 11, 24, 6, 11, 21, 3, 8, 17, 2, 5, 13,
  57. 33, 41, 43, 29, 37, 39, 25, 32, 34, 21, 27, 29, 17, 22, 24, 14,
  58. 18, 19, 9, 12, 13, 5, 8, 9, 17, 36, 31, 16, 33, 29, 14, 29,
  59. 27, 7, 27, 24, 6, 22, 19, 7, 16, 16, 3, 13, 13, 0, 8, 8,
  60. 45, 54, 63, 31, 47, 60, 17, 37, 57, 10, 30, 54, 9, 21, 51, 6,
  61. 17, 45, 5, 15, 39, 4, 12, 34, 52, 38, 31, 48, 34, 26, 45, 28,
  62. 21, 43, 23, 17, 38, 19, 14, 33, 16, 12, 28, 11, 9, 24, 9, 7,
  63. 63, 57, 37, 63, 53, 31, 61, 49, 28, 59, 43, 21, 58, 40, 16, 57,
  64. 36, 10, 53, 30, 4, 49, 24, 0, 45, 18, 0, 41, 14, 0, 38, 10,
  65. 0, 33, 8, 0, 27, 4, 0, 23, 2, 0, 19, 0, 0, 14, 0, 0,
  66. 63, 0, 63, 63, 0, 63, 63, 0, 63, 49, 49, 49, 54, 53, 54, 63,
  67. 23, 0, 63, 0, 0, 59, 0, 0, 54, 0, 0, 51, 0, 0, 47, 0,
  68. 0, 44, 0, 0, 37, 0, 0, 33, 0, 0, 29, 0, 0, 25, 0, 0,
  69. 7, 6, 2, 9, 8, 3, 10, 9, 4, 12, 12, 5, 14, 14, 7, 16,
  70. 16, 8, 18, 18, 10, 20, 20, 12, 22, 22, 14, 23, 24, 16, 25, 26,
  71. 18, 27, 28, 21, 29, 30, 23, 31, 32, 26, 33, 34, 29, 63, 63, 63,
  72. };
  73. PaletteClass DefaultPalette((unsigned char *)DefaultPaletteData);
  74. ConvertClass DefaultConvert(DefaultPalette, DefaultPalette, BSurface(8,8,8));