Browse Source

Update spriteeditor.c

Rudy Boudewijn van Etten 5 years ago
parent
commit
7d9a4c4d9a
1 changed files with 10 additions and 3 deletions
  1. 10 3
      SpriteEditor/spriteeditor.c

+ 10 - 3
SpriteEditor/spriteeditor.c

@@ -1911,7 +1911,7 @@ void loadspritelib(){
 
     
     // rebuild the sprite images..
-    for(int i=0;i<=80*4;i++){
+    for(int i=0;i<80*4;i++){
     bool empty=true;
     for(int y=0;y<spriteheight;y++){
     for(int x=0;x<spritewidth;x++){
@@ -1936,9 +1936,16 @@ void loadspritelib(){
     }
     }    
     }
+    //updatepreview();
+    //updatespritelib();
+    // First put the current selected into the map[]
+    //map[0][0]=1;
+    for(int y=0;y<spriteheight;y++){
+    for(int x=0;x<spritewidth;x++){
+        map[x][y] = spritelibmap[spritelibselected][x][y];
+    }}    
+    //updatespritelib();
     updatepreview();
-    updatespritelib();
-
 }
 
 void savespritelib(){