Remove HWR_InitTextureMapping and related tables
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1773/diffs\?commit_id\=929925771c0a8602f2747f2523d35c6c9d7d6382
This commit is contained in:
parent
00679aea18
commit
23f6d025a2
2 changed files with 1 additions and 92 deletions
|
|
@ -73,26 +73,8 @@ void HWR_AddTransparentFloor(levelflat_t *levelflat, extrasubsector_t *xsub, boo
|
|||
void HWR_AddTransparentPolyobjectFloor(levelflat_t *levelflat, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight,
|
||||
INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
|
||||
|
||||
// ==========================================================================
|
||||
// VIEW GLOBALS
|
||||
// ==========================================================================
|
||||
// Fineangles in the SCREENWIDTH wide window.
|
||||
#define FIELDOFVIEW ANGLE_90
|
||||
#define ABS(x) ((x) < 0 ? -(x) : (x))
|
||||
|
||||
static angle_t gl_clipangle;
|
||||
|
||||
// The viewangletox[viewangle + FINEANGLES/4] lookup
|
||||
// maps the visible view angles to screen X coordinates,
|
||||
// flattening the arc to a flat projection plane.
|
||||
// There will be many angles mapped to the same X.
|
||||
static INT32 gl_viewangletox[FINEANGLES/2];
|
||||
|
||||
// The xtoviewangleangle[] table maps a screen pixel
|
||||
// to the lowest viewangle that maps back to x ranges
|
||||
// from clipangle to -clipangle.
|
||||
static angle_t gl_xtoviewangle[MAXVIDWIDTH+1];
|
||||
|
||||
// ==========================================================================
|
||||
// GLOBALS
|
||||
// ==========================================================================
|
||||
|
|
@ -2958,78 +2940,6 @@ static void HWR_RenderBSPNode(INT32 bspnum)
|
|||
HWR_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
// FROM R_MAIN.C
|
||||
// ==========================================================================
|
||||
|
||||
//BP : exactely the same as R_InitTextureMapping
|
||||
void HWR_InitTextureMapping(void)
|
||||
{
|
||||
angle_t i;
|
||||
INT32 x;
|
||||
INT32 t;
|
||||
fixed_t focallength;
|
||||
fixed_t grcenterx;
|
||||
fixed_t grcenterxfrac;
|
||||
INT32 grviewwidth;
|
||||
|
||||
#define clipanglefov (FIELDOFVIEW>>ANGLETOFINESHIFT)
|
||||
|
||||
grviewwidth = vid.width;
|
||||
grcenterx = grviewwidth/2;
|
||||
grcenterxfrac = grcenterx<<FRACBITS;
|
||||
|
||||
// Use tangent table to generate viewangletox:
|
||||
// viewangletox will give the next greatest x
|
||||
// after the view angle.
|
||||
//
|
||||
// Calc focallength
|
||||
// so FIELDOFVIEW angles covers SCREENWIDTH.
|
||||
focallength = FixedDiv(grcenterxfrac,
|
||||
FINETANGENT(FINEANGLES/4+clipanglefov/2));
|
||||
|
||||
for (i = 0; i < FINEANGLES/2; i++)
|
||||
{
|
||||
if (FINETANGENT(i) > FRACUNIT*2)
|
||||
t = -1;
|
||||
else if (FINETANGENT(i) < -FRACUNIT*2)
|
||||
t = grviewwidth+1;
|
||||
else
|
||||
{
|
||||
t = FixedMul(FINETANGENT(i), focallength);
|
||||
t = (grcenterxfrac - t+FRACUNIT-1)>>FRACBITS;
|
||||
|
||||
if (t < -1)
|
||||
t = -1;
|
||||
else if (t > grviewwidth+1)
|
||||
t = grviewwidth+1;
|
||||
}
|
||||
gl_viewangletox[i] = t;
|
||||
}
|
||||
|
||||
// Scan viewangletox[] to generate xtoviewangle[]:
|
||||
// xtoviewangle will give the smallest view angle
|
||||
// that maps to x.
|
||||
for (x = 0; x <= grviewwidth; x++)
|
||||
{
|
||||
i = 0;
|
||||
while (gl_viewangletox[i]>x)
|
||||
i++;
|
||||
gl_xtoviewangle[x] = (i<<ANGLETOFINESHIFT) - ANGLE_90;
|
||||
}
|
||||
|
||||
// Take out the fencepost cases from viewangletox.
|
||||
for (i = 0; i < FINEANGLES/2; i++)
|
||||
{
|
||||
if (gl_viewangletox[i] == -1)
|
||||
gl_viewangletox[i] = 0;
|
||||
else if (gl_viewangletox[i] == grviewwidth+1)
|
||||
gl_viewangletox[i] = grviewwidth;
|
||||
}
|
||||
|
||||
gl_clipangle = gl_xtoviewangle[0];
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
// gl_things.c
|
||||
// ==========================================================================
|
||||
|
|
@ -6060,7 +5970,7 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
// software doesn't draw any further than 1024 for skies anyway, but this doesn't overlap properly
|
||||
// The only time this will probably be an issue is when a sky wider than 1024 is used as a sky AND a regular wall texture
|
||||
|
||||
angle = (dup_viewangle + gl_xtoviewangle[0]);
|
||||
angle = (dup_viewangle + ANGLE_45);
|
||||
|
||||
dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ void HWR_RenderPlayerView(void);
|
|||
void HWR_ClearSkyDome(void);
|
||||
void HWR_BuildSkyDome(void);
|
||||
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum);
|
||||
void HWR_InitTextureMapping(void);
|
||||
void HWR_SetViewSize(void);
|
||||
void HWR_DrawStretchyFixedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap);
|
||||
void HWR_DrawCroppedPatch(patch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h);
|
||||
|
|
|
|||
Loading…
Reference in a new issue