From 15e0b96f0c307f0827fd42fbfd5b7438ed4dafa6 Mon Sep 17 00:00:00 2001 From: Peter Slattery Date: Wed, 5 Feb 2020 20:36:31 -0800 Subject: [PATCH] Removed old sacn view code --- src/foldhaus_sacn_view.cpp | 43 ---------------------------- src/panels/foldhaus_panel_dmx_view.h | 34 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 43 deletions(-) delete mode 100644 src/foldhaus_sacn_view.cpp diff --git a/src/foldhaus_sacn_view.cpp b/src/foldhaus_sacn_view.cpp deleted file mode 100644 index 97c0b40..0000000 --- a/src/foldhaus_sacn_view.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// -// File: foldhaus_sacn_view.cpp -// Author: Peter Slattery -// Creation Date: 2020-01-01 -// -#ifndef FOLDHAUS_SACN_VIEW_CPP - -internal void -DrawSACNUniversePixels (render_command_buffer* RenderBuffer, sacn_universe* ToDraw, - v2 TopLeft, v2 Dimension) -{ - Assert(ToDraw); - - s32 PixelsPerRow = 21; - r32 PixelDim = Dimension.x / PixelsPerRow; - v2 PixelSize = v2{PixelDim, PixelDim}; - - v2 PixelRegister = TopLeft; - v4 DisplayColor = {0, 0, 0, 1}; - - s32 PixelsToDraw = ToDraw->SizeInSendBuffer - STREAM_HEADER_SIZE; - render_quad_batch_constructor BatchConstructor = PushRenderQuad2DBatch(RenderBuffer, PixelsToDraw); - - u8* ColorCursor = (u8*)ToDraw->StartPositionInSendBuffer + STREAM_HEADER_SIZE; - s32 PixelsDrawn = 0; - for (s32 i = 0; i < PixelsToDraw; i++) - { - PixelRegister.x = TopLeft.x + (PixelsDrawn % PixelsPerRow) * PixelDim; - PixelRegister.y = TopLeft.y - (PixelsDrawn / PixelsPerRow) * PixelDim; - - r32 Value = *ColorCursor++ / 255.f; - DisplayColor.r = Value; - DisplayColor.g = Value; - DisplayColor.b = Value; - - PushQuad2DOnBatch(&BatchConstructor, PixelRegister, PixelRegister + PixelSize, DisplayColor); - - ++PixelsDrawn; - } -} - -#define FOLDHAUS_SACN_VIEW_CPP -#endif // FOLDHAUS_SACN_VIEW_CPP \ No newline at end of file diff --git a/src/panels/foldhaus_panel_dmx_view.h b/src/panels/foldhaus_panel_dmx_view.h index 00f5965..e8f3caf 100644 --- a/src/panels/foldhaus_panel_dmx_view.h +++ b/src/panels/foldhaus_panel_dmx_view.h @@ -26,6 +26,40 @@ DMXView_Cleanup(panel* Panel, app_state* State) } +internal void +DrawSACNUniversePixels (render_command_buffer* RenderBuffer, sacn_universe* ToDraw, + v2 TopLeft, v2 Dimension) +{ + Assert(ToDraw); + + s32 PixelsPerRow = 21; + r32 PixelDim = Dimension.x / PixelsPerRow; + v2 PixelSize = v2{PixelDim, PixelDim}; + + v2 PixelRegister = TopLeft; + v4 DisplayColor = {0, 0, 0, 1}; + + s32 PixelsToDraw = ToDraw->SizeInSendBuffer - STREAM_HEADER_SIZE; + render_quad_batch_constructor BatchConstructor = PushRenderQuad2DBatch(RenderBuffer, PixelsToDraw); + + u8* ColorCursor = (u8*)ToDraw->StartPositionInSendBuffer + STREAM_HEADER_SIZE; + s32 PixelsDrawn = 0; + for (s32 i = 0; i < PixelsToDraw; i++) + { + PixelRegister.x = TopLeft.x + (PixelsDrawn % PixelsPerRow) * PixelDim; + PixelRegister.y = TopLeft.y - (PixelsDrawn / PixelsPerRow) * PixelDim; + + r32 Value = *ColorCursor++ / 255.f; + DisplayColor.r = Value; + DisplayColor.g = Value; + DisplayColor.b = Value; + + PushQuad2DOnBatch(&BatchConstructor, PixelRegister, PixelRegister + PixelSize, DisplayColor); + + ++PixelsDrawn; + } +} + GSMetaTag(panel_render); internal void DMXView_Render(panel Panel, rect PanelBounds, render_command_buffer* RenderBuffer, app_state* State, context Context, mouse_state Mouse)