CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

ROTBMP.H (6128B)


      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 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 // list of 256 sines
     17 
     18 #define MAKE_PTR(vp,x,y) (char *) (vp->Get_Offset() + ((y) * (vp->Get_Width() + vp->Get_XAdd())) + (x))
     19 #define MAKE_PTR2(vp,x,y) (char *) (vp->Get_Offset() + (((y)<<1) * (vp->Get_Width() + vp->Get_XAdd())) + ((x)<<1))
     20 
     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 
     28 		int Width;
     29 		int Height;
     30 		unsigned char * Data;
     31 };
     32 
     33 class TPoint2D
     34 {
     35 	public:
     36 		TPoint2D(int xx, int yy) : x(xx), y(yy) {};
     37 		TPoint2D(void) : x(0), y(0) {};
     38 
     39 		int x;
     40 		int y;
     41 };
     42 #endif
     43 
     44 
     45 long Cos256[] = {
     46      128,     127,     127,     127,     127,     127,     126,     126,
     47      125,     124,     124,     123,     122,     121,     120,     119,
     48      118,     116,     115,     114,     112,     111,     109,     107,
     49      106,     104,     102,     100,      98,      96,      94,      92,
     50       90,      87,      85,      83,      80,      78,      75,      73,
     51       70,      68,      65,      62,      59,      57,      54,      51,
     52       48,      45,      42,      39,      36,      33,      30,      27,
     53       24,      21,      18,      14,      11,       8,       5,       2,
     54        0,      -3,      -7,     -10,     -13,     -16,     -19,     -22,
     55      -25,     -28,     -31,     -35,     -38,     -41,     -44,     -46,
     56      -49,     -52,     -55,     -58,     -61,     -63,     -66,     -69,
     57      -72,     -74,     -77,     -79,     -82,     -84,     -86,     -89,
     58      -91,     -93,     -95,     -97,     -99,    -101,    -103,    -105,
     59     -107,    -108,    -110,    -112,    -113,    -114,    -116,    -117,
     60     -118,    -119,    -120,    -121,    -122,    -123,    -124,    -125,
     61     -125,    -126,    -126,    -127,    -127,    -127,    -127,    -127,
     62     -127,    -127,    -127,    -127,    -127,    -126,    -126,    -125,
     63     -125,    -124,    -123,    -122,    -121,    -120,    -119,    -118,
     64     -117,    -116,    -114,    -113,    -112,    -110,    -108,    -107,
     65     -105,    -103,    -101,     -99,     -97,     -95,     -93,     -91,
     66      -89,     -86,     -84,     -82,     -79,     -77,     -74,     -72,
     67      -69,     -66,     -64,     -61,     -58,     -55,     -52,     -49,
     68      -46,     -44,     -41,     -38,     -35,     -31,     -28,     -25,
     69      -22,     -19,     -16,     -13,     -10,      -7,      -3,       0,
     70        2,       5,       8,      11,      14,      18,      21,      24,
     71       27,      30,      33,      36,      39,      42,      45,      48,
     72       51,      54,      57,      59,      62,      65,      68,      70,
     73       73,      75,      78,      80,      83,      85,      87,      90,
     74       92,      94,      96,      98,     100,     102,     104,     106,
     75      107,     109,     111,     112,     114,     115,     116,     118,
     76      119,     120,     121,     122,     123,     124,     124,     125,
     77      126,     126,     127,     127,     127,     127,     127,     127,
     78 };
     79 long Sin256[] = {
     80        0,       3,       6,       9,      12,      15,      18,      21,
     81       25,      28,      31,      34,      37,      40,      43,      46,
     82       49,      52,      54,      57,      60,      63,      66,      68,
     83       71,      73,      76,      79,      81,      83,      86,      88,
     84       90,      92,      95,      97,      99,     101,     103,     104,
     85      106,     108,     110,     111,     113,     114,     115,     117,
     86      118,     119,     120,     121,     122,     123,     124,     125,
     87      125,     126,     126,     127,     127,     127,     127,     127,
     88      127,     127,     127,     127,     127,     126,     126,     125,
     89      125,     124,     123,     123,     122,     121,     120,     119,
     90      117,     116,     115,     113,     112,     110,     109,     107,
     91      105,     104,     102,     100,      98,      96,      94,      91,
     92       89,      87,      85,      82,      80,      77,      75,      72,
     93       70,      67,      64,      61,      59,      56,      53,      50,
     94       47,      44,      41,      38,      35,      32,      29,      26,
     95       23,      20,      17,      14,      11,       7,       4,       1,
     96       -1,      -4,      -7,     -11,     -14,     -17,     -20,     -23,
     97      -26,     -29,     -32,     -35,     -38,     -41,     -44,     -47,
     98      -50,     -53,     -56,     -59,     -61,     -64,     -67,     -70,
     99      -72,     -75,     -77,     -80,     -82,     -85,     -87,     -89,
    100      -91,     -94,     -96,     -98,    -100,    -102,    -104,    -105,
    101     -107,    -109,    -110,    -112,    -113,    -115,    -116,    -117,
    102     -119,    -120,    -121,    -122,    -123,    -123,    -124,    -125,
    103     -125,    -126,    -126,    -127,    -127,    -127,    -127,    -127,
    104     -127,    -127,    -127,    -127,    -127,    -126,    -126,    -125,
    105     -125,    -124,    -123,    -122,    -121,    -120,    -119,    -118,
    106     -117,    -115,    -114,    -113,    -111,    -110,    -108,    -106,
    107     -104,    -103,    -101,     -99,     -97,     -95,     -92,     -90,
    108      -88,     -86,     -83,     -81,     -79,     -76,     -73,     -71,
    109      -68,     -66,     -63,     -60,     -57,     -54,     -52,     -49,
    110      -46,     -43,     -40,     -37,     -34,     -31,     -28,     -25,
    111      -21,     -18,     -15,     -12,      -9,      -6,      -3,       0,
    112 };