@@ -102,7 +102,7 @@ Image *getPreview(char *filename)
102102 if (!loadscreen ("data/bgs/title" , packfile , pal , PIXEL_x8 , & title )) return NULL ;
103103 if ((scaledown = allocscreen (width , height , title -> pixelformat )) == NULL ) return NULL ;
104104 if ((preview = createImage (width , height )) == NULL ) return NULL ;
105- scalescreen (scaledown , title );
105+ scalescreen (scaledown , title );
106106 //memcpy(scaledown->palette, title->palette, PAL_BYTES);
107107
108108 // Load Pallete for preview
@@ -114,14 +114,14 @@ Image *getPreview(char *filename)
114114 dp = (void * )preview -> data ;
115115 for (y = 0 ; y < height ; y ++ )
116116 {
117- for (x = 0 ; x < width ; x ++ ) dp [x ] = palette [((int )(sp [x ])) & 0xFF ];
117+ for (x = 0 ; x < width ; x ++ ) dp [x ] = palette [((int )(sp [x ])) & 0xFF ];
118118 sp += scaledown -> width ;
119119 dp += preview -> textureWidth ;
120120 }
121121
122122 // ScreenShots within Menu will be saved as "Menu"
123- strncpy (packfile ,"Menu.xxx" ,MAX_LABEL_LEN );
124-
123+ strncpy (packfile ,"Menu.xxx" ,MAX_LABEL_LEN );
124+
125125 // Free Images and Terminiate Filecaching
126126 freescreen (& title );
127127 freescreen (& scaledown );
@@ -230,37 +230,37 @@ void sortList()
230230 }
231231}
232232
233- static int findPaks (void )
234- {
235- int i = 0 ;
236- DIR * dp = NULL ;
237- struct dirent * ds ;
238- dp = opendir (dListPath );
239- if (dp != NULL )
240- {
241- while ((ds = readdir (dp )) != NULL )
242- {
243- if (packfile_supported (ds -> d_name ))
244- {
245- fileliststruct * copy = NULL ;
246- if (filelist == NULL ) filelist = malloc (sizeof (fileliststruct ));
247- else
248- {
249- copy = malloc (( i + 1 ) * sizeof (fileliststruct ));
250- memcpy (copy , filelist , ( i + 1 ) * sizeof (fileliststruct ));
251- free (filelist );
252- filelist = malloc ((i + 1 ) * sizeof (fileliststruct ));
253- memcpy (filelist , copy , ( i + 1 ) * sizeof (fileliststruct ));
254- free (copy ); copy = NULL ;
255- }
256- memset (& filelist [i ], 0 , sizeof (fileliststruct ));
257- strcpy (filelist [i ].filename , ds -> d_name );
258- i ++ ;
259- }
260- }
261- closedir (dp );
262- }
263- return i ;
233+ static int findPaks (void )
234+ {
235+ int i = 0 ;
236+ DIR * dp = NULL ;
237+ struct dirent * ds ;
238+ dp = opendir (dListPath );
239+ if (dp != NULL )
240+ {
241+ while ((ds = readdir (dp )) != NULL )
242+ {
243+ if (packfile_supported (ds -> d_name ))
244+ {
245+ fileliststruct * copy = NULL ;
246+ if (filelist == NULL ) filelist = malloc (sizeof (fileliststruct ));
247+ else
248+ {
249+ copy = malloc (i * sizeof (fileliststruct ));
250+ memcpy (copy , filelist , i * sizeof (fileliststruct ));
251+ free (filelist );
252+ filelist = malloc ((i + 1 ) * sizeof (fileliststruct ));
253+ memcpy (filelist , copy , i * sizeof (fileliststruct ));
254+ free (copy ); copy = NULL ;
255+ }
256+ memset (& filelist [i ], 0 , sizeof (fileliststruct ));
257+ strcpy (filelist [i ].filename , ds -> d_name );
258+ i ++ ;
259+ }
260+ }
261+ closedir (dp );
262+ }
263+ return i ;
264264}
265265
266266void drawMenu ()
@@ -787,12 +787,12 @@ void menu(char *path)
787787 ctrl = Control ();
788788 switch (ctrl )
789789 {
790- case 1 :
791- if (dListTotal > 0 ) done = 1 ;
792- break ;
793-
794- case 2 :
795- done = 1 ;
790+ case 1 :
791+ if (dListTotal > 0 ) done = 1 ;
792+ break ;
793+
794+ case 2 :
795+ done = 1 ;
796796 break ;
797797
798798 case -1 :
@@ -814,8 +814,8 @@ void menu(char *path)
814814 case -5 :
815815 drawLogs ();
816816 break ;
817-
818- default :
817+
818+ default :
819819 break ;
820820 }
821821 }
0 commit comments