Skip to content

Commit

Permalink
Fixing letter in picture mode and fixing launching games
Browse files Browse the repository at this point in the history
  • Loading branch information
bittboy committed Sep 29, 2019
1 parent ad72ce3 commit 449b2aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions simplemenu/src/logic/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@ void showPicture() {
}

void launchGame() {
char fileToBeExecutedwithFullPath[200];
char fileToBeExecutedwithFullPath[2000];
if (favoritesSectionSelected && favoritesSize > 0) {
struct Favorite favorite = findFavorite(CURRENT_GAME_NAME);
// strcpy(fileToBeExecutedwithFullPath,favorite.filesDirectory);
strcat(fileToBeExecutedwithFullPath,favorite.name);
executeCommand(favorite.emulatorFolder,favorite.executable,fileToBeExecutedwithFullPath);
// printf("./invoker.elf %s%s %s\n ",favorite.emulatorFolder, favorite.executable, CURRENT_GAME_NAME);
executeCommand(favorite.emulatorFolder,favorite.executable,CURRENT_GAME_NAME);
} else if (CURRENT_GAME_NAME!=NULL) {
// strcpy(fileToBeExecutedwithFullPath,CURRENT_SECTION.filesDirectory);
strcat(fileToBeExecutedwithFullPath,CURRENT_GAME_NAME);
executeCommand(CURRENT_SECTION.emulatorFolder, CURRENT_SECTION.executable,fileToBeExecutedwithFullPath);
// printf("./invoker.elf %s%s %s\n ",CURRENT_SECTION.emulatorFolder, CURRENT_SECTION.executable, CURRENT_GAME_NAME);
executeCommand(CURRENT_SECTION.emulatorFolder, CURRENT_SECTION.executable,CURRENT_GAME_NAME);
}
}

Expand Down
5 changes: 4 additions & 1 deletion simplemenu/src/logic/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ void showLetter() {
filling[0]=CURRENT_SECTION.headerAndFooterTextBackgroundColor.r;
filling[1]=CURRENT_SECTION.headerAndFooterTextBackgroundColor.g;
filling[2]=CURRENT_SECTION.headerAndFooterTextBackgroundColor.b;
SDL_Color textColor = CURRENT_SECTION.headerAndFooterTextForegroundColor;
if (pictureMode) {
filling[0] = 21;
filling[1] = 18;
filling[2] = 26;
borderColor[0]=255;
borderColor[1]=255;
borderColor[2]=255;
textColor.r=255;
textColor.g=255;
textColor.b=255;
}
drawRectangleOnScreen(calculateProportionalSizeOrDistance(width+10), calculateProportionalSizeOrDistance(width+10), SCREEN_WIDTH/2-width/2-5,SCREEN_HEIGHT/2-width/2-5, borderColor);
drawRectangleOnScreen(calculateProportionalSizeOrDistance(width), calculateProportionalSizeOrDistance(width), SCREEN_WIDTH/2-width/2,SCREEN_HEIGHT/2-width/2, filling);
Expand All @@ -42,7 +46,6 @@ void showLetter() {
if(isdigit(letter[0])) {
letter[0]='#';
}
SDL_Color textColor = CURRENT_SECTION.headerAndFooterTextForegroundColor;
drawCurrentLetter(letter, textColor);
free(currentGame);
}
Expand Down

0 comments on commit 449b2aa

Please sign in to comment.