mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 20:50:58 +00:00
Merge branch 'next-newcontrols' into 'next'
fcam simple controls but slightly less hacky See merge request STJr/SRB2!647
This commit is contained in:
commit
a63bd720b9
22 changed files with 1212 additions and 622 deletions
20
src/b_bot.c
20
src/b_bot.c
|
@ -127,13 +127,17 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
|
|||
}
|
||||
|
||||
// Orientation
|
||||
if ((bot->pflags & (PF_SPINNING|PF_STARTDASH)) || flymode == 2)
|
||||
if (bot->pflags & (PF_SPINNING|PF_STARTDASH))
|
||||
{
|
||||
cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS;
|
||||
cmd->angleturn = (sonic->angle - tails->angle) >> 16; // NOT FRACBITS DAMNIT
|
||||
}
|
||||
else if (flymode == 2)
|
||||
{
|
||||
cmd->angleturn = sonic->player->cmd.angleturn - (tails->angle >> 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd->angleturn = (ang - tails->angle) >> FRACBITS;
|
||||
cmd->angleturn = (ang - tails->angle) >> 16; // NOT FRACBITS DAMNIT
|
||||
}
|
||||
|
||||
// ********
|
||||
|
@ -222,7 +226,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
|
|||
{
|
||||
if (dist < followthres && dist > touchdist) // Do positioning
|
||||
{
|
||||
cmd->angleturn = (ang - tails->angle) >> FRACBITS;
|
||||
cmd->angleturn = (ang - tails->angle) >> 16; // NOT FRACBITS DAMNIT
|
||||
cmd->forwardmove = 50;
|
||||
spinmode = true;
|
||||
}
|
||||
|
@ -230,7 +234,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
|
|||
{
|
||||
if (!bmom && (!(bot->pflags & PF_SPINNING) || (bot->dashspeed && bot->pflags & PF_SPINNING)))
|
||||
{
|
||||
cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS;
|
||||
cmd->angleturn = (sonic->angle - tails->angle) >> 16; // NOT FRACBITS DAMNIT
|
||||
spin = true;
|
||||
}
|
||||
spinmode = true;
|
||||
|
@ -244,7 +248,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
|
|||
if (bot->pflags & PF_SPINNING || !spin_last)
|
||||
{
|
||||
spin = true;
|
||||
cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS;
|
||||
cmd->angleturn = (sonic->angle - tails->angle) >> 16; // NOT FRACBITS DAMNIT
|
||||
cmd->forwardmove = MAXPLMOVE;
|
||||
spinmode = true;
|
||||
}
|
||||
|
@ -290,7 +294,7 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
|
|||
else if (dist < followmin)
|
||||
{
|
||||
// Copy inputs
|
||||
cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS;
|
||||
cmd->angleturn = (sonic->angle - tails->angle) >> 16; // NOT FRACBITS DAMNIT
|
||||
bot->drawangle = ang;
|
||||
cmd->forwardmove = 8 * pcmd->forwardmove / 10;
|
||||
cmd->sidemove = 8 * pcmd->sidemove / 10;
|
||||
|
@ -358,7 +362,7 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
|
||||
// Bot AI isn't programmed in analog.
|
||||
CV_SetValue(&cv_analog2, false);
|
||||
CV_SetValue(&cv_analog[1], false);
|
||||
|
||||
#ifdef HAVE_BLUA
|
||||
// Let Lua scripts build ticcmds
|
||||
|
|
|
@ -2114,7 +2114,12 @@ void CV_SaveVariables(FILE *f)
|
|||
|
||||
// Silly hack for Min/Max vars
|
||||
if (!strcmp(cvar->string, "MAX") || !strcmp(cvar->string, "MIN"))
|
||||
sprintf(stringtowrite, "%d", cvar->value);
|
||||
{
|
||||
if (cvar->flags & CV_FLOAT)
|
||||
sprintf(stringtowrite, "%f", FIXED_TO_FLOAT(cvar->value));
|
||||
else
|
||||
sprintf(stringtowrite, "%d", cvar->value);
|
||||
}
|
||||
else
|
||||
strcpy(stringtowrite, cvar->string);
|
||||
|
||||
|
|
|
@ -4651,9 +4651,9 @@ static void Local_Maketic(INT32 realtics)
|
|||
// and G_MapEventsToControls
|
||||
if (!dedicated) rendergametic = gametic;
|
||||
// translate inputs (keyboard/mouse/joystick) into game controls
|
||||
G_BuildTiccmd(&localcmds, realtics);
|
||||
G_BuildTiccmd(&localcmds, realtics, 1);
|
||||
if (splitscreen || botingame)
|
||||
G_BuildTiccmd2(&localcmds2, realtics);
|
||||
G_BuildTiccmd(&localcmds2, realtics, 2);
|
||||
|
||||
localcmds.angleturn |= TICCMD_RECEIVED;
|
||||
}
|
||||
|
|
|
@ -832,7 +832,7 @@ void D_StartTitle(void)
|
|||
CV_SetValue(&cv_usemouse, tutorialusemouse);
|
||||
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
|
||||
CV_SetValue(&cv_mousemove, tutorialmousemove);
|
||||
CV_SetValue(&cv_analog, tutorialanalog);
|
||||
CV_SetValue(&cv_analog[0], tutorialanalog);
|
||||
M_StartMessage("Do you want to \x82save the recommended \x82movement controls?\x80\n\nPress 'Y' or 'Enter' to confirm\nPress 'N' or any key to keep \nyour current controls",
|
||||
M_TutorialSaveControlResponse, MM_YESNO);
|
||||
}
|
||||
|
|
|
@ -781,6 +781,10 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_fireaxis2);
|
||||
CV_RegisterVar(&cv_firenaxis);
|
||||
CV_RegisterVar(&cv_firenaxis2);
|
||||
CV_RegisterVar(&cv_deadzone);
|
||||
CV_RegisterVar(&cv_deadzone2);
|
||||
CV_RegisterVar(&cv_digitaldeadzone);
|
||||
CV_RegisterVar(&cv_digitaldeadzone2);
|
||||
|
||||
// filesrch.c
|
||||
CV_RegisterVar(&cv_addons_option);
|
||||
|
@ -819,20 +823,34 @@ void D_RegisterClientCommands(void)
|
|||
CV_RegisterVar(&cv_joyscale2);
|
||||
|
||||
// Analog Control
|
||||
CV_RegisterVar(&cv_analog);
|
||||
CV_RegisterVar(&cv_analog2);
|
||||
CV_RegisterVar(&cv_useranalog);
|
||||
CV_RegisterVar(&cv_useranalog2);
|
||||
CV_RegisterVar(&cv_analog[0]);
|
||||
CV_RegisterVar(&cv_analog[1]);
|
||||
CV_RegisterVar(&cv_useranalog[0]);
|
||||
CV_RegisterVar(&cv_useranalog[1]);
|
||||
|
||||
// deez New User eXperiences
|
||||
CV_RegisterVar(&cv_directionchar);
|
||||
CV_RegisterVar(&cv_directionchar2);
|
||||
CV_RegisterVar(&cv_directionchar[0]);
|
||||
CV_RegisterVar(&cv_directionchar[1]);
|
||||
CV_RegisterVar(&cv_autobrake);
|
||||
CV_RegisterVar(&cv_autobrake2);
|
||||
|
||||
// Ported from kart
|
||||
CV_RegisterVar(&cv_deadzone);
|
||||
CV_RegisterVar(&cv_deadzone2);
|
||||
// hi here's some new controls
|
||||
CV_RegisterVar(&cv_cam_shiftfacing[0]);
|
||||
CV_RegisterVar(&cv_cam_shiftfacing[1]);
|
||||
CV_RegisterVar(&cv_cam_turnfacing[0]);
|
||||
CV_RegisterVar(&cv_cam_turnfacing[1]);
|
||||
CV_RegisterVar(&cv_cam_turnfacingability[0]);
|
||||
CV_RegisterVar(&cv_cam_turnfacingability[1]);
|
||||
CV_RegisterVar(&cv_cam_turnfacingspindash[0]);
|
||||
CV_RegisterVar(&cv_cam_turnfacingspindash[1]);
|
||||
CV_RegisterVar(&cv_cam_turnfacinginput[0]);
|
||||
CV_RegisterVar(&cv_cam_turnfacinginput[1]);
|
||||
CV_RegisterVar(&cv_cam_centertoggle[0]);
|
||||
CV_RegisterVar(&cv_cam_centertoggle[1]);
|
||||
CV_RegisterVar(&cv_cam_lockedinput[0]);
|
||||
CV_RegisterVar(&cv_cam_lockedinput[1]);
|
||||
CV_RegisterVar(&cv_cam_lockonboss[0]);
|
||||
CV_RegisterVar(&cv_cam_lockonboss[1]);
|
||||
|
||||
// s_sound.c
|
||||
CV_RegisterVar(&cv_soundvolume);
|
||||
|
@ -1501,9 +1519,9 @@ void SendWeaponPref(void)
|
|||
buf[0] = 0;
|
||||
if (cv_flipcam.value)
|
||||
buf[0] |= 1;
|
||||
if (cv_analog.value)
|
||||
if (cv_analog[0].value && cv_directionchar[0].value != 2)
|
||||
buf[0] |= 2;
|
||||
if (cv_directionchar.value)
|
||||
if (cv_directionchar[0].value == 1)
|
||||
buf[0] |= 4;
|
||||
if (cv_autobrake.value)
|
||||
buf[0] |= 8;
|
||||
|
@ -1517,9 +1535,9 @@ void SendWeaponPref2(void)
|
|||
buf[0] = 0;
|
||||
if (cv_flipcam2.value)
|
||||
buf[0] |= 1;
|
||||
if (cv_analog2.value)
|
||||
if (cv_analog[1].value && cv_directionchar[1].value != 2)
|
||||
buf[0] |= 2;
|
||||
if (cv_directionchar2.value)
|
||||
if (cv_directionchar[1].value == 1)
|
||||
buf[0] |= 4;
|
||||
if (cv_autobrake2.value)
|
||||
buf[0] |= 8;
|
||||
|
@ -1984,7 +2002,7 @@ static void Command_Map_f(void)
|
|||
CV_SetValue(&cv_usemouse, tutorialusemouse);
|
||||
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
|
||||
CV_SetValue(&cv_mousemove, tutorialmousemove);
|
||||
CV_SetValue(&cv_analog, tutorialanalog);
|
||||
CV_SetValue(&cv_analog[0], tutorialanalog);
|
||||
}
|
||||
tutorialmode = false; // warping takes us out of tutorial mode
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ extern INT32 tutorialgcs; // which control scheme is loaded?
|
|||
extern INT32 tutorialusemouse; // store cv_usemouse user value
|
||||
extern INT32 tutorialfreelook; // store cv_alwaysfreelook user value
|
||||
extern INT32 tutorialmousemove; // store cv_mousemove user value
|
||||
extern INT32 tutorialanalog; // store cv_analog user value
|
||||
extern INT32 tutorialanalog; // store cv_analog[0] user value
|
||||
|
||||
extern boolean looptitle;
|
||||
|
||||
|
|
906
src/g_game.c
906
src/g_game.c
File diff suppressed because it is too large
Load diff
40
src/g_game.h
40
src/g_game.h
|
@ -68,15 +68,37 @@ extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime,
|
|||
extern consvar_t cv_crosshair, cv_crosshair2;
|
||||
extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_chasefreelook, cv_mousemove;
|
||||
extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_chasefreelook2, cv_mousemove2;
|
||||
extern consvar_t cv_useranalog, cv_useranalog2;
|
||||
extern consvar_t cv_analog, cv_analog2;
|
||||
extern consvar_t cv_directionchar, cv_directionchar2;
|
||||
|
||||
extern consvar_t cv_useranalog[2], cv_analog[2];
|
||||
extern consvar_t cv_directionchar[2];
|
||||
|
||||
typedef enum {
|
||||
CS_LEGACY,
|
||||
CS_LMAOGALOG,
|
||||
CS_STANDARD,
|
||||
CS_SIMPLE = CS_LMAOGALOG|CS_STANDARD,
|
||||
} controlstyle_e;
|
||||
#define G_ControlStyle(ssplayer) (cv_directionchar[(ssplayer)-1].value == 3 ? CS_LMAOGALOG : ((cv_analog[(ssplayer)-1].value ? CS_LMAOGALOG : 0) | (cv_directionchar[(ssplayer)-1].value ? CS_STANDARD : 0)))
|
||||
#define P_ControlStyle(player) ((((player)->pflags & PF_ANALOGMODE) ? CS_LMAOGALOG : 0) | (((player)->pflags & PF_DIRECTIONCHAR) ? CS_STANDARD : 0))
|
||||
|
||||
extern consvar_t cv_autobrake, cv_autobrake2;
|
||||
extern consvar_t cv_deadzone, cv_deadzone2;
|
||||
extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis;
|
||||
extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2;
|
||||
extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_jumpaxis,cv_spinaxis,cv_fireaxis,cv_firenaxis,cv_deadzone,cv_digitaldeadzone;
|
||||
extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_jumpaxis2,cv_spinaxis2,cv_fireaxis2,cv_firenaxis2,cv_deadzone2,cv_digitaldeadzone2;
|
||||
extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest;
|
||||
|
||||
// hi here's some new controls
|
||||
extern consvar_t cv_cam_shiftfacing[2], cv_cam_turnfacing[2],
|
||||
cv_cam_turnfacingability[2], cv_cam_turnfacingspindash[2], cv_cam_turnfacinginput[2],
|
||||
cv_cam_centertoggle[2], cv_cam_lockedinput[2], cv_cam_lockonboss[2];
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LOCK_BOSS = 1<<0,
|
||||
LOCK_ENEMY = 1<<1,
|
||||
LOCK_INTERESTS = 1<<2,
|
||||
} lockassist_e;
|
||||
|
||||
|
||||
// mouseaiming (looking up/down with the mouse or keyboard)
|
||||
#define KB_LOOKSPEED (1<<25)
|
||||
#define MAXPLMOVE (50)
|
||||
|
@ -84,8 +106,10 @@ extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_g
|
|||
|
||||
// build an internal map name MAPxx from map number
|
||||
const char *G_BuildMapName(INT32 map);
|
||||
void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics);
|
||||
void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics);
|
||||
|
||||
extern boolean ticcmd_centerviewdown[2]; // For simple controls, lock the camera behind the player
|
||||
extern mobj_t *ticcmd_ztargetfocus[2]; // Locking onto an object?
|
||||
void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer);
|
||||
|
||||
// copy ticcmd_t to and fro the normal way
|
||||
ticcmd_t *G_CopyTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n);
|
||||
|
|
|
@ -132,6 +132,7 @@ extern INT32 gamecontroldefault[num_gamecontrolschemes][num_gamecontrols][2]; //
|
|||
extern INT32 gamecontrolbisdefault[num_gamecontrolschemes][num_gamecontrols][2];
|
||||
#define PLAYER1INPUTDOWN(gc) (gamekeydown[gamecontrol[gc][0]] || gamekeydown[gamecontrol[gc][1]])
|
||||
#define PLAYER2INPUTDOWN(gc) (gamekeydown[gamecontrolbis[gc][0]] || gamekeydown[gamecontrolbis[gc][1]])
|
||||
#define PLAYERINPUTDOWN(p, gc) ((p) == 2 ? PLAYER2INPUTDOWN(gc) : PLAYER1INPUTDOWN(gc))
|
||||
|
||||
#define num_gcl_tutorial_check 6
|
||||
#define num_gcl_tutorial_used 8
|
||||
|
|
|
@ -2201,10 +2201,14 @@ void HU_Drawer(void)
|
|||
return;
|
||||
|
||||
// draw the crosshair, not when viewing demos nor with chasecam
|
||||
if (!automapactive && cv_crosshair.value && !demoplayback && !camera.chase && !players[displayplayer].spectator)
|
||||
if (!automapactive && cv_crosshair.value && !demoplayback &&
|
||||
(!camera.chase || ticcmd_ztargetfocus[0])
|
||||
&& !players[displayplayer].spectator)
|
||||
HU_DrawCrosshair();
|
||||
|
||||
if (!automapactive && cv_crosshair2.value && !demoplayback && !camera2.chase && !players[secondarydisplayplayer].spectator)
|
||||
if (!automapactive && cv_crosshair2.value && !demoplayback &&
|
||||
(!camera2.chase || ticcmd_ztargetfocus[1])
|
||||
&& !players[secondarydisplayplayer].spectator)
|
||||
HU_DrawCrosshair2();
|
||||
|
||||
// draw desynch text
|
||||
|
|
|
@ -1304,7 +1304,7 @@ void OP_ObjectplaceMovement(player_t *player)
|
|||
{
|
||||
ticcmd_t *cmd = &player->cmd;
|
||||
|
||||
if (!player->climbing && (netgame || !cv_analog.value || (player->pflags & PF_SPINNING)))
|
||||
if (!player->climbing && (netgame || !cv_analog[0].value || (player->pflags & PF_SPINNING)))
|
||||
player->drawangle = player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
|
||||
ticruned++;
|
||||
|
|
374
src/m_menu.c
374
src/m_menu.c
|
@ -298,11 +298,14 @@ menu_t OP_MPControlsDef, OP_MiscControlsDef;
|
|||
menu_t OP_P1ControlsDef, OP_P2ControlsDef, OP_MouseOptionsDef;
|
||||
menu_t OP_Mouse2OptionsDef, OP_Joystick1Def, OP_Joystick2Def;
|
||||
menu_t OP_CameraOptionsDef, OP_Camera2OptionsDef;
|
||||
menu_t OP_PlaystyleDef;
|
||||
static void M_VideoModeMenu(INT32 choice);
|
||||
static void M_Setup1PControlsMenu(INT32 choice);
|
||||
static void M_Setup2PControlsMenu(INT32 choice);
|
||||
static void M_Setup1PJoystickMenu(INT32 choice);
|
||||
static void M_Setup2PJoystickMenu(INT32 choice);
|
||||
static void M_Setup1PPlaystyleMenu(INT32 choice);
|
||||
static void M_Setup2PPlaystyleMenu(INT32 choice);
|
||||
static void M_AssignJoystick(INT32 choice);
|
||||
static void M_ChangeControl(INT32 choice);
|
||||
|
||||
|
@ -348,6 +351,9 @@ static void M_DrawLevelStats(void);
|
|||
static void M_DrawTimeAttackMenu(void);
|
||||
static void M_DrawNightsAttackMenu(void);
|
||||
static void M_DrawSetupChoosePlayerMenu(void);
|
||||
static void M_DrawControlsDefMenu(void);
|
||||
static void M_DrawCameraOptionsMenu(void);
|
||||
static void M_DrawPlaystyleMenu(void);
|
||||
static void M_DrawControl(void);
|
||||
static void M_DrawMainVideoMenu(void);
|
||||
static void M_DrawVideoMode(void);
|
||||
|
@ -375,6 +381,7 @@ static void M_HandleSoundTest(INT32 choice);
|
|||
static void M_HandleImageDef(INT32 choice);
|
||||
static void M_HandleLoadSave(INT32 choice);
|
||||
static void M_HandleLevelStats(INT32 choice);
|
||||
static void M_HandlePlaystyleMenu(INT32 choice);
|
||||
#ifndef NONET
|
||||
static boolean M_CancelConnect(void);
|
||||
static void M_HandleConnectIP(INT32 choice);
|
||||
|
@ -1040,9 +1047,8 @@ static menuitem_t OP_P1ControlsMenu[] =
|
|||
|
||||
{IT_SUBMENU | IT_STRING, NULL, "Camera Options...", &OP_CameraOptionsDef, 50},
|
||||
|
||||
//{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Character angle", &cv_directionchar, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Automatic braking", &cv_autobrake, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Automatic braking", &cv_autobrake, 70},
|
||||
{IT_CALL | IT_STRING, NULL, "Play Style...", M_Setup1PPlaystyleMenu, 80},
|
||||
};
|
||||
|
||||
static menuitem_t OP_P2ControlsMenu[] =
|
||||
|
@ -1053,9 +1059,8 @@ static menuitem_t OP_P2ControlsMenu[] =
|
|||
|
||||
{IT_SUBMENU | IT_STRING, NULL, "Camera Options...", &OP_Camera2OptionsDef, 50},
|
||||
|
||||
//{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "Character angle", &cv_directionchar2, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Automatic braking", &cv_autobrake2, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Automatic braking", &cv_autobrake2, 70},
|
||||
{IT_CALL | IT_STRING, NULL, "Play Style...", M_Setup2PPlaystyleMenu, 80},
|
||||
};
|
||||
|
||||
static menuitem_t OP_ChangeControlsMenu[] =
|
||||
|
@ -1127,8 +1132,8 @@ static menuitem_t OP_Joystick1Menu[] =
|
|||
|
||||
{IT_STRING | IT_CVAR, NULL, "First-Person Vert-Look", &cv_alwaysfreelook, 120},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-Person Vert-Look", &cv_chasefreelook, 130},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER,
|
||||
NULL, "Deadzone", &cv_deadzone, 140 },
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Analog Deadzone", &cv_deadzone, 140},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Digital Deadzone", &cv_digitaldeadzone, 150},
|
||||
};
|
||||
|
||||
static menuitem_t OP_Joystick2Menu[] =
|
||||
|
@ -1145,8 +1150,8 @@ static menuitem_t OP_Joystick2Menu[] =
|
|||
|
||||
{IT_STRING | IT_CVAR, NULL, "First-Person Vert-Look", &cv_alwaysfreelook2,120},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-Person Vert-Look", &cv_chasefreelook2, 130},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER,
|
||||
NULL, "Deadzone", &cv_deadzone2, 140 },
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Analog Deadzone", &cv_deadzone2,140},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Digital Deadzone", &cv_digitaldeadzone2,150},
|
||||
};
|
||||
|
||||
static menuitem_t OP_JoystickSetMenu[1+MAX_JOYSTICKS];
|
||||
|
@ -1183,32 +1188,98 @@ static menuitem_t OP_Mouse2OptionsMenu[] =
|
|||
|
||||
static menuitem_t OP_CameraOptionsMenu[] =
|
||||
{
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam , 10},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam , 20},
|
||||
{IT_STRING | IT_CVAR, NULL, "Orbital Looking" , &cv_cam_orbit , 30},
|
||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam_adjust, 40},
|
||||
{IT_HEADER, NULL, "General Toggles", NULL, 0},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam , 6},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam , 11},
|
||||
{IT_STRING | IT_CVAR, NULL, "Orbital Looking" , &cv_cam_orbit , 16},
|
||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam_adjust, 21},
|
||||
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_dist, 60},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_height, 70},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam_speed, 80},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Turning Speed", &cv_cam_turnmultiplier, 90},
|
||||
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_savedist[0][0], 36},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_saveheight[0][0], 41},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam_speed, 46},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam_turnmultiplier, 51},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 100},
|
||||
{IT_HEADER, NULL, "Display Options", NULL, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 66},
|
||||
};
|
||||
|
||||
static menuitem_t OP_Camera2OptionsMenu[] =
|
||||
{
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam2 , 10},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam2 , 20},
|
||||
{IT_STRING | IT_CVAR, NULL, "Orbital Looking" , &cv_cam2_orbit , 30},
|
||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam2_adjust, 40},
|
||||
{IT_HEADER, NULL, "General Toggles", NULL, 0},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam2 , 6},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam2 , 11},
|
||||
{IT_STRING | IT_CVAR, NULL, "Orbital Looking" , &cv_cam2_orbit , 16},
|
||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam2_adjust, 21},
|
||||
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam2_dist, 60},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam2_height, 70},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam2_speed, 80},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Turning Speed", &cv_cam2_turnmultiplier, 90},
|
||||
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_savedist[0][1], 36},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_saveheight[0][1], 41},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam2_speed, 46},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam2_turnmultiplier, 51},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 100},
|
||||
{IT_HEADER, NULL, "Display Options", NULL, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 66},
|
||||
};
|
||||
|
||||
static menuitem_t OP_CameraExtendedOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "General Toggles", NULL, 0},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam , 6},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam , 11},
|
||||
{IT_STRING | IT_CVAR, NULL, "Orbital Looking" , &cv_cam_orbit , 16},
|
||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam_adjust, 21},
|
||||
|
||||
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_savedist[1][0], 36},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_saveheight[1][0], 41},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam_speed, 46},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam_turnmultiplier, 51},
|
||||
|
||||
{IT_HEADER, NULL, "Automatic Camera Options", NULL, 60},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Shift to player angle", &cv_cam_shiftfacing[0], 66},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Turn to player angle", &cv_cam_turnfacing[0], 71},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Turn to ability", &cv_cam_turnfacingability[0], 76},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Turn to spindash", &cv_cam_turnfacingspindash[0], 81},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Turn to input", &cv_cam_turnfacinginput[0], 86},
|
||||
|
||||
{IT_HEADER, NULL, "Locked Camera Options", NULL, 95},
|
||||
{IT_STRING | IT_CVAR, NULL, "Lock button behavior", &cv_cam_centertoggle[0], 101},
|
||||
{IT_STRING | IT_CVAR, NULL, "Sideways movement", &cv_cam_lockedinput[0], 106},
|
||||
{IT_STRING | IT_CVAR, NULL, "Targeting assist", &cv_cam_lockonboss[0], 111},
|
||||
|
||||
{IT_HEADER, NULL, "Display Options", NULL, 120},
|
||||
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 126},
|
||||
};
|
||||
|
||||
static menuitem_t OP_Camera2ExtendedOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "General Toggles", NULL, 0},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-person Camera" , &cv_chasecam2 , 6},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flip Camera with Gravity" , &cv_flipcam2 , 11},
|
||||
{IT_STRING | IT_CVAR, NULL, "Orbital Looking" , &cv_cam2_orbit , 16},
|
||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam2_adjust, 21},
|
||||
|
||||
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_savedist[1][1], 36},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_saveheight[1][1], 41},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam2_speed, 46},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam2_turnmultiplier, 51},
|
||||
|
||||
{IT_HEADER, NULL, "Automatic Camera Options", NULL, 60},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Shift to player angle", &cv_cam_shiftfacing[1], 66},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Turn to player angle", &cv_cam_turnfacing[1], 71},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Turn to ability", &cv_cam_turnfacingability[1], 76},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Turn to spindash", &cv_cam_turnfacingspindash[1], 81},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Turn to input", &cv_cam_turnfacinginput[1], 86},
|
||||
|
||||
{IT_HEADER, NULL, "Locked Camera Options", NULL, 95},
|
||||
{IT_STRING | IT_CVAR, NULL, "Lock button behavior", &cv_cam_centertoggle[1], 101},
|
||||
{IT_STRING | IT_CVAR, NULL, "Sideways movement", &cv_cam_lockedinput[1], 106},
|
||||
{IT_STRING | IT_CVAR, NULL, "Targeting assist", &cv_cam_lockonboss[1], 111},
|
||||
|
||||
{IT_HEADER, NULL, "Display Options", NULL, 120},
|
||||
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 126},
|
||||
};
|
||||
|
||||
static menuitem_t OP_VideoOptionsMenu[] =
|
||||
|
@ -1927,12 +1998,24 @@ menu_t OP_MainDef = DEFAULTMENUSTYLE(
|
|||
menu_t OP_ChangeControlsDef = CONTROLMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_CHANGECONTROLS << 12), // second level (<<6) set on runtime
|
||||
OP_ChangeControlsMenu, &OP_MainDef);
|
||||
menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE(
|
||||
|
||||
menu_t OP_P1ControlsDef = {
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6),
|
||||
"M_CONTRO", OP_P1ControlsMenu, &OP_MainDef, 50, 30);
|
||||
menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE(
|
||||
"M_CONTRO",
|
||||
sizeof(OP_P1ControlsMenu)/sizeof(menuitem_t),
|
||||
&OP_MainDef,
|
||||
OP_P1ControlsMenu,
|
||||
M_DrawControlsDefMenu,
|
||||
50, 30, 0, NULL};
|
||||
menu_t OP_P2ControlsDef = {
|
||||
MN_OP_MAIN + (MN_OP_P2CONTROLS << 6),
|
||||
"M_CONTRO", OP_P2ControlsMenu, &OP_MainDef, 50, 30);
|
||||
"M_CONTRO",
|
||||
sizeof(OP_P2ControlsMenu)/sizeof(menuitem_t),
|
||||
&OP_MainDef,
|
||||
OP_P2ControlsMenu,
|
||||
M_DrawControlsDefMenu,
|
||||
50, 30, 0, NULL};
|
||||
|
||||
menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE(
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_P1MOUSE << 12),
|
||||
"M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 35, 30);
|
||||
|
@ -1957,12 +2040,41 @@ menu_t OP_JoystickSetDef =
|
|||
0,
|
||||
NULL
|
||||
};
|
||||
menu_t OP_CameraOptionsDef = DEFAULTMENUSTYLE(
|
||||
|
||||
menu_t OP_CameraOptionsDef = {
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_P1CAMERA << 12),
|
||||
"M_CONTRO", OP_CameraOptionsMenu, &OP_P1ControlsDef, 35, 30);
|
||||
menu_t OP_Camera2OptionsDef = DEFAULTMENUSTYLE(
|
||||
"M_CONTRO",
|
||||
sizeof (OP_CameraOptionsMenu)/sizeof (menuitem_t),
|
||||
&OP_P1ControlsDef,
|
||||
OP_CameraOptionsMenu,
|
||||
M_DrawCameraOptionsMenu,
|
||||
35, 30,
|
||||
0,
|
||||
NULL
|
||||
};
|
||||
menu_t OP_Camera2OptionsDef = {
|
||||
MN_OP_MAIN + (MN_OP_P2CONTROLS << 6) + (MN_OP_P2CAMERA << 12),
|
||||
"M_CONTRO", OP_Camera2OptionsMenu, &OP_P2ControlsDef, 35, 30);
|
||||
"M_CONTRO",
|
||||
sizeof (OP_Camera2OptionsMenu)/sizeof (menuitem_t),
|
||||
&OP_P2ControlsDef,
|
||||
OP_Camera2OptionsMenu,
|
||||
M_DrawCameraOptionsMenu,
|
||||
35, 30,
|
||||
0,
|
||||
NULL
|
||||
};
|
||||
|
||||
static menuitem_t OP_PlaystyleMenu[] = {{IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandlePlaystyleMenu, 0}};
|
||||
|
||||
menu_t OP_PlaystyleDef = {
|
||||
MN_OP_MAIN + (MN_OP_P1CONTROLS << 6) + (MN_OP_PLAYSTYLE << 12),
|
||||
NULL,
|
||||
1,
|
||||
&OP_P1ControlsDef,
|
||||
OP_PlaystyleMenu,
|
||||
M_DrawPlaystyleMenu,
|
||||
0, 0, 0, NULL
|
||||
};
|
||||
|
||||
|
||||
menu_t OP_VideoOptionsDef =
|
||||
|
@ -3079,7 +3191,7 @@ boolean M_Responder(event_t *ev)
|
|||
}
|
||||
else if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime())
|
||||
{
|
||||
const INT32 jdeadzone = (JOYAXISRANGE * cv_deadzone.value) / FRACUNIT;
|
||||
const INT32 jdeadzone = (JOYAXISRANGE * cv_digitaldeadzone.value) / FRACUNIT;
|
||||
if (ev->data3 != INT32_MAX)
|
||||
{
|
||||
if (Joystick.bGamepadStyle || abs(ev->data3) > jdeadzone)
|
||||
|
@ -4197,6 +4309,102 @@ static void M_DrawGenericMenu(void)
|
|||
}
|
||||
}
|
||||
|
||||
const char *PlaystyleNames[4] = {"Legacy", "Standard", "Simple", "Old Analog??"};
|
||||
const char *PlaystyleDesc[4] = {
|
||||
// Legacy
|
||||
"The play style used for\n"
|
||||
"old-school SRB2.\n"
|
||||
"\n"
|
||||
"This play style is identical\n"
|
||||
"to Standard, except that the\n"
|
||||
"player always looks in the\n"
|
||||
"direction of the camera."
|
||||
,
|
||||
|
||||
// Standard
|
||||
"The default play style,\n"
|
||||
"designed for full control\n"
|
||||
"with a keyboard and mouse.\n"
|
||||
"\n"
|
||||
"The camera rotates only when\n"
|
||||
"you tell it to. The player\n"
|
||||
"looks in the direction they're\n"
|
||||
"moving, but acts in the direction\n"
|
||||
"the camera is facing.\n"
|
||||
"\n"
|
||||
"Mastery of this play style will\n"
|
||||
"open up the highest level of play!"
|
||||
,
|
||||
|
||||
// Simple
|
||||
"A play style designed for\n"
|
||||
"gamepads and hassle-free play.\n"
|
||||
"\n"
|
||||
"The camera rotates automatically\n"
|
||||
"as you move, and the player faces\n"
|
||||
"and acts in the direction\n"
|
||||
"they're moving.\n"
|
||||
"\n"
|
||||
"Hold \x82" "Center View\x80 to lock the\n"
|
||||
"camera behind the player!\n"
|
||||
,
|
||||
|
||||
// Old Analog
|
||||
"I see.\n"
|
||||
"\n"
|
||||
"You really liked the old analog mode,\n"
|
||||
"so when 2.2 came out, you opened up\n"
|
||||
"your config file and brought it back.\n"
|
||||
"\n"
|
||||
"That's absolutely valid, but I implore\n"
|
||||
"you to try the new Simple play style\n"
|
||||
"instead!"
|
||||
};
|
||||
|
||||
static UINT8 playstyle_activeplayer = 0, playstyle_currentchoice = 0;
|
||||
|
||||
static void M_DrawControlsDefMenu(void)
|
||||
{
|
||||
UINT8 opt = 0;
|
||||
|
||||
M_DrawGenericMenu();
|
||||
|
||||
if (currentMenu == &OP_P1ControlsDef)
|
||||
{
|
||||
opt = cv_directionchar[0].value ? 1 : 0;
|
||||
opt = playstyle_currentchoice = cv_useranalog[0].value ? 3 - opt : opt;
|
||||
|
||||
if (opt == 2)
|
||||
{
|
||||
OP_CameraOptionsDef.menuitems = OP_CameraExtendedOptionsMenu;
|
||||
OP_CameraOptionsDef.numitems = sizeof (OP_CameraExtendedOptionsMenu) / sizeof (menuitem_t);
|
||||
}
|
||||
else
|
||||
{
|
||||
OP_CameraOptionsDef.menuitems = OP_CameraOptionsMenu;
|
||||
OP_CameraOptionsDef.numitems = sizeof (OP_CameraOptionsMenu) / sizeof (menuitem_t);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
opt = cv_directionchar[1].value ? 1 : 0;
|
||||
opt = playstyle_currentchoice = cv_useranalog[1].value ? 3 - opt : opt;
|
||||
|
||||
if (opt == 2)
|
||||
{
|
||||
OP_Camera2OptionsDef.menuitems = OP_Camera2ExtendedOptionsMenu;
|
||||
OP_Camera2OptionsDef.numitems = sizeof (OP_Camera2ExtendedOptionsMenu) / sizeof (menuitem_t);
|
||||
}
|
||||
else
|
||||
{
|
||||
OP_Camera2OptionsDef.menuitems = OP_Camera2OptionsMenu;
|
||||
OP_Camera2OptionsDef.numitems = sizeof (OP_Camera2OptionsMenu) / sizeof (menuitem_t);
|
||||
}
|
||||
}
|
||||
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + 80, V_YELLOWMAP, PlaystyleNames[opt]);
|
||||
}
|
||||
|
||||
#define scrollareaheight 72
|
||||
|
||||
// note that alphakey is multiplied by 2 for scrolling menus to allow greater usage in UINT8 range.
|
||||
|
@ -4208,7 +4416,9 @@ static void M_DrawGenericScrollMenu(void)
|
|||
x = currentMenu->x;
|
||||
y = currentMenu->y;
|
||||
|
||||
if ((currentMenu->menuitems[itemOn].alphaKey*2 - currentMenu->menuitems[0].alphaKey*2) <= scrollareaheight)
|
||||
if (currentMenu->menuitems[currentMenu->numitems-1].alphaKey < scrollareaheight)
|
||||
tempcentery = currentMenu->y; // Not tall enough to scroll, but this thinker is used in case it becomes so
|
||||
else if ((currentMenu->menuitems[itemOn].alphaKey*2 - currentMenu->menuitems[0].alphaKey*2) <= scrollareaheight)
|
||||
tempcentery = currentMenu->y - currentMenu->menuitems[0].alphaKey*2;
|
||||
else if ((currentMenu->menuitems[currentMenu->numitems-1].alphaKey*2 - currentMenu->menuitems[itemOn].alphaKey*2) <= scrollareaheight)
|
||||
tempcentery = currentMenu->y - currentMenu->menuitems[currentMenu->numitems-1].alphaKey*2 + 2*scrollareaheight;
|
||||
|
@ -7644,7 +7854,7 @@ void M_TutorialSaveControlResponse(INT32 ch)
|
|||
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
|
||||
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
|
||||
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
|
||||
CV_Set(&cv_analog, cv_analog.defaultvalue);
|
||||
CV_Set(&cv_analog[0], cv_analog[0].defaultvalue);
|
||||
S_StartSound(NULL, sfx_itemup);
|
||||
}
|
||||
else
|
||||
|
@ -7662,13 +7872,13 @@ static void M_TutorialControlResponse(INT32 ch)
|
|||
tutorialusemouse = cv_usemouse.value;
|
||||
tutorialfreelook = cv_alwaysfreelook.value;
|
||||
tutorialmousemove = cv_mousemove.value;
|
||||
tutorialanalog = cv_analog.value;
|
||||
tutorialanalog = cv_analog[0].value;
|
||||
|
||||
G_CopyControls(gamecontrol, gamecontroldefault[tutorialgcs], gcl_tutorial_full, num_gcl_tutorial_full);
|
||||
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
|
||||
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
|
||||
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
|
||||
CV_Set(&cv_analog, cv_analog.defaultvalue);
|
||||
CV_Set(&cv_analog[0], cv_analog[0].defaultvalue);
|
||||
|
||||
//S_StartSound(NULL, sfx_itemup);
|
||||
}
|
||||
|
@ -11575,6 +11785,88 @@ static void M_ChangeControl(INT32 choice)
|
|||
M_StartMessage(tmp, M_ChangecontrolResponse, MM_EVENTHANDLER);
|
||||
}
|
||||
|
||||
static void M_Setup1PPlaystyleMenu(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
|
||||
playstyle_activeplayer = 0;
|
||||
OP_PlaystyleDef.prevMenu = &OP_P1ControlsDef;
|
||||
M_SetupNextMenu(&OP_PlaystyleDef);
|
||||
}
|
||||
|
||||
static void M_Setup2PPlaystyleMenu(INT32 choice)
|
||||
{
|
||||
(void)choice;
|
||||
|
||||
playstyle_activeplayer = 1;
|
||||
OP_PlaystyleDef.prevMenu = &OP_P2ControlsDef;
|
||||
M_SetupNextMenu(&OP_PlaystyleDef);
|
||||
}
|
||||
|
||||
static void M_DrawPlaystyleMenu(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (i != 3)
|
||||
V_DrawCenteredString((i+1)*BASEVIDWIDTH/4, 20, (i == playstyle_currentchoice) ? V_YELLOWMAP : 0, PlaystyleNames[i]);
|
||||
|
||||
if (i == playstyle_currentchoice)
|
||||
{
|
||||
V_DrawScaledPatch((i+1)*BASEVIDWIDTH/4 - 8, 10, 0, W_CachePatchName("M_CURSOR", PU_CACHE));
|
||||
V_DrawString(30, 50, V_ALLOWLOWERCASE, PlaystyleDesc[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void M_HandlePlaystyleMenu(INT32 choice)
|
||||
{
|
||||
switch (choice)
|
||||
{
|
||||
case KEY_ESCAPE:
|
||||
case KEY_BACKSPACE:
|
||||
M_SetupNextMenu(currentMenu->prevMenu);
|
||||
break;
|
||||
|
||||
case KEY_ENTER:
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
CV_SetValue((playstyle_activeplayer ? &cv_directionchar[1] : &cv_directionchar[0]), playstyle_currentchoice ? 1 : 0);
|
||||
CV_SetValue((playstyle_activeplayer ? &cv_useranalog[1] : &cv_useranalog[0]), playstyle_currentchoice/2);
|
||||
|
||||
if (playstyle_activeplayer)
|
||||
CV_UpdateCam2Dist();
|
||||
else
|
||||
CV_UpdateCamDist();
|
||||
|
||||
M_SetupNextMenu(currentMenu->prevMenu);
|
||||
break;
|
||||
|
||||
case KEY_LEFTARROW:
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
playstyle_currentchoice = (playstyle_currentchoice+2)%3;
|
||||
break;
|
||||
|
||||
case KEY_RIGHTARROW:
|
||||
S_StartSound(NULL, sfx_menu1);
|
||||
playstyle_currentchoice = (playstyle_currentchoice+1)%3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void M_DrawCameraOptionsMenu(void)
|
||||
{
|
||||
M_DrawGenericScrollMenu();
|
||||
|
||||
if (gamestate == GS_LEVEL && (paused || P_AutoPause()))
|
||||
{
|
||||
if (currentMenu == &OP_Camera2OptionsDef && splitscreen && camera2.chase)
|
||||
P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false);
|
||||
if (currentMenu == &OP_CameraOptionsDef && camera.chase)
|
||||
P_MoveChaseCamera(&players[displayplayer], &camera, false);
|
||||
}
|
||||
}
|
||||
|
||||
// ===============
|
||||
// VIDEO MODE MENU
|
||||
// ===============
|
||||
|
|
|
@ -81,6 +81,8 @@ typedef enum
|
|||
MN_OP_P2JOYSTICK,
|
||||
MN_OP_P2CAMERA,
|
||||
|
||||
MN_OP_PLAYSTYLE,
|
||||
|
||||
MN_OP_VIDEO,
|
||||
MN_OP_VIDEOMODE,
|
||||
MN_OP_COLOR,
|
||||
|
|
|
@ -600,12 +600,12 @@ void M_SaveConfig(const char *filename)
|
|||
CV_SetValue(&cv_usemouse, tutorialusemouse);
|
||||
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
|
||||
CV_SetValue(&cv_mousemove, tutorialmousemove);
|
||||
CV_SetValue(&cv_analog, tutorialanalog);
|
||||
CV_SetValue(&cv_analog[0], tutorialanalog);
|
||||
CV_SaveVariables(f);
|
||||
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
|
||||
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
|
||||
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
|
||||
CV_Set(&cv_analog, cv_analog.defaultvalue);
|
||||
CV_Set(&cv_analog[0], cv_analog[0].defaultvalue);
|
||||
}
|
||||
else
|
||||
CV_SaveVariables(f);
|
||||
|
|
|
@ -120,6 +120,10 @@ extern consvar_t cv_cam_speed, cv_cam_rotate, cv_cam_rotspeed, cv_cam_turnmultip
|
|||
extern consvar_t cv_cam2_dist, cv_cam2_still, cv_cam2_height;
|
||||
extern consvar_t cv_cam2_speed, cv_cam2_rotate, cv_cam2_rotspeed, cv_cam2_turnmultiplier, cv_cam2_orbit, cv_cam2_adjust;
|
||||
|
||||
extern consvar_t cv_cam_savedist[2][2], cv_cam_saveheight[2][2];
|
||||
void CV_UpdateCamDist(void);
|
||||
void CV_UpdateCam2Dist(void);
|
||||
|
||||
extern fixed_t t_cam_dist, t_cam_height, t_cam_rotate;
|
||||
extern fixed_t t_cam2_dist, t_cam2_height, t_cam2_rotate;
|
||||
|
||||
|
@ -181,16 +185,14 @@ fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move);
|
|||
fixed_t P_ReturnThrustY(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
|
||||
mobj_t *P_LookForFocusTarget(player_t *player, mobj_t *exclude, SINT8 direction, UINT8 lockonflags);
|
||||
|
||||
mobj_t *P_LookForEnemies(player_t *player, boolean nonenemies, boolean bullet);
|
||||
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
|
||||
boolean P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
|
||||
boolean P_SuperReady(player_t *player);
|
||||
void P_DoJump(player_t *player, boolean soundandstate);
|
||||
#if 0
|
||||
boolean P_AnalogMove(player_t *player);
|
||||
#else
|
||||
#define P_AnalogMove(player) (player->pflags & PF_ANALOGMODE)
|
||||
#endif
|
||||
#define P_AnalogMove(player) (P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
boolean P_TransferToNextMare(player_t *player);
|
||||
UINT8 P_FindLowestMare(void);
|
||||
void P_FindEmerald(void);
|
||||
|
|
12
src/p_map.c
12
src/p_map.c
|
@ -377,7 +377,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
{
|
||||
object->angle = object->player->drawangle = spring->angle;
|
||||
|
||||
if (!demoplayback || P_AnalogMove(object->player))
|
||||
if (!demoplayback || P_ControlStyle(object->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (object->player == &players[consoleplayer])
|
||||
localangle = spring->angle;
|
||||
|
@ -632,7 +632,7 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails)
|
|||
&& P_MobjFlip(tails->mo)*sonic->mo->momz <= 0)
|
||||
{
|
||||
if (sonic-players == consoleplayer && botingame)
|
||||
CV_SetValue(&cv_analog2, false);
|
||||
CV_SetValue(&cv_analog[1], false);
|
||||
P_ResetPlayer(sonic);
|
||||
P_SetTarget(&sonic->mo->tracer, tails->mo);
|
||||
sonic->powers[pw_carry] = CR_PLAYER;
|
||||
|
@ -644,7 +644,7 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails)
|
|||
}
|
||||
else {
|
||||
if (sonic-players == consoleplayer && botingame)
|
||||
CV_SetValue(&cv_analog2, true);
|
||||
CV_SetValue(&cv_analog[1], true);
|
||||
P_SetTarget(&sonic->mo->tracer, NULL);
|
||||
sonic->powers[pw_carry] = CR_NONE;
|
||||
}
|
||||
|
@ -1327,7 +1327,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
thing->angle = tmthing->angle;
|
||||
|
||||
if (!demoplayback || P_AnalogMove(thing->player))
|
||||
if (!demoplayback || P_ControlStyle(thing->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (thing->player == &players[consoleplayer])
|
||||
localangle = thing->angle;
|
||||
|
@ -1626,7 +1626,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
}
|
||||
else if (thing->player) {
|
||||
if (thing->player-players == consoleplayer && botingame)
|
||||
CV_SetValue(&cv_analog2, true);
|
||||
CV_SetValue(&cv_analog[1], true);
|
||||
if (thing->player->powers[pw_carry] == CR_PLAYER)
|
||||
{
|
||||
P_SetTarget(&thing->tracer, NULL);
|
||||
|
@ -3509,7 +3509,7 @@ isblocking:
|
|||
&& canclimb)
|
||||
{
|
||||
slidemo->angle = climbangle;
|
||||
/*if (!demoplayback || P_AnalogMove(slidemo->player))
|
||||
/*if (!demoplayback || P_ControlStyle(slidemo->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (slidemo->player == &players[consoleplayer])
|
||||
localangle = slidemo->angle;
|
||||
|
|
|
@ -1351,9 +1351,9 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
|
|||
if (turnthings == 2 || (turnthings == 1 && !mo->player)) {
|
||||
mo->angle += delta;
|
||||
if (mo->player == &players[consoleplayer])
|
||||
localangle = mo->angle;
|
||||
localangle += delta;
|
||||
else if (mo->player == &players[secondarydisplayplayer])
|
||||
localangle2 = mo->angle;
|
||||
localangle2 += delta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2850,7 +2850,7 @@ static void P_InitLevelSettings(void)
|
|||
}
|
||||
|
||||
if (botingame)
|
||||
CV_SetValue(&cv_analog2, true);
|
||||
CV_SetValue(&cv_analog[1], true);
|
||||
}
|
||||
|
||||
// Respawns all the mapthings and mobjs in the map from the already loaded map data.
|
||||
|
@ -3161,26 +3161,26 @@ static void P_InitCamera(void)
|
|||
if (!cv_cam2_rotate.changed)
|
||||
CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);
|
||||
|
||||
if (!cv_analog.changed)
|
||||
CV_SetValue(&cv_analog, 0);
|
||||
if (!cv_analog2.changed)
|
||||
CV_SetValue(&cv_analog2, 0);
|
||||
if (!cv_analog[0].changed)
|
||||
CV_SetValue(&cv_analog[0], 0);
|
||||
if (!cv_analog[1].changed)
|
||||
CV_SetValue(&cv_analog[1], 0);
|
||||
|
||||
displayplayer = consoleplayer; // Start with your OWN view, please!
|
||||
}
|
||||
|
||||
if (twodlevel)
|
||||
{
|
||||
CV_SetValue(&cv_analog, false);
|
||||
CV_SetValue(&cv_analog2, false);
|
||||
CV_SetValue(&cv_analog[0], false);
|
||||
CV_SetValue(&cv_analog[1], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cv_useranalog.value)
|
||||
CV_SetValue(&cv_analog, true);
|
||||
if (cv_useranalog[0].value)
|
||||
CV_SetValue(&cv_analog[0], true);
|
||||
|
||||
if ((splitscreen && cv_useranalog2.value) || botingame)
|
||||
CV_SetValue(&cv_analog2, true);
|
||||
if ((splitscreen && cv_useranalog[1].value) || botingame)
|
||||
CV_SetValue(&cv_analog[1], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3427,6 +3427,9 @@ boolean P_LoadLevel(boolean fromnetsave)
|
|||
/*if (!cv_cam_speed.changed)
|
||||
CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue);*/
|
||||
|
||||
CV_UpdateCamDist();
|
||||
CV_UpdateCam2Dist();
|
||||
|
||||
if (!cv_chasecam.changed)
|
||||
CV_SetValue(&cv_chasecam, chase);
|
||||
|
||||
|
|
|
@ -4614,7 +4614,7 @@ DoneSection2:
|
|||
|
||||
player->mo->angle = player->drawangle = lineangle;
|
||||
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
|
@ -9127,7 +9127,7 @@ void T_Pusher(pusher_t *p)
|
|||
thing->player->pflags |= PF_SLIDING;
|
||||
thing->angle = R_PointToAngle2 (0, 0, xspeed<<(FRACBITS-PUSH_FACTOR), yspeed<<(FRACBITS-PUSH_FACTOR));
|
||||
|
||||
if (!demoplayback || P_AnalogMove(thing->player))
|
||||
if (!demoplayback || P_ControlStyle(thing->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (thing->player == &players[consoleplayer])
|
||||
{
|
||||
|
|
325
src/p_user.c
325
src/p_user.c
|
@ -42,6 +42,8 @@
|
|||
#include "b_bot.h"
|
||||
// Objectplace
|
||||
#include "m_cheat.h"
|
||||
// Thok camera snap (ctrl-f "chalupa")
|
||||
#include "g_input.h"
|
||||
|
||||
#ifdef HW3SOUND
|
||||
#include "hardware/hw3sound.h"
|
||||
|
@ -1063,7 +1065,7 @@ void P_ResetPlayer(player_t *player)
|
|||
player->onconveyor = 0;
|
||||
player->skidtime = 0;
|
||||
if (player-players == consoleplayer && botingame)
|
||||
CV_SetValue(&cv_analog2, true);
|
||||
CV_SetValue(&cv_analog[1], true);
|
||||
}
|
||||
|
||||
// P_PlayerCanDamage
|
||||
|
@ -3578,7 +3580,7 @@ static void P_DoClimbing(player_t *player)
|
|||
}
|
||||
|
||||
#define CLIMBCONEMAX FixedAngle(90*FRACUNIT)
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
{
|
||||
|
@ -4393,7 +4395,7 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
|
||||
player->drawangle = player->mo->angle = player->mo->angle - ANGLE_180; // Turn around from the wall you were climbing.
|
||||
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle; // Adjust the local control angle.
|
||||
|
@ -4437,7 +4439,7 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
player->powers[pw_carry] = CR_NONE;
|
||||
P_SetTarget(&player->mo->tracer, NULL);
|
||||
if (player-players == consoleplayer && botingame)
|
||||
CV_SetValue(&cv_analog2, true);
|
||||
CV_SetValue(&cv_analog[1], true);
|
||||
}
|
||||
else if (player->powers[pw_carry] == CR_GENERIC)
|
||||
{
|
||||
|
@ -4641,7 +4643,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
if (player->dashspeed > player->maxdash)
|
||||
player->dashspeed = player->maxdash;
|
||||
|
||||
|
||||
if (player->dashspeed < player->maxdash && player->mindash != player->maxdash)
|
||||
{
|
||||
#define chargecalculation (6*(player->dashspeed - player->mindash))/(player->maxdash - player->mindash)
|
||||
|
@ -4724,7 +4726,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
|
|||
{
|
||||
player->mo->angle = R_PointToAngle2(player->mo->x, player->mo->y, lockon->x, lockon->y);
|
||||
bullet = P_SpawnPointMissile(player->mo, lockon->x, lockon->y, zpos(lockon), player->revitem, player->mo->x, player->mo->y, zpos(player->mo));
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
|
@ -5353,6 +5355,16 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
player->pflags &= ~(PF_SPINNING|PF_STARTDASH);
|
||||
player->pflags |= PF_THOKKED;
|
||||
|
||||
// Change localangle to match for simple controls? (P.S. chalupa)
|
||||
// disabled because it seemed to disorient people and Z-targeting exists now
|
||||
/*if (!demoplayback)
|
||||
{
|
||||
if (player == &players[consoleplayer] && cv_cam_turnfacingability[0].value > 0 && !(PLAYER1INPUTDOWN(gc_turnleft) || PLAYER1INPUTDOWN(gc_turnright)))
|
||||
localangle = player->mo->angle;
|
||||
else if (player == &players[secondarydisplayplayer] && cv_cam_turnfacingability[1].value > 0 && !(PLAYER2INPUTDOWN(gc_turnleft) || PLAYER2INPUTDOWN(gc_turnright)))
|
||||
localangle2 = player->mo->angle;
|
||||
}*/
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5607,13 +5619,6 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
boolean P_AnalogMove(player_t *player)
|
||||
{
|
||||
return player->pflags & PF_ANALOGMODE;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// P_GetPlayerControlDirection
|
||||
//
|
||||
|
@ -5652,7 +5657,7 @@ INT32 P_GetPlayerControlDirection(player_t *player)
|
|||
origtempangle = tempangle = 0; // relative to the axis rather than the player!
|
||||
controlplayerdirection = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
|
||||
}
|
||||
else if (P_AnalogMove(player) && thiscam->chase)
|
||||
else if ((P_ControlStyle(player) & CS_LMAOGALOG) && thiscam->chase)
|
||||
{
|
||||
if (player->awayviewtics)
|
||||
origtempangle = tempangle = player->awayviewmobj->angle;
|
||||
|
@ -5878,7 +5883,7 @@ static void P_3dMovement(player_t *player)
|
|||
INT32 mforward = 0, mbackward = 0;
|
||||
angle_t dangle; // replaces old quadrants bits
|
||||
fixed_t normalspd = FixedMul(player->normalspeed, player->mo->scale);
|
||||
boolean analogmove = false;
|
||||
controlstyle_e controlstyle;
|
||||
boolean spin = ((onground = P_IsObjectOnGround(player->mo)) && (player->pflags & (PF_SPINNING|PF_THOKKED)) == PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH));
|
||||
fixed_t oldMagnitude, newMagnitude;
|
||||
#ifdef ESLOPE
|
||||
|
@ -5891,7 +5896,7 @@ static void P_3dMovement(player_t *player)
|
|||
// Get the old momentum; this will be needed at the end of the function! -SH
|
||||
oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
|
||||
|
||||
analogmove = P_AnalogMove(player);
|
||||
controlstyle = P_ControlStyle(player);
|
||||
|
||||
cmd = &player->cmd;
|
||||
|
||||
|
@ -5918,7 +5923,7 @@ static void P_3dMovement(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
if (analogmove)
|
||||
if (controlstyle & CS_LMAOGALOG)
|
||||
{
|
||||
movepushangle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
}
|
||||
|
@ -6064,7 +6069,7 @@ static void P_3dMovement(player_t *player)
|
|||
P_SetObjectMomZ(player->mo, FixedDiv(cmd->forwardmove*FRACUNIT, 15*FRACUNIT>>1), false);
|
||||
}
|
||||
}
|
||||
else if (!analogmove
|
||||
else if (!(controlstyle == CS_LMAOGALOG)
|
||||
&& cmd->forwardmove != 0 && !(player->pflags & PF_GLIDING || player->exiting
|
||||
|| (P_PlayerInPain(player) && !onground)))
|
||||
{
|
||||
|
@ -6103,7 +6108,7 @@ static void P_3dMovement(player_t *player)
|
|||
P_InstaThrust(player->mo, player->mo->angle-ANGLE_90, FixedDiv(cmd->sidemove*player->mo->scale, 15*FRACUNIT>>1));
|
||||
}
|
||||
// Analog movement control
|
||||
else if (analogmove)
|
||||
else if (controlstyle == CS_LMAOGALOG)
|
||||
{
|
||||
if (!(player->pflags & PF_GLIDING || player->exiting || P_PlayerInPain(player)))
|
||||
{
|
||||
|
@ -8114,8 +8119,33 @@ static void P_MovePlayer(player_t *player)
|
|||
P_2dMovement(player);
|
||||
else
|
||||
{
|
||||
if (!player->climbing && (!P_AnalogMove(player)))
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
if (!player->climbing)
|
||||
{
|
||||
switch (P_ControlStyle(player))
|
||||
{
|
||||
case CS_LEGACY:
|
||||
case CS_STANDARD:
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
break;
|
||||
|
||||
case CS_LMAOGALOG:
|
||||
break; // handled elsewhere
|
||||
|
||||
case CS_SIMPLE:
|
||||
if (cmd->forwardmove || cmd->sidemove)
|
||||
{
|
||||
angle_t controlangle = R_PointToAngle2(0, 0, cmd->forwardmove << FRACBITS, -cmd->sidemove << FRACBITS);
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */) + controlangle;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle_t drawangleoffset = (player->powers[pw_carry] == CR_ROLLOUT) ? ANGLE_180 : 0;
|
||||
player->mo->angle = player->drawangle + drawangleoffset;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ticruned++;
|
||||
if ((cmd->angleturn & TICCMD_RECEIVED) == 0)
|
||||
|
@ -8241,7 +8271,7 @@ static void P_MovePlayer(player_t *player)
|
|||
if (player->pflags & PF_GLIDING)
|
||||
{
|
||||
mobj_t *mo = player->mo; // seriously why isn't this at the top of the function hngngngng
|
||||
fixed_t leeway = !P_AnalogMove(player) ? FixedAngle(cmd->sidemove*(FRACUNIT)) : 0;
|
||||
fixed_t leeway = (P_ControlStyle(player) != CS_LMAOGALOG) ? FixedAngle(cmd->sidemove*(FRACUNIT)) : 0;
|
||||
fixed_t glidespeed = player->actionspd;
|
||||
fixed_t momx = mo->momx - player->cmomx, momy = mo->momy - player->cmomy;
|
||||
angle_t angle, moveangle = R_PointToAngle2(0, 0, momx, momy);
|
||||
|
@ -8513,7 +8543,7 @@ static void P_MovePlayer(player_t *player)
|
|||
//////////////////
|
||||
|
||||
// This really looks like it should be moved to P_3dMovement. -Red
|
||||
if (P_AnalogMove(player)
|
||||
if (P_ControlStyle(player) == CS_LMAOGALOG
|
||||
&& (cmd->forwardmove != 0 || cmd->sidemove != 0) && !player->climbing && !twodlevel && !(player->mo->flags2 & MF2_TWOD))
|
||||
{
|
||||
// If travelling slow enough, face the way the controls
|
||||
|
@ -9117,6 +9147,132 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// P_LookForFocusTarget
|
||||
// Looks for a target for a player to focus on, for Z-targeting etc.
|
||||
// exclude would be the current focus target, to ignore.
|
||||
// direction, if set, requires the target to be to the left (1) or right (-1) of the angle
|
||||
// mobjflags can be used to limit the flags of objects that can be focused
|
||||
//
|
||||
mobj_t *P_LookForFocusTarget(player_t *player, mobj_t *exclude, SINT8 direction, UINT8 lockonflags)
|
||||
{
|
||||
mobj_t *mo;
|
||||
thinker_t *think;
|
||||
mobj_t *closestmo = NULL;
|
||||
const fixed_t maxdist = 2560*player->mo->scale;
|
||||
const angle_t span = ANGLE_45;
|
||||
fixed_t dist, closestdist = 0;
|
||||
angle_t dangle, closestdangle = 0;
|
||||
|
||||
for (think = thlist[THINK_MOBJ].next; think != &thlist[THINK_MOBJ]; think = think->next)
|
||||
{
|
||||
if (think->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
continue;
|
||||
|
||||
mo = (mobj_t *)think;
|
||||
|
||||
if (mo->flags & MF_NOCLIPTHING)
|
||||
continue;
|
||||
|
||||
if (mo == player->mo || mo == exclude)
|
||||
continue;
|
||||
|
||||
if (mo->health <= 0) // dead
|
||||
continue;
|
||||
|
||||
switch (mo->type)
|
||||
{
|
||||
case MT_TNTBARREL:
|
||||
if (lockonflags & LOCK_INTERESTS)
|
||||
break;
|
||||
/*fallthru*/
|
||||
case MT_PLAYER: // Don't chase other players!
|
||||
case MT_DETON:
|
||||
continue; // Don't be STUPID, Sonic!
|
||||
|
||||
case MT_FAKEMOBILE:
|
||||
if (!(lockonflags & LOCK_BOSS))
|
||||
continue;
|
||||
break;
|
||||
|
||||
case MT_EGGSHIELD:
|
||||
if (!(lockonflags & LOCK_ENEMY))
|
||||
continue;
|
||||
break;
|
||||
|
||||
case MT_EGGSTATUE:
|
||||
if (tutorialmode)
|
||||
break; // Always focus egg statue in the tutorial
|
||||
/*fallthru*/
|
||||
default:
|
||||
|
||||
if ((lockonflags & LOCK_BOSS) && ((mo->flags & (MF_BOSS|MF_SHOOTABLE)) == (MF_BOSS|MF_SHOOTABLE))) // allows if it has the flags desired XOR it has the invert aimable flag
|
||||
{
|
||||
if (mo->flags2 & MF2_FRET)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((lockonflags & LOCK_ENEMY) && (!((mo->flags & (MF_ENEMY|MF_SHOOTABLE)) == (MF_ENEMY|MF_SHOOTABLE)) != !(mo->flags2 & MF2_INVERTAIMABLE))) // allows if it has the flags desired XOR it has the invert aimable flag
|
||||
break;
|
||||
|
||||
if ((lockonflags & LOCK_INTERESTS) && (mo->flags & (MF_PUSHABLE|MF_MONITOR))) // allows if it has the flags desired XOR it has the invert aimable flag
|
||||
break;
|
||||
|
||||
continue; // not a valid object
|
||||
}
|
||||
|
||||
{
|
||||
fixed_t zdist = (player->mo->z + player->mo->height/2) - (mo->z + mo->height/2);
|
||||
dist = P_AproxDistance(player->mo->x-mo->x, player->mo->y-mo->y);
|
||||
|
||||
if (abs(zdist) > dist)
|
||||
continue; // Don't home outside of desired angle!
|
||||
|
||||
dist = P_AproxDistance(dist, zdist);
|
||||
if (dist > maxdist)
|
||||
continue; // out of range
|
||||
}
|
||||
|
||||
if ((twodlevel || player->mo->flags2 & MF2_TWOD)
|
||||
&& abs(player->mo->y-mo->y) > player->mo->radius)
|
||||
continue; // not in your 2d plane
|
||||
|
||||
dangle = R_PointToAngle2(player->mo->x, player->mo->y, mo->x, mo->y) - (
|
||||
!exclude ? player->mo->angle : R_PointToAngle2(player->mo->x, player->mo->y, exclude->x, exclude->y)
|
||||
);
|
||||
|
||||
if (direction)
|
||||
{
|
||||
if (direction == 1 && dangle > ANGLE_180)
|
||||
continue; // To the right of the player
|
||||
if (direction == -1 && dangle < ANGLE_180)
|
||||
continue; // To the left of the player
|
||||
}
|
||||
|
||||
if (dangle > ANGLE_180)
|
||||
dangle = InvAngle(dangle);
|
||||
|
||||
if (dangle > span)
|
||||
continue; // behind back
|
||||
|
||||
// Inflate dist by angle difference to bias toward objects at a closer angle
|
||||
dist = FixedDiv(dist, FINECOSINE(dangle>>ANGLETOFINESHIFT)*3);
|
||||
|
||||
if (closestmo && (exclude ? (dangle > closestdangle) : (dist > closestdist)))
|
||||
continue;
|
||||
|
||||
if (!P_CheckSight(player->mo, mo))
|
||||
continue; // out of sight
|
||||
|
||||
closestmo = mo;
|
||||
closestdist = dist;
|
||||
closestdangle = dangle;
|
||||
}
|
||||
|
||||
return closestmo;
|
||||
}
|
||||
|
||||
//
|
||||
// P_LookForEnemies
|
||||
// Looks for something you can hit - Used for homing attack
|
||||
|
@ -9232,7 +9388,7 @@ boolean P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target
|
|||
if (source->player)
|
||||
{
|
||||
source->player->drawangle = source->angle;
|
||||
if (!demoplayback || P_AnalogMove(source->player))
|
||||
if (!demoplayback || P_ControlStyle(source->player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (source->player == &players[consoleplayer])
|
||||
localangle = source->angle;
|
||||
|
@ -9584,12 +9740,12 @@ static void CV_CamRotate2_OnChange(void)
|
|||
}
|
||||
|
||||
static CV_PossibleValue_t CV_CamSpeed[] = {{0, "MIN"}, {1*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {45, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {25, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t multiplier_cons_t[] = {{0, "MIN"}, {3*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_cam_dist = {"cam_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_height = {"cam_height", "25", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_dist = {"cam_curdist", "160", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_height = {"cam_curheight", "25", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_speed = {"cam_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_rotate = {"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -9597,8 +9753,8 @@ consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NUL
|
|||
consvar_t cv_cam_turnmultiplier = {"cam_turnmultiplier", "1.0", CV_FLOAT|CV_SAVE, multiplier_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_orbit = {"cam_orbit", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_adjust = {"cam_adjust", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_dist = {"cam2_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_height = {"cam2_height", "25", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_dist = {"cam2_curdist", "160", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_height = {"cam2_curheight", "25", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_speed = {"cam2_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_rotate = {"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -9607,6 +9763,42 @@ consvar_t cv_cam2_turnmultiplier = {"cam2_turnmultiplier", "1.0", CV_FLOAT|CV_SA
|
|||
consvar_t cv_cam2_orbit = {"cam2_orbit", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_adjust = {"cam2_adjust", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// [standard vs simple][p1 or p2]
|
||||
consvar_t cv_cam_savedist[2][2] = {
|
||||
{ // standard
|
||||
{"cam_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist, 0, NULL, NULL, 0, 0, NULL}
|
||||
},
|
||||
{ // simple
|
||||
{"cam_simpledist", "224", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_simpledist", "224", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist, 0, NULL, NULL, 0, 0, NULL}
|
||||
|
||||
}
|
||||
};
|
||||
consvar_t cv_cam_saveheight[2][2] = {
|
||||
{ // standard
|
||||
{"cam_height", "25", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_height", "25", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist, 0, NULL, NULL, 0, 0, NULL}
|
||||
},
|
||||
{ // simple
|
||||
{"cam_simpleheight", "48", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_simpleheight", "48", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist, 0, NULL, NULL, 0, 0, NULL}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
void CV_UpdateCamDist(void)
|
||||
{
|
||||
CV_Set(&cv_cam_dist, va("%f", FIXED_TO_FLOAT(cv_cam_savedist[cv_useranalog[0].value][0].value)));
|
||||
CV_Set(&cv_cam_height, va("%f", FIXED_TO_FLOAT(cv_cam_saveheight[cv_useranalog[0].value][0].value)));
|
||||
}
|
||||
|
||||
void CV_UpdateCam2Dist(void)
|
||||
{
|
||||
CV_Set(&cv_cam2_dist, va("%f", FIXED_TO_FLOAT(cv_cam_savedist[cv_useranalog[1].value][1].value)));
|
||||
CV_Set(&cv_cam2_height, va("%f", FIXED_TO_FLOAT(cv_cam_saveheight[cv_useranalog[1].value][1].value)));
|
||||
}
|
||||
|
||||
fixed_t t_cam_dist = -42;
|
||||
fixed_t t_cam_height = -42;
|
||||
fixed_t t_cam_rotate = -42;
|
||||
|
@ -9640,8 +9832,14 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
|
|||
thiscam->y = y;
|
||||
thiscam->z = z;
|
||||
|
||||
if (!(thiscam == &camera && (cv_cam_still.value || cv_analog.value))
|
||||
&& !(thiscam == &camera2 && (cv_cam2_still.value || cv_analog2.value)))
|
||||
if ((thiscam == &camera && G_ControlStyle(1) == CS_SIMPLE)
|
||||
|| (thiscam == &camera2 && G_ControlStyle(2) == CS_SIMPLE))
|
||||
{
|
||||
thiscam->angle = (thiscam == &camera) ? localangle : localangle2;
|
||||
thiscam->aiming = (thiscam == &camera) ? localaiming : localaiming2;
|
||||
}
|
||||
else if (!(thiscam == &camera && (cv_cam_still.value || cv_analog[0].value))
|
||||
&& !(thiscam == &camera2 && (cv_cam2_still.value || cv_analog[1].value)))
|
||||
{
|
||||
thiscam->angle = player->mo->angle;
|
||||
thiscam->aiming = 0;
|
||||
|
@ -9666,6 +9864,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
subsector_t *newsubsec;
|
||||
fixed_t f1, f2;
|
||||
|
||||
static fixed_t camsideshift[2] = {0, 0};
|
||||
fixed_t shiftx = 0, shifty = 0;
|
||||
|
||||
// We probably shouldn't move the camera if there is no player or player mobj somehow
|
||||
if (!player || !player->mo)
|
||||
return true;
|
||||
|
@ -9756,7 +9957,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
else
|
||||
{
|
||||
focusangle = mo->angle;
|
||||
focusangle = player->cmd.angleturn << 16;
|
||||
focusaiming = player->aiming;
|
||||
}
|
||||
|
||||
|
@ -9796,7 +9997,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
camheight = FixedMul(camheight, player->camerascale);
|
||||
|
||||
#ifdef REDSANALOG
|
||||
if (P_AnalogMove(player) && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) {
|
||||
if (P_ControlStyle(player) == CS_LMAOGALOG && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) {
|
||||
camstill = true;
|
||||
|
||||
if (camspeed < 4*FRACUNIT/5)
|
||||
|
@ -9826,7 +10027,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
angle = R_PointToAngle2(mo->x, mo->y, mo->target->x, mo->target->y);
|
||||
}
|
||||
}
|
||||
else if (P_AnalogMove(player) && !sign) // Analog
|
||||
else if (P_ControlStyle(player) == CS_LMAOGALOG && !sign) // Analog
|
||||
angle = R_PointToAngle2(thiscam->x, thiscam->y, mo->x, mo->y);
|
||||
else if (demoplayback)
|
||||
{
|
||||
|
@ -9843,14 +10044,14 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
else
|
||||
angle = focusangle + FixedAngle(camrotate*FRACUNIT);
|
||||
|
||||
if (!resetcalled && (cv_analog.value || demoplayback) && ((thiscam == &camera && t_cam_rotate != -42) || (thiscam == &camera2
|
||||
if (!resetcalled && (cv_analog[0].value || demoplayback) && ((thiscam == &camera && t_cam_rotate != -42) || (thiscam == &camera2
|
||||
&& t_cam2_rotate != -42)))
|
||||
{
|
||||
angle = FixedAngle(camrotate*FRACUNIT);
|
||||
thiscam->angle = angle;
|
||||
}
|
||||
|
||||
if ((((thiscam == &camera) && cv_analog.value) || ((thiscam != &camera) && cv_analog2.value) || demoplayback) && !sign && !objectplacing && !(twodlevel || (mo->flags2 & MF2_TWOD)) && (player->powers[pw_carry] != CR_NIGHTSMODE) && displayplayer == consoleplayer)
|
||||
if ((((thiscam == &camera) && cv_analog[0].value) || ((thiscam != &camera) && cv_analog[1].value) || demoplayback) && !sign && !objectplacing && !(twodlevel || (mo->flags2 & MF2_TWOD)) && (player->powers[pw_carry] != CR_NIGHTSMODE) && displayplayer == consoleplayer)
|
||||
{
|
||||
#ifdef REDSANALOG
|
||||
if ((player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)); else
|
||||
|
@ -9871,6 +10072,29 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
}
|
||||
|
||||
if (G_ControlStyle((thiscam == &camera) ? 1 : 2) == CS_SIMPLE && !sign)
|
||||
{
|
||||
// Shift the camera slightly to the sides depending on the player facing direction
|
||||
UINT8 forplayer = (thiscam == &camera) ? 0 : 1;
|
||||
fixed_t shift = FixedMul(FINESINE((player->mo->angle - angle) >> ANGLETOFINESHIFT), cv_cam_shiftfacing[forplayer].value);
|
||||
|
||||
if (player->powers[pw_carry] == CR_NIGHTSMODE)
|
||||
{
|
||||
fixed_t cos = FINECOSINE((angle_t) (player->flyangle * ANG1)>>ANGLETOFINESHIFT);
|
||||
shift = FixedMul(shift, min(FRACUNIT, player->speed*abs(cos)/6000));
|
||||
shift += FixedMul(camsideshift[forplayer] - shift, FRACUNIT-(camspeed>>2));
|
||||
}
|
||||
else if (ticcmd_centerviewdown[(thiscam == &camera) ? 0 : 1])
|
||||
shift = FixedMul(camsideshift[forplayer], FRACUNIT-camspeed);
|
||||
else
|
||||
shift += FixedMul(camsideshift[forplayer] - shift, FRACUNIT-(camspeed>>3));
|
||||
camsideshift[forplayer] = shift;
|
||||
|
||||
shift = FixedMul(shift, camdist);
|
||||
shiftx = -FixedMul(FINESINE(angle>>ANGLETOFINESHIFT), shift);
|
||||
shifty = FixedMul(FINECOSINE(angle>>ANGLETOFINESHIFT), shift);
|
||||
}
|
||||
|
||||
// sets ideal cam pos
|
||||
if (twodlevel || (mo->flags2 & MF2_TWOD))
|
||||
dist = 480<<FRACBITS;
|
||||
|
@ -9893,7 +10117,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
camheight = mo->scale << 7;
|
||||
camspeed = FRACUNIT/12;
|
||||
}
|
||||
else if (P_AnalogMove(player)) // x1.2 dist for analog
|
||||
else if (P_ControlStyle(player) == CS_LMAOGALOG) // x1.2 dist for analog
|
||||
{
|
||||
dist = FixedMul(dist, 6*FRACUNIT/5);
|
||||
camheight = FixedMul(camheight, 6*FRACUNIT/5);
|
||||
|
@ -10217,8 +10441,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
else
|
||||
{
|
||||
viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||
viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||
viewpointx = mo->x + shiftx + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||
viewpointy = mo->y + shifty + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||
}
|
||||
|
||||
if (!camstill && !resetcalled && !paused)
|
||||
|
@ -10259,6 +10483,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
else
|
||||
thiscam->momz = FixedMul(z - thiscam->z, camspeed);
|
||||
|
||||
thiscam->momx += FixedMul(shiftx, camspeed);
|
||||
thiscam->momy += FixedMul(shifty, camspeed);
|
||||
}
|
||||
|
||||
// compute aming to look the viewed point
|
||||
|
@ -10806,7 +11033,7 @@ static void P_MinecartThink(player_t *player)
|
|||
else if (angdiff > ANGLE_180 && angdiff < InvAngle(MINECARTCONEMAX))
|
||||
player->mo->angle = minecart->angle - MINECARTCONEMAX;
|
||||
|
||||
if (angdiff + minecart->angle != player->mo->angle && (!demoplayback || P_AnalogMove(player)))
|
||||
if (angdiff + minecart->angle != player->mo->angle && (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG))
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
|
@ -10885,7 +11112,7 @@ static void P_MinecartThink(player_t *player)
|
|||
else
|
||||
minecart->angle = targetangle + ANGLE_180;
|
||||
angdiff = (minecart->angle - prevangle);
|
||||
if (angdiff && (!demoplayback || P_AnalogMove(player))) // maintain relative angle on turns
|
||||
if (angdiff && (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)) // maintain relative angle on turns
|
||||
{
|
||||
player->mo->angle += angdiff;
|
||||
if (player == &players[consoleplayer])
|
||||
|
@ -11660,7 +11887,7 @@ void P_PlayerThink(player_t *player)
|
|||
player->mo->reactiontime--;
|
||||
else if (player->powers[pw_carry] == CR_MINECART)
|
||||
{
|
||||
if (!P_AnalogMove(player))
|
||||
if (P_ControlStyle(player) != CS_LMAOGALOG)
|
||||
player->mo->angle = (cmd->angleturn << 16 /* not FRACBITS */);
|
||||
|
||||
ticruned++;
|
||||
|
@ -11673,7 +11900,7 @@ void P_PlayerThink(player_t *player)
|
|||
{
|
||||
if (player->powers[pw_carry] == CR_ROPEHANG)
|
||||
{
|
||||
if (!P_AnalogMove(player))
|
||||
if (P_ControlStyle(player) != CS_LMAOGALOG)
|
||||
player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */);
|
||||
|
||||
ticruned++;
|
||||
|
@ -11721,7 +11948,7 @@ void P_PlayerThink(player_t *player)
|
|||
;
|
||||
else if (!(player->pflags & PF_DIRECTIONCHAR)
|
||||
|| (player->climbing) // stuff where the direction is forced at all times
|
||||
|| (P_AnalogMove(player) || twodlevel || player->mo->flags2 & MF2_TWOD) // keep things synchronised up there, since the camera IS seperate from player motion when that happens
|
||||
|| (twodlevel || player->mo->flags2 & MF2_TWOD) // keep things synchronised up there, since the camera IS seperate from player motion when that happens
|
||||
|| G_RingSlingerGametype()) // no firing rings in directions your player isn't aiming
|
||||
player->drawangle = player->mo->angle;
|
||||
else if (P_PlayerInPain(player))
|
||||
|
@ -11752,7 +11979,7 @@ void P_PlayerThink(player_t *player)
|
|||
case CR_ROLLOUT:
|
||||
if (cmd->forwardmove || cmd->sidemove) // only when you're pressing movement keys
|
||||
{ // inverse direction!
|
||||
diff = ((player->mo->angle + R_PointToAngle2(0, 0, -cmd->forwardmove<<FRACBITS, cmd->sidemove<<FRACBITS)) - player->drawangle);
|
||||
diff = (((player->cmd.angleturn<<16) + R_PointToAngle2(0, 0, -cmd->forwardmove<<FRACBITS, cmd->sidemove<<FRACBITS)) - player->drawangle);
|
||||
factor = 4;
|
||||
}
|
||||
break;
|
||||
|
@ -11809,7 +12036,7 @@ void P_PlayerThink(player_t *player)
|
|||
}
|
||||
else if (cmd->forwardmove || cmd->sidemove) // only when you're pressing movement keys
|
||||
{
|
||||
diff = ((player->mo->angle + R_PointToAngle2(0, 0, cmd->forwardmove<<FRACBITS, -cmd->sidemove<<FRACBITS)) - player->drawangle);
|
||||
diff = ((player->mo->angle + ((player->pflags & PF_ANALOGMODE) ? 0 : R_PointToAngle2(0, 0, cmd->forwardmove<<FRACBITS, -cmd->sidemove<<FRACBITS))) - player->drawangle);
|
||||
factor = 4;
|
||||
}
|
||||
else if (player->rmomx || player->rmomy)
|
||||
|
@ -12422,7 +12649,7 @@ void P_PlayerAfterThink(player_t *player)
|
|||
{
|
||||
player->mo->angle = tails->angle;
|
||||
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
|
@ -12445,7 +12672,7 @@ void P_PlayerAfterThink(player_t *player)
|
|||
P_SetTarget(&player->mo->tracer, NULL);
|
||||
|
||||
if (player-players == consoleplayer && botingame)
|
||||
CV_SetValue(&cv_analog2, (player->powers[pw_carry] != CR_PLAYER));
|
||||
CV_SetValue(&cv_analog[1], (player->powers[pw_carry] != CR_PLAYER));
|
||||
break;
|
||||
}
|
||||
case CR_GENERIC: // being carried by some generic item
|
||||
|
@ -12511,7 +12738,7 @@ void P_PlayerAfterThink(player_t *player)
|
|||
macecenter->angle += cmd->sidemove<<ANGLETOFINESHIFT;
|
||||
player->mo->angle += cmd->sidemove<<ANGLETOFINESHIFT; // 2048 --> ANGLE_MAX
|
||||
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
if (!demoplayback || P_ControlStyle(player) == CS_LMAOGALOG)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle; // Adjust the local control angle.
|
||||
|
|
22
src/r_main.c
22
src/r_main.c
|
@ -187,20 +187,20 @@ void SplitScreen_OnChange(void)
|
|||
|
||||
static void ChaseCam_OnChange(void)
|
||||
{
|
||||
if (!cv_chasecam.value || !cv_useranalog.value)
|
||||
CV_SetValue(&cv_analog, 0);
|
||||
if (!cv_chasecam.value || !cv_useranalog[0].value)
|
||||
CV_SetValue(&cv_analog[0], 0);
|
||||
else
|
||||
CV_SetValue(&cv_analog, 1);
|
||||
CV_SetValue(&cv_analog[0], 1);
|
||||
}
|
||||
|
||||
static void ChaseCam2_OnChange(void)
|
||||
{
|
||||
if (botingame)
|
||||
return;
|
||||
if (!cv_chasecam2.value || !cv_useranalog2.value)
|
||||
CV_SetValue(&cv_analog2, 0);
|
||||
if (!cv_chasecam2.value || !cv_useranalog[1].value)
|
||||
CV_SetValue(&cv_analog[1], 0);
|
||||
else
|
||||
CV_SetValue(&cv_analog2, 1);
|
||||
CV_SetValue(&cv_analog[1], 1);
|
||||
}
|
||||
|
||||
static void FlipCam_OnChange(void)
|
||||
|
@ -1234,6 +1234,16 @@ void R_RegisterEngineStuff(void)
|
|||
CV_RegisterVar(&cv_cam2_orbit);
|
||||
CV_RegisterVar(&cv_cam2_adjust);
|
||||
|
||||
CV_RegisterVar(&cv_cam_savedist[0][0]);
|
||||
CV_RegisterVar(&cv_cam_savedist[0][1]);
|
||||
CV_RegisterVar(&cv_cam_savedist[1][0]);
|
||||
CV_RegisterVar(&cv_cam_savedist[1][1]);
|
||||
|
||||
CV_RegisterVar(&cv_cam_saveheight[0][0]);
|
||||
CV_RegisterVar(&cv_cam_saveheight[0][1]);
|
||||
CV_RegisterVar(&cv_cam_saveheight[1][0]);
|
||||
CV_RegisterVar(&cv_cam_saveheight[1][1]);
|
||||
|
||||
CV_RegisterVar(&cv_showhud);
|
||||
CV_RegisterVar(&cv_translucenthud);
|
||||
|
||||
|
|
|
@ -1179,10 +1179,20 @@ static void ST_drawInput(void)
|
|||
"AUTOBRAKE");
|
||||
y -= 8;
|
||||
}
|
||||
if (stplyr->pflags & PF_ANALOGMODE)
|
||||
switch (P_ControlStyle(stplyr))
|
||||
{
|
||||
case CS_LMAOGALOG:
|
||||
V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "ANALOG");
|
||||
y -= 8;
|
||||
break;
|
||||
|
||||
case CS_SIMPLE:
|
||||
V_DrawThinString(x, y, hudinfo[HUD_LIVES].f, "SIMPLE");
|
||||
y -= 8;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!demosynced) // should always be last, so it doesn't push anything else around
|
||||
|
|
Loading…
Reference in a new issue