Fine control on menu sounds (bug #449)
Smoothed out various warts in the interfaces that had to do with the global sound resource going NULL on occasion. Added sounds for page up/down where appropriate. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1294 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
Changes towards version 0.4:
|
Changes towards version 0.4:
|
||||||
|
- Fine-grained control of menu sounds, "MenuSounds" global now
|
||||||
|
guaranteed to always be non-null -Michael
|
||||||
- Added support for stdio file access through temporary files to uio.
|
- Added support for stdio file access through temporary files to uio.
|
||||||
added uio_copyFile to uio - SvdB
|
added uio_copyFile to uio - SvdB
|
||||||
- Added uio_getFileLocation() and uio_getMountFileSystemType() to uio.
|
- Added uio_getFileLocation() and uio_getMountFileSystemType() to uio.
|
||||||
|
|||||||
@@ -1557,6 +1557,8 @@ AlienTalkSegue (COUNT wait_track)
|
|||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
DoCommunication (PENCOUNTER_STATE pES)
|
DoCommunication (PENCOUNTER_STATE pES)
|
||||||
{
|
{
|
||||||
|
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (!(CommData.AlienTransitionDesc.AnimFlags & (TALK_INTRO | TALK_DONE)))
|
if (!(CommData.AlienTransitionDesc.AnimFlags & (TALK_INTRO | TALK_DONE)))
|
||||||
{
|
{
|
||||||
AlienTalkSegue ((COUNT)~0);
|
AlienTalkSegue ((COUNT)~0);
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ DoConfirmExit (void)
|
|||||||
if (CurrentMenuState.select)
|
if (CurrentMenuState.select)
|
||||||
{
|
{
|
||||||
done = TRUE;
|
done = TRUE;
|
||||||
|
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 1),
|
||||||
|
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||||
}
|
}
|
||||||
else if (CurrentMenuState.cancel)
|
else if (CurrentMenuState.cancel)
|
||||||
{
|
{
|
||||||
@@ -160,6 +162,9 @@ DoConfirmExit (void)
|
|||||||
{
|
{
|
||||||
response = !response;
|
response = !response;
|
||||||
DrawConfirmationWindow (response);
|
DrawConfirmationWindow (response);
|
||||||
|
PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 0),
|
||||||
|
0, NotPositional (), NULL, GAME_SOUND_PRIORITY);
|
||||||
|
|
||||||
}
|
}
|
||||||
TaskSwitch ();
|
TaskSwitch ();
|
||||||
} while (!done);
|
} while (!done);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
DoSelectAction (PMENU_STATE pMS)
|
DoSelectAction (PMENU_STATE pMS)
|
||||||
{
|
{
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
{
|
{
|
||||||
pMS->CurState = ATTACK + 1;
|
pMS->CurState = ATTACK + 1;
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ static DWORD _max_accel, _min_accel, _step_accel;
|
|||||||
static BOOLEAN _gestalt_keys;
|
static BOOLEAN _gestalt_keys;
|
||||||
int ExitState;
|
int ExitState;
|
||||||
|
|
||||||
|
static MENU_SOUND_FLAGS sound_0, sound_1;
|
||||||
|
|
||||||
volatile CONTROLLER_INPUT_STATE ImmediateInputState;
|
volatile CONTROLLER_INPUT_STATE ImmediateInputState;
|
||||||
volatile MENU_INPUT_STATE ImmediateMenuState;
|
volatile MENU_INPUT_STATE ImmediateMenuState;
|
||||||
|
|
||||||
@@ -269,6 +271,7 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
|||||||
}
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
MENU_SOUND_FLAGS input;
|
||||||
TaskSwitch ();
|
TaskSwitch ();
|
||||||
|
|
||||||
UpdateInputState ();
|
UpdateInputState ();
|
||||||
@@ -284,17 +287,25 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
|||||||
|
|
||||||
if (CurrentInputState.exit)
|
if (CurrentInputState.exit)
|
||||||
ExitState = ConfirmExit ();
|
ExitState = ConfirmExit ();
|
||||||
|
|
||||||
|
input = MENU_SOUND_NONE;
|
||||||
|
if (CurrentMenuState.up) input |= MENU_SOUND_UP;
|
||||||
|
if (CurrentMenuState.down) input |= MENU_SOUND_DOWN;
|
||||||
|
if (CurrentMenuState.left) input |= MENU_SOUND_LEFT;
|
||||||
|
if (CurrentMenuState.right) input |= MENU_SOUND_RIGHT;
|
||||||
|
if (CurrentMenuState.select) input |= MENU_SOUND_SELECT;
|
||||||
|
if (CurrentMenuState.cancel) input |= MENU_SOUND_CANCEL;
|
||||||
|
if (CurrentMenuState.special) input |= MENU_SOUND_SPECIAL;
|
||||||
|
if (CurrentMenuState.page_up) input |= MENU_SOUND_PAGEUP;
|
||||||
|
if (CurrentMenuState.page_down) input |= MENU_SOUND_PAGEDOWN;
|
||||||
|
if (CurrentMenuState.del) input |= MENU_SOUND_DELETE;
|
||||||
|
|
||||||
if (MenuSounds
|
if (MenuSounds
|
||||||
&& (pSolarSysState == 0
|
&& (pSolarSysState == 0
|
||||||
/* see if in menu */
|
/* see if in menu */
|
||||||
|| pSolarSysState->MenuState.CurState
|
|| pSolarSysState->MenuState.CurState
|
||||||
|| pSolarSysState->MenuState.Initialized > 2)
|
|| pSolarSysState->MenuState.Initialized > 2)
|
||||||
&& (CurrentMenuState.select
|
&& (input & (sound_0 | sound_1))
|
||||||
|| CurrentMenuState.up
|
|
||||||
|| CurrentMenuState.down
|
|
||||||
|| CurrentMenuState.left
|
|
||||||
|| CurrentMenuState.right)
|
|
||||||
#ifdef NEVER
|
#ifdef NEVER
|
||||||
&& !PLRPlaying ((MUSIC_REF)~0)
|
&& !PLRPlaying ((MUSIC_REF)~0)
|
||||||
#endif /* NEVER */
|
#endif /* NEVER */
|
||||||
@@ -303,7 +314,7 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
|||||||
SOUND S;
|
SOUND S;
|
||||||
|
|
||||||
S = MenuSounds;
|
S = MenuSounds;
|
||||||
if (CurrentMenuState.select)
|
if (input & sound_1)
|
||||||
S = SetAbsSoundIndex (S, 1);
|
S = SetAbsSoundIndex (S, 1);
|
||||||
|
|
||||||
PlaySoundEffect (S, 0, NotPositional (), NULL, 0);
|
PlaySoundEffect (S, 0, NotPositional (), NULL, 0);
|
||||||
@@ -317,6 +328,21 @@ DoInput (PVOID pInputState, BOOLEAN resetInput)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetMenuSounds (MENU_SOUND_FLAGS s0, MENU_SOUND_FLAGS s1)
|
||||||
|
{
|
||||||
|
sound_0 = s0;
|
||||||
|
sound_1 = s1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
GetMenuSounds (MENU_SOUND_FLAGS *s0, MENU_SOUND_FLAGS *s1)
|
||||||
|
{
|
||||||
|
*s0 = sound_0;
|
||||||
|
*s1 = sound_1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BATTLE_INPUT_STATE
|
BATTLE_INPUT_STATE
|
||||||
p1_combat_summary (void)
|
p1_combat_summary (void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -444,6 +444,8 @@ DoNaming (PMENU_STATE pMS)
|
|||||||
DoInput (pMS, TRUE);
|
DoInput (pMS, TRUE);
|
||||||
DisableCharacterMode ();
|
DisableCharacterMode ();
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
pMS->InputFunc = DoSettings;
|
pMS->InputFunc = DoSettings;
|
||||||
pMS->CurState = (BYTE)pMS->delta_item;
|
pMS->CurState = (BYTE)pMS->delta_item;
|
||||||
pMS->delta_item = 0;
|
pMS->delta_item = 0;
|
||||||
@@ -502,6 +504,7 @@ DoSettings (PMENU_STATE pMS)
|
|||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
cur_speed = (BYTE)(GLOBAL (glob_flags) & COMBAT_SPEED_MASK) >> COMBAT_SPEED_SHIFT;
|
cur_speed = (BYTE)(GLOBAL (glob_flags) & COMBAT_SPEED_MASK) >> COMBAT_SPEED_SHIFT;
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
DrawMenuStateStrings (PM_SOUND_ON, pMS->CurState);
|
DrawMenuStateStrings (PM_SOUND_ON, pMS->CurState);
|
||||||
@@ -571,6 +574,8 @@ DoQuitMenu (PMENU_STATE pMS)
|
|||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
DrawMenuStateStrings (PM_NO_QUIT, pMS->CurState);
|
DrawMenuStateStrings (PM_NO_QUIT, pMS->CurState);
|
||||||
@@ -984,6 +989,7 @@ DoPickGame (PMENU_STATE pMS)
|
|||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
first_time = (BOOLEAN)(pMS->Initialized == 0);
|
first_time = (BOOLEAN)(pMS->Initialized == 0);
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS | MENU_SOUND_PAGEUP | MENU_SOUND_PAGEDOWN, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
@@ -1288,8 +1294,7 @@ PickGame (PMENU_STATE pMS)
|
|||||||
pMS->CurString = (STRING)&desc_array[0];
|
pMS->CurString = (STRING)&desc_array[0];
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
DoInput (pMS, TRUE);
|
DoInput (pMS, TRUE);
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
pMS->Initialized = -1;
|
pMS->Initialized = -1;
|
||||||
pMS->InputFunc = DoGameOptions;
|
pMS->InputFunc = DoGameOptions;
|
||||||
@@ -1357,6 +1362,8 @@ DoGameOptions (PMENU_STATE pMS)
|
|||||||
if (LastActivity == CHECK_LOAD)
|
if (LastActivity == CHECK_LOAD)
|
||||||
force_select = TRUE;
|
force_select = TRUE;
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (pMS->Initialized <= 0)
|
if (pMS->Initialized <= 0)
|
||||||
{
|
{
|
||||||
if (LastActivity == CHECK_LOAD)
|
if (LastActivity == CHECK_LOAD)
|
||||||
@@ -1410,6 +1417,7 @@ GameOptions (void)
|
|||||||
|
|
||||||
MenuState.InputFunc = DoGameOptions;
|
MenuState.InputFunc = DoGameOptions;
|
||||||
MenuState.CurState = SAVE_GAME;
|
MenuState.CurState = SAVE_GAME;
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)&MenuState, TRUE);
|
DoInput ((PVOID)&MenuState, TRUE);
|
||||||
|
|
||||||
pLocMenuState = 0;
|
pLocMenuState = 0;
|
||||||
|
|||||||
@@ -1614,6 +1614,7 @@ UnbatchGraphics ();
|
|||||||
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)&MenuState, TRUE);
|
DoInput ((PVOID)&MenuState, TRUE);
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|||||||
@@ -445,6 +445,7 @@ TFB_VideoInput (VIDEO_REF VidRef)
|
|||||||
vis.InputFunc = TFB_DoVideoInput;
|
vis.InputFunc = TFB_DoVideoInput;
|
||||||
vis.CurVideo = VidRef;
|
vis.CurVideo = VidRef;
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
DoInput (&vis, TRUE);
|
DoInput (&vis, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -844,6 +844,8 @@ DoLoadTeam (PMELEE_STATE pMS)
|
|||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN | MENU_SOUND_PAGEUP | MENU_SOUND_PAGEDOWN, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
@@ -1164,6 +1166,7 @@ DoEdit (PMELEE_STATE pMS)
|
|||||||
{
|
{
|
||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT | MENU_SOUND_DELETE);
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
pMS->CurIndex = pMS->TeamImage[pMS->side].ShipList[pMS->row][pMS->col];
|
pMS->CurIndex = pMS->TeamImage[pMS->side].ShipList[pMS->row][pMS->col];
|
||||||
@@ -1308,6 +1311,8 @@ DoPickShip (PMELEE_STATE pMS)
|
|||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (pMS->Initialized <= 0)
|
if (pMS->Initialized <= 0)
|
||||||
{
|
{
|
||||||
if (pMS->CurIndex == (BYTE)~0 && pMS->Initialized == 0)
|
if (pMS->CurIndex == (BYTE)~0 && pMS->Initialized == 0)
|
||||||
@@ -1585,6 +1590,7 @@ DoMelee (PMELEE_STATE pMS)
|
|||||||
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
pMS->Initialized = TRUE;
|
pMS->Initialized = TRUE;
|
||||||
@@ -2049,6 +2055,7 @@ Melee (void)
|
|||||||
MenuState.side = 0;
|
MenuState.side = 0;
|
||||||
MenuState.star_bucks[0] = GetTeamValue (&MenuState.TeamImage[0]);
|
MenuState.star_bucks[0] = GetTeamValue (&MenuState.TeamImage[0]);
|
||||||
MenuState.star_bucks[1] = GetTeamValue (&MenuState.TeamImage[1]);
|
MenuState.star_bucks[1] = GetTeamValue (&MenuState.TeamImage[1]);
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)&MenuState, TRUE);
|
DoInput ((PVOID)&MenuState, TRUE);
|
||||||
|
|
||||||
WaitForSoundEnd (TFBSOUND_WAIT_ALL);
|
WaitForSoundEnd (TFBSOUND_WAIT_ALL);
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ DoInstallModule (PMENU_STATE pMS)
|
|||||||
cancel = CurrentMenuState.cancel;
|
cancel = CurrentMenuState.cancel;
|
||||||
motion = CurrentMenuState.left || CurrentMenuState.right || CurrentMenuState.up || CurrentMenuState.down;
|
motion = CurrentMenuState.left || CurrentMenuState.right || CurrentMenuState.up || CurrentMenuState.down;
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
FirstItem = 0;
|
FirstItem = 0;
|
||||||
switch (NewState = pMS->CurState)
|
switch (NewState = pMS->CurState)
|
||||||
{
|
{
|
||||||
@@ -754,6 +756,16 @@ ExitOutfit:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
switch (pMS->CurState)
|
||||||
|
{
|
||||||
|
case OUTFIT_DOFUEL:
|
||||||
|
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (pMS->CurState == OUTFIT_DOFUEL)
|
if (pMS->CurState == OUTFIT_DOFUEL)
|
||||||
ChangeFuelQuantity ();
|
ChangeFuelQuantity ();
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ OldContext = SetContext (SpaceContext);
|
|||||||
|
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
pMenuState = &MenuState;
|
pMenuState = &MenuState;
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)&MenuState, TRUE);
|
DoInput ((PVOID)&MenuState, TRUE);
|
||||||
pMenuState = 0;
|
pMenuState = 0;
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|||||||
@@ -358,6 +358,7 @@ Cargo (PMENU_STATE pMS)
|
|||||||
DrawStatusMessage ((UNICODE *)~0);
|
DrawStatusMessage ((UNICODE *)~0);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)pMS, TRUE);
|
DoInput ((PVOID)pMS, TRUE);
|
||||||
|
|
||||||
pMS->InputFunc = DoFlagshipCommands;
|
pMS->InputFunc = DoFlagshipCommands;
|
||||||
|
|||||||
@@ -625,6 +625,7 @@ Devices (PMENU_STATE pMS)
|
|||||||
pMS->CurFrame = (FRAME)DeviceMap;
|
pMS->CurFrame = (FRAME)DeviceMap;
|
||||||
TFB_ResetControls ();
|
TFB_ResetControls ();
|
||||||
DoManipulateDevices (pMS); /* to make sure it's initialized */
|
DoManipulateDevices (pMS); /* to make sure it's initialized */
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)pMS, TRUE);
|
DoInput ((PVOID)pMS, TRUE);
|
||||||
pMS->CurFrame = 0;
|
pMS->CurFrame = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ GenerateAndrosynth (BYTE control)
|
|||||||
|
|
||||||
pPSD = (PPLANETSIDE_DESC)pMenuState->ModuleFrame;
|
pPSD = (PPLANETSIDE_DESC)pMenuState->ModuleFrame;
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
DoDiscoveryReport (pPSD->OldMenuSounds);
|
DoDiscoveryReport (MenuSounds);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString =
|
pSolarSysState->SysInfo.PlanetInfo.DiscoveryString =
|
||||||
SetRelStringTableIndex (
|
SetRelStringTableIndex (
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ GenerateVUX (BYTE control)
|
|||||||
|
|
||||||
pPSD = (PPLANETSIDE_DESC)pMenuState->ModuleFrame;
|
pPSD = (PPLANETSIDE_DESC)pMenuState->ModuleFrame;
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
DoDiscoveryReport (pPSD->OldMenuSounds);
|
DoDiscoveryReport (MenuSounds);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
pPSD->InTransit = TRUE;
|
pPSD->InTransit = TRUE;
|
||||||
|
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ CheckObjectCollision (COUNT index)
|
|||||||
&& CurStarDescPtr->Index != ANDROSYNTH_DEFINED)
|
&& CurStarDescPtr->Index != ANDROSYNTH_DEFINED)
|
||||||
{
|
{
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
DoDiscoveryReport (pPSD->OldMenuSounds);
|
DoDiscoveryReport (MenuSounds);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
}
|
}
|
||||||
if (ElementPtr->mass_points == 0)
|
if (ElementPtr->mass_points == 0)
|
||||||
@@ -1890,8 +1890,6 @@ PlanetSide (PMENU_STATE pMS)
|
|||||||
|
|
||||||
memset ((PPLANETSIDE_DESC)&PSD, 0, sizeof (PSD));
|
memset ((PPLANETSIDE_DESC)&PSD, 0, sizeof (PSD));
|
||||||
PSD.InTransit = TRUE;
|
PSD.InTransit = TRUE;
|
||||||
PSD.OldMenuSounds = MenuSounds;
|
|
||||||
MenuSounds = 0;
|
|
||||||
|
|
||||||
PSD.TectonicsChance =
|
PSD.TectonicsChance =
|
||||||
TectonicsChanceTab[pSolarSysState->SysInfo.PlanetInfo.Tectonics];
|
TectonicsChanceTab[pSolarSysState->SysInfo.PlanetInfo.Tectonics];
|
||||||
@@ -1973,6 +1971,7 @@ PlanetSide (PMENU_STATE pMS)
|
|||||||
|
|
||||||
pMS->Initialized = FALSE;
|
pMS->Initialized = FALSE;
|
||||||
pMS->InputFunc = DoPlanetSide;
|
pMS->InputFunc = DoPlanetSide;
|
||||||
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
DoInput ((PVOID)pMS, FALSE);
|
DoInput ((PVOID)pMS, FALSE);
|
||||||
|
|
||||||
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
if (!(GLOBAL (CurrentActivity) & CHECK_ABORT))
|
||||||
@@ -2079,7 +2078,7 @@ PlanetSide (PMENU_STATE pMS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ZeroVelocityComponents (&GLOBAL (velocity));
|
ZeroVelocityComponents (&GLOBAL (velocity));
|
||||||
MenuSounds = PSD.OldMenuSounds;
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
pSolarSysState->MenuState.Initialized -= 4;
|
pSolarSysState->MenuState.Initialized -= 4;
|
||||||
pSolarSysState->PauseRotate = 0;
|
pSolarSysState->PauseRotate = 0;
|
||||||
|
|||||||
@@ -1078,7 +1078,6 @@ DoneSphereGrowth:
|
|||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
DoStarMap (void)
|
DoStarMap (void)
|
||||||
{
|
{
|
||||||
SOUND OldMenuSounds;
|
|
||||||
MENU_STATE MenuState;
|
MENU_STATE MenuState;
|
||||||
POINT universe;
|
POINT universe;
|
||||||
//FRAME OldFrame;
|
//FRAME OldFrame;
|
||||||
@@ -1134,11 +1133,9 @@ DoStarMap (void)
|
|||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
OldMenuSounds = MenuSounds;
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
MenuSounds = 0;
|
|
||||||
|
|
||||||
DoInput ((PVOID)&MenuState, FALSE);
|
DoInput ((PVOID)&MenuState, FALSE);
|
||||||
MenuSounds = OldMenuSounds;
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
pMenuState = 0;
|
pMenuState = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -225,6 +225,15 @@ DoModifyRoster (PMENU_STATE pMS)
|
|||||||
down = CurrentMenuState.down;
|
down = CurrentMenuState.down;
|
||||||
horiz = CurrentMenuState.left || CurrentMenuState.right;
|
horiz = CurrentMenuState.left || CurrentMenuState.right;
|
||||||
|
|
||||||
|
if (pMS->Initialized && (pMS->CurState & SHIP_TOGGLE))
|
||||||
|
{
|
||||||
|
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
}
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
pMS->InputFunc = DoModifyRoster;
|
pMS->InputFunc = DoModifyRoster;
|
||||||
@@ -436,6 +445,7 @@ Roster (void)
|
|||||||
|
|
||||||
MenuState.flash_frame0 = (FRAME)ship_pos;
|
MenuState.flash_frame0 = (FRAME)ship_pos;
|
||||||
MenuState.flash_frame1 = (FRAME)modified_ship_pos;
|
MenuState.flash_frame1 = (FRAME)modified_ship_pos;
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)&MenuState, TRUE);
|
DoInput ((PVOID)&MenuState, TRUE);
|
||||||
|
|
||||||
pMenuState = pOldMenuState;
|
pMenuState = pOldMenuState;
|
||||||
|
|||||||
@@ -669,11 +669,7 @@ PickPlanetSide (PMENU_STATE pMS)
|
|||||||
{
|
{
|
||||||
pMS->InputFunc = PickPlanetSide;
|
pMS->InputFunc = PickPlanetSide;
|
||||||
SetMenuRepeatDelay (0, 0, 0, FALSE);
|
SetMenuRepeatDelay (0, 0, 0, FALSE);
|
||||||
if (pMS->CurFrame == 0)
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
{
|
|
||||||
pMS->CurFrame = (FRAME)MenuSounds;
|
|
||||||
MenuSounds = 0;
|
|
||||||
}
|
|
||||||
if (!select)
|
if (!select)
|
||||||
{
|
{
|
||||||
RECT r;
|
RECT r;
|
||||||
@@ -706,8 +702,7 @@ PickPlanetSide (PMENU_STATE pMS)
|
|||||||
{
|
{
|
||||||
STAMP s;
|
STAMP s;
|
||||||
|
|
||||||
MenuSounds = (SOUND)pMS->CurFrame;
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
pMS->CurFrame = 0;
|
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
DrawStatusMessage (NULL_PTR);
|
DrawStatusMessage (NULL_PTR);
|
||||||
@@ -801,15 +796,12 @@ PickPlanetSide (PMENU_STATE pMS)
|
|||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
|
|
||||||
ExitPlanetSide:
|
ExitPlanetSide:
|
||||||
if (pMS->CurFrame)
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
{
|
|
||||||
MenuSounds = (SOUND)pMS->CurFrame;
|
|
||||||
pMS->CurFrame = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
pMS->InputFunc = DoScan;
|
pMS->InputFunc = DoScan;
|
||||||
pMS->CurState = DISPATCH_SHUTTLE;
|
pMS->CurState = DISPATCH_SHUTTLE;
|
||||||
SetDefaultMenuRepeatDelay ();
|
SetDefaultMenuRepeatDelay ();
|
||||||
|
return (FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1019,7 +1011,7 @@ DoScan (PMENU_STATE pMS)
|
|||||||
|
|
||||||
pMS->Initialized = FALSE;
|
pMS->Initialized = FALSE;
|
||||||
pMS->CurFrame = 0;
|
pMS->CurFrame = 0;
|
||||||
return (PickPlanetSide (pMS));
|
return PickPlanetSide (pMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
pSolarSysState->MenuState.Initialized += 4;
|
pSolarSysState->MenuState.Initialized += 4;
|
||||||
@@ -1235,6 +1227,7 @@ ScanSystem (void)
|
|||||||
PrintCoarseScan3DO ();
|
PrintCoarseScan3DO ();
|
||||||
|
|
||||||
pMenuState = &MenuState;
|
pMenuState = &MenuState;
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)&MenuState, FALSE);
|
DoInput ((PVOID)&MenuState, FALSE);
|
||||||
pMenuState = 0;
|
pMenuState = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1926,6 +1926,7 @@ ExploreSolarSys (void)
|
|||||||
SolarSysState.GenFunc = GenerateIP (CurStarDescPtr->Index);
|
SolarSysState.GenFunc = GenerateIP (CurStarDescPtr->Index);
|
||||||
|
|
||||||
InitSolarSys ();
|
InitSolarSys ();
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)&SolarSysState.MenuState, FALSE);
|
DoInput ((PVOID)&SolarSysState.MenuState, FALSE);
|
||||||
UninitSolarSys ();
|
UninitSolarSys ();
|
||||||
pSolarSysState = 0;
|
pSolarSysState = 0;
|
||||||
|
|||||||
@@ -289,6 +289,7 @@ LastActivity = WON_LAST_BATTLE;
|
|||||||
|
|
||||||
FlushInput ();
|
FlushInput ();
|
||||||
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
|
||||||
|
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)&MenuState, TRUE);
|
DoInput ((PVOID)&MenuState, TRUE);
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|||||||
@@ -643,6 +643,11 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
SBYTE dx = 0, dy = 0;
|
SBYTE dx = 0, dy = 0;
|
||||||
BYTE NewState;
|
BYTE NewState;
|
||||||
|
|
||||||
|
if (!(pMS->delta_item & MODIFY_CREW_FLAG))
|
||||||
|
{
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
}
|
||||||
|
|
||||||
if (CurrentMenuState.right) dx = 1;
|
if (CurrentMenuState.right) dx = 1;
|
||||||
if (CurrentMenuState.left) dx = -1;
|
if (CurrentMenuState.left) dx = -1;
|
||||||
if (CurrentMenuState.up) dy = -1;
|
if (CurrentMenuState.up) dy = -1;
|
||||||
@@ -709,7 +714,15 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
&GLOBAL (built_ship_q), hStarShip
|
&GLOBAL (built_ship_q), hStarShip
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if ((pMS->delta_item & MODIFY_CREW_FLAG) && (hStarShip))
|
||||||
|
{
|
||||||
|
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT | MENU_SOUND_CANCEL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
}
|
||||||
|
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
|
|
||||||
#ifdef WANT_SHIP_SPINS
|
#ifdef WANT_SHIP_SPINS
|
||||||
@@ -759,6 +772,7 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
|
DrawMenuStateStrings (PM_CREW, SHIPYARD_CREW);
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
}
|
}
|
||||||
else if (select)
|
else if (select)
|
||||||
{
|
{
|
||||||
@@ -845,7 +859,9 @@ DoModifyShips (PMENU_STATE pMS)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(pMS->delta_item ^= MODIFY_CREW_FLAG))
|
if (!(pMS->delta_item ^= MODIFY_CREW_FLAG))
|
||||||
|
{
|
||||||
goto ChangeFlashRect;
|
goto ChangeFlashRect;
|
||||||
|
}
|
||||||
else if (hStarShip == 0)
|
else if (hStarShip == 0)
|
||||||
{
|
{
|
||||||
SetContext (StatusContext);
|
SetContext (StatusContext);
|
||||||
@@ -1201,6 +1217,7 @@ DoShipyard (PMENU_STATE pMS)
|
|||||||
select = CurrentMenuState.select;
|
select = CurrentMenuState.select;
|
||||||
cancel = CurrentMenuState.cancel;
|
cancel = CurrentMenuState.cancel;
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
pMS->InputFunc = DoShipyard;
|
pMS->InputFunc = DoShipyard;
|
||||||
|
|||||||
@@ -279,6 +279,7 @@ DoStarBase (PMENU_STATE pMS)
|
|||||||
pMS->CurState = DEPART_BASE;
|
pMS->CurState = DEPART_BASE;
|
||||||
goto ExitStarBase;
|
goto ExitStarBase;
|
||||||
}
|
}
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
|
|
||||||
if (!pMS->Initialized)
|
if (!pMS->Initialized)
|
||||||
{
|
{
|
||||||
@@ -385,6 +386,7 @@ ExitStarBase:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
|
||||||
DoInput ((PVOID)pMS, TRUE);
|
DoInput ((PVOID)pMS, TRUE);
|
||||||
|
|
||||||
pMS->Initialized = FALSE;
|
pMS->Initialized = FALSE;
|
||||||
|
|||||||
@@ -171,6 +171,21 @@ extern void Introduction (void);
|
|||||||
int initIO (void);
|
int initIO (void);
|
||||||
void uninitIO (void);
|
void uninitIO (void);
|
||||||
|
|
||||||
|
/* Constants for DoInput */
|
||||||
|
typedef UWORD MENU_SOUND_FLAGS;
|
||||||
|
#define MENU_SOUND_UP ((MENU_SOUND_FLAGS)(1 << 0))
|
||||||
|
#define MENU_SOUND_DOWN ((MENU_SOUND_FLAGS)(1 << 1))
|
||||||
|
#define MENU_SOUND_LEFT ((MENU_SOUND_FLAGS)(1 << 2))
|
||||||
|
#define MENU_SOUND_RIGHT ((MENU_SOUND_FLAGS)(1 << 3))
|
||||||
|
#define MENU_SOUND_SELECT ((MENU_SOUND_FLAGS)(1 << 4))
|
||||||
|
#define MENU_SOUND_CANCEL ((MENU_SOUND_FLAGS)(1 << 5))
|
||||||
|
#define MENU_SOUND_SPECIAL ((MENU_SOUND_FLAGS)(1 << 6))
|
||||||
|
#define MENU_SOUND_PAGEUP ((MENU_SOUND_FLAGS)(1 << 7))
|
||||||
|
#define MENU_SOUND_PAGEDOWN ((MENU_SOUND_FLAGS)(1 << 8))
|
||||||
|
#define MENU_SOUND_DELETE ((MENU_SOUND_FLAGS)(1 << 9))
|
||||||
|
#define MENU_SOUND_ARROWS (MENU_SOUND_UP | MENU_SOUND_DOWN | MENU_SOUND_LEFT | MENU_SOUND_RIGHT)
|
||||||
|
#define MENU_SOUND_NONE ((MENU_SOUND_FLAGS)0)
|
||||||
|
|
||||||
extern void SetFlashRect (PRECT pRect, FRAME f);
|
extern void SetFlashRect (PRECT pRect, FRAME f);
|
||||||
|
|
||||||
extern void DrawStarConBox (PRECT pRect, SIZE BorderWidth, COLOR
|
extern void DrawStarConBox (PRECT pRect, SIZE BorderWidth, COLOR
|
||||||
@@ -179,6 +194,8 @@ extern void DrawStarConBox (PRECT pRect, SIZE BorderWidth, COLOR
|
|||||||
extern BOOLEAN ConfirmExit (void);
|
extern BOOLEAN ConfirmExit (void);
|
||||||
extern DWORD SeedRandomNumbers (void);
|
extern DWORD SeedRandomNumbers (void);
|
||||||
extern void DoInput (PVOID pInputState, BOOLEAN resetInput);
|
extern void DoInput (PVOID pInputState, BOOLEAN resetInput);
|
||||||
|
void SetMenuSounds (MENU_SOUND_FLAGS sound_0, MENU_SOUND_FLAGS sound_1);
|
||||||
|
void GetMenuSounds (MENU_SOUND_FLAGS *sound_0, MENU_SOUND_FLAGS *sound_1);
|
||||||
extern BOOLEAN Battle (void);
|
extern BOOLEAN Battle (void);
|
||||||
extern void EncounterBattle (void);
|
extern void EncounterBattle (void);
|
||||||
extern void SetPlayerInput (void);
|
extern void SetPlayerInput (void);
|
||||||
|
|||||||
Reference in New Issue
Block a user