X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_PandaDriver.pde;h=6a4a3da021c760c15873fda6583fc155fa16b9b8;hb=9299ed7cf2cd9fb180f95d2cd22f63afa1863fe0;hp=7fd45c0acc8134d699e25a7293963c47e5129f4b;hpb=e73ef85d13e1f4787bbf2705d294791d268d95b1;p=SugarCubes.git diff --git a/_PandaDriver.pde b/_PandaDriver.pde index 7fd45c0..6a4a3da 100644 --- a/_PandaDriver.pde +++ b/_PandaDriver.pde @@ -23,7 +23,7 @@ public class PandaDriver { private final OscMessage message; // List of point indices on the board - private final List points; + private final int[] points; // Bit for flipped status of each point index private final boolean[] flipped; @@ -34,7 +34,12 @@ public class PandaDriver { public PandaDriver(NetAddress address, Model model, int[][] channelList, int[][] flippedList) { this.address = address; message = new OscMessage("/shady/pointbuffer"); - points = buildMappedList(model, channelList); + List pointList = buildMappedList(model, channelList); + points = new int[pointList.size()]; + int i = 0; + for (int value : pointList) { + points[i++] = value; + } flipped = buildFlippedList(model, flippedList); } @@ -70,12 +75,11 @@ public class PandaDriver { Cube cube = model.getCubeByRawIndex(cubeNumber); if (cube == null) { throw new RuntimeException("Non-existing cube specified in flipped RGB mapping (" + cubeNumber + ")"); - } else { - for (int i = 1; i < cubeInfo.length; ++i) { - int stripIndex = cubeInfo[i]; - for (Point p : cube.strips.get(stripIndex-1).points) { - flipped[p.index] = true; - } + } + for (int i = 1; i < cubeInfo.length; ++i) { + int stripIndex = cubeInfo[i]; + for (Point p : cube.strips.get(stripIndex-1).points) { + flipped[p.index] = true; } } }