ROTBMP.H 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. ** Command & Conquer Red Alert(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. // list of 256 sines
  19. #define MAKE_PTR(vp,x,y) (char *) (vp->Get_Offset() + ((y) * (vp->Get_Width() + vp->Get_XAdd())) + (x))
  20. #define MAKE_PTR2(vp,x,y) (char *) (vp->Get_Offset() + (((y)<<1) * (vp->Get_Width() + vp->Get_XAdd())) + ((x)<<1))
  21. #ifndef WIN32
  22. class BitmapClass
  23. {
  24. public:
  25. BitmapClass(int w, int h, unsigned char * data) :
  26. Width(w), Height(h), Data(data) {};
  27. int Width;
  28. int Height;
  29. unsigned char * Data;
  30. };
  31. class TPoint2D
  32. {
  33. public:
  34. TPoint2D(int xx, int yy) : x(xx), y(yy) {};
  35. TPoint2D(void) : x(0), y(0) {};
  36. int x;
  37. int y;
  38. };
  39. #endif
  40. long Cos256[] = {
  41. 128, 127, 127, 127, 127, 127, 126, 126,
  42. 125, 124, 124, 123, 122, 121, 120, 119,
  43. 118, 116, 115, 114, 112, 111, 109, 107,
  44. 106, 104, 102, 100, 98, 96, 94, 92,
  45. 90, 87, 85, 83, 80, 78, 75, 73,
  46. 70, 68, 65, 62, 59, 57, 54, 51,
  47. 48, 45, 42, 39, 36, 33, 30, 27,
  48. 24, 21, 18, 14, 11, 8, 5, 2,
  49. 0, -3, -7, -10, -13, -16, -19, -22,
  50. -25, -28, -31, -35, -38, -41, -44, -46,
  51. -49, -52, -55, -58, -61, -63, -66, -69,
  52. -72, -74, -77, -79, -82, -84, -86, -89,
  53. -91, -93, -95, -97, -99, -101, -103, -105,
  54. -107, -108, -110, -112, -113, -114, -116, -117,
  55. -118, -119, -120, -121, -122, -123, -124, -125,
  56. -125, -126, -126, -127, -127, -127, -127, -127,
  57. -127, -127, -127, -127, -127, -126, -126, -125,
  58. -125, -124, -123, -122, -121, -120, -119, -118,
  59. -117, -116, -114, -113, -112, -110, -108, -107,
  60. -105, -103, -101, -99, -97, -95, -93, -91,
  61. -89, -86, -84, -82, -79, -77, -74, -72,
  62. -69, -66, -64, -61, -58, -55, -52, -49,
  63. -46, -44, -41, -38, -35, -31, -28, -25,
  64. -22, -19, -16, -13, -10, -7, -3, 0,
  65. 2, 5, 8, 11, 14, 18, 21, 24,
  66. 27, 30, 33, 36, 39, 42, 45, 48,
  67. 51, 54, 57, 59, 62, 65, 68, 70,
  68. 73, 75, 78, 80, 83, 85, 87, 90,
  69. 92, 94, 96, 98, 100, 102, 104, 106,
  70. 107, 109, 111, 112, 114, 115, 116, 118,
  71. 119, 120, 121, 122, 123, 124, 124, 125,
  72. 126, 126, 127, 127, 127, 127, 127, 127,
  73. };
  74. long Sin256[] = {
  75. 0, 3, 6, 9, 12, 15, 18, 21,
  76. 25, 28, 31, 34, 37, 40, 43, 46,
  77. 49, 52, 54, 57, 60, 63, 66, 68,
  78. 71, 73, 76, 79, 81, 83, 86, 88,
  79. 90, 92, 95, 97, 99, 101, 103, 104,
  80. 106, 108, 110, 111, 113, 114, 115, 117,
  81. 118, 119, 120, 121, 122, 123, 124, 125,
  82. 125, 126, 126, 127, 127, 127, 127, 127,
  83. 127, 127, 127, 127, 127, 126, 126, 125,
  84. 125, 124, 123, 123, 122, 121, 120, 119,
  85. 117, 116, 115, 113, 112, 110, 109, 107,
  86. 105, 104, 102, 100, 98, 96, 94, 91,
  87. 89, 87, 85, 82, 80, 77, 75, 72,
  88. 70, 67, 64, 61, 59, 56, 53, 50,
  89. 47, 44, 41, 38, 35, 32, 29, 26,
  90. 23, 20, 17, 14, 11, 7, 4, 1,
  91. -1, -4, -7, -11, -14, -17, -20, -23,
  92. -26, -29, -32, -35, -38, -41, -44, -47,
  93. -50, -53, -56, -59, -61, -64, -67, -70,
  94. -72, -75, -77, -80, -82, -85, -87, -89,
  95. -91, -94, -96, -98, -100, -102, -104, -105,
  96. -107, -109, -110, -112, -113, -115, -116, -117,
  97. -119, -120, -121, -122, -123, -123, -124, -125,
  98. -125, -126, -126, -127, -127, -127, -127, -127,
  99. -127, -127, -127, -127, -127, -126, -126, -125,
  100. -125, -124, -123, -122, -121, -120, -119, -118,
  101. -117, -115, -114, -113, -111, -110, -108, -106,
  102. -104, -103, -101, -99, -97, -95, -92, -90,
  103. -88, -86, -83, -81, -79, -76, -73, -71,
  104. -68, -66, -63, -60, -57, -54, -52, -49,
  105. -46, -43, -40, -37, -34, -31, -28, -25,
  106. -21, -18, -15, -12, -9, -6, -3, 0,
  107. };