Commit 564c0ba2 authored by Dino Bollinger's avatar Dino Bollinger Committed by Richard Gobeille
Browse files

Duke3D: Add ud member "folsvel" and allow strafing in map follow mode

`userdef[].folsvel` represents the strafe velocity.
parent 06f542ca
......@@ -161,7 +161,7 @@ typedef struct ud_setup_s {
typedef struct {
vec3_t camerapos;
int32_t const_visibility,uw_framerate;
int32_t camera_time,folfvel,folavel,folx,foly,fola;
int32_t camera_time,folfvel,folsvel,folavel,folx,foly,fola;
int32_t reccnt,crosshairscale;
int32_t runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125
......
......@@ -452,6 +452,7 @@ enum UserdefsLabel_t
USERDEFS_UW_FRAMERATE,
USERDEFS_CAMERA_TIME,
USERDEFS_FOLFVEL,
USERDEFS_FOLSVEL,
USERDEFS_FOLAVEL,
USERDEFS_FOLX,
USERDEFS_FOLY,
......
......@@ -942,6 +942,7 @@ memberlabel_t const UserdefsLabels[]=
{ "uw_framerate", USERDEFS_UW_FRAMERATE, 0, 0, -1 },
{ "camera_time", USERDEFS_CAMERA_TIME, 0, 0, -1 },
{ "folfvel", USERDEFS_FOLFVEL, 0, 0, -1 },
{ "folsvel", USERDEFS_FOLSVEL, 0, 0, -1 },
{ "folavel", USERDEFS_FOLAVEL, 0, 0, -1 },
{ "folx", USERDEFS_FOLX, 0, 0, -1 },
{ "foly", USERDEFS_FOLY, 0, 0, -1 },
......@@ -1138,6 +1139,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2)
case USERDEFS_UW_FRAMERATE: labelNum = ud.uw_framerate; break;
case USERDEFS_CAMERA_TIME: labelNum = ud.camera_time; break;
case USERDEFS_FOLFVEL: labelNum = ud.folfvel; break;
case USERDEFS_FOLSVEL: labelNum = ud.folsvel; break;
case USERDEFS_FOLAVEL: labelNum = ud.folavel; break;
case USERDEFS_FOLX: labelNum = ud.folx; break;
case USERDEFS_FOLY: labelNum = ud.foly; break;
......@@ -1337,6 +1339,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons
case USERDEFS_UW_FRAMERATE: ud.uw_framerate = iSet; break;
case USERDEFS_CAMERA_TIME: ud.camera_time = iSet; break;
case USERDEFS_FOLFVEL: ud.folfvel = iSet; break;
case USERDEFS_FOLSVEL: ud.folsvel = iSet; break;
case USERDEFS_FOLAVEL: ud.folavel = iSet; break;
case USERDEFS_FOLX: ud.folx = iSet; break;
case USERDEFS_FOLY: ud.foly = iSet; break;
......
......@@ -3410,6 +3410,7 @@ void P_GetInput(int const playerNum)
if (ud.scrollmode && ud.overhead_on)
{
ud.folfvel = input.fvel;
ud.folsvel = input.svel;
ud.folavel = fix16_to_int(input.q16avel);
}
......
......@@ -1103,8 +1103,8 @@ void G_DisplayRest(int32_t smoothratio)
if (!ud.pause_on)
{
ud.fola += ud.folavel>>3;
ud.folx += (ud.folfvel*sintable[(512+2048-ud.fola)&2047])>>14;
ud.foly += (ud.folfvel*sintable[(512+1024-512-ud.fola)&2047])>>14;
ud.folx += (ud.folfvel*sintable[(512-ud.fola)&2047] + ud.folsvel*sintable[(ud.fola)&2047])>>14;
ud.foly += (ud.folfvel*sintable[(1024-ud.fola)&2047] + ud.folsvel*sintable[(ud.fola-512)&2047])>>14;
}
#endif
cposx = ud.folx;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment