aboutsummaryrefslogtreecommitdiff
path: root/Source/LoadMenu.c
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2017-08-11 22:11:43 +0200
committerXaviDCR92 <xavi.dcr@gmail.com>2017-08-11 22:11:43 +0200
commitf97f48ca7cefd3380edc9bdaaebf17c16c5c871b (patch)
tree8fcc3e6cff095ba23ee8f18a9ce4d4c2521436b2 /Source/LoadMenu.c
parentf17b15bdffe45810eebc7695c10f1d7fc34af014 (diff)
* IMASK is now accessed as volatile variable.
* Other minor changes.
Diffstat (limited to 'Source/LoadMenu.c')
-rw-r--r--Source/LoadMenu.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/Source/LoadMenu.c b/Source/LoadMenu.c
index 0c9bbb1..eb7735f 100644
--- a/Source/LoadMenu.c
+++ b/Source/LoadMenu.c
@@ -456,13 +456,15 @@ void LoadMenuLoadFileList( char* fileList[], void* dest[],
for(fileLoadedCount = 0; fileLoadedCount < szFileList ; fileLoadedCount++)
{
- if(fileList[fileLoadedCount] == NULL)
+ DEBUG_PRINT_VAR(fileLoadedCount);
+
+ strCurrentFile = fileList[fileLoadedCount];
+
+ if(strCurrentFile == NULL)
{
continue;
}
- strCurrentFile = fileList[fileLoadedCount];
-
x_increment = (short)(LOADING_BAR_WIDTH / szFileList);
// Calculate new X position for loading menu plane sprite.
@@ -474,21 +476,21 @@ void LoadMenuLoadFileList( char* fileList[], void* dest[],
//Serial_printf("Files %d / %d loaded. New plane X = %d.\n",fileLoadedCount,szFileList,LoadMenuPlaneSpr.x);
// Backup original file path
- strncpy(aux_file_name,fileList[fileLoadedCount],100);
+ strncpy(aux_file_name, strCurrentFile, 100);
//We want to get file extension, so split into tokens
- strtok(fileList[fileLoadedCount],".;");
- extension = strtok(NULL,".;");
+ strtok(strCurrentFile, ".;");
+ extension = strtok(NULL, ".;");
- Serial_printf("File extension: .%s\n",extension);
+ Serial_printf("File extension: .%s\n", extension);
//Restore original file path in order to load file
- strncpy(fileList[fileLoadedCount],aux_file_name,100);
+ strncpy(strCurrentFile, aux_file_name, 100);
if(strncmp(extension,"TIM",3) == 0)
{
- if(GfxSpriteFromFile(fileList[fileLoadedCount], dest[fileLoadedCount]) == false)
+ if(GfxSpriteFromFile(strCurrentFile, dest[fileLoadedCount]) == false)
{
- Serial_printf("Could not load image file \"%s\"!\n",fileList[fileLoadedCount]);
+ Serial_printf("Could not load image file \"%s\"!\n", strCurrentFile);
}
}
else if(strncmp(extension,"CLT",3) == 0)
@@ -498,30 +500,30 @@ void LoadMenuLoadFileList( char* fileList[], void* dest[],
Serial_printf("WARNING: File %s linked to non-NULL destination pointer!\n", dest[fileLoadedCount]);
}
- if(GfxCLUTFromFile(fileList[fileLoadedCount]) == false)
+ if(GfxCLUTFromFile(strCurrentFile) == false)
{
- Serial_printf("Could not load CLUT file \"%s\"!\n",fileList[fileLoadedCount]);
+ Serial_printf("Could not load CLUT file \"%s\"!\n", strCurrentFile);
}
}
else if(strncmp(extension,"VAG",3) == 0)
{
- if(SfxUploadSound(fileList[fileLoadedCount], dest[fileLoadedCount]) == false)
+ if(SfxUploadSound(strCurrentFile, dest[fileLoadedCount]) == false)
{
- Serial_printf("Could not load sound file \"%s\"!\n",fileList[fileLoadedCount]);
+ Serial_printf("Could not load sound file \"%s\"!\n", strCurrentFile);
}
}
else if(strncmp(extension,"FNT",3) == 0)
{
- if(FontLoadImage(fileList[fileLoadedCount], dest[fileLoadedCount]) == false)
+ if(FontLoadImage(strCurrentFile, dest[fileLoadedCount]) == false)
{
- Serial_printf("Could not load font file \"%s\"!\n",fileList[fileLoadedCount]);
+ Serial_printf("Could not load font file \"%s\"!\n", strCurrentFile);
}
}
else if(strncmp(extension,"PLT",3) == 0)
{
- if(PltParserLoadFile(fileList[fileLoadedCount], dest[fileLoadedCount]) == false)
+ if(PltParserLoadFile(strCurrentFile, dest[fileLoadedCount]) == false)
{
- Serial_printf("Could not load pilots file \"%s\"!\n",fileList[fileLoadedCount]);
+ Serial_printf("Could not load pilots file \"%s\"!\n", strCurrentFile);
}
}
else