Commits

Braden Obrzut  committed 25aa11e

- Fixed: HOM issue with movebob.
- Increased the movebob intensity to match ZDoom's. Further analysis is still needed.

  • Participants
  • Parent commits 4d3c566

Comments (0)

Files changed (2)

File src/wl_draw.cpp

 	/* 16:10 */	{1152,	500,	0x13333,	0,				48*5/6,		true},
 	/* 17:10 */ {1224,	471,	0x14666,	0,				48*40/51,	true},
 	/* 4:3 */	{960,	600,	0x10000,	0,				48,			false},
-	/* 5:4 */	{960,	640,	0x10000,	6.5*FRACUNIT,	48*15/16,	false}
+	/* 5:4 */	{960,	640,	0x10000,(fixed)6.5*FRACUNIT,	48*15/16,	false}
 };
 
 /*static*/ byte *vbuf = NULL;
 	// [RH] Smooth transitions between bobbing and not-bobbing frames.
 	// This also fixes the bug where you can "stick" a weapon off-center by
 	// shooting it when it's at the peak of its swing.
-	fixed bobtarget = FixedMul(players[0].bob>>1, finesine[bobangle])/2;
+	fixed bobtarget = FixedMul(players[0].bob>>1, finesine[bobangle]);
 	if (curbob != bobtarget)
 	{
 		if (abs (bobtarget - curbob) <= 1*FRACUNIT)

File src/wl_floorceiling.cpp

 extern fixed viewshift;
 extern fixed viewz;
 
-void R_DrawPlane(byte *vbuf, unsigned vbufPitch, int y0, int halfheight, fixed planeheight)
+static void R_DrawPlane(byte *vbuf, unsigned vbufPitch, int min_wallheight, int halfheight, fixed planeheight)
 {
 	fixed dist;                                // distance to row projection
 	fixed tex_step;                            // global step per one screen pixel
 	const byte *tex = NULL;
 	FTextureID lasttex;
 
+	const fixed heightFactor = abs(planeheight/32);
+	int y0 = (((min_wallheight >> 3)*heightFactor)>>FRACBITS) - abs(viewshift);
+	if(y0 > halfheight)
+		return; // view obscured by walls
+	if(y0 <= 0) y0 = 1; // don't let division by zero
+
 	lasttex.SetInvalid();
 
 	const unsigned int mapwidth = map->GetHeader().width;
 	else
 		tex_offset = vbuf + (signed)vbufPitch * (halfheight - y0 - 1);
 
-	fixed heightFactor = abs(planeheight/32);
-
 	int oldmapx = INT_MAX, oldmapy = INT_MAX;
 	// draw horizontal lines
 	for(int y = y0;true; ++y, floor ? tex_offset += vbufPitch : tex_offset -= vbufPitch)
 // according tile in third mapplane, respectively.
 void DrawFloorAndCeiling(byte *vbuf, unsigned vbufPitch, int min_wallheight)
 {
-	int halfheight = viewheight >> 1;
-	halfheight -= viewshift;
-	int y0 = min_wallheight >> 3;              // starting y value
-	y0 -= abs(viewshift);
-	if(y0 > halfheight)
-		return;                                // view obscured by walls
-	if(y0 <= 0) y0 = 1;                            // don't let division by zero
+	const int halfheight = (viewheight >> 1) - viewshift;
 
-	R_DrawPlane(vbuf, vbufPitch, y0, halfheight, viewz-(64<<FRACBITS));
-	R_DrawPlane(vbuf, vbufPitch, y0, halfheight, viewz);
+	R_DrawPlane(vbuf, vbufPitch, min_wallheight, halfheight, viewz-(64<<FRACBITS));
+	R_DrawPlane(vbuf, vbufPitch, min_wallheight, halfheight, viewz);
 }