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

Loading…
Cancel
Save