diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-08-14 14:29:04 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-08-14 14:29:04 +0200 |
| commit | db8bc5f9e386c76531dfe679df022dd05d3dd27a (patch) | |
| tree | 03ddd1ab050c79fa56e51a1f7c3d4c15bd1685b6 /Source/Menu.c | |
| parent | f97f48ca7cefd3380edc9bdaaebf17c16c5c871b (diff) | |
| download | airport-db8bc5f9e386c76531dfe679df022dd05d3dd27a.tar.gz | |
+ Documentation about sound sources.
* Sine-like effect used for runways now moved to SystemCalculateSine().
* Bugfix: ptrPlayer->FlightDataPage is now decreased if there aren't enough active aircraft.
* On main menu, 2 players option is now disabled if pad 2 is disconnected.
* More work on FPS measurement (not working yet).
* Number of used SPU voices is now returned on SfxUploadSound().
Diffstat (limited to 'Source/Menu.c')
| -rw-r--r-- | Source/Menu.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/Source/Menu.c b/Source/Menu.c index a2350da..8d5141a 100644 --- a/Source/Menu.c +++ b/Source/Menu.c @@ -39,6 +39,7 @@ enum { MAIN_MENU_PLAY_OPTIONS_LEVEL_BUTTONS = 2, MAIN_MENU_ONE_TWO_PLAYERS_LEVEL_BUTTONS = 2, + MAIN_MENU_ONE_TWO_PLAYERS_LEVEL_BUTTONS_PAD_TWO_DISCONNECTED = 1, MAIN_MENU_OPTIONS_LEVEL_BUTTONS = 1 }; @@ -398,19 +399,33 @@ void MainMenuButtonHandler(void) break; case ONE_TWO_PLAYERS_LEVEL: - max_buttons = MAIN_MENU_ONE_TWO_PLAYERS_LEVEL_BUTTONS; + + if( (btn_selected == TWO_PLAYER_BUTTON_INDEX) + && + (PadTwoConnected() == false) ) + { + max_buttons = MAIN_MENU_ONE_TWO_PLAYERS_LEVEL_BUTTONS_PAD_TWO_DISCONNECTED; + } + else + { + max_buttons = MAIN_MENU_ONE_TWO_PLAYERS_LEVEL_BUTTONS; + } + if(PadOneKeySinglePress(PAD_TRIANGLE) == true) { menuLevel = PLAY_OPTIONS_LEVEL; MainMenuMinimumBtn = PLAY_BUTTON_INDEX; btn_selected = PLAY_BUTTON_INDEX; } + break; default: max_buttons = 0; break; } + + //DEBUG_PRINT_VAR(btn_selected); MainMenuBtn[previous_btn_selected].was_selected = MainMenuBtn[previous_btn_selected].selected; MainMenuBtn[btn_selected].was_selected = MainMenuBtn[btn_selected].selected; @@ -428,7 +443,7 @@ void MainMenuButtonHandler(void) { MainMenuBtn[btn_selected].selected = false; previous_btn_selected = btn_selected; - btn_selected++; + btn_selected++; SfxPlaySound(&BellSnd); } @@ -447,10 +462,11 @@ void MainMenuButtonHandler(void) { if(menuLevel == ONE_TWO_PLAYERS_LEVEL) { - MainMenuBtn[btn_selected].f(); - // Once gameplay has finished, turn back to first level - MainMenuRestoreInitValues(); - btn_selected = PLAY_BUTTON_INDEX; + // Start gameplay! + MainMenuBtn[btn_selected].f(); + // Once gameplay has finished, turn back to first level + MainMenuRestoreInitValues(); + btn_selected = PLAY_BUTTON_INDEX; } else { @@ -536,6 +552,15 @@ void MainMenuDrawButton(TYPE_MMBtn * btn) MenuSpr.y = MAIN_MENU_TWO_PLAYER_BUTTON_Y - MainMenuBtnAni[btn->timer]; MenuSpr.u += btn->offset_u; MenuSpr.v += btn->offset_v; + + // Exception: turn option dimmer if second player pad isn't connected + + if(PadTwoConnected() == false) + { + MenuSpr.r = NORMAL_LUMINANCE >> 1; + MenuSpr.g = NORMAL_LUMINANCE >> 1; + MenuSpr.b = NORMAL_LUMINANCE >> 1; + } GsSortSprite(&MenuSpr); break; |
