Exemplo n.º 1
0
void ScoreTableView (int bNetwork)
{											 
   int	i, k, done, choice, nInMenu;
	uint	entryTime = SDL_GetTicks ();
	int	key;
   int	oldstates [MAX_PLAYERS];
   int	previousSeconds_left = -1;
   int	nReady,nEscaped;
	int	bRedraw = 0;

gameStates.menus.nInMenu++;
gameStates.app.bGameRunning = 0;

bNetwork = gameData.app.nGameMode & GM_NETWORK;

for (i = 0; i < MAX_NUM_NET_PLAYERS; i++)
	audio.DestroyObjectSound (gameData.multiplayer.players [i].nObject);

SetScreenMode (SCREEN_MENU);
gameData.score.bWaitingForOthers = 0;
//@@GrPaletteFadeIn (grPalette,32, 0);
GameFlushInputs ();
done = 0;
for (i = 0; i < gameData.multiplayer.nPlayers; i++)
	oldstates  [i] = gameData.multiplayer.players [i].connected;
if (bNetwork)
	NetworkEndLevel (&key);
backgroundManager.LoadStars (true);
while (!done) {
	if (!bRedraw || (ogl.m_states.nDrawBuffer == GL_BACK)) {
		backgroundManager.Redraw ();
		ScoreTableRedraw ();
		bRedraw = 1;
		}
	gameData.score.nKillsChanged = 0;
	for (i = 0; i < 4; i++)
		if (JoyGetButtonDownCnt (i)) {
			if (LAST_OEM_LEVEL) {
				ScoreTableQuit (1, bNetwork);
				return;
				}
			LOCALPLAYER.connected = 7;
			if (bNetwork)
				NetworkSendEndLevelPacket ();
			break;
			} 		
	for (i = 0; i < 3; i++)
		if (MouseButtonDownCount (i)) {
			if (LAST_OEM_LEVEL) {
				ScoreTableQuit (1, bNetwork);
				return;
				}
			LOCALPLAYER.connected=7;
			if (bNetwork)
				NetworkSendEndLevelPacket ();
			break;
			}		
	//see if redbook song needs to be restarted
	redbook.CheckRepeat ();
	k = KeyInKey ();
	switch (k) {
		case KEY_ENTER:
		case KEY_SPACEBAR:
			if ((gameData.app.nGameMode & GM_SERIAL) || (gameData.app.nGameMode & GM_MODEM)) {
				done=1;
				break;
				}
			if (LAST_OEM_LEVEL) {
				ScoreTableQuit (1, bNetwork);
				return;
				}
			gameData.multiplayer.players  [gameData.multiplayer.nLocalPlayer].connected = 7;
			if (bNetwork)
				NetworkSendEndLevelPacket ();
			break;

		case KEY_ESC:
			if (gameData.app.nGameMode & GM_NETWORK) {
				gameData.multiplayer.xStartAbortMenuTime = TimerGetApproxSeconds ();
				nInMenu = gameStates.menus.nInMenu;
				gameStates.menus.nInMenu = 0;
				choice = MsgBox (NULL, NetworkEndLevelPoll3, NULL, 2, TXT_YES, TXT_NO, TXT_ABORT_GAME);
				gameStates.menus.nInMenu = nInMenu;
				}
			else
				nInMenu = gameStates.menus.nInMenu;
				gameStates.menus.nInMenu = 0;
				choice = MsgBox (NULL, NULL, 2, TXT_YES, TXT_NO, TXT_ABORT_GAME);
				gameStates.menus.nInMenu = nInMenu;
				if (choice == 0) {
					ScoreTableQuit (1, bNetwork);
					return;
					}
				gameData.score.nKillsChanged = 1;
				break;

		case KEY_PRINT_SCREEN:
			SaveScreenShot (NULL, 0);
			break;

		case KEY_BACKSPACE:
			Int3 ();
			break;

		default:
			break;
		}
	if ((SDL_GetTicks () >= entryTime + MAX_VIEW_TIME) && 
		 (LOCALPLAYER.connected != 7)) {
		if (LAST_OEM_LEVEL) {
			ScoreTableQuit (1, bNetwork);
			return;
			}
		if ((gameData.app.nGameMode & GM_SERIAL) || (gameData.app.nGameMode & GM_MODEM)) {
			done = 1;
			break;
			}
		LOCALPLAYER.connected = 7;
		if (bNetwork)
			NetworkSendEndLevelPacket ();
		}
	if (bNetwork && (gameData.app.nGameMode & GM_NETWORK)) {
		CMenu m (1);
		m.AddGauge ("", -1, 1000); //dummy for NetworkEndLevelPoll2()
		NetworkEndLevelPoll2 (m, key, 0, 0);
		for (nEscaped = 0, nReady = 0, i = 0; i < gameData.multiplayer.nPlayers; i++) {
			if (gameData.multiplayer.players [i].connected && (i != gameData.multiplayer.nLocalPlayer)) {
			// Check timeout for idle players
			if (SDL_GetTicks () > (uint) networkData.nLastPacketTime [i] + ENDLEVEL_IDLE_TIME) {
	#if TRACE
				console.printf (CON_DBG, "idle timeout for CPlayerData %d.\n", i);
	#endif
				gameData.multiplayer.players [i].connected = 0;
				NetworkSendEndLevelSub (i);
				}
			}
		if (gameData.multiplayer.players [i].connected != oldstates [i]) {
			if (szConditionLetters [gameData.multiplayer.players [i].connected] != szConditionLetters [oldstates [i]])
				gameData.score.nKillsChanged = 1;
				oldstates [i] = gameData.multiplayer.players [i].connected;
				NetworkSendEndLevelPacket ();
				}
			if ((gameData.multiplayer.players [i].connected == 0) || (gameData.multiplayer.players [i].connected == 7))
				nReady++;
			if (gameData.multiplayer.players [i].connected != 1)
				nEscaped++;
			}
		if (nReady >= gameData.multiplayer.nPlayers)
			done = 1;
		if (nEscaped >= gameData.multiplayer.nPlayers)
			gameData.reactor.countdown.nSecsLeft = -1;
		if (previousSeconds_left != gameData.reactor.countdown.nSecsLeft) {
			previousSeconds_left = gameData.reactor.countdown.nSecsLeft;
			gameData.score.nKillsChanged=1;
			}
		if (gameData.score.nKillsChanged) {
			ScoreTableRedraw ();
			gameData.score.nKillsChanged = 0;
			}
		}
	}
LOCALPLAYER.connected = 7;
// Restore background and exit
paletteManager.DisableEffect ();
GameFlushInputs ();
ScoreTableQuit (0, bNetwork);
}
Exemplo n.º 2
0
void ScoreTableView (int bNetwork)
{											 
   int i, k, done,choice;
	fix entryTime = TimerGetApproxSeconds ();
	int key;
   int oldstates [MAX_PLAYERS];
   int previousSeconds_left=-1;
   int nReady,nEscaped;
	int bRedraw = 0;
	bkg bg;

gameStates.menus.nInMenu++;
gameStates.app.bGameRunning = 0;
memset (&bg, 0, sizeof (bg));

bNetwork = gameData.app.nGameMode & GM_NETWORK;

for (i = 0; i < MAX_NUM_NET_PLAYERS; i++)
	DigiKillSoundLinkedToObject (gameData.multiplayer.players [i].nObject);

SetScreenMode (SCREEN_MENU);
gameData.score.bWaitingForOthers = 0;
//@@GrPaletteFadeIn (grPalette,32, 0);
GameFlushInputs ();
done = 0;
for (i = 0; i < gameData.multiplayer.nPlayers; i++)
	oldstates  [i] = gameData.multiplayer.players [i].connected;
if (bNetwork)
	NetworkEndLevel (&key);
while (!done) {
	if (!bRedraw || (curDrawBuffer == GL_BACK)) {
		LoadStars (&bg, bRedraw);
		ScoreTableRedraw ();
		bRedraw = 1;
		}
	gameData.score.nKillsChanged = 0;
	for (i = 0; i < 4; i++)
		if (JoyGetButtonDownCnt (i)) {
			if (LAST_OEM_LEVEL) {
				ScoreTableQuit (&bg, 1, bNetwork);
				return;
				}
			LOCALPLAYER.connected = 7;
			if (bNetwork)
				NetworkSendEndLevelPacket ();
			break;
			} 		
	for (i = 0; i < 3; i++)
		if (MouseButtonDownCount (i)) {
			if (LAST_OEM_LEVEL) {
				ScoreTableQuit (&bg, 1, bNetwork);
				return;
				}
			LOCALPLAYER.connected=7;
			if (bNetwork)
				NetworkSendEndLevelPacket ();
			break;
			}		
	//see if redbook song needs to be restarted
	SongsCheckRedbookRepeat ();
	k = KeyInKey ();
	switch (k) {
		case KEY_ENTER:
		case KEY_SPACEBAR:
			if ((gameData.app.nGameMode & GM_SERIAL) || (gameData.app.nGameMode & GM_MODEM)) {
				done=1;
				break;
				}
			if (LAST_OEM_LEVEL) {
				ScoreTableQuit (&bg, 1, bNetwork);
				return;
				}
			gameData.multiplayer.players  [gameData.multiplayer.nLocalPlayer].connected = 7;
			if (bNetwork)
				NetworkSendEndLevelPacket ();
			break;

		case KEY_ESC:
			if (gameData.app.nGameMode & GM_NETWORK) {
				gameData.multiplayer.xStartAbortMenuTime = TimerGetApproxSeconds ();
				choice=ExecMessageBox1 (NULL, NetworkEndLevelPoll3, NULL, 2, TXT_YES, TXT_NO, TXT_ABORT_GAME);
				}
			else
				choice=ExecMessageBox (NULL, NULL, 2, TXT_YES, TXT_NO, TXT_ABORT_GAME);
				if (choice == 0) {
					ScoreTableQuit (&bg, 1, bNetwork);
					return;
					}
				gameData.score.nKillsChanged=1;
				break;

		case KEY_PRINT_SCREEN:
			SaveScreenShot (NULL, 0);
			break;

		case KEY_BACKSP:
			Int3 ();
			break;

		default:
			break;
		}
	if ((TimerGetApproxSeconds () >= entryTime + MAX_VIEW_TIME) && 
		 (LOCALPLAYER.connected != 7)) {
		if (LAST_OEM_LEVEL) {
			ScoreTableQuit (&bg, 1, bNetwork);
			return;
			}
		if ((gameData.app.nGameMode & GM_SERIAL) || (gameData.app.nGameMode & GM_MODEM)) {
			done=1;
			break;
			}
		LOCALPLAYER.connected = 7;
		if (bNetwork)
			NetworkSendEndLevelPacket ();
		}
	if (bNetwork && (gameData.app.nGameMode & GM_NETWORK)) {
		NetworkEndLevelPoll2 (0, NULL, &key, 0);
		for (nEscaped = 0, nReady = 0, i = 0; i < gameData.multiplayer.nPlayers; i++) {
			if (gameData.multiplayer.players [i].connected && i!=gameData.multiplayer.nLocalPlayer) {
			// Check timeout for idle players
			if (TimerGetApproxSeconds () > networkData.nLastPacketTime [i]+ENDLEVEL_IDLE_TIME) {
	#if TRACE
				con_printf (CONDBG, "idle timeout for tPlayer %d.\n", i);
	#endif
				gameData.multiplayer.players [i].connected = 0;
				NetworkSendEndLevelSub (i);
				}
			}
		if (gameData.multiplayer.players [i].connected!=oldstates [i]) {
			if (szConditionLetters [gameData.multiplayer.players [i].connected] != szConditionLetters [oldstates [i]])
				gameData.score.nKillsChanged = 1;
				oldstates [i] = gameData.multiplayer.players [i].connected;
				NetworkSendEndLevelPacket ();
				}
			if (gameData.multiplayer.players [i].connected==0 || gameData.multiplayer.players [i].connected==7)
				nReady++;
			if (gameData.multiplayer.players [i].connected!=1)
				nEscaped++;
			}
		if (nReady >= gameData.multiplayer.nPlayers)
			done = 1;
		if (nEscaped >= gameData.multiplayer.nPlayers)
			gameData.reactor.countdown.nSecsLeft = -1;
		if (previousSeconds_left != gameData.reactor.countdown.nSecsLeft) {
			previousSeconds_left = gameData.reactor.countdown.nSecsLeft;
			gameData.score.nKillsChanged=1;
			}
		if (gameData.score.nKillsChanged) {
			ScoreTableRedraw ();
			gameData.score.nKillsChanged = 0;
			}
		}
	}
LOCALPLAYER.connected = 7;
// Restore background and exit
GrPaletteFadeOut (NULL, 32, 0);
GameFlushInputs ();
ScoreTableQuit (&bg, 0, bNetwork);
}
Exemplo n.º 3
0
void ScoresView (int nCurItem)
{
	fix t0 = 0, t1;
	int c,i,done,looper;
	int k, bRedraw = 0;
	sbyte fades[64] = { 1,1,1,2,2,3,4,4,5,6,8,9,10,12,13,15,16,17,19,20,22,23,24,26,27,28,28,29,30,30,31,31,31,31,31,30,30,29,28,28,27,26,24,23,22,20,19,17,16,15,13,12,10,9,8,6,5,4,4,3,2,2,1,1 };
	bkg bg;

	memset (&bg, 0, sizeof (bg));

ReshowScores:
	scores_read ();
	SetScreenMode (SCREEN_MENU);
 	GrSetCurrentCanvas (NULL);
	xOffs = (grdCurCanv->cvBitmap.bmProps.w - 640) / 2;
	yOffs = (grdCurCanv->cvBitmap.bmProps.h - 480) / 2;
	if (xOffs < 0)
		xOffs = 0;
	if (yOffs < 0)
		yOffs = 0; 

	GameFlushInputs ();

	done = 0;
	looper = 0;

	while (!done)	{
		if (!bRedraw || gameOpts->menus.nStyle) {
			NMDrawBackground (&bg,xOffs, yOffs, xOffs + 640, xOffs + 480, bRedraw);
			grdCurCanv->cvFont = MEDIUM3_FONT;

			GrString (0x8000, yOffs + LHY (15), TXT_HIGH_SCORES, NULL);
			grdCurCanv->cvFont = SMALL_FONT;
			GrSetFontColorRGBi (RGBA_PAL (31,26,5), 1, 0, 0);
			GrString ( xOffs + LHX (31+33+XX), yOffs + LHY (46+7+YY), TXT_NAME, NULL);
			GrString ( xOffs + LHX (82+33+XX), yOffs + LHY (46+7+YY), TXT_SCORE, NULL);
			GrString (xOffs + LHX (127+33+XX), yOffs + LHY (46+7+YY), TXT_SKILL, NULL);
			GrString (xOffs + LHX (170+33+XX), yOffs + LHY (46+7+YY), TXT_LEVELS, NULL);
		//	GrString (202, 46, "Kills");
		//	GrString (234, 46, "Rescues");
			GrString (xOffs + LHX (288-
+XX), yOffs + LHY (46+7+YY), TXT_TIME, NULL);
			if (nCurItem < 0)
				GrString (0x8000, yOffs + LHY (175), TXT_PRESS_CTRL_R, NULL);
			GrSetFontColorRGBi (RGBA_PAL (28,28,28), 1, 0, 0);
			//GrPrintF (NULL, 0x8000, yOffs + LHY (31), "%c%s%c  - %s", 34, Scores.cool_saying, 34, Scores.stats[0].name);
			for (i = 0; i < MAX_HIGH_SCORES; i++) {
				//@@if (i==0)	{
				//@@	GrSetFontColorRGBi (RGBA_PAL (28,28,28), 1, 0, 0);
				//@@} else {
				//@@	GrSetFontColor (grFadeTable[BM_XRGB (28,28,28)+ ((28-i*2)*256)], 1, 0, 0);
				//@@}														 
				c = 28 - i * 2;
				GrSetFontColorRGBi (RGBA_PAL (c, c, c), 1, 0, 0);
				scores_draw_item (i, Scores.stats + i);
			}

			GrPaletteFadeIn (NULL,32, 0);

			if (nCurItem < 0)
				GrUpdate (0);
			bRedraw = 1;
			}
		if (nCurItem > -1)	{

			t1	= TimerGetFixedSeconds ();
			//if (t1 - t0 >= F1_0/128) 
			{
				t0 = t1;
				//@@GrSetFontColor (grFadeTable[fades[looper]*256+BM_XRGB (28,28,28)], -1);
				c = 7 + fades [looper];
				GrSetFontColorRGBi (RGBA_PAL (c, c, c), 1, 0, 0);
				if (++looper > 63) 
				 looper=0;
				if (nCurItem ==  MAX_HIGH_SCORES)
					scores_draw_item (MAX_HIGH_SCORES, &Last_game);
				else
					scores_draw_item (nCurItem, Scores.stats + nCurItem);
				}
			GrUpdate (0);
		}

		for (i=0; i<4; i++)
			if (JoyGetButtonDownCnt (i)>0) done=1;
		for (i=0; i<3; i++)
			if (MouseButtonDownCount (i)>0) done=1;

		//see if redbook song needs to be restarted
		SongsCheckRedbookRepeat ();

		k = KeyInKey ();
		switch (k)	{
		case KEY_CTRLED+KEY_R:	
			if (nCurItem < 0)		{
				// Reset scores...
				if (ExecMessageBox (NULL, NULL, 2,  TXT_NO, TXT_YES, TXT_RESET_HIGH_SCORES)==1)	{
					CFDelete (GetScoresFilename (), gameFolders.szDataDir);
					GrPaletteFadeOut (NULL, 32, 0);
					goto ReshowScores;
				}
			}
			break;
		case KEY_BACKSP:				
			Int3 (); 
			k = 0; 
			break;
		case KEY_PRINT_SCREEN:		
			SaveScreenShot (NULL, 0); 
			k = 0; 
			break;
		
		case KEY_ENTER:
		case KEY_SPACEBAR:
		case KEY_ESC:
			done = 1;
			break;
		}
	}
// Restore background and exit
GrPaletteFadeOut (NULL, 32, 0);
GrSetCurrentCanvas (NULL);
GameFlushInputs ();
NMRemoveBackground (&bg);
}
Exemplo n.º 4
0
int ReadControls (void)
{
	int key, skipControls = 0;
	fix keyTime;
	static ubyte explodingFlag=0;

gameStates.app.bPlayerFiredLaserThisFrame=-1;
if (!gameStates.app.bEndLevelSequence && !gameStates.app.bPlayerIsDead) {
		if ((gameData.demo.nState == ND_STATE_PLAYBACK) || (gameData.marker.nDefiningMsg)
			|| gameData.multigame.msg.bSending || gameData.multigame.msg.bDefining
			)	 // WATCH OUT!!! WEIRD CODE ABOVE!!!
			memset(&Controls, 0, sizeof(tControlInfo));
		else
			skipControls = ControlsReadAll ();		//NOTE LINK TO ABOVE!!!
	CheckRearView ();
	//	If automap key pressed, enable automap unless you are in network mode, control center destroyed and < 10 seconds left
	if (Controls [0].automapDownCount &&
		 !gameData.objs.speedBoost [OBJ_IDX (gameData.objs.consoleP)].bBoosted &&
		 !(IsMultiGame && gameData.reactor.bDestroyed && (gameData.reactor.countdown.nSecsLeft < 10)))
		automap.m_bDisplay = -1;
	DoWeaponStuff ();
	}
if (gameStates.app.bPlayerExploded) { //gameStates.app.bPlayerIsDead && (gameData.objs.consoleP->flags & OF_EXPLODING)) {
	if (!explodingFlag)  {
		explodingFlag = 1;			// When CPlayerData starts exploding, clear all input devices...
		GameFlushInputs ();
		}
	else {
		int i;
		for (i = 0; i < 4; i++)
			if (JoyGetButtonDownCnt (i) > 0)
				gameStates.app.bDeathSequenceAborted = 1;
		for (i = 0; i < 3; i++)
			if (MouseButtonDownCount (i) > 0)
				gameStates.app.bDeathSequenceAborted = 1;
		if (gameStates.app.bDeathSequenceAborted)
			GameFlushInputs ();
		}
	}
else {
	explodingFlag = 0;
	}
if (gameData.demo.nState == ND_STATE_PLAYBACK)
	UpdateVCRState ();
while ((key = KeyInKeyTime (&keyTime)) != 0) {
	if (gameData.marker.nDefiningMsg) {
		MarkerInputMessage (key);
			continue;
		}
if (IsMultiGame && (gameData.multigame.msg.bSending || gameData.multigame.msg.bDefining)) {
	MultiMsgInputSub (key);
	continue;		//get next key
	}
#if DBG
if ((key&KEYDBGGED) && IsMultiGame) {
	gameData.multigame.msg.nReceiver = 100;		// Send to everyone...
	sprintf(gameData.multigame.msg.szMsg, "%s %s", TXT_I_AM_A, TXT_CHEATER);
	}
#endif
#ifdef CONSOLE
if(!console.Events (key))
	continue;
#endif
if (gameStates.app.bPlayerIsDead)
	HandleDeathKey (key);
	if (gameStates.app.bEndLevelSequence)
		HandleEndlevelKey (key);
	else if (gameData.demo.nState == ND_STATE_PLAYBACK) {
		HandleDemoKey (key);
#if DBG
		HandleTestKey (key);
#endif
		}
	else {
		FinalCheats (key);
		HandleSystemKey (key);
		HandleVRKey (key);
		HandleGameKey (key);
#if DBG
		HandleTestKey (key);
#endif
		}
	}
return skipControls;
}
Exemplo n.º 5
0
void ControlsDoJoystick (int *bSlideOn, int *bBankOn, fix *pitchTimeP, fix *headingTimeP, int *nCruiseSpeed, int bGetSlideBank)
{
	int	i, v;

for (i = 0; i < 60; i += 30) {
	if (bGetSlideBank == 0) {
		if ((v = kcJoystick [i + 5].value) < 255) 
			*bSlideOn |= JoyGetButtonState (v);
		if ((v = kcJoystick [i + 10].value) < 255)
			*bBankOn |= JoyGetButtonState (v);
		return;
		}
	// Buttons
	if (bGetSlideBank == 2) {
		if ((v = kcJoystick [i + 0].value) < 255) {
			Controls [0].firePrimaryState |= JoyGetButtonState (v);
			Controls [0].firePrimaryDownCount += JoyGetButtonDownCnt (v);
			}
		if ((v = kcJoystick [i + 1].value) < 255) {
			Controls [0].fireSecondaryState |= JoyGetButtonState (v);
			Controls [0].fireSecondaryDownCount += JoyGetButtonDownCnt (v);
			}
		if ((v = kcJoystick [i + 2].value) < 255) 
			Controls [0].forwardThrustTime += JoyGetButtonDownTime (v);
		if ((v = kcJoystick [i + 3].value) < 255) 
			Controls [0].forwardThrustTime -= JoyGetButtonDownTime (v);
		if ((v = kcJoystick [i + 4].value) < 255) 
			Controls [0].fireFlareDownCount += JoyGetButtonDownCnt (v);
		if ((v = kcJoystick [i + 6].value) < 255) 
			Controls [0].sidewaysThrustTime -= JoyGetButtonDownTime (v);
		if ((v = kcJoystick [i + 7].value) < 255) 
			Controls [0].sidewaysThrustTime += JoyGetButtonDownTime (v);
		if ((v = kcJoystick [i + 8].value) < 255) 
			Controls [0].verticalThrustTime += JoyGetButtonDownTime (v);
		if ((v = kcJoystick [i + 9].value) < 255) 
			Controls [0].verticalThrustTime -= JoyGetButtonDownTime (v);
		if ((v = kcJoystick [i + 11].value) < 255) 
			Controls [2].bankTime += JoyGetButtonDownTime (v);
		if ((v = kcJoystick [i + 12].value) < 255) 
			Controls [2].bankTime -= JoyGetButtonDownTime (v);
		if ((v = kcJoystick [i + 19].value) < 255) {
			Controls [0].rearViewDownCount += JoyGetButtonDownCnt (v);
			Controls [0].rearViewDownState |= JoyGetButtonState (v);
			}
		if ((v = kcJoystick [i + 20].value) < 255) 
			Controls [0].dropBombDownCount += JoyGetButtonDownCnt (v);
		if ((v = kcJoystick [i + 21].value) < 255) 
			Controls [0].afterburnerState |= JoyGetButtonState (v);
		if ((v = kcJoystick [i + 22].value) < 255) 
			Controls [0].cyclePrimaryCount += JoyGetButtonDownCnt (v);
		if ((v = kcJoystick [i + 23].value) < 255) 
			Controls [0].cycleSecondaryCount += JoyGetButtonDownCnt (v);
		if ((v = kcJoystick [i + 24].value) < 255) 
			Controls [0].headlightCount += JoyGetButtonDownCnt (v);
		if (((v = kcJoystick [i + 25].value) < 255) && JoyGetButtonDownCnt (v))
			ToggleBomb ();
		if ((v = kcJoystick [i + 26].value) < 255) 
			Controls [0].toggleIconsCount += JoyGetButtonDownCnt (v);
		if ((v = kcJoystick [i + 27].value) < 255) 
			Controls [0].automapDownCount += JoyGetButtonDownCnt (v);
		if ((v = kcJoystick [i + 28].value) < 255) 
			Controls [0].useCloakDownCount += JoyGetButtonDownCnt (v);
		if ((v = kcJoystick [i + 29].value) < 255) 
			Controls [0].useInvulDownCount += JoyGetButtonDownCnt (v);

		// Axis movements
		if ((v = kcJoystick [i + 15].value) < 255) {
			if (kcJoystick [62].value)		// If inverted...
				Controls [0].sidewaysThrustTime += joyAxis [v];
			else
				Controls [0].sidewaysThrustTime -= joyAxis [v];
			}
		if ((v = kcJoystick [i + 16].value) < 255) {
			if (kcJoystick [63].value)		// If inverted...
				Controls [0].verticalThrustTime -= joyAxis [v];
			else
				Controls [0].verticalThrustTime += joyAxis [v];
			}
		if ((v = kcJoystick [i + 17].value) < 255) {
			if (kcJoystick [64].value)		// If inverted...
				Controls [2].bankTime += joyAxis [v];
			else
				Controls [2].bankTime -= joyAxis [v];
			}
		if ((v = kcJoystick [i + 18].value) < 255) {
			if (kcJoystick [65].value)		// If inverted...
				Controls [0].forwardThrustTime += joyAxis [v];
			else
				Controls [0].forwardThrustTime -= joyAxis [v];
			}
		// special continuous slide & bank handling
		if (*bSlideOn) {
			if ((v = kcJoystick [i + 13].value) < 255) {
				if (kcJoystick [60].value)		// If inverted...
					Controls [0].verticalThrustTime -= joyAxis [v];
				else
					Controls [0].verticalThrustTime += joyAxis [v];
			}
			if ((v = kcJoystick [i + 14].value) < 255) {
				if (kcJoystick [61].value)		// If inverted...
					Controls [0].sidewaysThrustTime -= joyAxis [v];
				else
					Controls [0].sidewaysThrustTime += joyAxis [v];
				}
			}
		else {
			if ((v = kcJoystick [i + 13].value) < 255) {
				if (kcJoystick [60].value)		// If inverted...
					Controls [2].pitchTime += DeltaAxis (v); // (joyAxis [v] * 16 / joy_sens_mod);
				else 
					Controls [2].pitchTime -= DeltaAxis (v); // (joyAxis [v] * 16 / joy_sens_mod);
				}
			if (!*bBankOn) {
				if ((v = kcJoystick [i + 14].value) < 255) {
					if (kcJoystick [61].value)		// If inverted...
						Controls [2].headingTime -= DeltaAxis (v); // (joyAxis [v] * 16 / joy_sens_mod); //kcFrameCount;
					else
						Controls [2].headingTime += DeltaAxis (v); // (joyAxis [v] * 16 / joy_sens_mod); // kcFrameCount;
					}
				}
			}
		if (*bBankOn) {
			if ((v = kcJoystick [i + 14].value) < 255) {
				if (kcJoystick [61].value)		// If inverted...
					Controls [2].bankTime += DeltaAxis (v); // (joyAxis [v] * 16 / joy_sens_mod);
				else
					Controls [2].bankTime -= DeltaAxis (v); // (joyAxis [v] * 16 / joy_sens_mod);
				}
			}
		}
	}
}