-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTypes.h
More file actions
53 lines (40 loc) · 722 Bytes
/
Types.h
File metadata and controls
53 lines (40 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
/* Basic types */
using byte = unsigned char;
using word = unsigned short;
using u64 = unsigned long long;
using i64 = long long;
using u32 = unsigned int;
using i32 = int;
using u16 = unsigned short;
using i16 = short;
using r32 = float;
using r64 = double;
union Register
{
struct
{
byte low;
byte hi;
};
word value;
};
struct RGB
{
byte red;
byte green;
byte blue;
bool isEqual( RGB other ) const
{
return red == other.red && green == other.green && blue == other.blue;
}
};
namespace color
{
constexpr RGB PINK = { 0xFF, 0x00, 0x80 };
}
/* Operators */
constexpr u64 operator"" _KB( u64 size )
{
return size * 1024;
}