Skip to content

Commit

Permalink
Fixed slot screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Jpe230 committed Jun 22, 2018
1 parent 3654272 commit 3df74fa
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,26 @@ void startSDLServices(){
SDL_LoadImage(renderer, &okbuttonp,"romfs:/okbutton_p.png" );
SDL_LoadImage(renderer, &check,"romfs:/check.png" );

for(int x = 0; x < 6; x++){
char nameFile_S[22];
snprintf(nameFile_S, sizeof nameFile_S, "save:/%d/caption.jpg", x);

if(file_exist (nameFile_S)){
SDL_LoadImage(renderer, &saveFileImg[x], nameFile_S);
}
else{
SDL_LoadImage(renderer, &saveFileImg[x], "romfs:/missingSlot.png");
if(mountSaveData() == 0){
currentState = -1;
errorScreen();
}
else{
for(int x = 0; x < 6; x++){
char nameFile_S[22];
snprintf(nameFile_S, sizeof nameFile_S, "save:/%d/caption.jpg", x);

if(file_exist (nameFile_S)){
SDL_LoadImage(renderer, &saveFileImg[x], nameFile_S);
}
else{
SDL_LoadImage(renderer, &saveFileImg[x], "romfs:/missingSlot.png");
}
}

selectSlotMenu(slot);
}

}

int file_exist (char *filename)
Expand All @@ -63,14 +72,7 @@ void initServices(){
currentState = 0;
currentItem = 0;
romfsInit();
if(mountSaveData() == 0){
currentState = -1;
errorScreen();
}
else{
startSDLServices();
}

startSDLServices();

}

Expand Down Expand Up @@ -483,9 +485,6 @@ int main(int argc, char **argv){
appletSetScreenShotPermission(1);
initServices();


selectSlotMenu(slot);

while(appletMainLoop())
{
hidScanInput();
Expand Down

0 comments on commit 3df74fa

Please sign in to comment.