ST_engine  0.3-ALPHA
light.hpp
1 /* This file is part of the "ST" project.
2  * You may use, distribute or modify this code under the terms
3  * of the GNU General Public License version 2.
4  * See LICENCE.txt in the root directory of the project.
5  *
6  * Author: Maxim Atanasov
7  * E-mail: maxim.atanasov@protonmail.com
8  */
9 
10 #ifndef LIGHT_DEF
11 #define LIGHT_DEF
12 
13 #include <cstdint>
14 
15 namespace ST {
17  struct light {
18 
19  public:
20  //8 bytes
21  int32_t origin_x;
22  int32_t origin_y;
23 
24  //4 bytes
25  uint16_t radius;
26  uint16_t intensity;
27 
28  //2 bytes
29  uint16_t brightness;
30 
31  //2 bytes
32  bool is_static = false;
33  uint8_t padding_byte{};
34 
35  light(int32_t origin_x, int32_t origin_y, uint16_t radius, uint16_t intensity, uint16_t brightness);
36  };
37 
38  static_assert(sizeof(ST::light) == 16, "class 'light' is not sized properly, maybe you have misaligned the fields");
39 }
40 
41 #endif //LIGHT_DEF
Contains the data needed to represent a light source.
Definition: light.hpp:17
light(int32_t origin_x, int32_t origin_y, uint16_t radius, uint16_t intensity, uint16_t brightness)
Definition: light.cpp:20