From 659e80afda7f78bffabb9f935aa47f446994629d Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 17 Nov 2017 00:19:40 -0500 Subject: [PATCH] Update Frames and Warps lights to new API --- src/Frames.cpp | 15 +++++++-------- src/Warps.cpp | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/Frames.cpp b/src/Frames.cpp index 68e7ecd..fdb7f94 100644 --- a/src/Frames.cpp +++ b/src/Frames.cpp @@ -304,14 +304,13 @@ FramesWidget::FramesWidget() { addChild(createLight>(Vec(165, 101), module, Frames::GAIN1_LIGHT + 2)); addChild(createLight>(Vec(232, 101), module, Frames::GAIN1_LIGHT + 3)); addChild(createLight>(Vec(61, 155), module, Frames::EDIT_LIGHT)); - { - RedGreenBlueLight *framesLight = new RedGreenBlueLight(); - framesLight->box.pos = Vec(100, 126); - framesLight->box.size = Vec(71, 71); - framesLight->module = module; - framesLight->lightId = Frames::FRAME_LIGHT; - addChild(framesLight); - } + + struct FrameLight : RedGreenBlueLight { + FrameLight() { + box.size = Vec(71, 71); + } + }; + addChild(createLight(Vec(100, 126), module, Frames::FRAME_LIGHT)); } diff --git a/src/Warps.cpp b/src/Warps.cpp index 2f91dde..1c1b0ff 100644 --- a/src/Warps.cpp +++ b/src/Warps.cpp @@ -156,12 +156,11 @@ WarpsWidget::WarpsWidget() { addOutput(createOutput(Vec(116, 316), module, Warps::AUX_OUTPUT)); addChild(createLight>(Vec(20, 167), module, Warps::CARRIER_GREEN_LIGHT)); - { - RedGreenBlueLight *algorithmLight = new RedGreenBlueLight(); - algorithmLight->box.pos = Vec(40, 63); - algorithmLight->box.size = Vec(71, 71); - algorithmLight->module = module; - algorithmLight->lightId = Warps::ALGORITHM_LIGHT; - addChild(algorithmLight); - } + + struct AlgorithmLight : RedGreenBlueLight { + AlgorithmLight() { + box.size = Vec(71, 71); + } + }; + addChild(createLight(Vec(40, 63), module, Warps::ALGORITHM_LIGHT)); }