2020-01-02 02:41:43 +00:00
|
|
|
//
|
|
|
|
// File: foldhaus_assembly.h
|
|
|
|
// Author: Peter Slattery
|
|
|
|
// Creation Date: 2020-01-01
|
|
|
|
//
|
|
|
|
#ifndef FOLDHAUS_ASSEMBLY_H
|
|
|
|
|
2020-10-03 15:46:14 +00:00
|
|
|
enum network_protocol
|
|
|
|
{
|
|
|
|
NetworkProtocol_SACN,
|
|
|
|
NetworkProtocol_ArtNet,
|
|
|
|
NetworkProtocol_UART,
|
|
|
|
|
|
|
|
NetworkProtocol_Count,
|
|
|
|
};
|
|
|
|
|
2019-11-23 00:07:25 +00:00
|
|
|
union pixel
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
u8 R;
|
|
|
|
u8 G;
|
|
|
|
u8 B;
|
|
|
|
};
|
|
|
|
u8 Channels[3];
|
|
|
|
};
|
|
|
|
|
2020-06-15 22:36:50 +00:00
|
|
|
struct led_buffer
|
2019-11-23 07:33:48 +00:00
|
|
|
{
|
2020-06-15 22:36:50 +00:00
|
|
|
u32 LedCount;
|
|
|
|
pixel* Colors;
|
2020-06-20 01:53:23 +00:00
|
|
|
v4* Positions;
|
2019-11-23 07:33:48 +00:00
|
|
|
};
|
|
|
|
|
2020-06-15 22:36:50 +00:00
|
|
|
struct led_system
|
2020-03-08 21:44:28 +00:00
|
|
|
{
|
2020-07-18 19:00:14 +00:00
|
|
|
gs_allocator PlatformMemory;
|
2020-06-15 22:36:50 +00:00
|
|
|
|
|
|
|
u32 BuffersCountMax;
|
|
|
|
u32 BuffersCount;
|
|
|
|
led_buffer* Buffers;
|
|
|
|
|
|
|
|
u32 LedsCountTotal;
|
2020-03-08 21:44:28 +00:00
|
|
|
};
|
|
|
|
|
2020-06-10 03:33:51 +00:00
|
|
|
struct v2_tag
|
|
|
|
{
|
|
|
|
u64 NameHash;
|
|
|
|
u64 ValueHash;
|
|
|
|
};
|
|
|
|
|
2020-10-03 15:46:14 +00:00
|
|
|
struct strip_sacn_addr
|
|
|
|
{
|
|
|
|
s32 StartUniverse;
|
|
|
|
s32 StartChannel;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct strip_uart_addr
|
|
|
|
{
|
|
|
|
u8 Channel;
|
|
|
|
};
|
|
|
|
|
2020-06-10 03:33:51 +00:00
|
|
|
struct v2_strip
|
|
|
|
{
|
|
|
|
s32 ControlBoxID; // TODO(Peter): I don't think we need this anymore
|
2020-06-20 01:53:23 +00:00
|
|
|
|
2020-10-03 15:46:14 +00:00
|
|
|
strip_sacn_addr SACNAddr;
|
|
|
|
strip_uart_addr UARTAddr;
|
2020-06-10 03:33:51 +00:00
|
|
|
|
|
|
|
// TODO(Peter): When we create more ways to calculate points, this needs to become
|
|
|
|
// a type enum and a union
|
|
|
|
v3 StartPosition;
|
|
|
|
v3 EndPosition;
|
|
|
|
|
|
|
|
u32 LedCount;
|
|
|
|
u32* LedLUT;
|
|
|
|
|
|
|
|
u32 TagsCount;
|
|
|
|
v2_tag* Tags;
|
|
|
|
};
|
|
|
|
|
2020-09-07 04:10:36 +00:00
|
|
|
struct led_strip_list
|
|
|
|
{
|
|
|
|
u32 Count;
|
|
|
|
u32 CountMax;
|
|
|
|
u32* StripIndices;
|
|
|
|
};
|
|
|
|
|
2019-11-23 00:07:25 +00:00
|
|
|
struct assembly
|
|
|
|
{
|
2020-07-18 19:00:14 +00:00
|
|
|
gs_memory_arena Arena;
|
2019-11-23 00:07:25 +00:00
|
|
|
|
2020-07-18 19:00:14 +00:00
|
|
|
gs_string Name;
|
|
|
|
gs_string FilePath;
|
2019-11-23 00:07:25 +00:00
|
|
|
|
2020-06-10 03:33:51 +00:00
|
|
|
r32 Scale;
|
2020-09-07 18:12:58 +00:00
|
|
|
v3 Center;
|
2020-06-15 22:36:50 +00:00
|
|
|
s32 LedCountTotal;
|
|
|
|
u32 LedBufferIndex;
|
2020-03-08 21:44:28 +00:00
|
|
|
|
2020-06-10 03:33:51 +00:00
|
|
|
u32 StripCount;
|
|
|
|
v2_strip* Strips;
|
2020-10-03 15:46:14 +00:00
|
|
|
|
|
|
|
network_protocol OutputMode;
|
2020-10-05 20:17:33 +00:00
|
|
|
gs_const_string UARTComPort;
|
2019-11-23 00:07:25 +00:00
|
|
|
};
|
2020-01-02 02:41:43 +00:00
|
|
|
|
2020-06-15 22:36:50 +00:00
|
|
|
struct assembly_array
|
|
|
|
{
|
|
|
|
u32 CountMax;
|
|
|
|
u32 Count;
|
|
|
|
assembly* Values;
|
|
|
|
};
|
2020-01-02 02:41:43 +00:00
|
|
|
|
2020-10-01 22:30:24 +00:00
|
|
|
internal led_buffer* LedSystemGetBuffer(led_system* System, u32 Index);
|
|
|
|
|
2020-01-02 02:41:43 +00:00
|
|
|
#define FOLDHAUS_ASSEMBLY_H
|
|
|
|
#endif // FOLDHAUS_ASSEMBLY_H
|