ROTBMP.H 6.0 KB

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