Files
James R 421d1da205 Squashed commit of the following:
commit ec89015662e12dada02877feb9309b565a07b2a4
Author: fickleheart <fickle@tinted.red>
Date:   Sat Jan 18 11:19:59 2020 -0600

    Fix loss of aimingtody precision at high FOV

commit f6efe19fca206f972ebe567051648b3b11f900c2
Author: fickleheart <fickle@tinted.red>
Date:   Sat Jan 18 11:15:36 2020 -0600

    Use generally higher zooms and fix fuzzy edges

commit 5757f24342f9dfdebe7bedc226f237bd0aea5cca
Author: fickleheart <fickle@tinted.red>
Date:   Sat Jan 18 10:53:45 2020 -0600

    Reduce the number of distinct roll angles

commit 8679606ebb56975a93b7140184b45170b82bc3fe
Author: fickleheart <fickle@tinted.red>
Date:   Sat Jan 18 10:53:23 2020 -0600

    Remove a couple adds from each pixel of morph mapping

commit af4479924ad616ddf50daee4d1886a59f159607a
Author: fickleheart <fickle@tinted.red>
Date:   Sat Jan 18 10:53:00 2020 -0600

    Fully clip drawing to roll-used screen bounds

commit 8868fc4d8abce1b6393303155e758921f7ef9e4f
Author: fickleheart <fickle@tinted.red>
Date:   Sat Jan 18 00:16:18 2020 -0600

    Fix lighting discrepancies between different FOVs

commit 1d221a453a183d3933b9176436e91efca9632011
Author: fickleheart <fickle@tinted.red>
Date:   Fri Jan 17 23:21:11 2020 -0600

    Avoid rendering unused left/right edges of screen while rolling

commit 21ccefe4eb96e3b3f3216025f40d6271faaac206
Author: fickleheart <fickle@tinted.red>
Date:   Fri Jan 17 22:03:16 2020 -0600

    Fix sky texture scaling wrong with fov changes

commit 7bd9344dd01cf541d86d3e7965e7037fb85ca494
Author: fickleheart <fickle@tinted.red>
Date:   Fri Jan 17 21:55:16 2020 -0600

    I think this fixes the compile errors

commit 64c4a4c02c6a59264446e9a43593e7397b774baa
Author: fickleheart <fickle@tinted.red>
Date:   Fri Jan 17 20:39:38 2020 -0600

    Fisheye lens experiments

commit 2b7d75126e8e8641a4b413c74b3c65da87e0d309
Author: fickleheart <fickle@tinted.red>
Date:   Fri Jan 17 20:39:15 2020 -0600

    Add DBG_VIEWMORPH to view pre-transformed view

commit 84329fcd2677a42860f986e06b901434bc44966e
Author: fickleheart <fickle@tinted.red>
Date:   Fri Jan 17 19:01:45 2020 -0600

    OGL can have little a viewroll

commit 7cf563eadd0c2a4e1977c7024ef40975159e5aff
Author: fickleheart <fickle@tinted.red>
Date:   Fri Jan 17 18:32:13 2020 -0600

    Un/archive viewrollangle in netsaves

commit d63aa1031e4c26d0fe6f077e15764aa27c55005b
Merge: e23f632cd 9a1cb0e30
Author: fickleheart <fickle@tinted.red>
Date:   Fri Jan 17 18:27:15 2020 -0600

    Merge remote-tracking branch 'upstream/next' into viewroll

commit e23f632cdbc687039ec25297ae0105142135e1a1
Author: fickleheart <fickle@tinted.red>
Date:   Tue Jan 14 23:44:21 2020 -0600

    Clean up fisheye and fix crashes

commit cdbea0be26067a5774778ba51a18df7aa661ce80
Author: fickleheart <fickle@tinted.red>
Date:   Tue Jan 14 23:30:39 2020 -0600

    Revert "LMAO fisheye"

    This reverts commit cd957d84f7332fc71ebd1924aaa2b533684cc07d.

commit cd957d84f7332fc71ebd1924aaa2b533684cc07d
Author: fickleheart <fickle@tinted.red>
Date:   Tue Jan 14 23:30:19 2020 -0600

    LMAO fisheye

commit c25e9696760afa898f24acab9ff43378e4156499
Author: fickleheart <fickle@tinted.red>
Date:   Tue Jan 14 23:29:56 2020 -0600

    wip viewroll stuff
2020-09-27 17:21:21 -07:00

85 lines
2.1 KiB
C

// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2018 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file r_sky.c
/// \brief Sky rendering
/// The SRB2 sky is a texture map like any
/// wall, wrapping around. A 1024 columns equal 360 degrees.
/// The default sky map is 256 columns and repeats 4 times
/// on a 320 screen.
#include "doomdef.h"
#include "doomstat.h"
#include "r_sky.h"
#include "r_local.h"
#include "w_wad.h"
#include "z_zone.h"
#include "p_maputl.h" // P_PointOnLineSide
//
// sky mapping
//
/** \brief Needed to store the number of the dummy sky flat.
Used for rendering, as well as tracking projectiles etc.
*/
INT32 skyflatnum;
/** \brief the lump number of the sky texture
*/
INT32 skytexture;
/** \brief the horizon line in a 256x128 sky texture
*/
INT32 skytexturemid;
/** \brief the scale of the sky
*/
fixed_t skyscale;
/** \brief used for keeping track of the current sky
*/
INT32 levelskynum;
INT32 globallevelskynum;
/** \brief The R_SetupSkyDraw function
Called at loadlevel after skytexture is set, or when sky texture changes.
\warning wallcolfunc should be set at R_ExecuteSetViewSize()
I don't bother because we don't use low detail anymore
\return void
*/
void R_SetupSkyDraw(void)
{
// the horizon line in a 256x128 sky texture
skytexturemid = (textures[skytexture]->height/2)<<FRACBITS;
// get the right drawer, it was set by screen.c, depending on the
// current video mode bytes per pixel (quick fix)
wallcolfunc = walldrawerfunc;
R_SetSkyScale();
}
/** \brief The R_SetSkyScale function
set the correct scale for the sky at setviewsize
\return void
*/
void R_SetSkyScale(void)
{
fixed_t difference = vid.fdupx-(vid.dupx<<FRACBITS);
skyscale = FixedDiv(fovtan, vid.fdupx+difference);
}