Browse Source

Fixed bug in layerEditor (surprise....)

Max Nuding 12 years ago
parent
commit
cf2f82b106
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      Cube Control/layerEditFrame.java

+ 6
- 6
Cube Control/layerEditFrame.java View File

@@ -105,7 +105,7 @@ public class layerEditFrame extends JFrame {
105 105
   private void loadData(){
106 106
 
107 107
     for(int i = 0; i < 8; i++){
108
-      int div = frame[li + i];
108
+      int div = frame[(8*(li+1)+i)-8];
109 109
       int[] rest = new int[8];
110 110
       int ctr = 0;
111 111
       while(div != 0){
@@ -116,11 +116,11 @@ public class layerEditFrame extends JFrame {
116 116
 
117 117
       for(int j = 0; j < 8; j++){
118 118
         if(rest[j] == 0){
119
-         ledPanels[li + j][i].setIcon(off);
119
+         ledPanels[j][i].setIcon(off);
120 120
         } else {
121
-         ledPanels[li + j][i].setIcon(on);
121
+         ledPanels[j][i].setIcon(on);
122 122
         }
123
-        ledStatus[li + j][i] = (byte) rest[j];
123
+        ledStatus[j][i] = (byte) rest[j];
124 124
       }
125 125
 
126 126
     }
@@ -153,7 +153,7 @@ public class layerEditFrame extends JFrame {
153 153
 
154 154
   public void save(){
155 155
     int ctr = 0;
156
-    short[] tmpFrame = new short[64];
156
+    short[] tmpFrame = frame;
157 157
     changedStateSinceSave = false;
158 158
     short reihe = 0;
159 159
     for(int j = 0; j < 8; j++){
@@ -161,7 +161,7 @@ public class layerEditFrame extends JFrame {
161 161
         reihe += ((short) Math.pow(2, i)) * ledStatus[i][j];
162 162
         ctr++;
163 163
       }
164
-      tmpFrame[j] = reihe;
164
+      tmpFrame[(8*(li+1)+j)-8] = reihe;
165 165
       reihe = 0;
166 166
     }
167 167
       frame = tmpFrame;

Loading…
Cancel
Save