diff --git a/src/r_main.c b/src/r_main.c index 87d06106e..44c388ec8 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -681,14 +681,8 @@ static inline void R_InitLightTables(void) } } -//#define WOUGHMP_WOUGHMP // I got a fish-eye lens - I'll make a rap video with a couple of friends -// it's kinda laggy sometimes - static struct { angle_t rollangle; // pre-shifted by fineshift -#ifdef WOUGHMP_WOUGHMP - fixed_t fisheye; -#endif fixed_t zoomneeded; INT32 *scrmap; @@ -700,9 +694,6 @@ static struct { boolean use; } viewmorph = { 0, -#ifdef WOUGHMP_WOUGHMP - 0, -#endif FRACUNIT, NULL, @@ -721,39 +712,20 @@ void R_CheckViewMorph(void) fixed_t temp; INT32 end, vx, vy, pos, usedpos; INT32 usedx, usedy, halfwidth = vid.width/2, halfheight = vid.height/2; -#ifdef WOUGHMP_WOUGHMP - float fisheyemap[MAXVIDWIDTH/2 + 1]; -#endif angle_t rollangle = players[displayplayers[0]].viewrollangle; -#ifdef WOUGHMP_WOUGHMP - fixed_t fisheye = cv_cam2_turnmultiplier.value; // temporary test value -#endif rollangle >>= ANGLETOFINESHIFT; rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot. -#ifdef WOUGHMP_WOUGHMP - fisheye &= ~0x7FF; // Same -#endif if (rollangle == viewmorph.rollangle && -#ifdef WOUGHMP_WOUGHMP - fisheye == viewmorph.fisheye && -#endif viewmorph.scrmapsize == vid.width*vid.height) return; // No change viewmorph.rollangle = rollangle; -#ifdef WOUGHMP_WOUGHMP - viewmorph.fisheye = fisheye; -#endif - if (viewmorph.rollangle == 0 -#ifdef WOUGHMP_WOUGHMP - && viewmorph.fisheye == 0 -#endif - ) + if (viewmorph.rollangle == 0) { viewmorph.use = false; viewmorph.x1 = 0; @@ -781,22 +753,6 @@ void R_CheckViewMorph(void) x1 = (vid.width*fabsf(rollcos) + vid.height*fabsf(rollsin)) / vid.width; y1 = (vid.height*fabsf(rollcos) + vid.width*fabsf(rollsin)) / vid.height; -#ifdef WOUGHMP_WOUGHMP - if (fisheye) - { - float f = FIXED_TO_FLOAT(fisheye); - for (vx = 0; vx <= halfwidth; vx++) - fisheyemap[vx] = 1.0f / cos(atan(vx * f / halfwidth)); - - f = cos(atan(f)); - if (f < 1.0f) - { - x1 /= f; - y1 /= f; - } - } -#endif - temp = max(x1, y1)*FRACUNIT; if (temp < FRACUNIT) temp = FRACUNIT; @@ -824,11 +780,6 @@ void R_CheckViewMorph(void) x1 = -(halfwidth * rollcos - halfheight * rollsin); y1 = -(halfheight * rollcos + halfwidth * rollsin); -#ifdef WOUGHMP_WOUGHMP - if (fisheye) - viewmorph.x1 = (INT32)(halfwidth - (halfwidth * fabsf(rollcos) + halfheight * fabsf(rollsin)) * fisheyemap[halfwidth]); - else -#endif viewmorph.x1 = (INT32)(halfwidth - (halfwidth * fabsf(rollcos) + halfheight * fabsf(rollsin))); //CONS_Printf("saving %d cols\n", viewmorph.x1); @@ -875,35 +826,6 @@ void R_CheckViewMorph(void) //CONS_Printf("Top left corner is %f %f\n", x1, y1); -#ifdef WOUGHMP_WOUGHMP - if (fisheye) - { - for (vy = 0; vy < halfheight; vy++) - { - x2 = x1; - y2 = y1; - x1 -= rollsin; - y1 += rollcos; - - for (vx = 0; vx < vid.width; vx++) - { - usedx = halfwidth + x2*fisheyemap[(int) floorf(fabsf(y2*zoomfactor))]; - usedy = halfheight + y2*fisheyemap[(int) floorf(fabsf(x2*zoomfactor))]; - - usedpos = usedx + usedy*vid.width; - - viewmorph.scrmap[pos] = usedpos; - viewmorph.scrmap[end-pos] = end-usedpos; - - x2 += rollcos; - y2 += rollsin; - pos++; - } - } - } - else - { -#endif x1 += halfwidth; y1 += halfheight; @@ -929,9 +851,6 @@ void R_CheckViewMorph(void) pos++; } } -#ifdef WOUGHMP_WOUGHMP - } -#endif viewmorph.use = true; }