Skip to content

Commit

Permalink
Better
Browse files Browse the repository at this point in the history
  • Loading branch information
bittboy committed Apr 26, 2021
1 parent 2493277 commit 13edf8f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions simplemenu/src/headers/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ struct SectionGroup {
};

struct MenuSection {
int counted;
char sectionName[250];
char fantasyName[250];
char *emulatorDirectories[10];
Expand Down
9 changes: 7 additions & 2 deletions simplemenu/src/logic/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ int advanceSection(int showLogo) {
if (currentSectionNumber==menuSectionCounter-1) {
currentSectionNumber=0;
}
CURRENT_SECTION.gameCount=theSectionHasGames(&CURRENT_SECTION);
if(!CURRENT_SECTION.counted&&!CURRENT_SECTION.initialized) {
CURRENT_SECTION.gameCount=theSectionHasGames(&CURRENT_SECTION);
}
if (tempCurrentSection==currentSectionNumber) {
returnValue = 0;
break;
Expand Down Expand Up @@ -145,7 +147,9 @@ int rewindSection(int showLogo) {
if (currentSectionNumber==-1) {
currentSectionNumber=menuSectionCounter-2;
}
CURRENT_SECTION.gameCount=theSectionHasGames(&CURRENT_SECTION);
if(!CURRENT_SECTION.counted&&!CURRENT_SECTION.initialized) {
CURRENT_SECTION.gameCount=theSectionHasGames(&CURRENT_SECTION);
}
if (tempCurrentSection==currentSectionNumber) {
returnValue = 0;
break;
Expand Down Expand Up @@ -611,6 +615,7 @@ void performGroupChoosingAction() {
currentSectionNumber=0;
for(int i=0;i<menuSectionCounter;i++) {
menuSections[i].initialized=0;
menuSections[i].counted=0;
menuSections[i].currentPage=0;
menuSections[i].realCurrentGameNumber=0;
menuSections[i].currentGameInPage=0;
Expand Down
6 changes: 3 additions & 3 deletions simplemenu/src/logic/control_od.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int performAction(struct Node *node) {
if(itsStoppedBecauseOfAnError&&!keys[BTN_A]) {
return(0);
}
if(keys[BTN_B]) {
if(keys[BTN_B]&&!(currentState==SELECTING_SECTION)) {
hotKeyPressed=1;
if (currentState==BROWSING_GAME_LIST) {
if (rom!=NULL&&keys[BTN_A]) {
Expand Down Expand Up @@ -175,7 +175,7 @@ int performAction(struct Node *node) {
}
}
}
if (keys[BTN_SELECT]&&!favoritesSectionSelected) {
if (keys[BTN_SELECT]&&!favoritesSectionSelected&&!(currentState==SELECTING_SECTION)) {
currentState=SELECTING_EMULATOR;
chosenChoosingOption=0;
launchAtBoot=isLaunchAtBoot(CURRENT_SECTION.currentGameNode->data->name);
Expand Down Expand Up @@ -211,7 +211,7 @@ int performAction(struct Node *node) {
return 0;
}

if (currentState!=SELECTING_EMULATOR&&!hotKeyPressed&&!isUSBMode) {
if (currentState!=SELECTING_EMULATOR&&!hotKeyPressed&&!isUSBMode&&!(currentState==SELECTING_SECTION)) {

if (rom!=NULL&&keys[BTN_X]) {
if(!isPicModeMenuHidden) {
Expand Down
1 change: 1 addition & 0 deletions simplemenu/src/logic/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ struct SectionGroup {
};

struct MenuSection {
int counted;
char sectionName[250];
char fantasyName[250];
char *emulatorDirectories[10];
Expand Down
2 changes: 1 addition & 1 deletion simplemenu/src/logic/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ void initializeDisplay() {
#ifdef TARGET_PC
// const SDL_VideoInfo* info = SDL_GetVideoInfo(); //<-- calls SDL_GetVideoInfo();
// SCREEN_HEIGHT = info->current_h;
SCREEN_HEIGHT = 240;
SCREEN_HEIGHT = 480;
SCREEN_WIDTH = (SCREEN_HEIGHT/3)*4;
SCREEN_RATIO = (double)SCREEN_WIDTH/SCREEN_HEIGHT;
screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
Expand Down
1 change: 1 addition & 0 deletions simplemenu/src/logic/logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ void executeCommandPC (char *executable, char *fileToBeExecutedWithFullPath) {
for (int i=0;i<dirCounter;i++){
free (dirs[i]);
}
section->counted=1;
return value;
}

Expand Down

0 comments on commit 13edf8f

Please sign in to comment.