Skip to content

Commit

Permalink
Merge branch 'master' into i240-wall-portal-edge-case
Browse files Browse the repository at this point in the history
  • Loading branch information
ioan-chera committed Nov 4, 2018
2 parents 9f70ad1 + f03e810 commit 98847e4
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 108 deletions.
23 changes: 10 additions & 13 deletions base/doom/player.edf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ weaponinfo Fist : DoomWeapon, 0

flags FLEEMELEE|NOHITGHOSTS|SILENCEABLE|DISABLEAPS|AUTOSWITCHFROM
mod Fist
recoil 10
recoil 10.0

firstdecoratestate S_PUNCH
states
Expand Down Expand Up @@ -59,7 +59,7 @@ weaponinfo Pistol : DoomWeapon, 1

flags SILENCEABLE|DISABLEAPS|HAPTICRECOIL|AUTOSWITCHFROM
mod Pistol
recoil 10
recoil 10.0
hapticrecoil 1
haptictime 1

Expand Down Expand Up @@ -96,7 +96,7 @@ weaponinfo Shotgun : DoomWeapon, 2

flags SILENCEABLE|DISABLEAPS|HAPTICRECOIL
mod Shotgun
recoil 30
recoil 30.0
hapticrecoil 3
haptictime 3

Expand Down Expand Up @@ -137,7 +137,7 @@ weaponinfo Chaingun : DoomWeapon, 3

flags SILENCEABLE|DISABLEAPS|HAPTICRECOIL
mod Chaingun
recoil 10
recoil 10.0
hapticrecoil 1
haptictime 1

Expand Down Expand Up @@ -172,8 +172,7 @@ weaponinfo MissileLauncher : DoomWeapon, 4
selectionorder 7000

flags NOAUTOFIRE|DISABLEAPS|SILENCEABLE|HAPTICRECOIL
//mod ""
recoil 100
recoil 100.0
hapticrecoil 6
haptictime 8

Expand Down Expand Up @@ -210,8 +209,7 @@ weaponinfo PlasmaRifle : DoomWeapon, 5
selectionorder 1000

flags SILENCEABLE|DISABLEAPS|HAPTICRECOIL|NOTSHAREWARE
//mod ""
recoil 20
recoil 20.0
hapticrecoil 2
haptictime 1

Expand Down Expand Up @@ -248,8 +246,7 @@ weaponinfo BFG9000 : DoomWeapon, 6
selectionorder 5000

flags NOAUTOFIRE|SILENCEABLE|DISABLEAPS|HAPTICRECOIL|NOTSHAREWARE
//mod ""
recoil 100
recoil 100.0
hapticrecoil 10
haptictime 10

Expand Down Expand Up @@ -281,9 +278,9 @@ weaponinfo BFG9000 : DoomWeapon, 6
// MBF Old-BFG
weaponinfo OldBFG : BFG9000
{
ammouse 1 // Only one ammo used per shot
ammouse 1 // Only one ammo used per shot

recoil 20 // Uses plasma's recoil
recoil 20.0 // Uses plasma's recoil

firstdecoratestate S_OLDBFG1
states
Expand Down Expand Up @@ -334,7 +331,7 @@ weaponinfo SuperShotgun : DoomWeapon, 8

flags SILENCEABLE|HAPTICRECOIL|DISABLEAPS
mod SShotgun
recoil 80
recoil 80.0
hapticrecoil 5
haptictime 5

Expand Down
2 changes: 1 addition & 1 deletion source/d_items.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct weaponinfo_t
unsigned int flags;
uint8_t intflags;
int mod;
int recoil;
fixed_t recoil;
int hapticrecoil; // haptic recoil strength, from 1 to 10
int haptictime; // haptic recoil duration, from 1 to 10
const char *upsound; // sound made when weapon is being brought up
Expand Down
4 changes: 2 additions & 2 deletions source/e_weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ cfg_opt_t wpninfo_tprops[] =
CFG_STR(ITEM_WPN_ADDFLAGS, "", CFGF_NONE), \
CFG_STR(ITEM_WPN_REMFLAGS, "", CFGF_NONE), \
CFG_STR(ITEM_WPN_MOD, "", CFGF_NONE), \
CFG_INT(ITEM_WPN_RECOIL, 0, CFGF_NONE), \
CFG_FLOAT(ITEM_WPN_RECOIL, 0.0, CFGF_NONE), \
CFG_INT(ITEM_WPN_HAPTICRECOIL, 0, CFGF_NONE), \
CFG_INT(ITEM_WPN_HAPTICTIME, 0, CFGF_NONE), \
CFG_STR(ITEM_WPN_UPSOUND, "none", CFGF_NONE), \
Expand Down Expand Up @@ -1357,7 +1357,7 @@ static void E_processWeapon(weapontype_t i, cfg_t *weaponsec, cfg_t *pcfg, bool
}

if(IS_SET(ITEM_WPN_RECOIL))
wp.recoil = cfg_getint(weaponsec, ITEM_WPN_RECOIL);
wp.recoil = M_DoubleToFixed(cfg_getfloat(weaponsec, ITEM_WPN_RECOIL));
if(IS_SET(ITEM_WPN_HAPTICRECOIL))
wp.hapticrecoil = cfg_getint(weaponsec, ITEM_WPN_HAPTICRECOIL);
if(IS_SET(ITEM_WPN_HAPTICTIME))
Expand Down
4 changes: 2 additions & 2 deletions source/p_pspr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,8 @@ void P_WeaponRecoil(player_t *player)
if(readyweapon->flags & WPF_ALWAYSRECOIL ||
(weapon_recoil && (demo_version >= 203 || !compatibility)))
{
P_Thrust(player, ANG180 + player->mo->angle, 0,
2048 * readyweapon->recoil); // phares
// MaxW: 2018/11/04: Changed to allow for fixed-point recoil
P_Thrust(player, ANG180 + player->mo->angle, 0, readyweapon->recoil / 32);
}
}

Expand Down
44 changes: 21 additions & 23 deletions source/r_bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static void R_ClipSolidWallSegment(int x1, int x2)
//
static void R_ClipPassWallSegment(int x1, int x2)
{
cliprange_t *start;
const cliprange_t *start;

start = solidsegs;

Expand Down Expand Up @@ -366,8 +366,7 @@ void R_ClearClipSegs()
//
// R_SetupPortalClipsegs
//
bool R_SetupPortalClipsegs(int minx, int maxx,
const float *top, const float *bottom)
bool R_SetupPortalClipsegs(int minx, int maxx, const float *top, const float *bottom)
{
int i = minx, stop = maxx + 1;
cliprange_t *solidseg = solidsegs;
Expand Down Expand Up @@ -474,9 +473,8 @@ static int R_DoorClosed(void)

extern camera_t *camera; // haleyjd

sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec,
int *floorlightlevel, int *ceilinglightlevel,
bool back)
const sector_t *R_FakeFlat(const sector_t *sec, sector_t *tempsec,
int *floorlightlevel, int *ceilinglightlevel, bool back)
{
if(!sec)
return NULL;
Expand Down Expand Up @@ -789,7 +787,7 @@ static bool R_ClipInitialSegRange(int *start, int *stop, float *clipx1, float *c
return true;
}

static void R_ClipSegToFPortal(void)
static void R_ClipSegToFPortal()
{
int i, startx;
float clipx1, clipx2;
Expand Down Expand Up @@ -857,7 +855,7 @@ static void R_ClipSegToFPortal(void)
}
}

static void R_ClipSegToCPortal(void)
static void R_ClipSegToCPortal()
{
int i, startx;
float clipx1, clipx2;
Expand Down Expand Up @@ -920,7 +918,7 @@ static void R_ClipSegToCPortal(void)
}
}

static void R_ClipSegToLPortal(void)
static void R_ClipSegToLPortal()
{
int i, startx;
float clipx1, clipx2;
Expand Down Expand Up @@ -1088,16 +1086,16 @@ R_ClipSegFunc segclipfuncs[] =
#define NEARCLIP 0.05f

static void R_2S_Sloped(float pstep, float i1, float i2, float textop,
float texbottom, vertex_t *v1, vertex_t *v2,
float texbottom, const vertex_t *v1, const vertex_t *v2,
float lclip1, float lclip2)
{
bool mark, markblend; // haleyjd
// ioanch: needed to prevent transfer_heights from affecting sky hacks.
bool marktheight, blocktheight;
bool heightchange;
float texhigh, texlow;
side_t *side = seg.side;
seg_t *line = seg.line;
const side_t *side = seg.side;
const seg_t *line = seg.line;

int h, h2, l, l2, t, t2, b, b2;

Expand Down Expand Up @@ -1409,8 +1407,8 @@ static void R_2S_Normal(float pstep, float i1, float i2, float textop,
bool marktheight, blocktheight;
bool uppermissing, lowermissing;
float texhigh, texlow;
side_t *side = seg.side;
seg_t *line = seg.line;
const side_t *side = seg.side;
const seg_t *line = seg.line;
fixed_t frontc, backc;

seg.twosided = true;
Expand Down Expand Up @@ -1953,17 +1951,17 @@ static bool R_allowBehindSectorPortal(const fixed_t bbox[4], const seg_t &tryseg
// Clips the given segment
// and adds any visible pieces to the line list.
//
static void R_AddLine(seg_t *line, bool dynasegs)
static void R_AddLine(const seg_t *line, bool dynasegs)
{
static sector_t tempsec;

float x1, x2;
float i1, i2, pstep;
float lclip1, lclip2;
v2float_t t1, t2, temp;
side_t *side;
const side_t *side;
float floorx1, floorx2;
vertex_t *v1, *v2;
const vertex_t *v1, *v2;

// ioanch 20160125: reject segs in front of line when rendering line portal
if(portalrender.w && portalrender.w->portal &&
Expand Down Expand Up @@ -2460,13 +2458,13 @@ static const int checkcoord[12][4] = // killough -- static const
// Checks BSP node/subtree bounding box.
// Returns true if some part of the bbox might be visible.
//
static bool R_CheckBBox(fixed_t *bspcoord) // killough 1/28/98: static
static bool R_CheckBBox(const fixed_t *bspcoord) // killough 1/28/98: static
{
int boxpos, boxx, boxy;
fixed_t x1, x2, y1, y2;
angle_t angle1, angle2, span, tspan;
int sx1, sx2;
cliprange_t *start;
const cliprange_t *start;

// Find the corners of the box
// that define the edges from current viewpoint.
Expand Down Expand Up @@ -2568,7 +2566,7 @@ static void R_interpolateVertex(dynavertex_t &v, v2fixed_t &org, v2float_t &forg
//
// Recurse through a polynode mini-BSP
//
static void R_RenderPolyNode(rpolynode_t *node)
static void R_RenderPolyNode(const rpolynode_t *node)
{
while(node)
{
Expand All @@ -2580,7 +2578,7 @@ static void R_RenderPolyNode(rpolynode_t *node)
// render partition seg
v2fixed_t org[2];
v2float_t forg[2];
seg_t *seg = &node->partition->seg;
const seg_t *seg = &node->partition->seg;
R_interpolateVertex(*seg->dyv1, org[0], forg[0]);
R_interpolateVertex(*seg->dyv2, org[1], forg[1]);
R_AddLine(seg, true);
Expand Down Expand Up @@ -2638,7 +2636,7 @@ static void R_AddDynaSegs(subsector_t *sub)
static void R_Subsector(int num)
{
int count;
seg_t *line;
const seg_t *line;
subsector_t *sub;
sector_t tempsec; // killough 3/7/98: deep water hack
int floorlightlevel; // killough 3/16/98: set floor lightlevel
Expand Down Expand Up @@ -2842,7 +2840,7 @@ void R_RenderBSPNode(int bspnum)
{
while(!(bspnum & NF_SUBSECTOR)) // Found a subsector?
{
node_t *bsp = &nodes[bspnum];
const node_t *bsp = &nodes[bspnum];

// Decide which side the view point is on.
int side = R_PointOnSide(viewx, viewy, bsp);
Expand Down
2 changes: 1 addition & 1 deletion source/r_bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void R_ClearDrawSegs();
void R_RenderBSPNode(int bspnum);

// killough 4/13/98: fake floors/ceilings for deep water / fake ceilings:
sector_t *R_FakeFlat(sector_t *, sector_t *, int *, int *, bool);
const sector_t *R_FakeFlat(const sector_t *, sector_t *, int *, int *, bool);
bool R_PickNearestBoxLines(const fixed_t bbox[4], dlnormal_t &dl1,
dlnormal_t &dl2, slopetype_t *slope = nullptr);

Expand Down
Loading

0 comments on commit 98847e4

Please sign in to comment.